Hackthebox OpenKeys writeup

Hackthebox OpenKeys writeup
Hackthebox OpenKeys writeup


Hackthebox OpenKeys writeup

It is a great machine from hackthebox .It is Having BSD OS .which is very vulnerable .Starting with authentication bypass which gave the ssh-keys for a user .Then simple exploiting OPenBSD 6.6 vulnerabilities .

Table of Content

  • Port Scan
  • Directory enumeration
  • Authentication bypass
  • Getting ssh-keys for User jennifer(user)
  • Exploiting OPenBSD 6.6.(root)

Port Scan

➜ cat nmap
Nmap 7.80 scan initiated Thu Nov 5 06:30:50 2020 as: nmap -sC -sV -v -O -oN nmap
Increasing send delay for from 0 to 5 due to 121 out of 401 dropped probes since last increase.
Nmap scan report for
Host is up (0.22s latency).
Not shown: 998 closed ports
22/tcp open ssh OpenSSH 8.1 (protocol 2.0)
| ssh-hostkey:
| 3072 5e:ff:81:e9:1f:9b:f8:9a:25:df:5d:82:1a:dd:7a:81 (RSA)
| 256 64:7a:5a:52:85:c5:6d:d5:4a:6b:a7:1a:9a:8a:b9:bb (ECDSA)
|_ 256 12:35:4b:6e:23:09:dc:ea:00:8c:72:20:c7:50:32:f3 (ED25519)
80/tcp open http OpenBSD httpd
| http-methods:
|_ Supported Methods: GET HEAD
|_http-title: Site doesn't have a title (text/html).
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
Uptime guess: 0.000 days (since Thu Nov 5 06:32:26 2020)
Network Distance: 2 hops
TCP Sequence Prediction: Difficulty=263 (Good luck!)
IP ID Sequence Generation: Randomized
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 Nov 5 06:32:45 2020 -- 1 IP address (1 host up) scanned in 115.57 seconds

The highlighting part in the nmap result was that machine was running OpenBSD httpd.

Directory enumeration

so i started googling about it .But in the mean while I ran dirbuster.

Hackthebox OpenKeys writeup

Let’s see what /include had

Hackthebox OpenKeys writeup
Hackthebox OpenKeys writeup

/auth.php.swp gave an another domain so I quickly added that also to my host file.

Moreover I came to know that we can easily bypass the authentication in the openBSD.


Authentication bypass

Hackthebox OpenKeys writeup

So let’s try to bypass the authentication.

Hackthebox OpenKeys writeup

And it successfully bypassed the authentication.

Hackthebox OpenKeys writeup

But it says no OpenSSH keys found .

So let’ try to login into jennifer account .So I used Burp Suite to manipulate the request .

Getting SSH-Keys for Jennifer(user)

Hackthebox OpenKeys writeup

What I did was just added a username along with the PHPSESSID.

The next we got the ssh keys for jennifer.

Hackthebox OpenKeys writeup

Save it to my machine with 600 permissions .

Congratulations we logged in as jennifer and the user part is complete.

Hackthebox OpenKeys writeup

Exploiting OpenBSD 6.6 (root)

So now it’s time for the privilege escalation.

openkeys$ uname -a
OpenBSD openkeys.htb 6.6 GENERIC#353 amd64 .

Looking at google I found that OpenBSD 6.6 is very much vulnerable.

I got a exploit from github .

Hackthebox OpenKeys writeup

And I got the root shell.

Hackthebox OpenKeys writeup

Thanks for reading Have a nice day …

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 5

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


No comments yet. Why don’t you start the discussion?

Leave a Reply

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