begin process at 2010 09 04 19:30:04
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Réseau & internet

 > SCANNEUR D'IP21

SCANNEUR D'IP21


 Information sur la source

Note :
6,67 / 10 - par 3 personnes
6,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Réseau & internet Classé sous :ip, scan, scanner, ip, scanner, upload, upload, pub Niveau :Débutant Date de création :30/12/2004 Vu / téléchargé :6 865 / 267

Auteur : Bl0tCh

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

 Description

Voilà, c'est un petit scanneur de pub,

Il est en ligne de commande ce qui permet de l'utiliser en remote :

    Scanneur de Pub en ligne de commande
    Utilisable en remote

    Utilisation :
    Dans un fichier path.txt entrez les repertoires qui doivent etre checkes
    scanneur.exe ipstart ipend nbthread

Il teste l'upload, le dl avec un fichier 1mb, il met les reusltats ds results.txt

Pour le moment j'ai pas mis de compteur de vitesse mais c'est rapide, je le ferais surement quand j'aurais le temps

Source

  • import sys
  • import os.path
  • import thread
  • from ftplib import FTP
  • import time
  • from string import *
  • def testeur(i):
  • fp=[]
  • fp=open('path.txt', 'r').readlines()
  • while 1:
  • indir=1
  • upok=1
  • dlok=1
  • logged=1
  • connected=1
  • try:
  • ip=listip[0]
  • del listip[0]
  • except:
  • print 'Thread ' + i + ' termine'
  • break
  • try:
  • print 'Trying to connect on ' + ip
  • ftp=FTP(ip)
  • print 'Connected on ' + ip
  • except:
  • print 'Unabled to connect on ' + ip
  • connected=0
  • if(connected==1):
  • try:
  • print 'Trying to logon on ' + ip
  • ftp.login()
  • print 'Logged in on ' + ip
  • except:
  • print 'Unabled to logon on ' + ip
  • logged=0
  • if(logged==1 and connected==1):
  • print 'Will check directories on ' + ip
  • for currentdir in fp:
  • currentdir=currentdir[0:len(currentdir)-1]
  • indir=1
  • upok=1
  • dlok=1
  • print 'Checking ' + currentdir + ' on ' + ip
  • try:
  • ftp.cwd(currentdir)
  • except:
  • print 'Directory ' + currentdir + ' does not exists or we do not have permission on ' + ip
  • indir=0
  • if(indir==1):
  • print 'Trying to upload on ' + ip
  • up=open('mbtest.dm', 'rb')
  • try:
  • ftp.storbinary('STOR mbtest.dm', up)
  • print 'Upload succeed on ' + ip
  • except:
  • print 'Unabled to upload on ' + ip
  • upok=0
  • if(upok==1 and indir==1):
  • print 'Trying to download on ' + ip
  • try:
  • ftp.retrbinary('RETR mbtest.dm', open('testdl'+i+'.dm', 'wb').write)
  • print 'Download succeed on ' + ip
  • except:
  • print 'Unabled to download on ' + ip
  • dlok=0
  • if(dlok==1 and upok==1 and indir==1):
  • print ip + ' Ok!'
  • fp=open('results.txt', 'a').write(ip+'\nOndir : ' + currentdir + '\n')
  • break
  • if(len(sys.argv)!=4 or os.path.exists('path.txt')==False or os.path.exists('mbtest.dm')==False):
  • print """DMScan21
  • Scanneur de Pub en ligne de commande
  • Utilisable en remote
  • utilisation :
  • dans un fichier path.txt entrez les repertoire qui doivent etre checkes
  • scanneur.exe ipstart ipend nbthread
  • """
  • sys.exit()
  • else:
  • ip1=sys.argv[1]
  • ip2=sys.argv[2]
  • nbthread=int(sys.argv[3])
  • print 'Initialisation...'
  • if(os.path.exists('results.txt')==False) : open('results.txt', 'w')
  • global listip
  • listip=[]
  • firstpart=[]
  • secondpart=[]
  • thirdpart=[]
  • fourthpart=[]
  • part1=[]
  • part1=split(ip1, '.')
  • part2=[]
  • part2=split(ip2, '.')
  • if(part1[0]==part2[0]):
  • firstpart.append(part1[0])
  • egal=1
  • else:
  • if(part1[0]>part2[0]):
  • fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
  • sys.exit()
  • else:
  • while int(part1[0])<=int(part2[0]):
  • firstpart.append(part1[0])
  • part1[0]=str(int(part1[0])+1)
  • if(part1[1]==part2[1]):
  • secondpart.append(part1[1])
  • egal=1
  • else:
  • if(part1[1]>part2[1] and egal==1):
  • fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
  • sys.exit()
  • else:
  • while int(part1[1])<=int(part2[1]):
  • secondpart.append(part1[1])
  • part1[1]=str(int(part1[1])+1)
  • if(part1[2]==part2[2]):
  • thirdpart.append(part1[2])
  • egal=1
  • else:
  • if(part1[2]>part2[2] and egal==1):
  • fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
  • sys.exit()
  • else:
  • while int(part1[2])<=int(part2[2]):
  • thirdpart.append(part1[2])
  • part1[2]=str(int(part1[2])+1)
  • if(part1[3]==part2[3]):
  • fourthpart.append(part1[3])
  • else:
  • if(part1[3]>part2[3] and egal==1):
  • fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
  • sys.exit()
  • else:
  • while int(part1[3])<=int(part2[3]):
  • fourthpart.append(part1[3])
  • part1[3]=str(int(part1[3])+1)
  • for current in firstpart:
  • for current2 in secondpart:
  • for current3 in thirdpart:
  • for current4 in fourthpart:
  • listip.append(current + '.' + current2 + '.' +current3 + '.' +current4)
  • print 'Finish\n'
  • for i in range(nbthread):
  • thread.start_new_thread(testeur, (str(i+1), ))
  • print 'Thread ' + str(i+1) + ' lance'
  • time.sleep(0.15)
  • raw_input('Scan Lance !\n')
