Created
January 3, 2022 11:08
-
-
Save shinobe179/49c38a24632c05d6fd322d36823fbbdf to your computer and use it in GitHub Desktop.
Hydra(http-post-form)の引数を対話的に構築するツール
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
cmd = 'hydra ' | |
# username | |
while True: | |
use_list = input('use username list?[Y/n]: ') | |
if re.match(r'(y|yes|n|no)', use_list, re.I) or use_list == '': | |
break | |
else: | |
print('[x]Unintent input.') | |
continue | |
if re.match(r'(y|yes)', use_list, re.I) or use_list == '': | |
cmd += '-L ' | |
userlist_name = input('filename of users[/usr/share/seclists/Usernames/xato-net-10-million-usernames.txt]: ') | |
if userlist_name == '': | |
userlist_name = '/usr/share/seclists/Usernames/xato-net-10-million-usernames.txt' | |
cmd += userlist_name + ' ' | |
else: | |
cmd += '-l ' | |
cmd += input('username: ') + ' ' | |
# password | |
while True: | |
use_list = '' | |
use_list = input('use password list?[Y/n]: ') | |
if re.match(r'(y|yes|n|no)', use_list, re.I) or use_list == '': | |
break | |
else: | |
print('[x]Unintent input.') | |
continue | |
if re.match(r'(y|yes)', use_list, re.I) or use_list == '': | |
cmd += '-P ' | |
passlist_name = input('filename of passwords[/usr/share/seclists/Passwords/xato-net-10-million-passwords-1000000.txt]: ') | |
if passlist_name == '': | |
passlist_name = '/usr/share/seclists/Passwords/xato-net-10-million-passwords-1000000.txt' | |
cmd += passlist_name + ' ' | |
else: | |
cmd += '-p ' | |
cmd += input('password: ') + ' ' | |
# params | |
cmd += "'http-post-form:" | |
cmd += '//' + input('host:port/path/to/form: ') + ':' | |
param_u = input('param of username: ') | |
cmd += f'{param_u}=^USER^&' | |
param_p = input('param of password: ') | |
cmd += f'{param_p}=^PASS^&' | |
while True: | |
k = input('key: ') | |
v = input('value: ') | |
cmd += f'{k}={v}' | |
q = '' | |
while True: | |
q = input('Enything else?[y/N]: ') | |
if re.match(r'(y|yes|n|no)', q, re.I) or q == '': | |
break | |
else: | |
print('[x]Unintent input.') | |
continue | |
if re.match(r'y|yes', q, re.I): | |
cmd += '&' | |
continue | |
else: | |
break | |
cmd += ":" | |
cmd += input('failed strings: ') | |
cmd += "'" | |
print(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment