1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PythonのURLブルートフォーススクリプト

Last updated at Posted at 2025-06-13

主な機能

  • http://example.com/pages/1, .../2, ..., .../100 などのURLに対して使用
  • ステータスコードが200の場合、Content-Length ヘッダを確認して空ページやファイルのサイズを表示
  • 結果を標準出力に表示(存在するURLとそのサイズ、またはエラー)

前提条件

  • Python 3.6+
  • requests ライブラリのインストール

使用例

python3 url_brute.py

以下の条件でページが存在するか確認したい:

ENTER BASE URL (e.g. http://example.com): http://target.com
ENTER PAGES DIRECTORY (e.g. pages): pages
ENTER START NUMBER (e.g. 1): 1
ENTER END NUMBER (e.g. 50): 50

[+] FOUND: http://target.com/pages/3 (Content-Length: 1245 bytes)
[!] FOUND BUT EMPTY (0 bytes or unknown size): http://target.com/pages/15
[-] NOT FOUND: http://target.com/pages/22 (STATUS: 404)

補足

  • Content-Lengthが取得できない、もしくは0の場合、「空または不明」として警告表示。
  • タイムアウト(既定3秒)や接続エラー、その他requests例外をキャッチ

GitHub

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?