Advertisement
Guest User

Untitled

a guest
Sep 21st, 2016
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. <?php
  2.  
  3. set_time_limit(3000);
  4.  
  5. /* connect to gmail */
  6. $hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
  7. $username = 'email@gmail.com';
  8. $password = 'password';
  9.  
  10. /* try to connect */
  11. $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
  12.  
  13. $emails = imap_search($inbox, 'FROM "noreply@pl.hidemyass.com"');
  14.  
  15. /* if any emails found, iterate through each email */
  16. if($emails) {
  17.  
  18. $count = 1;
  19.  
  20. /* put the newest emails on top */
  21. rsort($emails);
  22.  
  23. file_put_contents('leaked.txt',"HideMyAss Premium Proxies Leaked by ShinyMK@HF - Premium Newsletter Proxies below are every proxy sent by HMA since 8th of August 2016. Enjoy :)" . PHP_EOL);
  24.  
  25. /* for every email... */
  26. foreach($emails as $email_number)
  27. {
  28.  
  29. /* get information specific to this email */
  30. $overview = imap_fetch_overview($inbox,$email_number,0);
  31.  
  32. $message = imap_fetchbody($inbox,$email_number,2);
  33.  
  34. /* get mail structure */
  35. $structure = imap_fetchstructure($inbox, $email_number);
  36.  
  37. $attachments = array();
  38.  
  39. /* if any attachments found... */
  40. if(isset($structure->parts) && count($structure->parts))
  41. {
  42. for($i = 0; $i < count($structure->parts); $i++)
  43. {
  44. $attachments[$i] = array(
  45. 'is_attachment' => false,
  46. 'filename' => '',
  47. 'name' => '',
  48. 'attachment' => ''
  49. );
  50.  
  51. if($structure->parts[$i]->ifdparameters)
  52. {
  53. foreach($structure->parts[$i]->dparameters as $object)
  54. {
  55. if(strtolower($object->attribute) == 'filename')
  56. {
  57. $attachments[$i]['is_attachment'] = true;
  58. $attachments[$i]['filename'] = $object->value;
  59. }
  60. }
  61. }
  62.  
  63. if($structure->parts[$i]->ifparameters)
  64. {
  65. foreach($structure->parts[$i]->parameters as $object)
  66. {
  67. if(strtolower($object->attribute) == 'name')
  68. {
  69. $attachments[$i]['is_attachment'] = true;
  70. $attachments[$i]['name'] = $object->value;
  71. }
  72. }
  73. }
  74.  
  75. if($attachments[$i]['is_attachment'])
  76. {
  77. $attachments[$i]['attachment'] = imap_fetchbody($inbox, $email_number, $i+1);
  78.  
  79. /* 3 = BASE64 encoding */
  80. if($structure->parts[$i]->encoding == 3)
  81. {
  82. $attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']);
  83. }
  84. /* 4 = QUOTED-PRINTABLE encoding */
  85. elseif($structure->parts[$i]->encoding == 4)
  86. {
  87. $attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']);
  88. }
  89. }
  90. }
  91. }
  92.  
  93. /* iterate through each attachment and save it */
  94. foreach($attachments as $attachment)
  95. {
  96. if($attachment['is_attachment'] == 1)
  97. {
  98. $filename = $attachment['name'];
  99. if(empty($filename)) $filename = $attachment['filename'];
  100. $fp = fopen("./temp.zip", "w+");
  101. fwrite($fp, $attachment['attachment']);
  102. fclose($fp);
  103.  
  104. // get the absolute path to $file
  105. $path = pathinfo(realpath('temp.zip'), PATHINFO_DIRNAME);
  106.  
  107. $zip = new ZipArchive;
  108. $res = $zip->open('temp.zip');
  109. if ($res === TRUE) {
  110.  
  111. //Extract the Zip;
  112. $zip->extractTo($path);
  113. $zip->close();
  114.  
  115. //Delete un-needed files;
  116. unlink('temp.zip');
  117. unlink('readme.txt');
  118.  
  119. //Write the leaked proxies to 'leaked.txt' on root;
  120. $file = file('full_list_nopl/_full_list.txt');
  121. file_put_contents('leaked.txt', $file, FILE_APPEND);
  122.  
  123. //Delete the un-needed folders;
  124. $files = glob('full_list/*');
  125. foreach($files as $file){
  126. if(is_file($file)) unlink($file);
  127. }
  128. $files = glob('full_list_nopl/*');
  129. foreach($files as $file){
  130. if(is_file($file)) unlink($file);
  131. }
  132. rmdir('full_list');
  133. rmdir('full_list_nopl');
  134.  
  135. } else {
  136. die('Error unzipping leaked HideMyAss proxies. Check back later.');
  137. }
  138.  
  139. }
  140. }
  141. }
  142. }
  143.  
  144. /* close the connection */
  145. imap_close($inbox);
  146.  
  147. echo "HideMyAss Premium Proxy List's sucessfully leaked to leaked.txt by ShinyMK";
  148.  
  149. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement