我正在嘗試使用nmap
來確定特定IP地址的操作系統。這是我到目前爲止的代碼:使用nmap對特定IP地址進行操作系統檢測
import java.io.*;
public class NmapFlags {
public static void main(String[] args) throws Exception {
try {
String[] cmdarray = { "nmap", "-O", "66.110.59.130" };//
// example trying to find the OS or device detials of this Ip address//
Process process = Runtime.getRuntime().exec(cmdarray);
BufferedReader r = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String s;
while ((s = r.readLine()) != null) {
System.out.println(s);
}
r.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
運行此代碼後輸出我得到的是:
All 1000 scanned ports on 66.110.59.130 are filtered
All 1000 scanned ports on 66.110.59.130 are filtered
Too many fingerprints match this host to give specific OS details
Too many fingerprints match this host to give specific OS details
OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 246.06 seconds
Nmap done: 1 IP address (1 host up) scanned in 246.06 seconds**
是否有任何其他nmap
標誌,我可以用它來檢測設備類型?我試過了 - 一個選項。我需要在跟蹤路由的每一跳中找到設備詳細信息。
這不是[標籤:java]的問題,這是一個'nmap'問題。你應該問[su] – durron597