dirmap + dirsearchのインストールと使用法のチュートリアル

dirmap + dirsearchのインストールと使用法のチュートリアル

0x00インストール

  • すべてpy3のみをサポートします
  • エラーを実行するときにモジュールを1つずつインストールするのは醜いです。dirmapによって提供されるrequirement.txtを見てください。
gevent
requests
progressbar2
lxml

直接

pip3 install -r requirement.txt

どれほど快適でリラックスできるか

ここに写真の説明を挿入

0x01使用

dirmap

高度なWebディレクトリスキャンツールであるこの機能は、DirBuster、Dirsearch、cansina、Yujianよりも強力です。

次の機能があります。

  • 同時実行エンジン
  • 辞書が使える
  • 純粋な発破
  • ページをクロールして動的に辞書を生成できます
  • ファズスキャンできます
  • カスタムリクエスト
  • カスタム応答結果の処理...

基本的な使い方

python3 dirmap.py -i https://target.com -lcf
python3 dirmap.py -i 192.168.1.1 -lcf

単一のターゲット、デフォルトはhttp

python3 dirmap.py -i https://target.com -lcf
python3 dirmap.py -i 192.168.1.1 -lcf

サブネット(CIDR形式)

python3 dirmap.py -i 192.168.1.0/24 -lcf

ネットワーク範囲

python3 dirmap.py -i 192.168.1.1-192.168.1.100 -lcf
  • ファイルの読み取り
python3 dirmap.py -iF targets.txt -lcf

targets.txt上記のフォーマットをサポートします

  • 結果を保存
  1. 結果はプロジェクトのルートディレクトリoutputフォルダに自動的に保存されます
  2. 各ターゲットはtxtを生成し、命名形式は次のとおりです。目标域名.txt
  3. 結果は自動的に重複排除されるため、多くの冗長性について心配する必要はありません。

dirsearch

python3 dirsearch.py -u <URL> -e <EXTENSION>
python3 dirsearch.py -u url -e *
py -3 dirsearch.py -u url -e *
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)
    -E, --extensions-list
                        Use predefined list of common extensions

  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)
    --exclude-texts=EXCLUDETEXTS
                        Exclude responses by texts, separated by comma
                        (example: "Not found", "Error")
    --exclude-regexps=EXCLUDEREGEXPS
                        Exclude responses by regexps, separated by comma
                        (example: "Not foun[a-z]{1}", "^Error$")
    -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: HEAD;POST
    --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
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --recursive -R 2
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --recursive -R 4 --scan-subdirs=/,/wp-content/,/wp-admin/
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --exclude-texts=This,AndThat
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt -H "User-Agent: IE"
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt -t 20
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --random-agents
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --json-report=reports/target.json
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --simple-report=reports/target-paths.txt
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --plain-text-report=reports/target-paths-and-status.json
Traceback (most recent call last):
  File "dirsearch.py", line 26, in <module>
    from lib.core import ArgumentParser
ModuleNotFoundError: No module named 'lib.core'

argumentparモジュールをインストールする

  • それでもエラーが報告され、モジュールのインストール後にモジュールを使用できない場合は、完全なものをダウンロードしてください

おすすめ

転載: blog.csdn.net/vanarrow/article/details/108190126