import sys
import os.path
import thread
from ftplib import FTP
import time
from string import *

def testeur(i):
    fp=[]
    fp=open('path.txt', 'r').readlines()
    while 1:
        indir=1
        upok=1
        dlok=1
        logged=1
        connected=1
        
        try:
            ip=listip[0]
            del listip[0]
        except:
            print 'Thread ' + i + ' termine'
            break
        
        try:
            print 'Trying to connect on ' + ip
            ftp=FTP(ip)
            print 'Connected on ' + ip
        except:
            print 'Unabled to connect on ' + ip
            connected=0

        if(connected==1):
            try:
                print 'Trying to logon on ' + ip
                ftp.login()
                print 'Logged in on ' + ip
            except:
                print 'Unabled to logon on ' + ip
                logged=0
            
        if(logged==1 and connected==1):
            print 'Will check directories on ' + ip
            for currentdir in fp:
                currentdir=currentdir[0:len(currentdir)-1]
                indir=1
                upok=1
                dlok=1
                print 'Checking ' + currentdir + ' on ' + ip

                try:
                    ftp.cwd(currentdir)
                except:
                    print 'Directory ' + currentdir + ' does not exists or we do not have permission on ' + ip
                    indir=0
                    
                if(indir==1):
                    print 'Trying to upload on ' + ip
                    up=open('mbtest.dm', 'rb')
                    try:
                        ftp.storbinary('STOR mbtest.dm', up)
                        print 'Upload succeed on ' + ip
                    except:
                        print 'Unabled to upload on ' + ip
                        upok=0
                        
                if(upok==1 and indir==1):
                    print 'Trying to download on ' + ip
                    try:
                        ftp.retrbinary('RETR mbtest.dm', open('testdl'+i+'.dm', 'wb').write)
                        print 'Download succeed on ' + ip
                    except:
                        print 'Unabled to download on ' + ip
                        dlok=0
                if(dlok==1 and upok==1 and indir==1):
                    print ip + ' Ok!'
                    fp=open('results.txt', 'a').write(ip+'\nOndir : ' + currentdir + '\n')
                    break

if(len(sys.argv)!=4 or os.path.exists('path.txt')==False or os.path.exists('mbtest.dm')==False):
    print """DMScan21
    
    Scanneur de Pub en ligne de commande
    Utilisable en remote

    utilisation :
    dans un fichier path.txt entrez les repertoire qui doivent etre checkes
    scanneur.exe ipstart ipend nbthread
    """
    sys.exit()
else:
    ip1=sys.argv[1]
    ip2=sys.argv[2]
    nbthread=int(sys.argv[3])

print 'Initialisation...'

if(os.path.exists('results.txt')==False) : open('results.txt', 'w')

global listip
listip=[]

firstpart=[]
secondpart=[]
thirdpart=[]
fourthpart=[]

part1=[]
part1=split(ip1, '.')
part2=[]
part2=split(ip2, '.')

if(part1[0]==part2[0]):
    firstpart.append(part1[0])
    egal=1
else:
    if(part1[0]>part2[0]):
        fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
        sys.exit()
    else:
        while int(part1[0])<=int(part2[0]):
            firstpart.append(part1[0])
            part1[0]=str(int(part1[0])+1)

if(part1[1]==part2[1]):
    secondpart.append(part1[1])
    egal=1
else:
    if(part1[1]>part2[1] and egal==1):
        fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
        sys.exit()
    else:
        while int(part1[1])<=int(part2[1]):
            secondpart.append(part1[1])
            part1[1]=str(int(part1[1])+1)

if(part1[2]==part2[2]):
    thirdpart.append(part1[2])
    egal=1
else:
    if(part1[2]>part2[2] and egal==1):
        fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
        sys.exit()
    else:
        while int(part1[2])<=int(part2[2]):
            thirdpart.append(part1[2])
            part1[2]=str(int(part1[2])+1)


