指令類型:portrule
Nmap Script指令摘要
這個指令用於尋找 DOM 中可能由攻擊者控制的資訊,這些資訊可能被用來以某些方式影響 JavaScript 執行,攻擊的詳細說明可以在這裡找到:攻擊說明。
這些指令都涉及檢測網站中可能存在的安全漏洞,特別是與跨站指令攻擊 (XSS) 相關的漏洞;同時,您還可以參考以下相關指令:
Nmap Script指令參數
http-dombased-xss.singlepages
用於指定要測試的頁面,可以列出要測試的頁面,例如 {/index.php, /profile.php};預設情況下,它是空的,表示處於爬行模式,會自動尋找要測試的頁面。
slaxml.debug
用於除錯的選項,查看 slaxml函式庫進一步了解。
httpspider.doscraping, httpspider.maxdepth, httpspider.maxpagecount, httpspider.noblacklist, httpspider.url, httpspider.useheadfornonwebfiles, httpspider.withindomain, httpspider.withinhost
用於控制爬行行為,包括深度、最大頁數、URL 黑名單等,參考 httpspider函式庫進一步了解。
http.host, http.max-body-size, http.max-cache-size, http.max-pipeline, http.pipeline, http.truncated-ok, http.useragent
用於控制 HTTP 請求和回應,包括主機名稱、最大內容大小、暫存等;參考 http函式庫進一步了解。
smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername
用於 SMB 身份驗證,包括網域、雜湊 (Hash)、使用者名稱等,參考 smbauth函式庫進一步了解。
Nmap Script指令範例
nmap -p80 --script http-dombased-xss.nse <target>
DOM-based XSS occur in client-side JavaScript and this script tries to detect them by using some patterns. Please note, that the script may generate some false positives. Don't take everything in the output as a vulnerability, if you don't review it first.
Most of the patterns used to determine the vulnerable code have been taken from this page: https://code.google.com/p/domxsswiki/wiki/LocationSources
Nmap Script指令輸出
PORT STATE SERVICE REASON
80/tcp open http syn-ack
| http-dombased-xss:
| Spidering limited to: maxdepth=3; maxpagecount=20; withinhost=some-very-random-page.com
| Found the following indications of potential DOM based XSS:
|
| Source: document.write("<OPTION value=1>"+document.location.href.substring(document.location.href.indexOf("default=")
| Pages: http://some-very-random-page.com:80/, http://some-very-random-page.com/foo.html
|
| Source: document.write(document.URL.substring(pos,document.URL.length)
|_ Pages: http://some-very-random-page.com/foo.html
Nmap Script作者:
George Chatzisofroniou
License: Same as Nmap--See https://nmap.org/book/man-legal.html