Hackthebox OpenKeys writeup
| | |

Hackthebox OpenKeys writeup

Introduction

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

hackthebox/openkeys/10.10.10.199
➜ cat nmap
Nmap 7.80 scan initiated Thu Nov 5 06:30:50 2020 as: nmap -sC -sV -v -O -oN nmap 10.10.10.199
Increasing send delay for 10.10.10.199 from 0 to 5 due to 121 out of 401 dropped probes since last increase.
Nmap scan report for 10.10.10.199
Host is up (0.22s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
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:
OS:SCAN(V=7.80%E=4%D=11/5%OT=22%CT=1%CU=34790%PV=Y%DS=2%DC=I%G=Y%TM=5FA34F3
OS:5%P=x86_64-pc-linux-gnu)SEQ(SP=108%GCD=1%ISR=10C%TI=RD%CI=RI%II=RI%TS=21
OS:)SEQ(SP=105%GCD=1%ISR=106%TI=RD%CI=RI%TS=22)OPS(O1=M54DNNSNW6NNT11%O2=M5
OS:4DNNSNW6NNT11%O3=M54DNW6NNT11%O4=M54DNNSNW6NNT11%O5=M54DNNSNW6NNT11%O6=M
OS:54DNNSNNT11)WIN(W1=4000%W2=4000%W3=4000%W4=4000%W5=4000%W6=4000)ECN(R=Y%
OS:DF=Y%T=40%W=4000%O=M54DNNSNW6%CC=N%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=
OS:0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=S%F=AR%O=%RD=0%Q=)T5(R=Y%D
OS:F=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=S%F=AR%
OS:O=%RD=0%Q=)T7(R=N)U1(R=Y%DF=N%T=FF%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK
OS:=G%RUD=G)IE(R=Y%DFI=S%T=FF%CD=S)
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.

link

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 …

Similar Posts

  • Hackthebox Granny writeup

    Commands used 1-nmap -sC -v 10.10.10.152-msfconsle3-use exploit/windows/iis/iis_webdav_scstoragepathfromurl4-set targeturi /_vti_bin5-set rhosts 10.10.14.205-set lhost your_ip6-set lport 12347-run Steps involved Steps invloved 1-Port Scanning2-Searching exploit for IIS 6.03-Exploiting IIS with metasploit Port scan Starting Nmap 7.70 ( https://nmap.org ) at 2020-04-16 23:06 EDT NSE: Loaded 119 scripts for scanning. NSE: Script Pre-scanning. Initiating NSE at 23:06 Completed NSE…

  • | |

    Hackthebox Magic writeup

    Introduction It is a medium machine from the hack the box platform.Which has simple authentication bypass to upload a malicious file and then jumping a user followed by privilege escalation using SUID Steps involved 1-Port Scan2-Visiting website3-Authentication bypass4-Encoding php inside image5-Uploading malicious file and bypassing security check6-Uploading php reverse shell7-Getting full shell8-Getting db user creds9-Jumping…

  • |

    Cheatsheet for HTB

    Linux General ctrl + r Search History reverse Run Script at startup update-rc.d -f /path/to/the/script remove Delete Script from defaults Vim i for insert mode esc to leave insert mode To be continued with macros and all this handy shit Tmux Config from ippsec. First press the prefix ctrl + a, then release the buttons…

  • | |

    Hackthebox Luanne Writeup

    Introduction It is a openBSD machine which has some directory enumeration and mostly all the steps are based on enumeration.Making the initial foothold may take time but over all a great machine . Steps involved 1-Port Scan 2-Enumerating website 3-Directory enumeration 4-Making of perfect payload 5-Getting reverse shell 6-Getting webapi_user password 7-Getting ssh keys for…

Leave a Reply

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