├── assets ├── image.png └── httpx.png └── readme.md /assets/image.png: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/httpx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chasingboy/dirsx/HEAD/assets/httpx.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

dirsx

2 |

dirsx 是一款能够自动化过滤扫描结果的目录扫描工具

3 |

4 | 5 | 6 | 7 | 8 | 9 |

10 | 11 | image 12 | 13 | ### 前言 14 | > 当时正值华为发布遥遥领先, 加上“遥遥领先”只是开个玩笑, 大佬们见笑了 15 | 16 | 平时使用过 dirsearch|dirmap 等一些目录扫描工具,针对如今的 WEB 多样化,对扫描结果的过滤总感觉与预期不符合。因此下定决心造个轮子,就这样有了 dirsx。当时是使用 python 写的,但是可移植性不是很好。所以使用 golang 进行重构,顺便学习一下 golang。 17 | 18 | ### 功能 19 | > 大部分功能其他工具都有, 只是根据个人习惯更改
20 | 21 | ✅ 支持使用 html 相似度对结果进行过滤
22 | ✅ 支持对 301、302、403 状态进行二次判断
23 | ✅ 支持对 json 返回结果进行判断
24 | ✅ 支持字典第一个字母大写|全部字母大写|添加前后缀
25 | ✅ 支持返回页面 title, 如无 title 返回内容前面 30 个字符串 (默认|设置)
26 | ✅ 支持自动过滤模式, 默认开启 (开启|关闭)
27 | 28 | ### 基本使用 29 | 🏷️ 指定字典进行扫描 30 | ```bash 31 | dirsx -u https://www.baidu.com -w words.txt 32 | ``` 33 | 🏷️ 指定目录递归扫描, 目前暂无添加结果递归功能扫描,担心目录误报 34 | ```bash 35 | dirsx -u https://www.baidu.com -w words.txt --split 36 | 37 | # https://www.baidu.com/a/b/ 38 | # -> https://www.baidu.com/a/ 39 | # -> https://www.baidu.com/a/b/ 40 | ``` 41 | 🏷️ 指定备份文件进行扫描 42 | ```bash 43 | dirsx -u https://www.baidu.com -w words.txt --bak 44 | ``` 45 | 46 | ![image](https://github.com/user-attachments/assets/735dc7f5-f60a-43b3-8d9f-fdf695139aad) 47 | 48 | 🏷️ 指定添加后缀进行扫描 49 | ```bash 50 | dirsx -u https://www.baidu.com -w words.txt --suffix h5 51 | 52 | # https://www.baidu.com/admin 53 | # -> https://www.baidu.com/adminh5 54 | ``` 55 | 56 | 🏷️ 指定添加 cookie | headers 57 | ```bash 58 | # --cookie 59 | dirsx -u https://www.baidu.com -w words.txt --cookie "session=admin" 60 | 61 | # --headers 62 | dirsx -u https://www.baidu.com -w words.txt --headers "Authorization: bearer eyJ0eX..." --headers "X-Forwarded-For: 127.0.0.1" 63 | 64 | # --headers-file 65 | dirsx -u https://www.baidu.com -w words.txt --headers-file headers.txt 66 | ``` 67 | 68 | 🏷️ 内置一些常用字典选择, 在没有指定字典时显示该列表 69 | * 常见目录字典 70 | * dirsearch 的自带字典 71 | * 长度为 1-5 的字母组合 72 | * ... ... 73 | ``` 74 | ~ kali$ dirsx -u http://127.0.0.1/ 75 | 76 | 77 | ██████╗ ██╗██████╗ ███████╗██╗ ██╗ 78 | ██╔══██╗██║██╔══██╗██╔════╝╚██╗██╔╝ 79 | ██║ ██║██║██████╔╝███████╗ ╚███╔╝ 80 | ██║ ██║██║██╔══██╗╚════██║ ██╔██╗ 81 | ██████╔╝██║██║ ██║███████║██╔╝ ██╗ 82 | ╚═════╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ 83 | 1.1.0 84 | xboy@遥遥领先 85 | 86 | [+] You have not appoint payloads, so you can select from the list: 87 | [0] fuzzing-dirs-common.txt 88 | [1] fuzzing-dirs-dirsearch.txt 89 | [2] fuzzing-files-php.txt 90 | [3] fuzzing-letter-len1.txt 91 | [4] fuzzing-letter-len2.txt 92 | [5] fuzzing-letter-len3.txt 93 | [6] fuzzing-letter-len4.txt 94 | ... ... 95 | [+] Select payloads with number: 1 96 | 97 | ``` 98 | 99 | ### --httpx 模式 100 | 增加 httpx 模式, 可以在没有 httpx 工具的情况下用来探测 WEB 服务 101 | ``` 102 | dirsx -u https://www.baidu.com --httpx 103 | ``` 104 | image 105 | 106 | ### --ffuf 模式 107 | 增加 ffuf 模式, 用法与 ffuf 工具一样, 使用 FUZZ 指定 Fuzzing 位置 108 | ``` 109 | # Fuzzing dirs 110 | dirsx --ffuf -u http://127.0.0.1/FUZZ -w words.txt 111 | dirsx --ffuf -u http://127.0.0.1/FUZZ.php -w words.txt 112 | dirsx --ffuf -u http://127.0.0.1/FUZZ/index.php -w words.txt 113 | 114 | # Fuzzing headers 115 | dirsx --ffuf -u http://127.0.0.1/ -H "x-forwarded-for: FUZZ" 116 | ``` 117 | 118 | ### dirsx -h 119 | 120 | ```bash 121 | ~ kali$ dirsx -h 122 | 123 | 124 | ██████╗ ██╗██████╗ ███████╗██╗ ██╗ 125 | ██╔══██╗██║██╔══██╗██╔════╝╚██╗██╔╝ 126 | ██║ ██║██║██████╔╝███████╗ ╚███╔╝ 127 | ██║ ██║██║██╔══██╗╚════██║ ██╔██╗ 128 | ██████╔╝██║██║ ██║███████║██╔╝ ██╗ 129 | ╚═════╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ 130 | 1.1.0 131 | xboy@遥遥领先 132 | 133 | Usage: 134 | dirsx [OPTIONS] 135 | 136 | Application Options: 137 | -u, --url= input url of target 138 | -l, --list= input file containing list of target 139 | -w, --wordlist= appoint wordlist for scanning directory 140 | --title-len= set title display length (default: 30) 141 | -t, --threads= number of threads to use (default: 20) 142 | --timeout= timeout in seconds (default: 5) 143 | -o, --output= file to write output results 144 | --prefix= add prefix of payloads 145 | --suffix= add suffix of payloads 146 | -e, --extension= add extension eg: -e php,html 147 | --remove-ext= remove extension eg: --remove-ext php | admin.php -> admin 148 | --upper-title capitalize the first letter eg: admin -> Admin 149 | --upper-all capitalize the all letter eg: admin -> ADMIN 150 | --bak enable scanning backup file (default:false) 151 | --split enable spliting the url path, eg: /a/b -> /a/, /a/b (default: false) 152 | -X= method of http requests (default: GET) 153 | -x, --excode= specify the status codes that be filtered eg: 400,404 (default: 154 | 400,404,406,416,501,502,503) 155 | --cookie= set request cookies, eg: --cookie "session=admin" 156 | -H, --headers= set request headers, string[] eg: -H "Token: admin=true" -H "Cookie: 157 | login=true" 158 | --headers-file= set request headers file, eg: --headers-file headers.txt 159 | --proxy= set request proxy, eg: --proxy http://127.0.0.1:8080 160 | --no-smart disable smart mode (automated filtering) 161 | 162 | Help Options: 163 | -h, --help Show this help message 164 | ``` 165 | 166 | ### 字典添加 167 | 可在 dicts 目录下根据个人需求更新常用字典 168 | ``` 169 | dirsx $ tree 170 | . 171 | ├── dicts 172 | │   ├── fuzzing-dirs-common.txt 173 | │   ├── fuzzing-dirs-dirsearch.txt 174 | │   ├── fuzzing-files-php.txt 175 | │   ├── fuzzing-letter-len1.txt 176 | │   ├── fuzzing-letter-len2.txt 177 | │   ├── fuzzing-letter-len3.txt 178 | │   ├── fuzzing-letter-len4.txt 179 | │   ├── fuzzing-months-1-12.txt 180 | │   ├── fuzzing-numbers-0-9.txt 181 | │   ├── fuzzing-payloads-aspx.txt 182 | │   ├── fuzzing-payloads-bakfile.txt 183 | │   ├── fuzzing-payloads-common.txt 184 | │   ├── fuzzing-payloads-java.txt 185 | │   ├── fuzzing-payloads-null.txt 186 | │   ├── fuzzing-payloads-php.txt 187 | │   ├── fuzzing-routers-common.txt 188 | │   ├── fuzzing-words-len1-5.txt 189 | │   └── fuzzing-years-1990-2024.txt 190 | ├── dirsx 191 | ``` 192 | 193 | ### dirsx 安装 194 | 根据对应系统类型下载执行文件 https://github.com/chasingboy/dirsx/releases 195 | 196 | > ⚠️注意: 源代码中删除了部分还需要完善的代码,所以请不要使用源代码编译 197 | 198 | 199 | > window 10 终端颜色显示问题, 可以更换系统终端为 window terminal 解决此问题 `https://github.com/microsoft/terminal` 200 | 201 | ### 公众号 202 | 该公众号用于编写 Xtools 系列工具使用文档和工具更新通知 203 | 204 |

