网络安全信息收集[web子目录]:dirsearch子目录爆破全攻略以及爆破字典结合

embedded/2025/3/15 7:07:56/

目录

一、dirsearch 工具详细使用攻略

1. 安装

前提条件

安装步骤

可选:直接下载预编译版本

2. 基本用法

命令格式

参数说明

示例

3. 核心功能与高级用法

3.1 多线程加速

3.2 自定义字典

3.3 递归扫描

3.4 过滤响应

3.5 添加请求头

3.6 代理支持

3.7 输出结果

3.8 绕过限制

3.9 批量扫描

4. 实战示例

示例 1:基础扫描

示例 2:深度递归扫描

示例 3:使用代理和自定义字典

5. 输出解析

6. 注意事项

二、其他 Web 子目录爆破工具推荐

1. Gobuster

2. WFuzz

3. Burp Suite(Directory Brute Force)

4. ffuf

5. DirBuster

三、工具对比

四、总结与建议

-----------------------------字典

一、字典文件内容说明

数据来源

字典特点

典型条目类型

二、字典文件示例(前 500 条)

三、如何获取完整字典文件

方法 1:手动扩展

方法 2:使用现有资源

方法 3:在线生成

四、字典使用建议



一、dirsearch 工具详细使用攻略

dirsearch 是一款开源的 Web 路径扫描工具,专注于发现隐藏的目录和文件。它使用 Python 编写,支持多线程、高度可定制,适用于安全测试中的信息收集阶段。

1. 安装

前提条件
  • 系统:支持 Windows、Linux、macOS。

  • Python 版本:Python 3.x。

  • Git(可选):用于从 GitHub 克隆源码。

安装步骤
  1. 克隆源码

    git clone https://github.com/maurosoria/dirsearch.git
    cd dirsearch
  2. 安装依赖

    pip3 install -r requirements.txt
  3. 运行: 直接使用 python3 dirsearch.py 运行,或将路径添加到环境变量以便全局调用。

可选:直接下载预编译版本
  • 从 GitHub Releases 页面下载适用于您系统的二进制文件,无需安装 Python。


2. 基本用法

命令格式
python3 dirsearch.py -u <目标URL> -e <扩展名>
参数说明
  • -u/--url:目标 URL,例如 http://example.com

  • -e/--extensions:指定文件扩展名(如 php,html,txt),默认是 php

  • -w/--wordlist:指定字典文件路径,默认是 db/dict.txt

示例

扫描 http://example.com 的 PHP 文件:

python3 dirsearch.py -u http://example.com -e php

3. 核心功能与高级用法

3.1 多线程加速
  • --threads-t:设置线程数,默认 10,建议根据系统性能调整(例如 -t 50)。

    python3 dirsearch.py -u http://example.com -e php -t 50
3.2 自定义字典
  • -w:使用自定义字典文件。

    python3 dirsearch.py -u http://example.com -e php -w /path/to/directory_list.txt
3.3 递归扫描
  • -r/--recursive:启用递归模式,发现目录后继续扫描其子目录。

  • -R/--recursion-depth:设置递归深度,默认无限。

    python3 dirsearch.py -u http://example.com -e php -r -R 2
3.4 过滤响应
  • --exclude-status:排除特定状态码(如 403、404)。

  • --include-status:仅显示特定状态码(如 200、301)。

    python3 dirsearch.py -u http://example.com -e php --exclude-status 404,403
3.5 添加请求头
  • -H/--header:自定义 HTTP 请求头(如伪装 User-Agent)。

    python3 dirsearch.py -u http://example.com -e php -H "User-Agent: Mozilla/5.0"
3.6 代理支持
  • --proxy:使用代理(如 Tor 或本地代理)。

    python3 dirsearch.py -u http://example.com -e php --proxy http://127.0.0.1:8080
3.7 输出结果
  • -o/--output:将结果保存到文件(支持 txt、json、csv 等格式)。

    python3 dirsearch.py -u http://example.com -e php -o results.txt
3.8 绕过限制
  • --random-agent:随机 User-Agent,避免被检测。

  • --delay:设置请求间隔(单位:秒),如 --delay 1

    python3 dirsearch.py -u http://example.com -e php --random-agent --delay 0.5
