begin process at 2012 05 27 18:25:21
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Réseaux & Internet

 > SCANNER D'IP

SCANNER D'IP


 Information sur la source

Note :
5,5 / 10 - par 2 personnes
5,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Réseaux & Internet Niveau :Initié Date de création :04/09/2004 Date de mise à jour :04/11/2004 17:22:17 Vu / téléchargé :7 266 / 874

Auteur : ekinoks

Ecrire un message privé
Site perso
Commentaire sur cette source (24)
Ajouter un commentaire et/ou une note

 Description

Ce programe scane une plage d'ip et cherche dans celle ci quel son celle qui otorise une connection par le port 21 (FTP) en temps qu'anonymous.

Source

  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <windows.h>
  • #include <Wininet.h>
  • HINTERNET internet_ok;
  • HANDLE thboot;
  • int tmp,tmp2,tmp3,tmp4,tmp5,nb;
  • char ftp_ip[16];
  • char ftp_ip2[16];
  • char ftp_ip3[16];
  • char ftp_ip4[16];
  • char ftp_ip5[16];
  • conint()
  • {
  • internet_ok = InternetOpen("", 1, "", "", 0);
  • if ( internet_ok == NULL )
  • {
  • printf("Impossible de se connecter a internet.\n");
  • return(1);
  • } else
  • {
  • printf("Connection a internet Reussi.\n");
  • return(0);
  • }
  • }
  • DWORD WINAPI conftp(LPVOID ftp_ipnb_tmp)
  • {
  • char * ftp_ipnb = (char*) ftp_ipnb_tmp;
  • HINTERNET ftp_ok;
  • char ftp_ip_bis[16];
  • if (!strcmp(ftp_ipnb,"1"))
  • {
  • strcpy(ftp_ip_bis,ftp_ip);
  • tmp=0;
  • }else if (!strcmp(ftp_ipnb,"2"))
  • {
  • strcpy(ftp_ip_bis,ftp_ip2);
  • tmp2=0;
  • }else if (!strcmp(ftp_ipnb,"3"))
  • {
  • strcpy(ftp_ip_bis,ftp_ip3);
  • tmp3=0;
  • }else if (!strcmp(ftp_ipnb,"4"))
  • {
  • strcpy(ftp_ip_bis,ftp_ip4);
  • tmp4=0;
  • }else if (!strcmp(ftp_ipnb,"5"))
  • {
  • strcpy(ftp_ip_bis,ftp_ip5);
  • tmp5=0;
  • }else
  • {
  • nb--;
  • printf("ERREUR");
  • system("pause");
  • return(0);
  • }
  • ftp_ok = InternetConnect ( internet_ok, ftp_ip_bis, 21, "anonymous", "aze@aze.com", INTERNET_SERVICE_FTP, 0, 0);
  • if ( ftp_ok == NULL )
  • {
  • //DWORD errorCode = GetLastError();
  • //printf("Impossible de se connecter au FTP(%d).\n",errorCode);
  • //printf("Impossible : %d\n",errorCode);
  • nb--;
  • return(1);
  • } else
  • {
  • printf("\t\t\t\t%s\n",ftp_ip_bis);
  • nb--;
  • InternetCloseHandle(ftp_ok);
  • return(0);
  • }
  • }
  • main()
  • {
  • DWORD deb, fin;
  • int d1,d2,d3,d4,f1,f2,f3,f4,tmp_tmp;
  • if (conint() == 1) //connection a internet
  • return(1);
  • printf("Scan de l'ip : ");
  • scanf("%d.%d.%d.%d",&d1,&d2,&d3,&d4);
  • printf("A l'ip : ");
  • scanf("%d.%d.%d.%d",&f1,&f2,&f3,&f4);
  • printf("\nScan de d'ip %d.%d.%d.%d a l'ip %d.%d.%d.%d :\n",d1,d2,d3,d4,f1,f2,f3,f4);
  • deb = GetTickCount(); // debut du crono //
  • if (d1!=f1)
  • {
  • for(;d1<=f1;d1++)
  • {
  • for(;d2<256;d2++)
  • {
  • for(;d3<256;d3++)
  • {
  • for(;d4<256;d4++)
  • {
  • while(tmp_tmp == 0)
  • {
  • while (nb>800)
  • sleep(500);
  • if (tmp == 0)
  • {
  • tmp=tmp_tmp=1;
  • sprintf(ftp_ip,"%d.%d.%d.%d",d1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
  • }else if (tmp2 == 0)
  • {
  • tmp2=tmp_tmp=1;
  • sprintf(ftp_ip2,"%d.%d.%d.%d",d1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
  • }else if (tmp3 == 0)
  • {
  • tmp3=tmp_tmp=1;
  • sprintf(ftp_ip3,"%d.%d.%d.%d",d1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
  • }else if (tmp4 == 0)
  • {
  • tmp4=tmp_tmp=1;
  • sprintf(ftp_ip4,"%d.%d.%d.%d",d1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
  • }else if (tmp5 == 0)
  • {
  • tmp5=tmp_tmp=1;
  • sprintf(ftp_ip5,"%d.%d.%d.%d",d1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
  • } else
  • sleep(1);
  • }
  • tmp_tmp = 0;
  • }
  • d4=0;
  • }
  • d3=0;
  • }
  • d2=0;
  • }
  • }
  • if (d2!=f2)
  • {
  • for(;d2<=f2;d2++)
  • {
  • for(;d3<256;d3++)
  • {
  • for(;d4<256;d4++)
  • {
  • while(tmp_tmp == 0)
  • {
  • while (nb>800)
  • sleep(500);
  • if (tmp == 0)
  • {
  • tmp=tmp_tmp=1;
  • sprintf(ftp_ip,"%d.%d.%d.%d",f1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
  • }else if (tmp2 == 0)
  • {
  • tmp2=tmp_tmp=1;
  • sprintf(ftp_ip2,"%d.%d.%d.%d",f1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
  • }else if (tmp3 == 0)
  • {
  • tmp3=tmp_tmp=1;
  • sprintf(ftp_ip3,"%d.%d.%d.%d",f1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
  • }else if (tmp4 == 0)
  • {
  • tmp4=tmp_tmp=1;
  • sprintf(ftp_ip4,"%d.%d.%d.%d",f1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
  • }else if (tmp5 == 0)
  • {
  • tmp5=tmp_tmp=1;
  • sprintf(ftp_ip5,"%d.%d.%d.%d",f1,d2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
  • } else
  • sleep(1);
  • }
  • tmp_tmp = 0;
  • }
  • d4=0;
  • }
  • d3=0;
  • }
  • }
  • if (d3!=f3)
  • {
  • for(;d3<=f3;d3++)
  • {
  • for(;d4<256;d4++)
  • {
  • while(tmp_tmp == 0)
  • {
  • while (nb>800)
  • sleep(500);
  • if (tmp == 0)
  • {
  • tmp=tmp_tmp=1;
  • sprintf(ftp_ip,"%d.%d.%d.%d",f1,f2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
  • }else if (tmp2 == 0)
  • {
  • tmp2=tmp_tmp=1;
  • sprintf(ftp_ip2,"%d.%d.%d.%d",f1,f2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
  • }else if (tmp3 == 0)
  • {
  • tmp3=tmp_tmp=1;
  • sprintf(ftp_ip3,"%d.%d.%d.%d",f1,f2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
  • }else if (tmp4 == 0)
  • {
  • tmp4=tmp_tmp=1;
  • sprintf(ftp_ip4,"%d.%d.%d.%d",f1,f2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
  • }else if (tmp5 == 0)
  • {
  • tmp5=tmp_tmp=1;
  • sprintf(ftp_ip5,"%d.%d.%d.%d",f1,f2,d3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
  • } else
  • sleep(1);
  • }
  • tmp_tmp = 0;
  • }
  • d4=0;
  • }
  • }
  • if (d4!=f4)
  • {
  • for(;d4<=f4;d4++)
  • {
  • while(tmp_tmp == 0)
  • {
  • while (nb>800)
  • sleep(500);
  • if (tmp == 0)
  • {
  • tmp=tmp_tmp=1;
  • sprintf(ftp_ip,"%d.%d.%d.%d",f1,f2,f3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
  • }else if (tmp2 == 0)
  • {
  • tmp2=tmp_tmp=1;
  • sprintf(ftp_ip2,"%d.%d.%d.%d",f1,f2,f3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
  • }else if (tmp3 == 0)
  • {
  • tmp3=tmp_tmp=1;
  • sprintf(ftp_ip3,"%d.%d.%d.%d",f1,f2,f3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
  • }else if (tmp4 == 0)
  • {
  • tmp4=tmp_tmp=1;
  • sprintf(ftp_ip4,"%d.%d.%d.%d",f1,f2,f3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
  • }else if (tmp5 == 0)
  • {
  • tmp5=tmp_tmp=1;
  • sprintf(ftp_ip5,"%d.%d.%d.%d",f1,f2,f3,d4);
  • nb++;
  • while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
  • } else
  • sleep(1);
  • }
  • tmp_tmp = 0;
  • }
  • }
  • fin = GetTickCount(); // debut du crono //
  • printf("Tout les thread lancer en %d Ms\n",fin-deb);
  • while(nb!=0)
  • sleep(500);
  • fin = GetTickCount(); // debut du crono //
  • printf("Scan fini en %d Ms\n",fin-deb);
  • system("PAUSE");
  • }
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <Wininet.h>

HINTERNET internet_ok;
HANDLE thboot;
int tmp,tmp2,tmp3,tmp4,tmp5,nb;
char ftp_ip[16];
char ftp_ip2[16];
char ftp_ip3[16]; 
char ftp_ip4[16]; 
char ftp_ip5[16]; 
   
conint()
{
    internet_ok = InternetOpen("", 1, "", "", 0);
	if ( internet_ok == NULL )
	{ 
        printf("Impossible de se connecter a internet.\n");
        return(1);
    } else
    {
        printf("Connection a internet Reussi.\n");
        return(0);
    }    
}     

DWORD WINAPI conftp(LPVOID ftp_ipnb_tmp)
{
    char * ftp_ipnb = (char*) ftp_ipnb_tmp;
    HINTERNET ftp_ok;
    char ftp_ip_bis[16];
    
    if (!strcmp(ftp_ipnb,"1"))
    {
        strcpy(ftp_ip_bis,ftp_ip);
        tmp=0;
    }else if (!strcmp(ftp_ipnb,"2"))
    {
        strcpy(ftp_ip_bis,ftp_ip2);
        tmp2=0;
    }else if (!strcmp(ftp_ipnb,"3"))
    {
        strcpy(ftp_ip_bis,ftp_ip3);
        tmp3=0;
    }else if (!strcmp(ftp_ipnb,"4"))
    {
        strcpy(ftp_ip_bis,ftp_ip4);
        tmp4=0;
    }else if (!strcmp(ftp_ipnb,"5"))
    {
        strcpy(ftp_ip_bis,ftp_ip5);
        tmp5=0;
    }else
    {
        nb--;
        printf("ERREUR");
        system("pause");
        return(0);
    }
    
    ftp_ok = InternetConnect ( internet_ok, ftp_ip_bis, 21, "anonymous", "aze@aze.com", INTERNET_SERVICE_FTP, 0, 0);  
    if ( ftp_ok == NULL )
    { 
        //DWORD errorCode = GetLastError();
        //printf("Impossible de se connecter au FTP(%d).\n",errorCode);
        //printf("Impossible : %d\n",errorCode);
        nb--;
        return(1);
    } else
    {
        printf("\t\t\t\t%s\n",ftp_ip_bis);
        nb--;
        InternetCloseHandle(ftp_ok);
        return(0); 
    }         
}    

main()
{
    DWORD deb, fin;
    int d1,d2,d3,d4,f1,f2,f3,f4,tmp_tmp;
    
    if (conint() == 1)       //connection a internet
        return(1);
    
    printf("Scan de l'ip : ");
    scanf("%d.%d.%d.%d",&d1,&d2,&d3,&d4);
    printf("A l'ip : ");
    scanf("%d.%d.%d.%d",&f1,&f2,&f3,&f4);
    printf("\nScan de d'ip %d.%d.%d.%d a l'ip %d.%d.%d.%d :\n",d1,d2,d3,d4,f1,f2,f3,f4);
    deb = GetTickCount();       //   debut du crono  //
    if (d1!=f1)
    {
        for(;d1<=f1;d1++)
        {
            for(;d2<256;d2++)
            {
                for(;d3<256;d3++)
                {
                    for(;d4<256;d4++)
                    {
                        while(tmp_tmp == 0)
                        {
                            while (nb>800)
                            sleep(500);
                            if (tmp == 0)
                            {
                                tmp=tmp_tmp=1;
                                sprintf(ftp_ip,"%d.%d.%d.%d",d1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
                            }else if (tmp2 == 0)
                            {
                                tmp2=tmp_tmp=1;
                                sprintf(ftp_ip2,"%d.%d.%d.%d",d1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
                            }else if (tmp3 == 0)
                            {
                                tmp3=tmp_tmp=1;
                                sprintf(ftp_ip3,"%d.%d.%d.%d",d1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
                            }else if (tmp4 == 0)
                            {
                                tmp4=tmp_tmp=1;
                                sprintf(ftp_ip4,"%d.%d.%d.%d",d1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
                            }else if (tmp5 == 0)
                            {
                                tmp5=tmp_tmp=1;
                                sprintf(ftp_ip5,"%d.%d.%d.%d",d1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
                            } else
                            sleep(1);
                        }
                        tmp_tmp = 0;
                        
                    }
                    d4=0;
                }
                d3=0;
            }
            d2=0;
        } 
    }    
        
    if (d2!=f2)
    {
        for(;d2<=f2;d2++)
        {
            for(;d3<256;d3++)
            {
                for(;d4<256;d4++)
                {
                        while(tmp_tmp == 0)
                        {
                            while (nb>800)
                            sleep(500);
                            if (tmp == 0)
                            {
                                tmp=tmp_tmp=1;
                                sprintf(ftp_ip,"%d.%d.%d.%d",f1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
                            }else if (tmp2 == 0)
                            {
                                tmp2=tmp_tmp=1;
                                sprintf(ftp_ip2,"%d.%d.%d.%d",f1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
                            }else if (tmp3 == 0)
                            {
                                tmp3=tmp_tmp=1;
                                sprintf(ftp_ip3,"%d.%d.%d.%d",f1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
                            }else if (tmp4 == 0)
                            {
                                tmp4=tmp_tmp=1;
                                sprintf(ftp_ip4,"%d.%d.%d.%d",f1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
                            }else if (tmp5 == 0)
                            {
                                tmp5=tmp_tmp=1;
                                sprintf(ftp_ip5,"%d.%d.%d.%d",f1,d2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
                            } else
                            sleep(1);    
                        }
                        tmp_tmp = 0;
                }
                d4=0;
            }
            d3=0;
        }
    }     
        
    if (d3!=f3)
    {
        for(;d3<=f3;d3++)
        {
            for(;d4<256;d4++)
            {
                        while(tmp_tmp == 0)
                        {
                            while (nb>800)
                            sleep(500);
                            if (tmp == 0)
                            {
                                tmp=tmp_tmp=1;
                                sprintf(ftp_ip,"%d.%d.%d.%d",f1,f2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
                            }else if (tmp2 == 0)
                            {
                                tmp2=tmp_tmp=1;
                                sprintf(ftp_ip2,"%d.%d.%d.%d",f1,f2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
                            }else if (tmp3 == 0)
                            {
                                tmp3=tmp_tmp=1;
                                sprintf(ftp_ip3,"%d.%d.%d.%d",f1,f2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
                            }else if (tmp4 == 0)
                            {
                                tmp4=tmp_tmp=1;
                                sprintf(ftp_ip4,"%d.%d.%d.%d",f1,f2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
                            }else if (tmp5 == 0)
                            {
                                tmp5=tmp_tmp=1;
                                sprintf(ftp_ip5,"%d.%d.%d.%d",f1,f2,d3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
                            } else
                            sleep(1);    
                        }
                        tmp_tmp = 0;
            }
            d4=0;
        }
    }        

    if (d4!=f4)
    {
        for(;d4<=f4;d4++)
        {
                        while(tmp_tmp == 0)
                        {
                            while (nb>800)
                            sleep(500);
                            if (tmp == 0)
                            {
                                tmp=tmp_tmp=1;
                                sprintf(ftp_ip,"%d.%d.%d.%d",f1,f2,f3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"1", 0, NULL)) == NULL);
                            }else if (tmp2 == 0)
                            {
                                tmp2=tmp_tmp=1;
                                sprintf(ftp_ip2,"%d.%d.%d.%d",f1,f2,f3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
                            }else if (tmp3 == 0)
                            {
                                tmp3=tmp_tmp=1;
                                sprintf(ftp_ip3,"%d.%d.%d.%d",f1,f2,f3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"3", 0, NULL)) == NULL);
                            }else if (tmp4 == 0)
                            {
                                tmp4=tmp_tmp=1;
                                sprintf(ftp_ip4,"%d.%d.%d.%d",f1,f2,f3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"4", 0, NULL)) == NULL);
                            }else if (tmp5 == 0)
                            {
                                tmp5=tmp_tmp=1;
                                sprintf(ftp_ip5,"%d.%d.%d.%d",f1,f2,f3,d4);
                                nb++;
                                while((thboot = CreateThread(NULL, 0, conftp , &"5", 0, NULL)) == NULL);
                            } else
                            sleep(1);    
                        }
                        tmp_tmp = 0;
        }
    }     
    fin = GetTickCount();       //   debut du crono  //
    printf("Tout les thread lancer en %d Ms\n",fin-deb);   
    while(nb!=0)
    sleep(500);
    fin = GetTickCount();       //   debut du crono  //
    printf("Scan fini en %d Ms\n",fin-deb);
    system("PAUSE");
}

 Conclusion

Si vous avez des idéés pour acceleré le programe, n'esiter pas a le dir pour que je puisse l'updater.
Elle scanne actuellement 2805 IP en 87Sec.

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !
  • main.cTélécharger ce fichier [Réservé aux membres club]Voir ce fichier11 694 octets
  • Projet1.devTélécharger ce fichier [Réservé aux membres club]910 octets
  • Projet1.exeTélécharger ce fichier [Réservé aux membres club]405 586 octets

Télécharger le zip


 Historique

04 septembre 2004 21:43:09 :
Ferme le HANDLE si le scanner arrive a ce connecter a une ip. Merci a aardman pour me l'avoir fait remarquer
05 septembre 2004 15:31:04 :
1) Rectification du cas ou la creation du thread echou, ce qui créé une boucle infini. Merci a NitRic pour me l'avoir fait remarquer. 2) Déplacement de l'attente "while(tmp == 1);" avent la création du thread au lieu d&#8217;après ce qui a pour cause d&#8217;accélère très légèrement la rapidité du programme.
06 septembre 2004 15:33:28 :
Augmentate la rapidité du programe, il scan maintenent 4 foi plus rapidement qu'avent.
04 novembre 2004 17:22:18 :
+ rapide - gourmand

 Sources du même auteur

Source avec Zip PARTAGER SA CONNEXION INTERNET
Source avec Zip PETITE CONSOL
Source avec Zip PROGRAMME DE TRI

 Sources de la même categorie

Source avec Zip Source avec une capture MINI SERVEUR HTTP [WINDOWS] par ganjarasta
Source avec Zip Source avec une capture CLIENT DE TEST MODBUS TCP par brunovan
Source avec Zip Source avec une capture SCANIP [ARP / ICMP] par ganjarasta
Source avec Zip Source avec une capture TRACEROUTE [WINPCAP] par ganjarasta
Source avec Zip SERVEUR MULTITHREAD [LINUX/WIN] par nipepsinicolas

Commentaires et avis

Commentaire de eRoZion le 04/09/2004 19:15:45

Ca l'air cool.
Je vais regarder ça.
Merci du source.

Commentaire de coucou747 le 04/09/2004 20:19:29 administrateur CS

il manque juste deux ou trois points : les ip de la nasa et du FBI pour le pas frapper a la mauvaise porte, vérifier l'accès en écriture, et l'envois de mail (anonyme évidement) vers les boites de ces potes avec un mail crypté disant : "j'ai déposé mes fichiers illégaux à : IP" enfin voila, je trouves pas ça très cool...

21 c'est un port qui peut être forcé parait-il facilement...

enfin voila, cet outil peut être utilisé avec de plus ou moins bonnes intentions... et rien que pour ça je ne l'aurais pas posté...

Commentaire de BlackGoddess le 04/09/2004 20:21:33

le scan d'ip, c'est mal :o

Commentaire de coucou747 le 04/09/2004 20:25:52 administrateur CS

le scann c'ets pas mauvais en soi, mais l'utilisation peut être (est souvent) faite par des personnes mals-intentionnés...

Commentaire de aardman le 04/09/2004 20:52:05

Salut,
Ekinoks, faudrait penser a fermer les handles de temp en temp ...
Sinon pour accelerer le programme, je pense qu'il faudrait utiliser les sockets.

Commentaire de ekinoks le 04/09/2004 21:20:49

Avent de faire ce programe, je me suis grandement renssegnier sur la legalité des scans d'ip.
Le scan d'ip est finalement autorisé par la loi.

coucou747> Mon programe cherche que des IP donc on peu se connecter en anonymous et donc telecharger les fichiers pressent. Mon but n'est pas de trouvez des IP donc l'upload est autorisé, ce qui d'ailleur son c'est type de scanneur qui son utilisé avec des mauvaise intention.

aardman> he... les handles ne se ferme pas tout seul quant la fonction se termine ?

Commentaire de ekinoks le 04/09/2004 21:53:16

Je vien d'updater le programe, j'avais oublié de fermer les handles si la connection a une ip reussisé.
Merci aardman de me l'avoir fait remarqué

Commentaire de NitRic le 05/09/2004 09:26:08

Perso, j'utiliserais WaitForSingleObject() plutôt que des boucles, faut faire gaffe avec les threads/ressources partagées/... et les boucles infinies.

Je validerais aussi la création du thread, imagine que le thread n'a pu être créé >> boucle infinie ....



~(.:: NitRic ::)~

Commentaire de ekinoks le 05/09/2004 14:50:18

NitRic :
1) a vrai dir, je ne peu pas utilisé WaitForSingleObject() car je créé tout mes thread a partir du meme HANDLE ("thboot").
2) ha oui c'est vrai, j'ai oublié le cas ou la creation du thread echou, je vais rectifier ca ... merci.

Commentaire de benozor77 le 05/09/2004 20:59:01

Bonjour/Bonsoir,

Lors de la compilation, j'ai ces 'erreurs' :
C:\DOCUME~1\*****\LOCALS~1\Temp\cck9daaa.o(.text+0x9d):main.c: undefined reference to `InternetOpenA@20'
C:\DOCUME~1\*****\LOCALS~1\Temp\cck9daaa.o(.text+0x14a):main.c: undefined reference to `InternetConnectA@32'
C:\DOCUME~1\*****\LOCALS~1\Temp\cck9daaa.o(.text+0x18a):main.c: undefined reference to `InternetCloseHandle@4'

Si quelqu'un pouvait m'en dire plus.

Commentaire de ekinoks le 05/09/2004 21:05:58

tu utilise surment dev-c++, si c'est le cas :
Ouvre "Projet1.dev" va dans "projet", "option du projet", onglet "paramétre", clique sur "ajouter fichier" et selection le fichier "libwininet.a" dans le dossier "lib" de la ou tu a installez dev-c++, d'origine c'est : "c://Dev-Cpp/lib/libwininet.a"

Commentaire de ekinoks le 06/09/2004 15:44:11

Je viens de faire une mise a jour, j'ais trouvé une solution pour augmenté la rapidité du programme par 4.
Avent cette mise a jour, le programme attendait que le dernier thread copie la valeur qui se trouvé dans "ftp_ip" avent d'en lancé un autre. a cette endroit, le programme perdait beaucoup de temps :^/
C'est pour quoi, j'ai créé 5 variables qui jouerons le meme role que "ftp_ip", C'est a dire que le 1ere thread copiera la valeur de  ftp_ip pendent que le 2eme copiera la valeur de "ftp_ip2" le 3eme celle de "ftp_ip3 " etc... créant ainsi une boucle de 5 variables. De cette manière, les variables ftp_ipx on le temps de transmettre leur valeur au thread et le programme n'a plus a attendre betement.

Commentaire de abdoulax le 08/09/2004 22:57:26

Pour l'incrémentation des IP tu pourrais utilisé les ip long comme ça tu as just à ajouter 1 à chaque fois als que la ça lance des boucles et encore des boucles .

Have fun

Commentaire de NitRic le 09/09/2004 02:20:55

Qu'est-ce que c'est que ca !?

---------------------
while((thboot = CreateThread(NULL, 0, conftp , &"2", 0, NULL)) == NULL);
---------------------

Désolé mais, c'est `affreux` comme ligne

Petite précision:
DWORD == unsigned long == %lu != %d

etc ... etc ...

Si tu veux un bon conseil, limite le nombre de thread simultané. Impose une limite de ... dison 60-200 maximum et patiente(wait), quand un thread est terminé, tu en lance un nouveau et ainsi de suite.

Ce n'est pas avec un while ( (var = CreateThread(...)) ); que tu vas avoir des performances optimals. Plus tu charge le système, moin c'est performant & safe.

Tes ftp_ip, ftp_ip2, ... Tu vas avoir des surprises un jour ou l'autre ...

Extrait de mon premier message:
------------------------------------
faut faire gaffe avec les threads/ressources partagées/...
------------------------------------

...

~(.:: NitRic ::.)~

Commentaire de ekinoks le 09/09/2004 15:36:08

abdoulax> les ip long ? ca marche comment ca ?

NitRic> bha... a vrai dir, j'ai fait des tests pour savoir ou je perdais tout mon temps et ou mon cpu travailler le plus...
Mes experriences on montré que avent qu'un FTP reponde, il se passer une 20ene de seconde, sans utilisé le CPU. C'est pour quoi j'ai fait des CreateThread sans limite...

Commentaire de BlackGoddess le 09/09/2004 15:57:47

while(nb!=0); >> sans utiliser le CPU ????? jy crois pas un instant avec ca .... (notons au passage qu'il manque la gestion de la synchro ...)

Commentaire de ekinoks le 09/09/2004 22:10:58

BlackGoddess> Oui, comme le programe fonctionne actuelement, 100% du cpu est utilisé avec ces boucle qui serve d'attente comme celle ci.
Cela ralentiré t'il le programe sachent que mes threads n'utilise presque pas le cpu mais attende une reponsse des FTP ?

Commentaire de NitRic le 09/09/2004 22:32:28

Sous Windows il existe tout ce dont nous avons besoin pour le multithreading, synchrnonisation, etc ..., etc ...

Pourquoi ne pas les utiliser !?



~(.:: NitRic ::.)~

Commentaire de ekinoks le 10/09/2004 23:13:35

NitRic> hu ? auré tu une documentation sur tout ca en francais pour que je puisse amelioré la source ?

Commentaire de abdoulax le 11/09/2004 00:29:27

Nitric à parfaitement raison ...

Commentaire de NitRic le 11/09/2004 00:34:55

ekinoks, évidement

http://bob.developpez.com/tutapiwin/article_46.php

Commentaire de abdoulax le 11/09/2004 02:23:50

Lol quelle rapidité de réponse.

Mouai sinon je vien just de posté une source comme exemple avec des long ip, donc va voir si ça t'interresse ...

Commentaire de Cypi007 le 21/02/2008 17:08:01 10/10

Bien mais avec le logiciel whois tu peux trouver tous les ip possibles puis avec ton logiciel sa peut devenir trés dangereux

Commentaire de Cypi007 le 21/02/2008 17:25:19

par exemple je connais les ip de ton site son
Domain servers in listed order:
NF1.NO-IP.COM 204.16.252.8
NF2.NO-IP.COM 216.66.37.12
NF3.NO-IP.COM 70.86.196.66
NF4.NO-IP.COM 69.65.5.122
tout sa grace whois puis si je le combine avec ton scanneur
tu te rend compte c'est pas que c'est legal ou pas mais c'est dangereux pour tous le monde

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,499 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales