Netdiscover是一種網絡掃描工具,通過ARP掃描發現活動主機,可以通過主動和被動兩種模式進行ARP掃描。通過主動發送ARP請求檢查網絡ARP流量,通過自動掃描模式掃描網絡地址。本文介紹Netdiscover的安裝和使用方法。
Netdiscover安裝
Kali Linux提供的網絡掃描工具
github地址:https://github.com/alexxy/netdiscover
ubuntu:
$ sudo apt install netdiscover
安裝完成后查看幫助信息:
$ netdiscover -h
Netdiscover 0.5.1 [Active/passive ARP reconnaissance tool]
Written by: Jaime Penalba <jpenalbae@gmail.com>
Usage: netdiscover [-i device] [-r range | -l file | -p] [-m file] [-F filter] [-s time] [-c count] [-n node] [-dfPLNS]
-i device: your network device
-r range: scan a given range instead of auto scan. 192.168.6.0/24,/16,/8
-l file: scan the list of ranges contained into the given file
-p passive mode: do not send anything, only sniff
-m file: scan a list of known MACs and host names
-F filter: customize pcap filter expression (default: "arp")
-s time: time to sleep between each ARP request (milliseconds)
-c count: number of times to send each ARP request (for nets with packet loss)
-n node: last source IP octet used for scanning (from 2 to 253)
-d ignore home config files for autoscan and fast mode
-f enable fastmode scan, saves a lot of time, recommended for auto
-P print results in a format suitable for parsing by another program and stop after active scan
-L similar to -P but continue listening after the active scan is completed
-N Do not print header. Only valid when -P or -L is enabled.
-S enable sleep time suppression between each request (hardcore mode)
If -r, -l or -p are not enabled, netdiscover will scan for common LAN addresses
Netdiscover選項
選項 | 說明 |
---|---|
-i device | 網絡接口 |
-r range | 掃描范圍,例如192.168.0.0/24,僅支持/8, /16和/24 |
-l file | 掃描范圍列表文件,每行一個范圍 |
-p | 被動模式:不發生任何報文,僅嗅探 |
-m file | 掃描已知Mac地址和主機名的列表文件 |
-F filter | 自定義pcap filter表達式(默認“arp”) |
-s time | 每個ARP請求間的休眠時間(毫秒,默認1ms) |
-c count | 發送每個ARP請求的次數,用於丟失數據包的網絡,默認1次 |
-n node | 掃描最后的源IP,默認為67(x.x.x.67),允許范圍為2-253 |
-d | 忽略自動掃描和快速模式的主配置文件,掃描默認的范圍和IP |
-f | 啟用快速模式掃描,掃描每個網段的.1、.100 和 .254 |
-P | 產生輸出到文件或者其他解析程序,掃描完成后退出,例如:netdiscover -P -r 192.168.20.0/16 | grep 192.168.20.100 |
-L | 與-P類似,但在主動掃描后繼續捕獲ARP包 |
-N | 不打印表頭,僅在-P 或者-L啟用時有效 |
-S | 已棄用 |
Netdiscover使用
用法
如果未啟用被動模式(-p)、掃描列表(-l)或掃描范圍(-r)選項,netdiscover將掃描LAN地址(192.168.0.0/16、172.16.0.0/12和10.0.0.0/8)。
掃描結果控制鍵:
h:顯示幫助信息
$ netdiscover -i ens38 -p
q:退出幫助信息界面,或者退出掃描(或者Ctrl+c退出)
j:向下滾動(或者使用下方向箭頭)
k:向上滾動(或者使用上方向箭頭)
.:向上翻頁
,:向下翻頁
掃描結果視圖:
a:顯示ARP響應列表
r:顯示ARP請求列表
u:顯示檢測到的唯一主機
使用實例
掃描指定接口:
$ netdiscover -i ens38
快速掃描:
$ netdiscover -i ens38 -f
掃描指定范圍:
$ netdiscover -i ens38 -r 192.168.0.0/16
被動掃描,僅嗅探:
$ netdiscover -i ens38 -r 192.168.0.0/16 -p
歡迎關注公眾號:「測試開發小記」及時接收最新技術文章!