ImageVerifierCode 换一换
格式:DOCX , 页数:76 ,大小:28.19KB ,
资源ID:26996226      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/26996226.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(snort 免费的软件.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

snort 免费的软件.docx

1、snort 免费的软件这是一个免费的软件,你可以在GUN通用公共许可协议系统下进行重新配置或修改,通过免费软件开发发行版本2或你自己买的有使用权的任意一个都可以。这个项目是分散式的,比较有用,本软件不提供任何保证,甚至不会包括可售性和适用于任何特定目的的保证。可以看得相关GUN通用公共许可协议的更多详细资料。你应该接受一个复制的GUN通用公共许可协议在项目以外。#include log.hextern OptTreeNode *otn_tmp; /* global ptr to current rule data */char *data_dump_buffer; /* printout bu

2、ffer for PrintNetData */int dump_ready; /* flag to indicate status of printout buffer */int dump_size; /* size of printout buffer */static unsigned char ezero6; /* crap for ARP */* * Function: OpenLogFile() * * Purpose: Create the log directory and file to put the packet log into. * This function su

3、cks, Ive got to find a better way to do this * this stuff. * * Arguments: None. * * Returns: 0 on success, exits on error */int OpenLogFile(int mode, Packet * p) char log_pathSTD_BUF+1; /* path to log file */ char log_fileSTD_BUF+1; /* name of log file */ char proto5; /* logged packet protocol */ /*

4、 zero out our buffers */ bzero(char *) log_path, STD_BUF+1); bzero(char *) log_file, STD_BUF+1); bzero(char *) proto, 5); if(mode = GENERIC_LOG) snprintf(log_file, STD_BUF, %s%s/log, chrootdir = NULL ? : chrootdir, pv.log_dir); if(log_ptr = fopen(log_file, a) = NULL) FatalError(ERROR: OpenLogFile()

5、= fopen(%s) log file: %sn, log_file, strerror(errno); return 0; if(mode = DUMP) snprintf(log_file, STD_BUF, %s%s/PACKET_FRAG, chrootdir = NULL ? : chrootdir, pv.log_dir); if(log_ptr = fopen(log_file, a) = NULL) FatalError(ERROR: OpenLogFile() = fopen(%s) log file: %sn, log_file, strerror(errno); ret

6、urn 0; if(mode = BOGUS) snprintf(log_file, STD_BUF, %s%s/PACKET_BOGUS, chrootdir = NULL ? : chrootdir, pv.log_dir); if(log_ptr = fopen(log_file, a) = NULL) FatalError(ERROR: OpenLogFile() = fopen(%s) log file: %sn, log_file, strerror(errno); return 0; if(mode = NON_IP) snprintf(log_file, STD_BUF, %s

7、%s/PACKET_NONIP, chrootdir = NULL ? : chrootdir, pv.log_dir); if(log_ptr = fopen(log_file, a) = NULL) FatalError(ERROR: OpenLogFile() = fopen(%s) log file: %sn, log_file, strerror(errno); return 0; if(mode = ARP) snprintf(log_file, STD_BUF, %s%s/ARP, chrootdir = NULL ? : chrootdir, pv.log_dir); if(l

8、og_ptr = fopen(log_file, a) = NULL) FatalError(ERROR: OpenLogFile() = fopen(%s) log file: %sn, log_file, strerror(errno); return 0; if(otn_tmp != NULL) if(otn_tmp-logto != NULL) snprintf(log_file, STD_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, otn_tmp-logto); if(log_ptr = fopen(log_fi

9、le, a) = NULL) FatalError(ERROR: OpenLogFile() = fopen(%s) log file: %sn, log_file, strerror(errno); return 0; /* figure out which way this packet is headed in relation to the homenet */ if(p-iph-ip_dst.s_addr & mask) = pv.homenet) if(p-iph-ip_src.s_addr & mask) != pv.homenet) snprintf(log_path, STD

10、_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, inet_ntoa(p-iph-ip_src); else if(p-sp = p-dp) snprintf(log_path, STD_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, inet_ntoa(p-iph-ip_src); else snprintf(log_path, STD_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, ine

11、t_ntoa(p-iph-ip_dst); else if(p-iph-ip_src.s_addr & mask) = pv.homenet) snprintf(log_path, STD_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, inet_ntoa(p-iph-ip_dst); else if(p-sp = p-dp) snprintf(log_path, STD_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, inet_ntoa(p-iph-ip_s

12、rc); else snprintf(log_path, STD_BUF, %s%s/%s, chrootdir = NULL ? : chrootdir, pv.log_dir, inet_ntoa(p-iph-ip_dst); #ifdef DEBUG ErrorMessage(Creating directory: %sn, log_path);#endif /* build the log directory */ if(mkdir(log_path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) if(errno != EEXIST) FatalErr

13、or(ERROR: OpenLogFile() = mkdir(%s) log directory: %sn, log_path, strerror(errno); #ifdef DEBUG printf(Directory Created!n);#endif /* build the log filename */ if(p-iph-ip_proto = IPPROTO_TCP | p-iph-ip_proto = IPPROTO_UDP) if(p-frag_flag) #ifdef WIN32 snprintf(log_file, STD_BUF, %s/IP_FRAG.ids, log

14、_path);#else snprintf(log_file, STD_BUF, %s/IP_FRAG, log_path);#endif else if(p-sp = p-dp) #ifdef WIN32 snprintf(log_file, STD_BUF, %s/%s_%d-%d.ids, log_path,#else snprintf(log_file, STD_BUF, %s/%s:%d-%d, log_path,#endif protocol_namesp-iph-ip_proto, p-sp, p-dp); else #ifdef WIN32 snprintf(log_file,

15、 STD_BUF, %s/%s_%d-%d.ids, log_path,#else snprintf(log_file, STD_BUF, %s/%s:%d-%d, log_path,#endif protocol_namesp-iph-ip_proto, p-dp, p-sp); else if(p-frag_flag) #ifdef WIN32 snprintf(log_file, STD_BUF, %s/IP_FRAG.ids, log_path);#else snprintf(log_file, STD_BUF, %s/IP_FRAG, log_path);#endif else if

16、(p-iph-ip_proto = IPPROTO_ICMP) #ifdef WIN32 snprintf(log_file, STD_BUF, %s/%s_%s.ids, log_path, ICMP, IcmpFileName(p);#else snprintf(log_file, STD_BUF, %s/%s_%s, log_path, ICMP, IcmpFileName(p);#endif else #ifdef WIN32 snprintf(log_file, STD_BUF, %s/PROTO%d.ids, log_path, p-iph-ip_proto);#else snpr

17、intf(log_file, STD_BUF, %s/PROTO%d, log_path, p-iph-ip_proto);#endif #ifdef DEBUG printf(Opening file: %sn, log_file);#endif /* finally open the log file */ if(log_ptr = fopen(log_file, a) = NULL) FatalError(ERROR: OpenLogFile() = fopen(%s) log file: %sn, log_file, strerror(errno); #ifdef DEBUG prin

18、tf(File opened.n);#endif return 0;/* * Function: PrintNetData(FILE *, u_char *,int) * * Purpose: Do a side by side dump of a buffer, hex dump of buffer bytes on * the left, decoded ASCII on the right. * * Arguments: fp = ptr to stream to print to * start = pointer to buffer data * len = length of da

19、ta buffer * * Returns: void function */void PrintNetData(FILE * fp, u_char * start, const int len) char *end; /* ptr to buffer end */ int i; /* counter */ int j; /* counter */ int dbuf_size; /* data buffer size */ int done; /* flag */ char *data; /* index pointer */ char *frame_ptr; /* we use 66 byt

20、e frames for a printed line */ char *d_ptr; /* data pointer into the frame */ char *c_ptr; /* char pointer into the frame */ char conv = 0123456789ABCDEF; /* xlation lookup table */ /* initialization */ done = 0; if(start = NULL) printf(Got NULL ptr in PrintNetData()n); return; /* zero, print a and

21、get out */ if(!len) fputc(n, fp); return; /* * if weve already prepared this particular data buffer, just print it * out again to save time */ if(dump_ready) fwrite(data_dump_buffer, dump_size, 1, fp); fflush(fp); return; end = start + (len - 1); /* set the end of buffer ptr */ if(len pv.mtus0) if(p

22、v.verbose_flag) printf(Got bogus buffer length (%d) for PrintNetData, defaulting to 16 bytes!n, len); if(pv.verbose_bytedump_flag = 1) dbuf_size = (FRAME_SIZE + 8) + (FRAME_SIZE + 8) + 1; else dbuf_size = FRAME_SIZE + FRAME_SIZE + 1; /* dbuf_size = 66 + 67; */ end = start + 15; else if(pv.verbose_by

23、tedump_flag = 1) /* figure out how big the printout data buffer has to be */ dbuf_size = (len / 16) * (FRAME_SIZE + 8) + (FRAME_SIZE + 8) + 1; else /* figure out how big the printout data buffer has to be */ dbuf_size = (len / 16) * FRAME_SIZE) + FRAME_SIZE + 1; /* dbuf_size = (len / 16) * 66) + 67;

24、 */ /* generate the buffer */ data_dump_buffer = (char *) malloc(dbuf_size); /* make sure it got allocated properly */ if(data_dump_buffer = NULL) ErrorMessage(Failed allocating %X bytes! (Length: %X)n, dbuf_size, len); perror(PrintNetData(); CleanExit(SIGQUIT); /* clean it out */ memset(data_dump_b

25、uffer, 0x20, dbuf_size); /* set the byte buffer pointer to step thru the data buffer */ data = start; /* set the frame pointer to the start of the printout buffer */ frame_ptr = data_dump_buffer; /* initialize counters and frame index pointers */ i = 0; j = 0; /* loop thru the whole buffer */ while(

26、!done) if(pv.verbose_bytedump_flag = 1) d_ptr = frame_ptr + 8; c_ptr = (frame_ptr + 8 + C_OFFSET); sprintf(frame_ptr, 0x%04X: , j); j += 16; else d_ptr = frame_ptr; c_ptr = (frame_ptr + C_OFFSET); /* process 16 bytes per frame */ for(i = 0; i 4); d_ptr+; /* look up the second nybble */ *d_ptr = conv

27、(*data & 0xFF) & 0x0F); d_ptr+; /* put a space in between */ *d_ptr = 0x20; d_ptr+; /* print out the char equivalent */ if(*data 0x1F & *data 0x7F) *c_ptr = (*data & 0xFF); else *c_ptr = 0x2E; c_ptr+; /* increment the pointer or finish up */ if(data end) data+; else /* finish up the buffer printout

28、and set the ready flags */ done = 1; dump_ready = 1; *c_ptr = n; c_ptr+; *c_ptr = n; c_ptr+; *c_ptr = 0; dump_size = (int) (c_ptr - data_dump_buffer); fwrite(data_dump_buffer, dump_size, 1, fp); return; *c_ptr = n; if(pv.verbose_bytedump_flag = 1) frame_ptr += (FRAME_SIZE + 8); else frame_ptr += FRAME_SIZE; /* * Function: PrintCharData(FILE *, char *,int) * * Purpose: Dump th

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1