Hackthebox Bashed writeup

Hackthebox Bashed writeup

Introduction

It is a easy Linux machine from hack the box which has a little Dir enumeration followed by exploitation of a python file.

Steps involved

1-Port Scan

2-Directory enumeration

3-Getting user flag

4-Getting reverse shell

5-Changing user

6-Exploiting test.py

7-Getting root flag

Port Scan

Nmap 7.70 scan initiated Thu Apr 23 08:49:22 2020 as: nmap -sC -sV -O -v -oV 10.10.10.68
Increasing send delay for 10.10.10.68 from 0 to 5 due to 32 out of 106 dropped probes since last increase.
Nmap scan report for 10.10.10.68
Host is up (0.36s latency).
Not shown: 999 closed ports
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|http-favicon: Unknown favicon MD5: 6AA5034A553DFA77C3B2C7B4C26CF870 | http-methods: | Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Arrexel’s Development Site
Aggressive OS guesses: Linux 3.18 (95%), Linux 3.2 – 4.9 (95%), Linux 3.16 (95%), ASUS RT-N56U WAP (Linux 3.4) (94%), Linux 3.1 (93%), Linux 3.2 (93%), Linux 3.10 – 4.11 (93%), Linux 3.13 (92%), DD-WRT v3.0 (Linux 4.4.2) (92%), Linux 4.10 (92%)
No exact OS matches for host (test conditions non-ideal).
Uptime guess: 0.000 days (since Thu Apr 23 08:51:41 2020)
Network Distance: 2 hops
TCP Sequence Prediction: Difficulty=256 (Good luck!)
IP ID Sequence Generation: All zeros
Read data files from: /usr/bin/../share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done at Thu Apr 23 08:52:13 2020 — 1 IP address (1 host up) scanned in 171.65 seconds

So the very first step is to visit the website.

Hackthebox Bashed writeup

Directory enumeration

Nothing interesting there so let’s run directory enumeration tools.

gobuster dir -u 10.10.10.68 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,txt

Hackthebox Bashed writeup

Getting user flag

So let’s see what’s in there .So i got some thing in the /dev

Hackthebox Bashed writeup

When i clicked on one of the .php file it opened a shell as www-data.

Hackthebox Bashed writeup

And then i got the user flag through this.

Hackthebox Bashed writeup

Getting reverse shell

Let’s get a reverse shell now.

Hackthebox Bashed writeup

Changing user

Got a reverse shell.

When i show the output after sudo -l then i understood that we can run cmds as script manager

Then we switched into it.

Exploiting test.py

The name script manager was a hint for me .So i looked into the script section.

Hackthebox Bashed writeup

I saw that the output was having a root right so i wrote my reverse shell in test.py.

Hackthebox Bashed writeup

Getting root flag

And when it ran it gave me the root.

Hackthebox Bashed writeup

Similar Posts

  • Passwords for the Active Hack the Box machines

    New methods For linux -cat /etc/shadow Example this. root:$6$YIFGN9YscCV72BjFtx/tehbc7sQTJp09c5.:18277:0:99999:7:::So use the highlighted part as the password.So password = YIFGN9YscCV72BjFtx/ For Windows Use ntlm hash Example Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c:::  password = 31d6cfe0d16ae931b73c59d7e0c Old methods For linux 1- cat /etc/shadow2-copy whole hash(root)root:$6$YIFGN9YscCV72BjFtx/tehbc7sQTJp09c5.:18277:0:99999:7:::3-Then find it’s MD5 sum and that’s your password for writeup For windows 1-Find root hash with hashdump.exe…

  • | |

    Hackthebox ServMon writeup

    Basic Information Difficulty-EasyType -WindowsPoints-20Maker-dmw0ngUser Blood- sampriti:08 mins, 06 seconds. Root Blood-sampriti:34 mins, 10 seconds. Steps involved 1-Port Scanning2-Searching exploit for NVMS-10003-Directory Traversal(Using Burp just POC)4-FTP enumeration5-Extracting passwords Using Directory Traversal 6-SSH login into Nadine(user.tx)7-Revising FTP and Nmap enumerations8-Checking Service on port 84439-Local port forwarding through SSH10-Searching exploit for NSClient++11-Exploiting NSClient with CLI12-Getting Root.txt Commands involved…

  • | | | |

    Hackthebox buff writeup

    Steps Involved 1-Port Scan 2-Enumerating Website 3-Exploiting Gym Management Software 1.0 4-Getting Web-shell 5-Getting full shell and user.txt 6-Privilege Escalation 7-Exploiting Cloudme.exe 8-Getting root flag Port Scan ┌─[nagendra@parrot]─[~/Desktop/hackthebox/buff] └──╼ $cat nmap Nmap 7.80 scan initiated Fri Aug 7 23:10:59 2020 as: nmap -Pn -sC -sV -v -oN nmap 10.10.10.198 Nmap scan report for 10.10.10.198 Host…

Leave a Reply

Your email address will not be published. Required fields are marked *