if(part1[3]==part2[3]):
    fourthpart.append(part1[3])
else:
    if(part1[3]>part2[3] and egal==1):
        fin=raw_input("Erreur, premiere ip superieure. Tapez une touche pour finir")
        sys.exit()
    else:
        while int(part1[3])<=int(part2[3]):
            fourthpart.append(part1[3])
            part1[3]=str(int(part1[3])+1)

for current in firstpart:
    for current2 in secondpart:
        for current3 in thirdpart:
            for current4 in fourthpart:
                listip.append(current + '.' + current2 + '.' +current3 + '.' +current4)

print 'Finish\n'

for i in range(nbthread):
    thread.start_new_thread(testeur, (str(i+1), ))
    print 'Thread ' + str(i+1) + ' lance'
    time.sleep(0.15)

raw_input('Scan Lance !\n')

 Conclusion

Voilà, je pense qu'il y a pas de prob meme si je l'ai pas reellement utilisé ^^

PS : sachez que le scan n'est pas très bien accepté ^^

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

Source avec Zip Source avec une capture STEGANOGRAPHIE SUR BITMAP 24 BITS
Source avec Zip COMPRESSION PAR LA METHODE DE HUFFMAN
Source avec Zip PARSEUR/LECTEUR DE FICHIER BITMAP
BINDSHELL BASIQUE
Source avec Zip Source avec une capture GENERATEUR/RESOLVEUR DE LABYRINTHE

 Sources de la même categorie

Source avec une capture HTTP FORWARDER par matad0r
Source avec Zip GÉNÉRATEUR HTML POUR L'UTILISATION DE PYTHON EN CGI par Just_1
SIMPLE COMPARATEUR IPV4 EN PYTHON par erebos
TÉLCHARGEUR YOUTUBE par rezuz
Source avec Zip LIRE DES FICHIERS PCAP par KimbleMandel

 Sources en rapport avec celle ci

SIMPLE COMPARATEUR IPV4 EN PYTHON par erebos
INCRÉMENTE IP par Marnage
SCANNER D' ADRESSES MAILS (ENTREPRISES, MESSAGERIES, BOITE ... par kerneltony95
Source avec Zip SCANNER DE PORTS. par bouceka
Source avec Zip Source avec une capture SCANNEUR DE FAILLES HTTP DE SON SITE PERSO ! par thecryingshadow

Commentaires et avis

Commentaire de Bl0tCh le 31/12/2004 11:46:11

J'ai testé cette nuit, marche très bien :D

Commentaire de beuzathor le 23/04/2005 11:08:48

heu je comprend pas comment il faut compiler ce code, pourriez vous m'aider plz

Commentaire de alkove le 06/05/2005 06:07:07

pas besoin de le compiler
tu télécharge et install python http://www.python.org/download/

et tu le lance en ligne de commande :
python scanner.py

Commentaire de khetzal le 03/12/2005 15:55:58

Bah je vais encore passer pour le debutant que je suis mais j'arrive pas à faire fonctionner:

    utilisation :
    dans un fichier path.txt entrez les repertoire qui doivent etre checkes
    scanneur.exe ipstart ipend nbthread

pour les repertoires c'est ok, mais l'ipstart, end et nbthread je met ça dans le meme fichier ? je les met comment dedans ?

Commentaire de kerneltony95 le 07/09/2006 20:04:36

escuse moi mais quelle est l utilité de scanner la pub?

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Adresse IP FAI [ par dabcorp ] Bonjour , Je recherche un moyen simple d'envoyer un IP contenant l'adresse IP du FAI de mes clients via mail quand celle ci change. J'ai d&#233;ja fa ip et reseau local [ par xilure ] comment en python peut on trouver l'adresse IP d'un PC ? cela pour faire un chat sur un reseau local du meme type que celui ci http://www.siteduzero.c [Python] Trouver l'IP d'un PC à partir d'un Pocket PC [ par sacrechipou ] Salut!Je suis en stage d'informatique et on m'a demandé à partir d'un pocket pc de récupérer l'adresse ip du PC auquel il est connecté.Ayant débuté le Module mechanize et fonction submit() [ par kobral999 ] Bonjour,Je développe en python sous Linux et je souhaiterais récupérer une liste de nom d'utilisateur, de machine et d'adresse IP disponible sur un si probleme avec les listes ... ( anonymisation de log ) [ par psyssa ] bonjour tt le monde , je devellope un programme d'anonymisation de logs en python le but etant donné la recuperation ds un premier temps dadresse ip Comment connaitre le pays d'origine via ip ou dns ? [ par ordema ] Bonjour a tous ; J'ai repris un bot sur un serveur de jeu et je cherche le moyen de récupérer le nom du pays d'un client connecté pour lui renvoyer l


Nos sponsors


Sondage...

CalendriCode

Septembre 2010
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
27282930   

Consulter la suite du CalendriCode

 
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,671 sec (4)

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