Nmap Development mailing list archives
Re: Help required:to execute nmap.exe from java app
From: guoxing.guo <guoxing.guo () wdk-networks com>
Date: Thu, 8 Sep 2011 10:33:47 +0800
Hi,all
I add the option "-oN nmap.log" to log the result and found the expected information in it.
But there is a little difference from that showing in an CMD window.
The last line of nmap.log is "Network Distance: 1 hop". But not "OS detection perfored. ... scanned in xxx seconds".
Is it correct ? Or it is a bug?
In my java app ,the thread suspend at "process.waitFor()".
Regards
Simon KWOK(郭国兴)
发件人: guoxing.guo
发送时间: 2011-09-08 09:27:17
收件人: nmap-dev
抄送:
主题: Help required:to execute nmap.exe from java app
Hi,all
I was trying to execute nmap.exe from my java app(JDK1.6+WinXP). But it seems never return.
Code following:
Process process = Runtime.getRuntime().exec("E:\workspace2\NM_Server\3rdparty\nmap\windows/nmap -O 172.16.164.64");
process.waitFor();
byte[] buffer = new byte[256];
int cnt = 0;
InputStream is = process.getInputStream();
StringBuffer sb = new StringBuffer();
while((cnt=is.read(buffer))>-0){
sb.append(new String(buffer,0,cnt));
}
is.close();
return sb.toString();
//Not work.
It can show the expected infomation when I execute "E:\workspace2\NM_Server\3rdparty\nmap\windows/nmap -O
172.16.164.64" in a command line window. Someone in stackoverflow.com says it maybe lost the PATH env . Actually it
works after I set PATH='' in the CMD window.
I found a related thread on http://seclists.org/nmap-dev/2008/q2/498 . But it seems have not been solved.
Any idea to out of this or workaround it will be appreciated.
Regards
Simon KWOK(郭国兴)
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/
Current thread:
- Help required:to execute nmap.exe from java app guoxing . guo (Sep 07)
- Message not available
- Re: Help required:to execute nmap.exe from java app Darren VanBuren (Sep 07)
- Message not available
- Re: Re: Help required:to execute nmap.exe from java app guoxing . guo (Sep 07)
- <Possible follow-ups>
- Re: Help required:to execute nmap.exe from java app guoxing . guo (Sep 07)
