zhzyker/dismap
GitHub: zhzyker/dismap
Dismap 是一款基于 Go 的资产发现与指纹识别工具,帮助快速定位网络中的 Web 与协议服务信息。
Stars: 2137 | Forks: 272
## 🌀 Dismap - 资产发现与识别工具



[[中文 Readme]](https://github.com/zhzyker/dismap/blob/main/readme-zh.md)
Dismap 的定位是一款资产 **发现** 与 **识别** 工具。它能够快速识别 web/tcp/udp 等协议及指纹信息,定位资产类型,适用于内外网。帮助红队快速定位潜在风险资产信息,帮助蓝队检测可疑脆弱资产。
Dismap 拥有完整的指纹规则库,当前包括 tcp/udp/tls 协议指纹和 **4500+ web 指纹规则**,可识别 favicon、body、header 等。规则库的介绍位于 [RuleLab](https://github.com/zhzyker/dismap#-rulelab)
~~扫描结果可直接发送至 [vulmap](https://github.com/zhzyker/vulmap)(>=0.8) 进行漏洞扫描。~~ 在 0.3 版本中,文本结果已更改,json 文件结果已加入,vulmap 将在 >= 1.0 支持联动。
## 🏂 运行
Dismap 是适用于 Linux、MacOS、Windows 的二进制文件。前往 [Release](https://github.com/zhzyker/dismap/releases) 下载对应版本运行:
```
# Linux 或 macOS
zhzyker@debian:~$ chmod +x dismap-0.3-linux-amd64
zhzyker@debian:~$ ./dismap-0.3-linux-amd64 -h
# Windows
C:\Users\zhzyker\Desktop> dismap-0.3-windows-amd64.exe -h
```
## 🎡 参数
```
-f, --file string Parse the target from the specified file for batch recognition
-h, --help Show help
-i, --ip string Network segment [e.g. -i 192.168.1.0/24 or -i 192.168.1.1-10]
-j, --json string Scan result in json format [e.g. -j r.json]
-l, --level int Specify log level (0:Fatal 1:Error 2:Info 3:Warning 4:Debug 5:Verbose) (default 3)
-m, --mode string Specify the protocol [e.g. -m mysql/-m http]
--nc Do not print character colors
--np Not use ICMP/PING to detect surviving hosts
-o, --output string Save the scan results to the specified file (default "output.txt")
-p, --port string Custom scan ports [e.g. -p 80,443 or -p 1-65535]
--proxy string Use proxy scan, support http/socks5 protocol [e.g. --proxy socks5://127.0.0.1:1080]
-t, --thread int Number of concurrent threads (default 500)
--timeout int Response timeout time, the default is 5 seconds (default 5)
--type string Specify the type [e.g. --type tcp/--type udp]
-u, --uri string Specify a target URI [e.g. -u https://example.com]
```
## 🎨 示例
```
zhzyker@debian:~$ ./dismap -i 192.168.1.1/24
zhzyker@debian:~$ ./dismap -i 192.168.1.1/24 -o result.txt -j result.json
zhzyker@debian:~$ ./dismap -i 192.168.1.1/24 --np --timeout 10
zhzyker@debian:~$ ./dismap -i 192.168.1.1/24 -t 1000
zhzyker@debian:~$ ./dismap -u https://github.com/zhzyker/dismap
zhzyker@debian:~$ ./dismap -u mysql://192.168.1.1:3306
zhzyker@debian:~$ ./dismap -i 192.168.1.1/24 -p 1-65535
```
## ⛪ 讨论
* Dismap 错误反馈或新功能建议 [click me](https://github.com/zhzyker/dismap/issues)
* Twitter: https://twitter.com/zhzyker
## 🌈 RuleLab
完整的规则库是一个结构体,位于 [rule.go](https://github.com/zhzyker/dismap/blob/main/configs/rule.go)
大致格式:
```
Rule:
Name: name /* Define rule name */
Type: header|body|ico /* Support recognized types, header, body, ico can be any logical combination, ico is to request favicon.ico separately and calculate MD5*/
Mode: and|or /* Type judgment logic */
Rule
InBody: str /* Specify which str exists in the response body */
InHeader: str /* Specify which str exists in the response Header */
InIcoMd5: str_md5 /* MD5 of favicon.ico */
Http:
ReqMethod: GET|POST /* Custom request method, currently supports GET and POST */
ReqPath: str /* Custom request web path */
ReqHeader: []str /* Customize the header of the Http request */
ReqBody: str /* Customize the body of the POST request */
```
**示例1:**
判断响应体中是否存在字符 ` `
```
{"Apahce Flink", "body", "", InStr{"( )", "", ""}, ReqHttp{"", "", nil, ""}},
```
**示例2:**
自定义请求路径 `/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, ""}},
```
**header、body、ico 的逻辑关系可以随意组合,但不能重复组合:**
可用:`"body|header|ico", "or"` 或 `"body|header|ico", "or|and"` 或 `"body|ico", "and"`
不可用:`"body|body", "or"`
不允许重复组合,可通过 InBody 指定类型来实现,例如 `"body", "", InStr{"(str1|str2)"}`
标签:API安全, C2日志可视化, DNS情报, EVTX分析, EVTX分析, Go语言, HTTP状态码, JSON输出, Linux, macOS, Redis利用, RuleLab, SEO审计, Site.js, TCP/UDP/TLS指纹, Web扫描, WHOIS查询, Windows, 协议探测, 批量测试, 报告生成, 指纹识别, 攻击向量, 无服务器架构, 日志审计, 混合加密, 漏洞前期信息收集, 程序破解, 网络资产识别, 蓝队防御, 规则库, 跨平台工具