2015-04-27 29 views
0

我正在嘗試使用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標誌,我可以用它來檢測設備類型?我試過了 - 一個選項。我需要在跟蹤路由的每一跳中找到設備詳細信息。

+3

這不是[標籤:java]的問題,這是一個'nmap'問題。你應該問[su] – durron597

回答

1

這確實是一個超級用戶問題。

Nmap執行主動指紋識別以預測遠程操作系統是什麼。這些探測器非常具有侵入性,我建議您進一步瞭解它(http://nmap.org/book/osdetect-fingerprint-format.html)。

「太多指紋匹配此主機以提供特定的操作系統細節」意味着探針相互矛盾或過寬。 例如,在NAT場景中,某些端口掃描會返回路由器信息(例如思科iOS),其他一些探測器會返回真實的主機規格(例如Windows)。

理解網絡結構的一個好方法可悲的是你的人的解釋,所以這將是複雜的腳本。 IP ID序列,指紋分析和服務檢測(-sV)可以幫助:

e.q。如果3389打開,則運行的操作系統是Windows。

e.q.如果IP ID序列發生變化,那麼目標可能是多個(負載平衡)。

e.q.您對指紋的分析將比午睡猜測更準確。

請讓我知道如果這不明確。