html隐藏目录在哪里查找,使用Dirsearch查找隐藏目录

对网站进行

安装Dirsearch

我们需要做的第一件事是从GitHub安装dirsearch 。最简单的方法是使用

git。因此,如果尚未在系统上安装它,请在终端中使用以下命令进行安装:

apt-get update && apt-get install git

现在,我们可以使用git clone命令来克隆该工具所在的目录:

git clone

https://github.com/maurosoria/dirsearch

接下来,使用cd命令切换到新创建的目录:

cd dirsearch/

并使用ls验证是否存在所有内容:

~/dirsearch# ls

CHANGELOG.md  db  default.conf  dirsearch.py  lib  logs  README.md  reports  thirdparty

配置目录搜索

无需进行安装,我们现在可以运行dirsearch,并且可以通过几种不同的方式来运行。

1、使用Python运行Dirsearch

第一个方法是简单地使用Python运行它,尽管它需要Python 3才能正常工作。我们可以在下面看到它为我们提供了一个简短的用法示例,告诉我们我们需要指定一个有效的URL。

~/dirsearch# python3 dirsearch.py

URL target is missing, try using -u

2、使用Bash运行Dirsearch

我们可以运行dirsearch的另一种方法是使用Bash。使用ls -la将为我们提供此目录中所有内容的权限,并且我们可以看到该工具是可执行的。

~/dirsearch# ls -la

所以我们要做的就是使用点斜线,它基本上是当前目录中文件的相对路径:

~/dirsearch# ./dirsearch.py

URL target is missing, try using -u

3、使用符号链接运行Dirsearch

运行dirsearch的最后一种方法(我的首选方法)是在/ bin目录中创建链接。这将使我们能够从任何地方运行该工具,而不是仅在从GitHub克隆的目录中运行。

首先,进入/ bin目录:

~/dirsearch# cd /bin/

然后,使用ln -s命令创建指向该工具的链接:

/bin# ln -s ~/dirsearch/dirsearch.py dirsearch

在这里,我将其命名为dirsearch,因此当我现在在终端中运行dirsearch时,该工具将能够从任何目录运行。现在,让我们回到主目录,然后再继续操作:

/bin# cd

使用Dirsearch扫描

现在,当我们在终端中键入dirsearch时,我们会从之前获得相同的用法消息:

~# dirsearch

URL target is missing, try using -u

要获得更详细的用法示例和完整的帮助菜单,请使用-h标志:

~# dirsearch -h

Usage: dirsearch [-u|--url] target [-e|--extensions] extensions [options]

Options:

-h, --help            show this help message and exit

Mandatory:

-u URL, --url=URL   URL target

-L URLLIST, --url-list=URLLIST

URL list target

-e EXTENSIONS, --extensions=EXTENSIONS

Extension list separated by comma (Example: php,asp)

Dictionary Settings:

-w WORDLIST, --wordlist=WORDLIST

-l, --lowercase

-f, --force-extensions

Force extensions for every wordlist entry (like in

DirBuster)

General Settings:

-s DELAY, --delay=DELAY

Delay between requests (float number)

-r, --recursive     Bruteforce recursively

-R RECURSIVE_LEVEL_MAX, --recursive-level-max=RECURSIVE_LEVEL_MAX

Max recursion level (subdirs) (Default: 1 [only

rootdir 1 dir])

--suppress-empty, --suppress-empty

--scan-subdir=SCANSUBDIRS, --scan-subdirs=SCANSUBDIRS

Scan subdirectories of the given -u|--url (separated

by comma)

--exclude-subdir=EXCLUDESUBDIRS, --exclude-subdirs=EXCLUDESUBDIRS

Exclude the following subdirectories during recursive

scan (separated by comma)

-t THREADSCOUNT, --threads=THREADSCOUNT

Number of Threads

-x EXCLUDESTATUSCODES, --exclude-status=EXCLUDESTATUSCODES

Exclude status code, separated by comma (example: 301,

500)

-c COOKIE, --cookie=COOKIE

--ua=USERAGENT, --user-agent=USERAGENT

-F, --follow-redirects

-H HEADERS, --header=HEADERS

Headers to add (example: --header "Referer:

example.com" --header "User-Agent: IE"

--random-agents, --random-user-agents

Connection Settings:

--timeout=TIMEOUT   Connection timeout

--ip=IP             Resolve name to IP address

--proxy=HTTPPROXY, --http-proxy=HTTPPROXY

Http Proxy (example: localhost:8080

--http-method=HTTPMETHOD

Method to use, default: GET, possible also: HEADOST

--max-retries=MAXRETRIES

-b, --request-by-hostname

By default dirsearch will request by IP for speed.

This forces requests by hostname

Reports:

--simple-report=SIMPLEOUTPUTFILE

Only found paths

--plain-text-report=PLAINTEXTOUTPUTFILE

Found paths with status codes

--json-report=JSONOUTPUTFILE

我们可以看到该工具具有大量的选项和潜在的配置设置,但是在本教程中,我们将重点介绍一些更重要的选项。

dirsearch至少需要一个URL和至少一个文件扩展名才能运行。例如,我们可以使用-u标志指定一个有效的URL ,并使用-e标志指定要搜索的文件扩展名:

66b39cefea89699334f2cf28c29bb452.gif

在启动之后,它为我们提供了有关扩展,正在使用的HTTP方法,线程数以及当前字典大小(在本例中为默认列表)的信息。然后,它开始爬网目录并返回找到的内容,包括状态码,大小和目录名称。

我们可以使用-x标志来排除某些HTTP状态代码。例如,让我们省略任何403代码:

66b39cefea89699334f2cf28c29bb452.gif

根据我们追求的结果,这可以使结果更清晰。我们还可以指定多个代码,以逗号分隔来排除它们。

我们可以通过设置-w标志来告诉dirsearch使用我们选择的字典:

~# dirsearch -u http://10.10.0.50/dvwa -e php -x 403,301,302 -w /usr/share/wordlists/wfuzz/general/common.txt

我们可以看到在这个特定的字典中找不到太多的结果,这是有道理的,因为它较小。

dirsearch的真正功能是执行递归目录扫描的能力。要运行递归搜索,只需添加-r标志:

66b39cefea89699334f2cf28c29bb452.gif

一旦完成初始扫描,它将返回并递归扫描每个找到的目录。例如,我们可以看到它开始扫描docs目录:

66b39cefea89699334f2cf28c29bb452.gif

我们还可以通过键盘中断随时暂停扫描。按e会完全退出扫描,按c会从上次停止的地方继续进行,按n会转到下一个目录。由于递归扫描通常需要花费一些时间,因此这些操作使我们可以控制结果。

像这样使用它只会递归地搜索一个级别。要将递归级别设置为更深的值,请使用-R标志,后跟要执行的级别数:

66b39cefea89699334f2cf28c29bb452.gif

66b39cefea89699334f2cf28c29bb452.gif

我们了解了dirsearch(一种功能强大的暴力Web目录扫描程序)及其与其他类似工具相比的一些优点。我们在系统上安装了dirsearch并设置了符号链接以允许我们从任何地方运行它。然后,我们研究了一些基本的使用示例,并展示了该工具的递归扫描功能的强大功能。最后,通过dirsearch可以轻松地在扫描网站时发现隐藏的目录和文件。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值