🌀 Dismap - Asset discovery and identification tool

🌀 Dismap - Asset discovery and identification tool

Release Release Release GitHub Repo stars GitHub forks
[English readme Click Me]
Dismap 定位是一个资产发现和识别工具;其特色功能在于快速识别 Web 指纹信息,定位资产类型。辅助红队快速定位目标资产信息,辅助蓝队发现疑似脆弱点

Dismap 拥有完善的指纹规则库,可轻松自定义新识别规则。借助于 golang 并发优势,即可实现快速资产探测与识别

扫描结果可直接丢给 Vulmap(>=0.8) 进行漏洞扫描。对于规则库的简介位于 RuleLab

🏂 Run

Dismap 对 Linux、MacOS、Windows 均提供了二进制可执行文件,前往 Release 下载对应版本即可运行:

# Linux and MacOS
zhzyker@debian:~$ chmod +x dismap
zhzyker@debian:~$ ./dismap -h

# Windows
C:\Users\zhzyker\Desktop> dismap.exe -h

dismap1 dismap2

🎡 Options

-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 时用该选项指定

🎨 Examples

zhzyker@debian:~$ ./dismap -ip 192.168.1.1/24
zhzyker@debian:~$ ./dismap -ip 192.168.1.1/24 -output result.txt
zhzyker@debian:~$ ./dismap -ip 192.168.1.1/24 -np -timeout 10
zhzyker@debian:~$ ./dismap -ip 192.168.1.1/24 -thread 1000
zhzyker@debian:~$ ./dismap -url https://github.com/zhzyker/dismap
zhzyker@debian:~$ ./dismap -ip 192.168.1.1/24 -port 1-65535

Discussion

QR-code

🌈 RuleLab

整个规则库是一个 struct 位于 rule.go 大致格式如下:

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 */

规则库示例1:

