天天看點

掃描篇:nmap的使用nmap的使用

nmap的使用

nmap裡面的腳本目錄:/usr/share/nmap/scripts/script.db

擷取IP

nmap host 域名
nmap dig 域名
           

是否存活

nmap -sP --script discovery ip
           

掃描線上主機

nmap -sP IP位址
           

探測IP協定

nmap -PO IP位址
           

擷取系統概要

探測防火牆

nmap -PN IP # 探測是否有防火牆
nmap -sA IP # 探測防火牆的規則
nmap -sw IP # TCP Windows掃描
nmap -sF IP # FIN掃描,識别端口狀态
           

傳輸層掃描

nmap -sT -p--Pn IP	# TCP掃描
nmap -sL IP/mask	# TCP掃描
nmap -sS -p--Pn IP	# SYN掃描
nmap -sU IP			# UDP掃描
           

繞開鑒權

nmap --script=auth IP
           

探測作業系統

nmap -O IP
           

探測軟體版本

nmap -V IP
nmap -sTV -p--Pn IP
           

探查區域網路内更多服務

nmap -n --script=broadcast IP
           

碎片化,偏移位

nmap -f IP
nmap --mtu 16 IP
           

判斷smtp是否使用預設端口

nmap -sV -script=smtp-strangeport IP
           

擷取PHP版本資訊

nmap -sV --script=http-php-version IP
           

使用者發現IP位址黑名單

nmap -sn IP --script dns-blacklist
           

簡單暴力猜解

nmap --script=brute IP
           

檢查是否存在漏洞

nmap --script=vuln IP
           

smb掃描

nmap --script=smb-brute.nse 
	--script-args=userdb=/var/passwd,
	passwdb=/var/passwd IP #smb破解
nmap -p445 --script=smb-enum-sessions.nse 
	--script-args=smbuser=test,smbpass=test IP
           

mssql掃描

nmap -p1433 --script=ms-sql-brute 
	--script-args=userdb=/var/passwd,
	passdb=/var/passwd IP
           

nmap的參數

特殊目标

option 詳情
-iL <inpurfilename> hosts/networks的清單
-iR <num hosts> 選擇一個随機的目标
–exclude <host1[,host2,…]> 排出host1\host2…
–excludefile <exclude_file> 排出檔案中的host

host發現

option 詳情
-sL 清單掃描
-sn ping掃描
-Pn 不跳過不響應的位址
-PS/PA/PU/PY[portlist] TCP SYN/ACK,UDP or SCTP 發現端口
-PE/PP/PM ICMP echo,timestamp,netmask 請求
-PO[protocol list] IP協定請求
-dns-servers <serv1[,serv2…]> 指定DNS伺服器
–system-dns 使用os的dns
–traceroute 追蹤

掃描技術

option 詳情
-sS/ sT/ sA/ sW/ sM TCP SYN/ Connect/ ACK/ windows/ mainon 掃描
-sU UDP掃描
-sN/ sF/ sX TCP null/ FIN/ Xmas掃描
–scanflags <flags> 定制TCP掃面的flag
-sI <zombie host[:probeport]> idle掃描
-sY/ sZ sctp init/cookie-echo 掃描
-sO IP協定掃描
-b <FTP relay host> FTP反彈掃描

端口掃描

option 詳細
-p <port ranges> 端口掃描
-exclude-ports <port> 不掃描的端口
-F 快速模式
-r 連續掃描端口
–top-ports <number> 掃描常用端口
–port-ratio <ratio> 掃描端口更多常用端口

伺服器版本的導向

option 詳細
-sV 探測打開的端口并确認服務/版本資訊
–version-intensity <level> 設定從0到9
–version-light 限制查詢的探頭
–version-all 嘗試所有信号的探頭
–version-trace 展示詳細的版本掃面資訊

script掃描

option 詳細
-sC 和–script=default相同
–script=<lua scripts> <lua scripts> 是對應的腳本名稱
–script-args=<n1=v1,…> 腳本的參數
–script-args-file=filename 檔案
–script-trace 展示所有發送的資料和接收的資訊
–script-updatedb 更新腳本的資料庫
–script-help=<lua script> 展示腳本的資訊

OS導向

option 詳情
-O 作業系統的類型
–osscan-limit 限制目标的作業系統的類型
–osscan-guess 猜測作業系統的類型

繼續閱讀