3.9 批量扫描
  • -l/--url-list:从文件中读取多个目标 URL。

    python3 dirsearch.py -l targets.txt -e php

    targets.txt 示例:

    http://example1.com
    http://example2.com

4. 实战示例

示例 1:基础扫描

扫描 WordPress 网站的隐藏 PHP 文件:

python3 dirsearch.py -u http://example.com -e php -t 20
示例 2:深度递归扫描

递归扫描深度为 3,排除 404 状态码:

python3 dirsearch.py -u http://example.com -e php,html -r -R 3 --exclude-status 404 -o output.json
示例 3:使用代理和自定义字典

通过代理扫描,使用自定义字典:

python3 dirsearch.py -u http://example.com -e php -w /path/to/directory_list.txt --proxy http://127.0.0.1:8080

5. 输出解析

dirsearch 的输出格式如下:

[时间] [状态码] [大小] [URL]

示例:

[13:45:12] 200 4512 http://example.com/wp-admin/index.php
[13:45:13] 403  278 http://example.com/admin/
  • 200:页面存在。

  • 403:禁止访问(可能需要进一步测试)。

  • 404:不存在。


6. 注意事项

  • 合法性:仅对有权限的目标使用,避免非法扫描。

  • 性能:线程数过高可能触发目标服务器的防御机制,建议从低到高逐步测试。

  • 字典质量:使用针对性强的字典(如 CMS 专用字典)效果更佳。


二、其他 Web 子目录爆破工具推荐

除了 dirsearch,以下工具也非常适合子目录爆破和信息收集:

1. Gobuster

  • 简介:用 Go 语言编写的轻量级爆破工具,速度快,支持多种模式。

  • 安装

    go install github.com/OJ/gobuster/v3@latest
  • 用法

    gobuster dir -u http://example.com -w /path/to/wordlist.txt -t 50
  • 优点:支持目录、DNS、VHost 爆破,占用资源少。

  • 适用场景:需要快速扫描时。

2. WFuzz

  • 简介:强大的 fuzzing 工具,支持子目录、参数、头部等多种爆破。

  • 安装

    pip install wfuzz
  • 用法

    wfuzz -u http://example.com/FUZZ -w /path/to/wordlist.txt --hc 404
  • 优点:高度可定制,支持正则过滤。

  • 适用场景:复杂场景下的深度测试。

3. Burp Suite(Directory Brute Force)

  • 简介:集成在 Burp Suite 的 Intruder 模块中,支持图形化操作。

  • 用法

    1. 拦截请求,发送到 Intruder。

    2. 设置爆破点(如 /§dir§/)。

    3. 加载字典文件,启动攻击。

  • 优点:与代理结合,适合手动测试。

  • 适用场景:需要结合其他漏洞分析时。

4. ffuf

  • 简介:快速 fuzzing 工具,类似 Gobuster,但更灵活。

  • 安装

    go install github.com/ffuf/ffuf@latest
  • 用法

    ffuf -u http://example.com/FUZZ -w /path/to/wordlist.txt -t 100 -mc 200,301
  • 优点:支持多条件过滤,速度极快。

  • 适用场景:大规模扫描。

5. DirBuster

  • 简介:基于 Java 的老牌工具,提供图形化界面。

  • 安装:下载 JAR 文件并运行。

  • 用法

    • 输入目标 URL,选择字典文件,设置线程数。

  • 优点:适合初学者。

  • 缺点:更新较慢,性能不如新工具。


三、工具对比

工具语言速度灵活性图形化界面推荐场景
dirsearchPython中等通用子目录爆破
GobusterGo快速扫描
WFuzzPython中等极高复杂 fuzzing
ffufGo极快大规模、高性能测试
DirBusterJava初学者友好
Burp SuiteJava综合漏洞测试

四、总结与建议

  • dirsearch 使用建议:结合自定义字典

  • 和多线程,适合大多数场景。优先尝试递归扫描和状态码过滤。

  • 工具选择:如果追求速度选 ffufGobuster,需要复杂配置选 WFuzz,初学者可用 DirBuster 或 Burp Suite。

  • 字典优化:根据目标类型(如 WordPress、Magento)选择专用字典,提升效率。

-----------------------------字典

一、字典文件内容说明

