Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. <?php
  2. class TokenPP {
  3.  
  4. function gettoken() {
  5. $cookie = tempnam('tmp','avo'.rand(1000000,9999999).'tmp.txt');
  6. $url = ("http://www.ocetiwakan.org/index.php?option=com_cmdonation&task=donation.submit");
  7. $content = $this->curl($url,"amount=".rand(0,1000)."&anonymous=1&payment_method=paypalproexpress&campaign_id=1&return_url=aW5kZXgucGhwP2Zvcm1hdD1odG1sJm9wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9OTAmSXRlbWlkPTU0OQ==",0,1,"","",0,0,$cookie,0);
  8. $url = $this->get_between($content,'If you are not redirected within 5 seconds please <a href="','"');
  9. $content = $this->curl($url,0,0,1,"","",0,0,$cookie,0);
  10. $token = $this->get_between($content,'"x-csrf-jwt": "','"');
  11. return $token;
  12. }
  13.  
  14. function get_between($string, $start, $end) {
  15. $string = " ".$string;
  16. $ini = strpos($string,$start);
  17. if ($ini == 0) return "";
  18. $ini += strlen($start);
  19. $len = strpos($string,$end,$ini) - $ini;
  20. return substr($string,$ini,$len);
  21. }
  22.  
  23. function curl($url, $fields="", $ssl = 0, $followLocation = 0, $referer = 'https://www.paypal.com', $optUrl = '', $deleteOldCookies=1, $sock = false, $usecookie=false, $geturl=false) {
  24. $ch = curl_init($url);
  25. $header = array();
  26. $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
  27. $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
  28. $header[0] .= "DNT: 1";
  29. $header[] = "Connection: keep-alive";
  30. $header[] = "Keep-Alive: 300";
  31. $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
  32. $header[] = "Accept-Language: en-us,en;q=0.5";
  33. $header[] = "Pragma: "; // browsers keep this blank.
  34. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 UBrowser/5.5.9936.1004 Safari/537.36");
  35. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  36. if ($usecookie) {
  37. curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie);
  38. curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie);
  39. }
  40. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  41. curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  42. if($followLocation){
  43. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  44. }
  45. curl_setopt($ch, CURLOPT_URL, $url);
  46. if($fields){
  47. curl_setopt($ch, CURLOPT_POST, true);
  48. curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
  49. }else{
  50. curl_setopt($ch, CURLOPT_POST, false);
  51. }
  52. if($referer){
  53. curl_setopt($ch, CURLOPT_REFERER, $referer);
  54. }else{
  55. curl_setopt($ch, CURLOPT_REFERER, $url);
  56. }
  57. if($ssl){
  58. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
  59. }else{
  60. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  61. }
  62. if($optUrl){
  63. curl_setopt ($ch, CURLOPT_URL, $optUrl);
  64. }
  65. if($sock){
  66. curl_setopt($ch, CURLOPT_PROXY, $sock);
  67. curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  68. }
  69. if($geturl == true){
  70. $xd1 = curl_exec($ch);
  71. $xd2 = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
  72. echo $xd1."|".$xd2;
  73. } else {
  74. return curl_exec($ch);
  75. }
  76. }
  77. }
  78. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement