Nmap使用技巧总结
生活随笔
收集整理的這篇文章主要介紹了
Nmap使用技巧总结
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Nmap使用技巧總結
一、主機發現
1. 全面掃描/綜合掃描 nmap -A 192.168.1.1032. Ping掃描 nmap -sP 192.168.1.1/243. 免Ping掃描,穿透防火墻,避免被防火墻發現 nmap -P0 192.168.1.1034. TCP SYN Ping 掃描 nmap -PS -v 192.168.1.103 nmap -PS80,10-100 -v 192.168.1.103 (針對防火墻丟棄RST包)5. TCP ACK Ping 掃描 nmap -PA -v 192.168.1.1036. UDP Ping 掃描 nmap -PU -v 192.168.1.1037. ICMP Ping Types 掃描 nmap -PU -v 192.168.1.103 (ICMP ECHO) nmap -PP -v 192.168.1.103 (ICMP 時間戳) nmap -PM -v 192.168.1.103 (ICMP 地址掩碼)8. ARP Ping 掃描 nmap -PR -v 192.168.1.1039. 列表 掃描 nmap -sL -v 192.168.1.10310. 禁止方向域名解析 nmap -n -sL -v 192.168.1.10311. 方向域名解析 nmap -R -sL -v 192.168.1.10312. 使用系統域名解析系統 nmap --system-dns 192.168.1.2 192.168.1.10313. 掃描IPV6地址 nmap -6 IPv614. 路由跟蹤 nmap --traceroute -v www.sunbridgegroup.com15. SCTP INIT Ping 掃描 nmap -PY -v 192.168.1.103二、端口掃描
1. 時序掃描 nmap -T(0-5) 192.168.1.1032. 常用掃描方式 nmap -p 80 192.168.1.103 nmap -p 80-100 192.168.1.103 nmap -p T:80,U:445 192.168.1.103 nmap -F 192.168.1.1.103 (快速掃描) nmap --top-ports 100 192.168.1.103 (掃描最有用的前100個端口)3. TCP SYN 掃描 (高效的掃描方式) nmap -sS -v 192.168.1.1034. TCP 連接掃描 nmap -sT -v 192.168.1.1035. UDP 連接掃描 nmap -sU -p 80-100 192.168.1.1036. 隱蔽掃描 nmap -sN 61.241.194.153(NULL掃描) nmap -sF 61.241.194.153(FIN掃描) nmap -sX 61.241.194.153(Xmas掃描)7. TCP ACK 掃描 nmap -sA 192.168.1.1038. TCP 窗口掃描 nmap -sW -v -F 192.168.1.1039. TCP Maimon 掃描 nmap -sM -T4 192.168.1.10310. 自定義 掃描 nmap -sT --scanflags SYNURG 192.168.1.10311. 空閑 掃描( 隱藏IP ) nmap -sI www.0day.co:80 192.168.1.10312. IP協議 掃描 nmap -sO -T4 192.168.1.10313. FTP Bounce 掃描 (已經不被支持)三、指紋識別與探測
1. 版本探測 nmap -sV 192.168.1.103 nmap -sV -A 192.168.1.1032. 全端口版本探測 nmap -sV --allports 192.168.1.1033. 設置掃描強度 nmap -sV --version-intensity (0-9) 192.168.1.1034. 輕量級掃描 nmap -sV --version-light 2 192.168.1.1035. 重量級掃描 nmap -sV --version-all 192.168.1.1036. 獲取詳細版本信息 nmap -sV --version-trace 192.168.1.1037. RPC掃描 nmap -sS -sR 192.168.1.1038. 對指定的目標進行操作系統監測 nmap -O --osscan-limit 192.168.1.1039. 推測系統并識別 nmap -O --osscan-guess 192.168.1.103四、伺機而動
1. 調整并行掃描組的大小 nmap --min-hostgroup 30 192.168.1.110/24 nmap --max-hostgroup 30 902 192.168.1.1042. 調整探測報文的并行度 nmap --min-parallelism 100 192.168.1.104 nmap --max-parallelism 100 192.168.1.1043. 調整探測報文超時 nmap --initial-rtt-timeout 100ms 192.168.1.104 nmap --max-rtt-timeout 100ms 192.168.1.104 nmap --min-rtt-timeout 100ms 192.168.1.1044. 放棄緩慢的目標主機 nmap --host-timeout 1800000ms 192.168.1.1045. 調整報文適合時間間隔 nmap --scan-delay 1s 192.168.1.104 nmap --max-scan-delay 1s 192.168.1.104五、防火墻/IDS逃逸
1. 報文分段 nmap -f -v 61.241.194.1532. 指定偏移大小 nmap --mtu 16 192.168.1.1043. IP欺騙 nmap -D RND:11 192.168.1.104 nmap -D 192.168.1.104,192.168.1.103,192.168.1.101 192.168.1.1044. 源地址欺騙 nmap -sI www.0day.cn:80 192.168.1.1045. 源端口欺騙 nmap --source-port 902 192.168.1.1046. 指定發包長度 nmap --data-length 30 192.168.1.1047. 目標主機隨機排序 nmap --randomize-hosts 192.168.1.1048. MAX地址欺騙 nmap -sT -Pn --spoof-mac 0 192.168.1.104六、信息收集
1. IP信息收集 nmap --script ip-geolocation-* www.pcos.cn2. WHOIS 查詢 nmap --script whois-domain www.pcos.cn nmap --script whois-domain --script-args whois.whodb=nofollow www.ithome.com nmap -sn --script whois-domain -v -iL host.txt3. 搜索郵件信息(新版可能沒有這個模塊) nmap --script http-email-harvest www.pcos.cn4. IP反查 nmap -sn --script hostmap-ip2hosts www.pcos.cn5. DNS信息收集 nmap --script dns-brute www.pcos.cn nmap --script dns-brute dns-brute.threads=10 www.pcos.cn nmap --script dns-brute dns-brute.threads=10,dns-brute.hostlis www.pcos.cn6. 檢索系統信息 nmap -p 445 445 192.168.1.104 --script membase-http-info7. 后臺打印機服務漏洞 nmap --script smb-security-mode.nse -p 445 119.29.155.458. 系統漏洞掃描 nmap --script smb-check-vulns.nse -p 445 119.29.155.459.掃描Web漏洞 nmap -p80 --script http-stored-xss.nse/http-sql-injection.nse 119.29.155.4510. 通過 Snmp 列舉 Windows 服務/賬戶 nmap -sU -p 161 --script=snmp-win32-services 192.168.1.104 nmap -sU -f -p 161 --script=snmp-win32-users 192.168.1.11011. 枚舉 DNS 服務器的主機名 nmap --script dns-brute --script-args dns-brute.domain=baidu.com12. HTTP信息收集 nmap -sV -p 80 www.0day.com (HTTP版本探測) nmap -p 80 --script=http-headers www.pcos.cn (HTTP信息頭探測) nmap -p 80 --script=http-sitemap-generator www.pcos.cn (爬行Web目錄結構)13. 枚舉SSL密鑰 nmap -p 443 --script=ssl-enum-ciphers www.baidu.com14. SSH服務密鑰信息探測 map -p 22 --script ssh-hostkey --script-args ssh_hostkey=full 127.0.0.1七、數據庫滲透測試
1. Mysql列舉數據庫 nmap -p3306 --script=mysql-databases --script-args mysqluser=root,mysqlpass 192.168.1.1012. 列舉 MySQL 變量 nmap -p3306 --script=mysql-variables 192.168.1.3 nmap -sV --script=mysql-variables 192.168.1.3 (無法確定端口的情況下)3. 檢查 MySQL 密碼 nmap -p3306 --script=mysql-empty-password 192.168.1.3 nmap -sV -F -T4 --script=mysql-empty-password 192.168.1.34. 審計 MySQL 密碼 nmap --script=mysql-brute 192.168.1.101 nmap -p3306 --script=mysql-brute userdb=/root/passdb.txt passdb=/root/pass.txt 192.168.1.101 (指定字典)5. 審計 MySQL 安全配置 nmap -p3306 --script mysql-audit --script-args "mysql-audit.username='root',mysql-audit.password='123',mysql-audit.filename='nselib/data/mysql-cis.audit'" 192.168.1.1046. 審計 Oracle 密碼 nmap --script=oracle-brute -p 1521 --script-args oracle-brute.sid=test 192.168.1.121 nmap --script=oracle-brute -p 1521 --script-args oracle-brute.sid=test --script-args userdb=/tmp/usernames.txt,passdb=/tmp/password.txt 192.168.1.1057. 審計 msSQL密碼 nmap -p 1433 --script ms-sql-brute --script-args userdb=name.txt,passdb=pass.txt 192.168.1.1048. 檢查 msSQL空密碼 nmap -p 1433 --script ms-sql-empty-password 192.168.1.1049. 讀取 msSQL 數據 nmap -p 1433 --script ms-sql-tables --script-args mssql.username=sa,mssql.Password=sa 192.168.1.10110. 讀取 msSQL 執行系統命令 nmap -p 1433 --script ms-sql-xp-cmdshell --script-args mssql.username=sa,mssql.password=sa,ms-sql-xp-cmdshell.cmd="ipconfig" 192.168.1.10111. 審計 PgSQL 密碼 nmap -p 5432 --script pgsql-brute 192.168.1.101八、滲透測試
1. 審計 HTTP 身份驗證 nmap --script=http-brute -p 80 www.pcos.cn2. 審計 FTP 服務器 nmap --script ftp-brute -p 21 192.168.1.101 nmap --script ftp-brute --script-args userdb=user.txt,passdb=pass.txt -p 21 192.168.1.101 nmap --script=ftp-anon 192.168.1.1013. 審計 Wordpress 程序 nmap -p80 --script http-wordpress-brute 192.168.1.110 nmap -p80 --script http-wordpress-brute --script-args userdb=user.txt,passdb=passwd.txt 192.168.1.110 nmap -p80 --script http-wordpress-brute --script-args http-wordpress-brute.threads=10 192.168.1.1104. 審計 Joomla 程序 nmap -p80 --script http-joomla-brute 192.168.1.110 nmap -p80 --script http-joomla-brute --script-args uesrdb=user.txt,passdb=passwd.txt 192.168.1.110 nmap -p80 --script http-joomla-brute --script-args uesrdb=user.txt,passdb=passwd.txt,http-joomla-brute.threads=5 192.168.1.1105. 審計 郵件服務器 nmap -p110 --script=pop3-brute 192.168.1.1106. 審計 SMB 口令 nmap --script smb-brute.nse -p 445 192.168.1.110 nmap --script smb-brute.nse --script-args passdb=pass.txt -p 445 192.168.1.1107. 審計 VNC 服務 nmap --script vnc-brute -p 5900 192.168.1.1108. 審計 SMTP 服務器 nmap -p 25 --script smtp-brute 192.168.1.110 nmap -p 25 --script=smtp-enum-users.nse smith.jack.com (枚舉遠程系統所有用戶)9. 檢測 Stuxnet 蠕蟲 nmap --script stuxnet-detect -p 445 192.168.1.11010. SNMP 服務安全審計 nmap -sU -p 161 --script=snmp-netstat 192.168.1.101 (獲取目標主機網絡連接狀態) nmap -sU -p 161 --script=snmp-processes 192.168.1.110 (枚舉目標主機的系統進程) nmap -sU -p 161 --script=snmp-win32-services 192.168.1.110 (獲得windows服務器的服務) nmap -sU -p 161 --script snmp-brute 192.168.1.110九、Zenmap
1. Intense scan (詳細掃描) nmap -T4 -A -v 192.168.1.1012. Intense scan plus UDP (UDP掃描經典使用) nmap -sS -sU -T4 -A -v 192.168.1.1013. Intense scan, all TCP ports (TCP掃描) nmap -p 1-65535 -T4 -A -v 192.168.1.1014. Intense scan, no ping (無Ping掃描) nmap -T4 -A -v -Pn 192.168.1.1015. Ping scan (Ping掃描) nmap -sn 192.168.1.101/246. Quick scan nmap -T4 -F 192.168.1.101/247. Quick scan plus nmap -sV -T4 -O -F --version-light 192.168.1.101/248. Quick traceroute nmap -sn --traceroute 192.168.1.1019. Regular scan nmap 192.168.1.10110. Slow comprehensive scan nmap -sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script "default or (discovery and safe)" 192.168.1.101十. Nmap 技巧
1. 發送以太網數據包 nmap --send-eth 192.168.1.1112. 網絡層發送 nmap --send-ip 192.168.1.1113. 假定擁有所有權 nmap --privileged 192.168.1.1114. 在交互模式中啟動 nmap --interactive5. 查看 Nmap 版本號 nmap -V6. 設置調試級別 nmap -d (1-9) 192.168.1.1117. 跟蹤發送接收的報文 nmap --packet-trace -p 20-30 192.168.1.1118. 列舉接口和路由 nmap --iflist www.iteye.com9. 指定網絡接口 nmap -e eth0 192.168.1.11110. 繼續中斷掃描 nmap -oG 1.txt -v 192.168.126.1/24 nmap --resume 1.txt (繼續掃描)11. Dnmap dnmap_server -f test (指定命令腳本) dnmap_client -s 192.168.1.107 -a test12. 編寫 Nse 腳本(1) -- The scanning module --author = "Wing"categories = {"version"}portrule = function(host,port)return port.protocol == "tcp" and port.number == 80 and port.state == "open"endaction = function(host,port)return "Found!!!"end(2) -- The scanning module --author = "Wing"categories = {"version"}local comm=require "comm"require "shortport"local http=require "http"portrule = function(host,port)return (port.number == 80) and (port.start=="open")endaction = function(host,port)local uri = "/admin.php"local response = http.get(host,port,uri)return "Found!!!"end13. 探測防火墻 nmap --script=firewalk --traceroute 192.168.1.11114. VMware認證破解 nmap -p 902 --script vmauthd-brute 192.168.1.107十一. Nmap的保存和輸出
1. 標準保存 nmap -F -oN d:/test1.txt 192.168.1.1112. XML保存 nmap -F -oX d:/test1.xml 192.168.1.1113. 133t 保存 nmap -F -oS d:/test2.txt 192.168.1.1114. Grep 保存 nmap -F -oG d:/test2.txt 192.168.1.1115. 保存到所有格式 nmap -F -oA d:/test2 192.168.1.1116. 補充保存文件 nmap -F -append-output -oN d:/test2.txt 192.168.1.1117. 轉換 XML 保存 nmap -F -oX testB.xml --stylesheet http://www.insecure.org/nmap/data/nmap.xsl 192.168.1.1118. 忽略 XML 聲明的 XSL 樣式表 nmap -oX d:/testC.xml --no-stylesheet 192.168.1.111總結
以上是生活随笔為你收集整理的Nmap使用技巧总结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 图解外包验收流程V2.0及详细说明实例
- 下一篇: MATLAB保存数据为txt或dat格式