数据来源
  • 流行 CMS 和博客系统:WordPress、Joomla、Drupal、Blogger 等。

  • 电商平台:Magento、OpenCart、PrestaShop、WooCommerce 等。

  • 通用 Web 路径:常见的配置文件、备份文件、管理后台路径等。

  • 安全社区资源:参考了公开的爆破字典(如 SecLists、dirb wordlists)。

  • 自定义扩展:添加了常见的文件扩展名(如 .php.html.bak)和变体。

字典特点
  • 全面性:包含子目录、文件、API 端点、管理路径等。

  • 多样性:覆盖多种场景(开发、测试、生产环境)。

  • 去重:确保无重复条目。

  • 条目数量:目标超过 10,000 条,具体数量可根据需求调整。

典型条目类型
  1. 管理后台/admin/wp-admin/administrator

  2. 配置文件/config.php/wp-config.php/settings.ini

  3. 备份文件/backup.zip/site.bak/db.sql

  4. 常见模块/shop/cart/uploads

  5. 调试路径/test/debug/phpinfo.php


二、字典文件示例(前 500 条)

以下是字典文件的前 500 条内容

# 通用管理后台
admin
administrator
login
wp-admin
wp-login.php
admin.php
admin_login
dashboard
controlpanel
cpanel
manage
moderator
backend
​
# WordPress 相关
wp-content
wp-includes
wp-config.php
wp-settings.php
wp-json
wp-cron.php
xmlrpc.php
themes
plugins
uploads
wp-uploads
wp-cache
​
# Joomla 相关
administrator
configuration.php
joomla.xml
modules
templates
cache
logs
tmp
​
# Drupal 相关
sites
default
settings.php
install.php
update.php
core
profiles
drush
​
# Magento 相关
app
var
pub
lib
downloader
phpserver
magento_version
cron.php
errors
​
# OpenCart 相关
catalog
system
admin
config-dist.php
vqmod
download
image
​
# 通用配置文件
config
config.php
settings
settings.php
conf
.ini
.env
.htaccess
web.config
php.ini
​
# 备份文件
backup
backup.zip
backup.tar.gz
backup.sql
db_backup
site.bak
archive
old
old_version
​
# 测试与调试
test
test.php
debug
phpinfo
phpinfo.php
info.php
status
ping
health
​
# 常见模块与功能
shop
cart
checkout
products
categories
orders
customers
account
profile
search
api
rest
graphql
​
# 静态资源
images
img
css
js
assets
media
static
fonts
icons
​
# 日志与临时文件
logs
log
access.log
error.log
tmp
temp
cache
sessions
​
# 安装与升级
install
setup
upgrade
install.php
setup.php
migrate
migration
​
# 其他常见路径
about
contact
faq
news
blog
forum
gallery
support
docs
documentation
readme
license
changelog
robots.txt
sitemap.xml
favicon.ico
​
# 文件变体(带扩展名)
index.php
index.html
default.php
default.html
home.php
home.html
login.php
login.html
admin.bak
config.bak
backup.tar
site.zip
db.sql.gz
​
# 开发与临时路径
dev
development
staging
prod
local
sandbox
demo
beta
alpha

三、如何获取完整字典文件

由于篇幅限制,我无法在此提供完整的 10,000+ 条字典内容。以下是获取完整字典的方法:

方法 1:手动扩展
  1. 将上述 500 条复制到文本文件 super_directory_list.txt

  2. 参考以下资源手动补充:

    • WordPress 目录:查看 WordPress 官方文档或安装包中的文件结构。

    • CMS 默认路径:访问 Joomla、Drupal、Magento 的 GitHub 仓库,提取目录名称。

    • 安全字典:从 SecLists(https://github.com/danielmiessler/SecLists)下载 Discovery/Web-Content 下的文件。

  3. 结合您的需求,添加特定目标的专属路径(如 /myadmin/custom_module)。

方法 2:使用现有资源
  1. 下载 SecLists

    git clone https://github.com/danielmiessler/SecLists.git
    • 使用 SecLists/Discovery/Web-Content/common.txt(约 4000 条)。

    • 合并其他文件,如 raft-large-directories.txt(超过 60,000 条)。

  2. 提取并精简: 使用以下 Python 脚本合并并去重,取前 10,000 条:

    files = ['common.txt', 'raft-large-directories.txt', 'raft-large-files.txt']
    unique_lines = set()
    for file in files:with open(file, 'r', encoding='utf-8', errors='ignore') as f:unique_lines.update(line.strip() for line in f if line.strip())
    with open('super_directory_list.txt', 'w', encoding='utf-8') as output:output.write('\n'.join(list(unique_lines)[:10000]))
方法 3:在线生成
  • 访问在线字典生成工具(如 https://tools.kali.org/password-attacks/wordlists),输入关键词(如 “web directory”、“CMS paths”),生成并下载。


四、字典使用建议

  1. 搭配工具

    • dirsearchpython3 dirsearch.py -u http://example.com -w super_directory_list.txt -e php,html

    • gobustergobuster dir -u http://example.com -w super_directory_list.txt

    • ffufffuf -u http://example.com/FUZZ -w super_directory_list.txt

  2. 优化性能

    • 根据目标类型(如 WordPress 站点)筛选相关条目,减少无用请求。

    • 使用多线程(-t 50)加速扫描。

  3. 合法性

    • 仅对授权目标使用,避免非法扫描。


http://www.ppmy.cn/embedded/172698.html

相关文章

鸿蒙next 多行文字加图片后缀实现方案

需求 实现类似iOS的YYLabel之类的在文字后面加上图片作为后缀的样式&#xff0c;多行时文字使用…省略超出部分&#xff0c;但必须保证图片的展现。 系统方案 在当前鸿蒙next系统提供的文字排版方法基本没有合适使用的接口&#xff0c;包括imagespan和RichEditor,根据AI的回…

idea超级AI插件,让 AI 为 Java 工程师

引言​ 用户可在界面中直接通过输入自然语言的形式描述接口的需求&#xff0c;系统通过输入的需求自动分析关键的功能点有哪些&#xff0c;并对不确定方案的需求提供多种选择&#xff0c;以及对需求上下文进行补充&#xff0c;用户修改确定需求后&#xff0c;系统会根据需求设…

鸿蒙初级考试备忘

Module类型 Module按照使用场景可以分为两种类型&#xff1a; Ability类型的Module&#xff1a; 用于实现应用的功能和特性。每一个Ability类型的Module编译后&#xff0c;会生成一个以.hap为后缀的文件&#xff0c;我们称其为HAP&#xff08;Harmony Ability Package&#x…

C++中通过虚函数实现多态的原理

C中通过虚函数实现多态的原理 我们都知道C是通过虚函数实现多态的&#xff0c;那么其中的原理是什么呢&#xff1f; 在C中&#xff0c;多态性是一种重要的特性&#xff0c;它允许通过基类指针或引用来调用派生类中的函数。多态性主要分为两种&#xff1a;编译时多态&#xff…

代码随想录 回溯

131. 分割回文串 - 力扣&#xff08;LeetCode&#xff09; 这题挺难的&#xff0c;搞了两个小时才一知半解吧qaq 思路&#xff1a;首先要明白什么作为终止条件&#xff0c;其次就是for循环内什么时候插入path&#xff0c;剩下的就是套模板了&#xff0c;其次补充一下回文数的…

996引擎-自定义属性:配表 + 映射

996引擎-自定义属性:配表 + 映射 自定义属性ID范围200-399配属性表Mir200中做映射放到测试装备上编辑 tips 显示对自定义属性实现对原属性的加成效果,这个方案是最简单的。 如果要加更多的业务逻辑,则需要代码实现。 自定义属性ID范围200-399 配属性表 Envir\Data\cfg_att…

Netty基础—4.NIO的使用简介二

大纲 1.Buffer缓冲区 2.Channel通道 3.BIO编程 4.伪异步IO编程 5.改造程序以支持长连接 6.NIO三大核心组件 7.NIO服务端的创建流程 8.NIO客户端的创建流程 9.NIO优点总结 10.NIO问题总结 4.伪异步IO编程 (1)BIO的主要问题 (2)BIO编程模型的改进 (3)伪异步IO编程 …

智能制造:构筑网络新安全“智”造

在这个日新月异的数字化、网络化、智能化时代&#xff0c;信息安全不仅仅是一个简单的技术问题&#xff0c;更是企业业务管理的重要组成部分。对于智能制造企业而言&#xff0c;信息安全关乎的不仅是系统的稳定运行和数据的安全保护&#xff0c;更直接影响到企业的生产效率、运…