Path: blob/master/documentation/modules/exploit/freebsd/webapp/spamtitan_unauth_rce.md
28182 views
Vulnerable Application
TitanHQ SpamTitan Gateway is an anti-spam appliance that protects against unwanted emails and malwares. This module exploits an improper input sanitization in versions 7.01, 7.02, 7.03 and 7.07 to inject command directives into the SNMP configuration file and get remote code execution as root. Note that only version 7.03 needs authentication and no authentication is required for versions 7.01, 7.02 and 7.07.
First, it sends an HTTP POST request to the snmp-x.php page with an SNMPD command directives (extend + command) passed to the community parameter. This payload is then added to snmpd.conf by the application. Finally, the module triggers the execution of this command by querying the SNMP server for the correct OID.
This exploit module has been successfully tested against versions 7.01, 7.02, 7.03, and 7.07.
Installation
A demo version of the vulnerable application can be downloaded here. Since the latest version of SpamTitan Gateway has this vulnerability fixed and no demo of the vulnerable versions are available for download, the previous major release demo has to be used and updates have to be installed manually.
Installation steps:
Download SpamTitan Gateway version 6 demo
.ovaimage: https://stdownload.titanhq.com/vmware/SpamTitan-6-amd64.ovaImport it to your favorite virtualization software and start it
Access the SpamTitan web user interface from the appliance IP. This IP is usually displayed on the welcome page once the virtual machine has boot up.
Login with the default credentials:
username:
adminpassword:
hiadmin
Go to
System Setup>System Updatesand clickStartin theCheck for Updates Nowsection. It will download all available update patches.From the
Available Updatessection, choose the version you want to test and click theinstallbutton in front of it.
Verification Steps
Install the application (see Installation)
Start msfconsole
Do:
use exploit/freebsd/webapp/spamtitan_unauth_rceDo:
set RHOSTS <ip>Do:
set LHOST <ip>Do:
runYou should get a shell.
Options
TARGETURI
The base path to SpamTitan. Default value is /.
USERNAME
The username to authenticate, if required (depending on SpamTitan Gateway version). Default value is admin.
PASSWORD
The password to authenticate, if required (depending on SpamTitan Gateway version). Default value is hiadmin.
COMMUNITY
The SNMP Community String to use (random string by default).
ALLOWEDIP
The IP address that will be allowed to query the injected extend command. This IP will be added to the SNMP configuration file on the target. This is typically this host IP address, but can be different if your are in a NAT'ed network. If not set, LHOST will be used instead. If LHOST is not set, it will default to 127.0.0.1.
SNMPPORT
The target SNMP port (UDP). Default port is 161.