
Python 3スクリプトで、2つのテキストファイルを入力として、対象のSSHサーバーに対して辞書/ワードリスト攻撃を実行します。Intelの技術審査のために作成されました。
このスクリプトはParamikoとColoramaに依存しています。依存関係はpip install -r requirements.txtまたはpip3 install -r requirements.txtでインストールできます。
ポート22、試行回数の制限やロックアウト期間なし
python3 buffalo.py localhost users.txt passwords.txt
デフォルトのスレッド数は100です。この数はthreadフラグを使用して増減できます。
python3 buffalo.py localhost users.txt passwords.txt --threads 200
ポート2222でサービスを指定
python3 buffalo.py localhost users.txt passwords.txt --port 2222
ほとんどのシステムには、一定の時間枠内でアカウントごとに何らかの試行制限があります。この制限を回避するには、--max_attemptsフラグと*--lockout_periodフラグを使用して、アカウントごとの試行回数を制限できます。たとえば、15分間でアカウントごとに3*回の試行に制限する場合です。
python3 buffalo.py localhost users.txt passwords.txt --max_attempts 3 --lockout_period 15
[$] python3 buffalo.py -h [12:39:53]
usage: buffalo.py [-h] [--port [PORT]] [--max_attempts [MAX_ATTEMPTS]] [--lockout_period [LOCKOUT_PERIOD]]
[--threads [THREADS]]
target users passwords
Quick SSH brute force script for Red Team @Intel.
positional arguments:
target Target IP or hostname.
users Username file, one username per line.
passwords Password file, one password per line.
optional arguments:
-h, --help show this help message and exit
--port [PORT] SSH port. DEFAULT 22.
--max_attempts [MAX_ATTEMPTS]
Max attempts per account within the lockout window. DEFAULT unlimited.
--lockout_period [LOCKOUT_PERIOD]
Length of the lockout window in minutes. DEFAULT 0.
--threads [THREADS] Thread count. DEFAULT 100.
以下は、将来実装できたら面白いと思うものの簡単なリストです。
invoke_shellを介してインタラクティブシェルを開くオプション。exec_commandを利用するさまざまなオプション。以下に思いついたアイデアを示します。