我正在尝试使用nmap. 到目前为止,这是我的代码:
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();
}
}
}
Run Code Online (Sandbox Code Playgroud)
运行此代码输出后,我得到的是:
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**
Run Code Online (Sandbox Code Playgroud)
是否还有其他nmap标志可用于检测设备类型?我试过 -A 选项。我需要在跟踪路由的每一跳找到设备详细信息。
Nmap 执行“主动指纹识别”(它发送数据包然后分析响应)来猜测远程操作系统是什么。这些探针非常具有侵入性,我建议您阅读更多相关信息(http://nmap.org/book/osdetect-fingerprint-format.html)。
“与此主机匹配的指纹过多,无法提供特定的操作系统详细信息”意味着探测相互矛盾或过于宽泛。例如,在 NAT 场景中,一些端口扫描返回路由器信息(如 Cisco iOS),其他一些探测返回真实的主机规格(如 Windows)。
了解网络如何设计的最好方法是依靠您自己根据不同的探针和输出进行判断。
IP ID 序列、指纹分析和服务检测 (-sV) 可以帮助:
eq 如果 3389 已打开,则运行的操作系统是 Windows。
eq 如果 IP ID 序列变化,则目标可能是多个(负载平衡)。
您对网络流量的分析总是比 nmap 尝试以自动方式猜测的更准确。