Port enumeration

I used nmap and found 3 open ports.

nmap -p- --open -vvv -sS --min-rate 5000 -Pn 10.129.245.216 -oG allPorts.txt

98154f31108db4a4ff675bf8cc4ccdc2.png I found an ssh port open and what look like 2 http servers.

Web enumeration

Inside the port 6274 I found a MCPJam instance. 7a37a6d0f76a7a8a54834763ff26194f.png I remenber from Kobold that this service hava a RCE vuln. 58d98ea927ca8b727b1dad26fbab17b9.png

RCE

Using this vulnerability, Im able to execute a shell. 0c6ad9abbd87076748a1853b7b20908a.png c89dfbdfe20d975bd72e7d16c4cb8b0e.png

MCP-DEV Enumeration

I found some strange services in ports 8888 and 5000. 59380c5faf15e089d9923ad733804141.png

Port forwarding

Using chisel I forwarded this services. - Attacker

chisel server --port 4000 --reverse
  • Victim
./chisel client 10.10.16.62:4000 R:5000:127.0.0.1:5000

Internal service enumeration

Once forwarded port 5000 I found what looks like somo type of API. 1113b923c3620964d0e551b3010c7c79.png But I need an API key to use it, and I have not this API key. In port 8888 I found a jupyter instance. 7965ce4d3e99976fcb60cf162040606e.png Using ps aux, I found the jupyter token. 8dff18512ccfda9246cc90436a870d65.png With that token, I was able to log in the noteboook. b48e7c4359bdd07178a793e289d5d3f1.png Here, I was able to execute python code. 80f8a4197f855e4352aa12e83532a8b5.png Using this app, I executed a reverse shell. 04ab7a07b786dad106d3390ff6466804.png 893ad683472a0023b6f449a41d263a48.png

Privilege escalation

Inside opt I found /opt/opsmcp/server.py, where I can see some credentials. 2b88ee65d7c743b8ad2b97583cc027d3.png Including an API key for the server in 5000. d6e62a3047f221ca052a4da5f936d6b8.png Now, following the api instructions, now, I can use this API. bb3222398c0f1dc2b9c20de8db88cd0c.png Reading the code again, I found some hidden tools. 5b3dd0e49511c2e997afc5b73f0b459d.png Following the code instructions, I execute the tool _admin_dump to exfiltrate the ssh key. 7947b5fbc81271a86f0e2eca6536dda0.png Now, I clean the ssh key.

printf "%b" "$KEY" > id_rsa

And, using ssh, I can log as root.

ssh -i id_rsa root@10.129.245.216

9951f0b1385cb253395e2e65d9630998.png