nmap是一個(gè)網(wǎng)絡(luò)探測和安詳掃描措施,系統(tǒng)打點(diǎn)者和小我私家可以利用這個(gè)軟件掃描大型的網(wǎng)絡(luò),獲取被掃描主機(jī)正在運(yùn)行以及提供什么處事等信息。 nmap支持許多掃描技能,譬喻:UDP、TCP connect()、TCP SYN(半開掃描)、ftp署理(bounce進(jìn)攻)、反向符號(hào)、ICMP、FIN、ACK掃描、圣誕樹(Xmas Tree)、SYN掃描和null掃描。從掃描范例一節(jié)可以獲得細(xì)節(jié)。nmap還提供了一些高級(jí)的特征,譬喻:通過TCP/IP協(xié)議棧特征探測操縱系統(tǒng)范例,奧秘掃描,動(dòng)態(tài)延時(shí)和重傳計(jì)較,并行掃描,通過并行ping掃描探測封鎖的主機(jī),誘餌掃描,避初步口過濾檢測,直接RPC掃描(無須端口影射),碎片掃描,以及機(jī)動(dòng)的方針和端口設(shè)定。本文具體先容了NMap的具體利用選項(xiàng),并給出了幾個(gè)實(shí)用實(shí)例,nmap是入侵和網(wǎng)絡(luò)安詳檢測的必備東西。
nmap
BT5(BackTrack--Information Gathering--Network Analysis--Network Scanners-nmap)
-sP 滲透內(nèi)網(wǎng)之后判定當(dāng)前網(wǎng)絡(luò)那些主機(jī)在線
nmap -sP 192.168.1/255
-vv 現(xiàn)實(shí)具體的掃描進(jìn)程
-sS 利用SYN半開式掃描,美國云服務(wù)器 江西電信服務(wù)器,這種掃描方法使得掃描功效越發(fā)正確(又稱半開放,或
隱身掃描)
nmap -vv -sS IP
-O 大寫O代表OS 判定主機(jī)操縱系統(tǒng)
nmap -O IP
延時(shí)計(jì)策
-T(0-5) 默認(rèn)為3
0 即Paranoid模式。為了避開IDS的檢測使掃描速度極慢,nmap串所有的掃描,
每隔至少5分鐘發(fā)送一個(gè)包
1 即Sneaky模式。也差不多,只是數(shù)據(jù)包的發(fā)送隔斷是15秒
2 即Polite模式。不增加太大的網(wǎng)絡(luò)負(fù)載,串行每個(gè)探測,并使每個(gè)探測隔斷
0.4秒
3 即Normal模式。nmap的默認(rèn)選項(xiàng),在不使網(wǎng)絡(luò)過載可能主機(jī)/端口丟失的環(huán)境
下盡大概快速地掃描
4 即Aggressive模式。配置5分鐘的超時(shí)限制,對(duì)每臺(tái)主機(jī)的掃描時(shí)間不高出5分
鐘,而且對(duì)每次探測回應(yīng)的期待時(shí)間不高出1.5秒。
5 即lnsane模式。只適合快速的網(wǎng)絡(luò)可能不在意丟失默些信息,每臺(tái)主機(jī)的超時(shí)
限制為75秒,對(duì)每次探測只期待0.3秒。
nmap -sS -T1 IP
-sV 探測端口的處事范例/詳細(xì)版本等信息
nmap -vv -sV IP
-p 端標(biāo)語 對(duì)某個(gè)端口的處事版本舉辦具體探測 有助于升入的針對(duì)性進(jìn)攻,
好比緩沖溢出進(jìn)攻
nmap -vv -sV IP -p 21
合用于表里網(wǎng)的探測,以內(nèi)網(wǎng)操縱為示例(外網(wǎng)參數(shù)同)
簡樸端口掃描: nmap -vv -sT(sS、sF、sU、sA) 192.168.0.1 -D 127.0.0.1
(-D偽造的地點(diǎn))
OS檢測: nmap -vv -sS -O 192.168.0.1
RPC辨別: nmap -sS -sR 192.168.0.1 Linux上的portmap就是一個(gè)簡樸的RPC服
務(wù),監(jiān)聽端口為111(默認(rèn))
Ping掃射:nmap -sP 172.16.15.0/24
十條常用nmap呼吁行名目
1)獲取長途主機(jī)的系統(tǒng)范例及開放端口
Get info about remote host ports and OS detection
nmap -sS -P0 -sV -O <target>
這里的 < target > 可以是單一 IP, 或主機(jī)名,或域名,或子網(wǎng)
-sS TCP SYN 掃描 (又稱半開放,或隱身掃描)
-P0 答允你封鎖 ICMP pings.
-sV 打開系統(tǒng)版本檢測
-O 實(shí)驗(yàn)識(shí)別長途操縱系統(tǒng)
-sS TCP SYN scanning (also known as half-open, or stealth scanning)
-P0 option allows you to switch off ICMP pings.
-sV option enables version detection
-O flag attempt to identify the remote operating system
Other option:
-A 同時(shí)啟用操縱系統(tǒng)指紋識(shí)別和版本檢測
-A option enables both OS fingerprinting and version detection
-v use -v twice for more verbosity.
nmap -sS -P0 -A -v < target >
2)列出開放了指定端口的主機(jī)列表
Get list of servers with a specific port open
nmap -sT -p 80 -oG – 192.168.1.* | grep open
Change the -p argument for the port number. See “man nmap” for
different ways to specify address ranges.
3)在網(wǎng)絡(luò)尋找所有在線主機(jī)
Find all active IP addresses in a network
nmap -sP 192.168.0.*
可能也可用以下呼吁:
nmap -sP 192.168.0.0/24
指定 subnet
4)Ping 指定范疇內(nèi)的 IP 地點(diǎn)
Ping a range of IP addresses
nmap -sP 192.168.1.100-254
nmap accepts a wide variety of addressing notation, multiple
targets/ranges, etc.
5)在某段子網(wǎng)上查找未占用的 IP
Find unused IPs on a given subnet
nmap -T4 -sP 192.168.2.0/24 && egrep "00:00:00:00:00:00" /proc/net/arp
6)在局域網(wǎng)上掃找 Conficker 蠕蟲病毒
Scan for the Conficker virus on your LAN ect.
nmap -PN -T4 -p139,445 -n -v –script=smb-check-vulns –script-args
safe=1 192.168.0.1-254
replace 192.168.0.1-256 with the IP’s you want to check.
7)掃描網(wǎng)絡(luò)上的惡意接入點(diǎn) rogue APs.
Scan Network for Rogue APs.
nmap -A -p1-85,113,443,8080-8100 -T4 –min-hostgroup 50 –max-rtt-
timeout 2000 –initial-rtt-timeout 300 –max-retries 3 –host-timeout
20m –max-scan-delay 1000 -oA wapscan 10.0.0.0/8
I’ve used this scan to successfully find many rogue APs on a very,
very large network.
8)利用誘餌掃描要領(lǐng)來掃描主機(jī)端口
Use a decoy while scanning ports to avoid getting caught by the sys
admin
sudo nmap -sS 192.168.0.10 -D 192.168.0.2
Scan for open ports on the target device/computer (192.168.0.10) while
setting up a decoy address (192.168.0.2). This will show the decoy ip
address instead of your ip in targets security logs. Decoy address
needs to be alive. Check the targets security log at /var/log/secure
to make sure it worked.
9)為一個(gè)子網(wǎng)列出反向 DNS 記錄
List of reverse DNS records for a subnet
nmap -R -sL 209.85.229.99/27 | awk '{if($3=="not")print"("$2") no
PTR";else print$3" is "$2}' | grep '('
10)顯示網(wǎng)絡(luò)上共有幾多臺(tái) Linux 及 Win 設(shè)備?
How Many Linux And Windows Devices Are On Your Network?
sudo nmap -F -O 192.168.1.1-255 | grep "Running: " > /tmp/os; echo
"$(cat /tmp/os | grep Linux | wc -l) Linux device(s)"; echo "$(cat
/tmp/os | grep Windows | wc -l) Window(s) devices"