✅Hack The Box - Chatterbox (Medium)
Last updated
Last updated
Nmap finds AChat on port 9256. The initial foothhold is trivial: we use AChat Remote Buffer Overflow to get a user shell as alfred.
In the privilege escalation phase, we find a credential in registry. Using this credential, we can construct port forwarding and use winexe
to spawn a SYSTEM shell.
HTB now filters all outbound connections going through port 22, so we have to map SSH to some other port.
RHOST: 10.129.29.216
LHOST: 10.10.14.79
Port 9255 and 9256 are open. The service running on port 9256 is AChat.
Searchsploit:
The exploit uses shellcode and we have to generate our own shellcode. Generate shellcode using Msfvenom:
Update the exploit, start a Netcat listener on port 443 and run the exploit:
Now we have a user shell as chatterbox\alfred
.
The victim machine runs 32-bit Windows 7:
Search for passwords in registry:
We find Welcome1!
:
Query this registry:
Here we learn that the username is Alfred
:
Note that SMB is running on internal ports 139 and 445:
Although we can't access these ports publicly, it is possible to gain this access using port forwarding.
On our attack machine, edit /etc/ssh/sshd_config
:
Restart SSH service:
Download 32-bit plink.exe
:
Transfer it to the victim machine:
Port forwarding:
However, we are getting a "connection timed out" error:
Recall that port forwarding is a SSH feature. This is because now HTB firewall rule filters any outbound connections on port 22. This was anonced in the HTB discord server:
Here we can edit /etc/ssh/sshd_config
and map SSH to some other port, for example, port 2222:
Restart the SSH service again:
Do port forward again, but this time we set the port to 2222:
Press "Enter" a few times until you see the output. Spawn a root shell using winexe
:
Again, press "Enter" a few times until you see the output. Now we get a SYSTEM shell: