bonekcok21

cPanel Exploit Checker 3.0

Aug 14th, 2016
1,777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.19 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # cpanel11 - expcheck.pl          Copyright(c) 2006 cPanel Inc.
  3. #                                 All rights Reserved.
  4. # [email protected]            http://www.cpanel.net
  5. print "cPanel Exploit Checker 3.0\n";
  6. my $notok=0;
  7. foreach my $script ('/usr/local/cpanel/bin/mysqladmin',
  8.                         '/usr/local/cpanel/bin/hooksadmin') {
  9.     my %TA=('unshift( @INC, "/usr/local/cpanel" );'=>0,,
  10.     '@INC=grep(!/(^\.|\.\.|\/\.+)/,@INC);'=>0,
  11.     '@INC=grep(/^(\/usr\/lib\d*\/perl|\/usr\/local\/lib\d*\/perl|\/usr\/local\/cpanel)/,@INC);'=>0);
  12.     print "Checking $script...";
  13.     if (! -e $script) { print 'not installed (ok) Done' . "\n"; next(); }
  14.     open(SS,'<',$script);
  15.     while(my $l = <SS>) {
  16.             foreach my $a (keys %TA) {
  17.                     if (index($l,$a) > -1) { delete $TA{$a}; next(); }
  18.             }
  19.     }
  20.     close(SS);
  21.     if ((scalar keys %TA) > 0) {
  22.         $notok++;
  23.             print "unsafe";
  24.     } else {
  25.         print "safe";
  26.     }
  27.     print "..Done\n";
  28. }
  29. if ($notok) { print "Your system has not been patched.  Please run
  30. http://layer1.cpanel.net/installer/sec092406.pl \n"; } else { print "Your system has been
  31. patched!\n"; }
Advertisement
Add Comment
Please, Sign In to add comment