[ authorization ] [ registration ] [ restore account ]
Contact us
You can contact us by:
0day Today Exploits Market and 0day Exploits Database

ProjectPier 0.8.8 Shell Upload

Author
BlackHawk
Risk
[
Security Risk High
]
0day-ID
0day-ID-19499
Category
web applications
Date add
03-10-2012
Platform
php
ProjectPier <= 0.8.8 Remote Code Execution by BlackHawk

Thanks to alisael for the time spent together. Half credits goes to her ;)

01/11/2012
ProjectPier come with a upload.php file under ./tools/, that is the GUI for  upload_file.php

----------------------------
<?php
header("Content-Type: text/plain");

  if ($_FILES["file"]["error"] > 0) {
    echo $_FILES["file"]["error"] . " " . $_FILES["file"]["name"] . " " . $_FILES["file"]["tmp_name"];
  } else {

    $folder = rtrim( './upload/' . $_POST['folder'] , '/');
    @mkdir($folder, 0777, true);

    $seq = str_pad((int) $_POST["part"],4,"0",STR_PAD_LEFT);
    move_uploaded_file($_FILES["file"]["tmp_name"],
    $folder . '/' . $_FILES["file"]["name"] . '-' . $seq ); // <-- XXXX
    echo $_FILES["file"]["error"] . " " . $folder . '/' . $_FILES["file"]["name"] . '-' . $seq;
  }
?>

-----------------------------

the file is uploaded in a fresh made dir, with the original name PLUS a minus (-) PLUS a sequence of 4 digits.
As Apache, if the filename got 2 extension (filename.one.two), when do not recognize the exstension (two), try to recognize the first one (one), and act as it's the correct one, you just need to rename a PHP shell in:

filename.php.1

and then call directly the file from the browser.




#  0day.today [2024-07-07]  #