即在响应Body中检查是否存在字符

)", "", ""}, ReqHttp{"", "", nil, ""}}, ">
{"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" or "body|header|ico", "or|and" or "body|ico", "and"
不允许: "body|body", "or"
重复组合不允许通过类型指定,但可通过 InBody 判断字符内实现: "body", "", InStr{"(str1|str2)"}

Owner
之乎者也
天苍苍,野茫茫,风吹的我就像头羊~ @YanYun-Lab & @0-sec & @pwnwikiorg
之乎者也
Comments
  • 在-f 情况下 对 url 报格式错误异常

    在-f 情况下 对 url 报格式错误异常

    [10:32:50] [ERROR] www.xxxx.cn is not in uri format, no port available [10:32:50] [ERROR] www.xxxxxx.com is not in uri format, no port available [10:32:50] [ERROR] www.sssssss.com is not in uri format, no port available [10:32:50] [ERROR] www.sssssss.com is not in uri format, no port available [10:32:50] [ERROR] www.ssssssss.com is not in uri format, no port available

    出现这样的问题是为什么呢 按理说-f 是支持这样URL 批量访问的呀

  • Mac m1 运行直接被killed的问题

    Mac m1 运行直接被killed的问题

    ➜ dismap ./dismap [1] 19891 killed ./dismap ➜ dismap ./dismap [1] 19917 killed ./dismap ➜ dismap ./dismap [1] 19925 killed ./dismap ➜ dismap ll total 6304 -rwxr-xr-x@ 1 xxxxx staff 2.8M 3 6 21:46 dismap ➜ dismap

  • JSON output may (should?) be NDJSON

    JSON output may (should?) be NDJSON

    Hi there,

    I think the JSON output should be NDJSON, as it is for a lot of other tools (Zgrab2 / Zdns, Masscan, Nuclei / dnsx / httpx, etc.).

    What it means is that instead of having one really long line:

    [{"result": 1}, {"result": 2}, {"result": 3}]
    

    You would have one line per result:

    {"result": 1}
    {"result": 2}
    {"result": 3}
    

    The main advantage for tools parsing your result is that they could read the results line per line, instead of having to json.load() the whole result at once, storing it in memory.

    You could take advantage of this to write the result as soon as they are available (as you do for the text output from what I understand). This would:

    • save a lot of memory since currently the whole JSON stays in the RAM before writing the result file;
    • allow interrupted scans to still produce exploitable results.

    What do you think?

  • Version 0.3

    Version 0.3

    • tcp/udp/tls protocol identification
    • Port Feature Fingerprinting
    • Optimized batch identification of read files, and can be mixed with domain name/IP/URL
    • Added http/socks5 proxy
    • Optimize txt text file format, add json file output
    • Added optional cancel terminal color display
    • Added debug/level information output, which can be used to manually judge hex
    • Optionally specify a specific protocol/port/type
    • Optimize the flag parameter options, support long and short option styles
    • Extended http rulebase rule entry
  • 报错没结果了

    报错没结果了

    linux平台

    panic: interface conversion: interface {} is nil, not []uint8
    
    goroutine 263 [running]:
    github.com/zhzyker/dismap/internal/parse.VerboseParse(0x0?)
            /Users/zhzyker/Security/Collect/dismap@zhzyker/0.4/dismap/internal/parse/parse_verbose.go:10 +0x2aa
    github.com/zhzyker/dismap/internal/operate.FlagUrl(0xc0000167e8?, {0xc00001ba80?, 0x0?}, 0x0?)
            /Users/zhzyker/Security/Collect/dismap@zhzyker/0.4/dismap/internal/operate/flag_url.go:25 +0xd3
    github.com/zhzyker/dismap/internal/operate.FlagFile.func1({0xc00001ba80?, 0x1c?}, 0x0?)
            /Users/zhzyker/Security/Collect/dismap@zhzyker/0.4/dismap/internal/operate/flag_file.go:48 +0x94
    created by github.com/zhzyker/dismap/internal/operate.FlagFile
            /Users/zhzyker/Security/Collect/dismap@zhzyker/0.4/dismap/internal/operate/flag_file.go:46 +0x65e
    
  • 关于识别只提供域名的情况下识别该域名其他端口指纹的需求

    关于识别只提供域名的情况下识别该域名其他端口指纹的需求

    在遇到域名与端口绑定访问的情况,只提供http://domain 或https://domain无法识别该uri下绑定的其他端口应用指纹,如参数-u+http://domain或-f文件中遇到http://domain时,无法探测到http://domain:8080的指纹,希望后续添加针对http://domain或https://domain的其他绑定端口指纹探测。

  • Binary banners seem padded with null bytes

    Binary banners seem padded with null bytes

    When exporting results to JSON, the field banner.byte is often padded with null bytes, making it unreliable. This seems to happen with short (less than 256 bytes) TCP banners (when the server talks first, without needing a hello from the client).

    The 256 bytes is consistent with buffer sizes often used in the code.

  • 指纹识别过程中在处理网页访问重定向的过程中出现bug

    指纹识别过程中在处理网页访问重定向的过程中出现bug

    url中出现 ?mod=phpcms&file=login&forward=http%3A%2F%2F127.0.0.1%3A8080%2Fadmin.php连接的时候代码中会错误的把他当成一个完整的连接,直接去请求然后导致报错 unsupported protocol scheme

    BUG代码

    internal/protocol/judge/tcp_http.go

    导致bug的原因是使用正则直接匹配url里是否存在http字符串,如果重定向后的链接参数里带有http的话会导致被匹配出来逻辑出错,直接使用 ?mod=phpcms&file=login&forward=http%3A%2F%2F127.0.0.1%3A8080%2Fadmin.php 作为完整连接请求,导致bug出现。

    if len(regexp.MustCompile("http").FindAllStringIndex(redirectPath, -1)) == 1 {
    			redirectUrl = redirectPath
    		} else {
    			if Url[len(Url)-1:] == "/" {
    				redirectUrl = Url + redirectPath
    			}
    			redirectUrl = Url + "/" + redirectPath
    		}
    

    修改建议

    只对前4个字符进行匹配

    if len(regexp.MustCompile("http").FindAllStringIndex(redirectPath[:4], -1)) == 1 {
    			redirectUrl = redirectPath
    		} else {
    			if Url[len(Url)-1:] == "/" {
    				redirectUrl = Url + redirectPath
    			}
    			redirectUrl = Url + "/" + redirectPath
    		}
    
A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests
A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests

Naabu is a port scanning tool written in Go that allows you to enumerate valid ports for hosts in a fast and reliable manner. It is a really simple to

Dec 31, 2022
GONET-Scanner - Golang network scanner with arp discovery and own parser
GONET-Scanner - Golang network scanner with arp discovery and own parser

GO/NET Scanner ScreenShots Install chmod +x install.sh ./install.sh [as root] U

Dec 11, 2022
An improvement on the PoC for the privacy-preserving contact discovery scheme I implemented as part of my UCL masters degree

Privacy-Preserving Contact Discovery / ARKE - PoC This is an improved version of the work I submitted as part of my masters degree dissertation at UCL

Dec 18, 2021
A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

age age is a simple, modern and secure file encryption tool, format, and library. It features small explicit keys, no config options, and UNIX-style c

Dec 28, 2022
Static binary analysis tool to compute shared strings references between binaries and output in JSON, YAML and YARA

StrTwins StrTwins is a binary analysis tool, powered by radare, that is capable to find shared code string references between executables and output i

May 3, 2022
DirDar is a tool that searches for (403-Forbidden) directories to break it and get dir listing on it
DirDar is a tool that searches for (403-Forbidden) directories to break it and get dir listing on it

DirDar v1.0 Description ??‍☠️ bypass forbidden directories - find and identify dir listing - you can use it as directory brute-forcer as well Compatab

Jan 1, 2023
A fast tool to mass scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin (CVE-2021-26855).
A fast tool to mass scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin (CVE-2021-26855).

proxylogscan This tool to mass scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and imperson

Dec 26, 2022
A scalable overlay networking tool with a focus on performance, simplicity and security

What is Nebula? Nebula is a scalable overlay networking tool with a focus on performance, simplicity and security. It lets you seamlessly connect comp

Dec 29, 2022
EarlyBird is a sensitive data detection tool capable of scanning source code repositories for clear text password violations, PII, outdated cryptography methods, key files and more.
EarlyBird is a sensitive data detection tool capable of scanning source code repositories for clear text password violations, PII, outdated cryptography methods, key files and more.

EarlyBird is a sensitive data detection tool capable of scanning source code repositories for clear text password violations, PII, outdated cryptograp

Dec 10, 2022
Nuclei is a fast tool for configurable targeted vulnerability scanning based on templates offering massive extensibility and ease of use.
Nuclei is a fast tool for configurable targeted vulnerability scanning based on templates offering massive extensibility and ease of use.

Fast and customisable vulnerability scanner based on simple YAML based DSL. How • Install • For Security Engineers • For Developers • Documentation •

Dec 30, 2022
A tool for secrets management, encryption as a service, and privileged access management
A tool for secrets management, encryption as a service, and privileged access management

Vault Please note: We take Vault's security and our users' trust very seriously. If you believe you have found a security issue in Vault, please respo

Jan 2, 2023
🌘🦊 DalFox(Finder Of XSS) / Parameter Analysis and XSS Scanning tool based on golang
🌘🦊 DalFox(Finder Of XSS) / Parameter Analysis and XSS Scanning tool based on golang

Finder Of XSS, and Dal(달) is the Korean pronunciation of moon. What is DalFox ?? ?? DalFox is a fast, powerful parameter analysis and XSS scanner, bas

Jan 5, 2023
A modern tool for the Windows kernel exploration and tracing
A modern tool for the Windows kernel exploration and tracing

Fibratus A modern tool for the Windows kernel exploration and observability Get Started » Docs • Filaments • Download • Discussions What is Fibratus?

Dec 30, 2022
kubescape is the first tool for testing if Kubernetes is deployed securely as defined in Kubernetes Hardening Guidance by to NSA and CISA
kubescape is the first tool for testing if Kubernetes is deployed securely as defined in Kubernetes Hardening Guidance by to NSA and CISA

Kubescape is the first tool for testing if Kubernetes is deployed securely as defined in Kubernetes Hardening Guidance by to NSA and CISA Tests are configured with YAML files, making this tool easy to update as test specifications evolve.

Jan 8, 2023
A pledge(2) and unveil(2)'d tool for verifying GnuPG signatures.

ogvt A pledge(2) and unveil(2)'d tool for verifying GnuPG signatures. Success ./ogvt -file test/uptime.txt -sig test/uptime.txt.asc -pub test/adent.p

Nov 25, 2021
A GREAT GUI Offline Tool for manipulating/seeking resolver list of repique and dnscrypt proxy.
A GREAT GUI Offline Tool for manipulating/seeking resolver list of repique and dnscrypt proxy.

Intro A GUI Offline Tool for decrypting and manipulating *.md files used by repique and dnscrypt proxy It's targeted for creating your own DoT, DoH an

Nov 27, 2022
Naabu - a port scanning tool written in Go that allows you to enumerate valid ports for hosts in a fast and reliable manner
Naabu - a port scanning tool written in Go that allows you to enumerate valid ports for hosts in a fast and reliable manner

Naabu is a port scanning tool written in Go that allows you to enumerate valid ports for hosts in a fast and reliable manner. It is a really simple tool that does fast SYN/CONNECT scans on the host/list of hosts and lists all ports that return a reply.

Jan 2, 2022
Velociraptor - Endpoint visibility and collection tool.

Velociraptor - Endpoint visibility and collection tool. Velociraptor is a tool for collecting host based state information using The Velociraptor Quer

Dec 7, 2022
A port scan and service weakpass brute tool build by golang.
A port scan and service weakpass brute tool build by golang.

A port scan and service weakpass brute tool build by golang.

Jan 5, 2023