Posts Bounty Hacker
Post
Cancel

Bounty Hacker

Description

You talked a big game about being the most elite hacker in the solar system. Prove it and claim your right to the status of Elite Bounty Hacker!

RoomBounty Hacker
OSLinux
DifficultyEasy
CreatorSevuhl

Let’s start with rustscan to quickly finds all open ports,

1
rustscan -a 10.10.229.96

image

we got 3 open ports. Let’s run a detail nmap scan on these ports to enumerate details.

1
nmap -sV -sC -p21,22,80 10.10.229.96 -oN nmap.txt

image

With nmap scan, we got to know that port 21 is running ftp service with anonymous login, port 22 is running ssh service and port 80 is running webserver. We’ll first enumerate ftp service and then move towards webserver (port 80).

1
ftp 10.10.229.96

image

after providing credentials, Anonymous:Anonymous, we got logged in.

Let’s establish directory content using ls -la,

image

we got 2 files named locks.txt and task.txt. Let’s download them on our local system using get command,

1
2
get locks.txt
get tasks.txt

image

With this, we’ve downloaded both files on our system. It’s time to read the content of these files.

1
cat tasks.txt

image

After reading content of tasks.txt file, we got to know that Lin is author of the file or maybe a user? Let’s see.

Let’s read the locks.txt file content,

1
cat locks.txt

image

Seems like these are all passwords. Worth giving a shot to bruteforce to find out correct credential.

Now that we’ve enumerated ftp, let’s enumerate webserver by visiting http://10.10.229.96,

image

we got a webpage and it seems like these characters are trying to break into system. But since, we don’t know the credential to login via ssh, we can’t move forward. So let’s create a user list which contains name of users,

1
cat user.txt

image

Reading the content of the file will confirm that we’ve added all the users.

Now that we’ve users list and password list, let’s try to bruteforce credentials of ssh service with help of tool Hydra,

1
hydra -L user.txt -P locks.txt ssh://10.10.229.96:22/ -t 4

image

after sometime, we’ll get correct username and password. Let’s now try to login via ssh service,

1
ssh lin@10.10.229.96

image

we’ve successfully authenticate ourselves as lin user.

Let’s establish directory content using ls -la,

image

we got our user flag.

Now, the part remains is privilege escalation. Let’s now list all the binaries which can be run as sudo without providing root user’s password,

1
sudo -l

image

we can see that /bin/tar binary can be run as sudo without providing password. Let’s search if this binary privesc is on GTFObins.

And we found a method to elevate our privileges using this binary,

image

we just have to execute this command and we’re root.

1
sudo tar -cf /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/bash

image

after executing this command, we’ll become root user and we can confirm it with id command.

let’s navigate to /root directory and establish directory content using ls -la

image

and there we have it, our root flag.

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