dismap 快速資產發現和識別工具
About dismap
Dismap 定位是一個適用于內外網的資產發現和識別工具;其特色功能在于快速識別 Web 指紋信息,定位資產類型。輔助紅隊快速定位目標資產信息,輔助藍隊發現疑似脆弱點。
Dismap 擁有完善的指紋規則庫,可輕松自定義新識別規則。
識別結果可直接丟給 Vulmap(>=0.8) 進行漏洞掃描實現簡易聯動。
項目地址:
https://github.com/zhzyker/dismap
工具最初定位為內網工具,自我感觸在大型攻防活動中,經常由于精力有限略過內網網站,而靠內網數據庫、弱口令、FTP、SMB 之類的目標來刷分,但多數內網往往分數達不到自己預期,故思理論上內網網站脆弱性肯定比外網高,實際上確不怎么打,還是內網精力分配的差異,又思搞一個快速識別網段(內網)所有 Web 資產類型出來的工具,豈不就能針對性逮好打的拿分了~
后續因測試需求經常在互聯網(外網)中掃描識別測試,驚奇的發現這玩意掃整個外網網段時效果遠遠高于自己預期,往往一個 C 段 200 左右個存活 IP 幾個 Tomcat、多少 Shiro、一堆 Spring、一些 Struts2 的網站清清楚楚擺在眼前,偶爾在蹦出來一堆其他 Web 應用,簡直不要太快樂。
授權問題僅貼自己搭建環境的效果圖:

Get & Run
下載鏈接:
https://github.com/zhzyker/dismap/releases
默認編譯了以下支持的系統類型:
dismap-darwin-amd64 6.66 MB
dismap-darwin-arm64 6.48 MB
dismap-linux-amd64 6.78 MB
dismap-linux-x86 6.02 MB
dismap-windows-amd64.exe 6.77 MB
dismap-windows-x86.exe 6.07 MB
運行: # Linux and MacOS zhzyker@debian:~$ chmod +x dismap zhzyker@debian:~$ ./dismap -h # Windows C:\Users\zhzyker\Desktop> dismap.exe -h
Optons
功能和參數使用解讀視頻(Bilibili):
https://www.bilibili.com/video/BV13L411b79E
常規參數:
-file string
Select a URL file for batch identification
# 從文件中讀取 Url 進行批量識別
-ip string
Network segment [e.g. -ip 192.168.1.0/24 or -ip 192.168.1.1-10]
# 指定一個網段,格式示例: 192.168.1.1/24 192.168.1.1-100 192.168.1.1-192.168.1.254
-np
Not use ICMP/PING to detect surviving hosts
# 不進行主機存活檢測,跳過存活檢測直接識別 Url
-output string
Save the scan results to the specified file (default "output.txt")
# 自定義識別結果輸出文件,默認追加到 output.txt 中
-port string
Custom scan ports [e.g. -port 80,443 or -port 1-65535]
# 自定義需要掃描的 Web 端口,默認端口在 /config/config.go 中
-thread int
Number of concurrent threads, (adapted to two network segments 2x254) (default 508)
# 多線程數量,默認508(兩個C段的數量),線程越高存活和識別丟失率可能越高,不建議超過2000
-timeout int
Response timeout time, the default is 5 seconds (default 5)
# 主機存活探測和 Http 超時時間,默認均為5秒
-url string
Specify a target URL [e.g. -url https://example.com]
# 識別單個 Url 時用該選項指定
RuleLab
規則庫大致格式:
Rule:
Name: name /* 定義規則名稱 */
Type: header|body|ico /* 支持識別的類型, header、body、ico 任意組合, ico 為單獨請求 favicon.ico 并計算 MD5*/
Mode: and|or /* 類型的判斷邏輯關系 */
Rule
InBody: str /* 需要指定響應 Body 中存在 str 則命中 */
InHeader: str /* 需要指定響應 Hedaer 中存在 str 則命中 */
InIcoMd5: str_md5 /* favicon.ico 的 MD5 值 */
Http:
ReqMethod: GET|POST /* 自定義請求方法,目前支持 GET 和 POST */
ReqPath: str /* 自定義請求 Web 路徑 */
ReqHeader: []str /* 自定義 Http 請求的 Header */
ReqBody: str /* 自定義 POST 請求時的 Body */
簡單示例:
# 即在響應Body中檢查是否存在字符
{"Apahce Flink", "body", "", InStr{"()", "", ""}, ReqHttp{"", "", nil, ""}},
# 自定義請求訪問/myportal/control/main,判斷自定義請求的結果中是否存在指定的 header 字符和 body 字符。可以發現均支持正則表達式
{"Apache OFBiz", "body|header", "or", InStr{"(Apache OFBiz|apache.ofbiz)", "(Set-Cookie: OFBiz.Visitor=(.*))", ""}, ReqHttp{"GET", "/myportal/control/main", nil, ""}},
對于規則庫的詳細說明見 Github
Linkage
目前開源的兩款工具(dismap v0.1 and vulmap >=0.8 )可進行簡易聯動使用,即把識別結果直接丟給漏洞掃描。
Dismap 默認會將掃描結果追加保存到 output.txt ,大致這個樣子:
###### dismap 0.1 output file ######
###### asset discovery and identification tools ######
###### by:https://github.com/zhzyker/dismap ######
[+] [200] [Apache Struts2] { http://192.168.43.134:8080/struts2-showcase-2.3.12/showcase.action } [Struts2 Showcase]
[+] [404] [Weblogic] { http://192.168.43.134:7001 } [None]
[-] [404] { http://192.168.43.134:8080/fast/ } [HTTP Status 404 – Not Found]
[+] [200] [Apache Tomcat] { http://192.168.43.134:8080 } [Apache Tomcat/8.5.56]
[+] [200] [Apache Shiro] { http://192.168.43.134:8080/samples-web-1.2.4/login.jsp } [None]
Vulmap 可以直接用 -f 選項指定該文件:
