Port scanning
- All TCP port scan
| |
- All UDP scan
| |
- Script Scan
| |
Web Exploitation
- There is a client portal in
ftp.wingdata.htb. It is using Wing FTP Server version 7.4.3 - This version of Wing FTP has a vulnerability in CVE-2025-47812. Exploit POC is here: https://www.exploit-db.com/exploits/52347
- To test if it is vulnerable,
| |
- To get RCE,
| |
- To get a reverse shell,
| |
Output:
| |
Shell as wingftp
- To upgrade TTY, Use script to spawn a tty
| |
Background the shell. CTRL+Z
On your machine,
| |
Then, press enter twice 2. Let’s find available users.
| |
- We can get the admin credentials in
/opt/wftpserver/Data/_ADMINISTRATOR/admins.xml
| |
Output:
| |
- The password cannot be cracked with rockyou.txt or crackstation
- Listening ports
| |
Output:
| |
- There are SSH keys in the directory.
| |
- Contents of
/etc/apache2/sites-available(The reverse proxy)
| |
- let’s see what files
wingftpowns
| |
Output:
| |
- Interesting files in
/opt/wftpserver/Data/1/usersdirectory
| |
Output:
| |
- All the passwords cannot be cracked with crackstation
- OS info
| |
Output:
| |
- We can modify the XML to bypass password protection. None of the users have anything interesing
- Groups information
| |
- Ok, I was stuck here for a very long time. Apparently, WingFTP adds salt before hashing!
| |
We need to use hash mode 1410
| |
Output:
| |
- We can use this creds to log in.
Shell as wacky
- Sudo privileges
| |
Output:
| |
- Contents of
/opt/backup_clients/restore_backup_clients.py
| |
| |
The filter argument in tarfile.open can be
fully_trusted: Honour all metadatatar: Honour tar-specific features but block features that are likely maliciousdata: Block most features specific to UNIX-like file systems. How the filter works is specified here There is an interesting section in tarfile manual about what else to consider even iffilter="datahere
- The version of Python in use is 3.12.3. It is vulnerable to CVE-2025-4517. Refer also https://github.com/google/security-research/security/advisories/GHSA-hgqp-3mmf-7h8f
| |
Output:
| |
- Exploit Change the configuration
| |
To create the malicious Tar file,
| |
Output:
| |
Transfer it to the victim and execute
| |
- Now, we can SSH into the machine as root
| |
Output:
| |
