安裝
GitHub項目地址:https://github.com/vanhauser-thc/thc-hydra
wget https://github.com/vanhauser-thc/thc-hydra/archive/master.zip

安裝必要組件:
-
yum -y install gcc libssh-devel openssl-devel
-
yum install -y unzip zip
解壓:
unzip master.zip
進入目錄:
cd thc-hydra-master/
編譯運行:
./configure

make &&make install

測試:
hydra -l root -p 12345678 192.168.234.128 ssh

下面測試一下密碼字典:(emmmm我沒文件所以隨便輸入了幾條)

hydra 192.168.234.128 ssh -l root -P ../password.txt

使用
語法:
-
hydra [some command line options] [-s PORT] TARGET PROTOCOL [MODULE-OPTIONS]
-
-
hydra [[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e nsr] [-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-W TIME] [-f] [-s PORT] [-x MIN:MAX:CHARSET] [-c TIME] [-ISOuvVd46] [service://server[:PORT][/OPT]]
常用選項:
| 選項 | 說明 | 示例 |
|---|---|---|
| -h | 查看所有可用的命令行選項 | hydra -h |
| -U | 檢查模塊是否具有可選參數 | hydra -U smb |
| -l | 指定用戶名 | -l zhangsan |
| -p | 指定密碼 | -p 123456 |
| -C | 使用冒號分隔的user:passwd格式,而不是-l/-p | -C zhangsan:123456 |
| -L | 指定用戶名字典文件 | -L /root/user.dict |
| -P | 指定密碼字典文件 | -P /root/passwd.dict |
| -M | 指定目標IP列表文件 | -M /root/ip.dict |
| -e | 嘗試“嘗試登錄為密碼”和“空密碼” | -e ns |
| -s | 指定對應模塊使用的端口,例如:如果ssh端口不是默認22,這里可以指定 | -s 2222 |
| -t | 指定線程數,默認16 | -t 1 |
| -vV | 顯示詳細破解過程 | -vV |
| -o | 指定將結果輸出到文件 | -o /result.txt |
| -b | 指定-o選項輸出的結果信息的類型,默認為文本信息,可以自定為jsonv1和json格式。 | -b json |
| -R | 恢復先前中止/崩潰的會話(當hydra被Control-C中止,被殺死或崩潰時,它會留下一個“hydra.restore”文件,其中包含恢復會話所需的所有信息。此會話文件每5分鍾寫入一次。注意:hydra.restore文件不能復制到不同的平台(例如從小端到大端,或從Solaris到AIX)) | -R |
| -I | 忽略現有的恢復文件(不要等待10秒) | -I |
| -S | 執行SSL連接 | -S |
| -f | 在使用-M參數后,找到第一對登錄用戶和密碼的時候終止破解 | -f |
| -W | 設置最大超時時間,單位秒,默認30秒 | -W 60 |
| -q | 不要打印有關連接錯誤的消息 | -q |
其他選項:
- 破解https:
hydra -m /index.php -l muts -P pass.txt 120.36.126.186 https
- 破解teamspeak:
hydra -l 用戶名 -P 密碼字典 -s 端口號 -vV ip teamspeak
- 破解cisco:
-
hydra -P pass.txt 120.36.126.186 cisco
-
hydra -m cloud -P pass.txt 120.36.126.186 cisco-enable
- 破解smb:
hydra -l administrator -P pass.txt 120.36.126.186 smb
- 破解pop3:
hydra -l muts -P pass.txt my.pop3.mail pop3
- 破解rdp:
hydra ip rdp -l administrator -P pass.txt -V
- 破解http-proxy:
hydra -l admin -P pass.txt http-proxy://120.36.126.186
- 破解imap:
-
hydra -L user.txt -p secret 120.36.126.186 imap PLAIN
-
hydra -C defaults.txt -6 imap://[fe80::2c:31ff:fe12:ac11]:143/PLAIN
- 破解telnet
hydra ip telnet -l 用戶 -P 密碼字典 -t 32 -s 23 -e ns -f -V
- 破解ftp:
-
hydra ip ftp -l 用戶名 -P 密碼字典 -t 線程(默認16) -vV
-
hydra ip ftp -l 用戶名 -P 密碼字典 -e ns -vV
- get方式提交,破解web登錄:
-
hydra -l 用戶名 -p 密碼字典 -t 線程 -vV -e ns ip http- get /admin/
-
hydra -l 用戶名 -p 密碼字典 -t 線程 -vV -e ns -f ip http- get /index.php
