Skip to main content

Enumeration

Run Nmap Scan

View Website

Untitled

Directory Bruteforcing (Run Gobuster)

Viewing website of found directories.

/Artwork

Untitled

/Music

Untitled Click login button

Finding Login Menu

Untitled And we found a admin website, OpenNetAdmin (ONA) version 18.1.1.

Exploitation

Searching for OpenNetAdmin Exploit

The exploit is done through OS command injection.

Exploit

We can do os command injection, but some of the commands are limited. Ex. changing directory by cd ../ but it changes back to the default directory after the command finishes.

Sending Reverse Shell to Attacker Machine

Checking Available Programming Language

After finding program, we found python 3.6.8 in the victim machine

Python Reverse Shell Script

We make the reverse shell script to send this to the victim machine and to execute it.

Listen to Reverse Shell and Exploit

Privilege Escalation

www-data to jimmy

Enumerating Credentials from Database Settings

Try Su to Escalate to Jimmy

Jimmy to Joanna

Getting into Internal Directory

Using www-data account, permissions were limited
However, now I can access to the internal website Analyzing Index.php
here it is comparing if ($_POST['username'] == 'jimmy' && hash('sha512',$_POST['password']) == '00e302ccdcf1c60b8ad50ea50cf72b939705f49f40f0dc658801b4680b7d758eebdc2e9f9ba8ba3ef8a8bb9a796d34ba2e856838ee9bdde852b8ec3b3a0523b1') if the username is jimmy and the password in SHA-512 hash format Let’s crack it CrackStation - Online Password Hash Cracking - MD5, SHA1, Linux, Rainbow Tables, etc. Untitled

Accessing the Internal Website using SSH Port Forwarding

Using SSH, let’s connect the internal website that we can’t access using ssh port forwarding
Access to the internal website Untitled Input the credentials that we gained Untitled Save the private key

Re-Encoding the Joanna SSH Private Key

Convert the private key to johntheripper format
Save the result hash
Crack the password using the Hash
For most of the hashes, we use rockyou.txt to crack it.
The pass phrase is a security measure to prevent unauthorized access to the private key. We are going to Re-Encode the joanna_id_rsa.key to id_rsa_joanna.

Login to the Joanna Account through SSH

Joanna to Root

Check Privilege

User Joanna can use sudo when it’s modifying /opt/priv using /bin/nano text editor

Finding a way to escalate privilege through Nano Text Editor

[nano | GTFOBins](https://gtfobins.github.io/gtfobins/nano/)

Exploit

Press Ctrl-R then Ctrl-X Then paste reset; sh 1>&0 2>&0 to the Command line and press enter. Untitled Type clear to the command line Untitled Untitled

Reference