image

205 | 206 | ### 特别感谢 207 | chainreactors@ https://github.com/chainreactors/spray 208 | 209 | maurosoria@ https://github.com/maurosoria/dirsearch 210 | 211 | ffuf@ https://github.com/ffuf/ffuf 212 | 213 | ### 更新记录 214 | [+] 2024-09-21【修复】--split bug| 302 filter bug 215 | 216 | [+] 2024-10-07【新增】cookie|header|proxy 功能 217 | 218 | [+] 2024-09-27【修复】302 filter 错误 219 | 220 | [+] 2024-10-11【修复】tls handshake failure, basic 页面对比错误 221 | 222 | [+] 2024-11-03【修复】title 特殊字符导致格式问题、Redirect 二次判断问题 223 | 224 | [+] 2024-11-15【新增】--httpx|--ffuf 模式 225 | 226 | [+] 2024-11-18【修复】发生异常时 -o 没有输出结果的问题 #4 227 | 228 | [+] 2024-12-17【修复】map error: concurrent map read and map write 229 | 230 | [+] 2024-12-17【修改】扫描结果实时打印, 增加进度条设置是否显示 231 | 232 | [+] 2024-12-19【新增】@tony 师傅整理字典 fuzzing-payloads-vulnerability.txt 233 | 234 | [+] 2024-12-20【修复】--no-smart 模式 30X 跳转丢包问题 235 | 236 | [+] 2025-04-20【修复】ffuf 模式 bug|修改字典目录 wordlist|重构部分代码 237 | 238 | [+] 2025-05-28【新增】json 格式结果输出功能 239 | 240 | [+] 2025-08-06【修复】URL 格式处理和 http 连接错误 bug 241 | 242 | [+] 2025-09-25【修复】--ffuf 模式显示 payload 问题 243 | 244 | [+] 2025-09-25【新增】支持目标扫描过程中保存结果|Ctrl+C 中断且保存结果 245 | 246 | [+] 2025-09-25【新增】--word-first 模式 247 | 248 | [+] 2025-11-18【修复】-x 参数问题 249 | --------------------------------------------------------------------------------