Probleme avec de codage

Fermé
prask - Modifié le 18 juil. 2019 à 23:09
yg_be Messages postés 22729 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 26 avril 2024 - 19 juil. 2019 à 13:16
bonjour je veux crée un scanner de port en python mais le problème c'est que j'ai une erreur dans une de mes ligne de code si quelqu'un pourrais m'aider

je me suis aidé d'une vidéo mais toujours le même problème

bien évidemment j'exploit ce code sous kali linux en dualboot

voici le code ci contre

import  socket 
import requests
import platefore
import sys 
import time 
from datetime import datetime 
import thread

def platform_required():
    if 'Linux' not in platform.platform.platform():
        sys.exit('[*] Linux System Required ! ')

def  check_internet():
    try:
        r = request.get('https://www.google.com')
        print('\033[1;92m[\033[1;94m+\033[1;92m] Internet Found !')
       except:
                print('\033[1;92m[\033[1;94m+\033[1;92m] Internet Found !')
          except:
              print('\033[1;91m[!] Internet Not found ! ')          
def portscanner(target.port):
    try:
    s = socket.socket(socket.AF_INET. socket.SOCK_STREAM)
        s.connect((target.port))
        print('\033[1;92m[\033[1;94m+\033[1;92m] Port '+str(port)+' open !')
            except:
                #pass
                print('\033[1;92m[\033[1;94m+\033[1;92m] Port '+str(port)+'\033[1;91mclosed !')
                def main():
                    platform_required()
                    check_internet()
                    os.System('clear')
                    os.system('clear')
                    target = raw_input('\033[1;92m[\033[1;94m+\033[1;92m] Enter Target IP :> ')
                     x = raw_input('\033[1;92m[\033[1;94m+\033[1;92m] enter Port Max :> ')
                 i = 1
                 y = 1
                 t = datetime.now().strftime('[%H:%M:%S]')
                 print('\033[1;92m[\033[1;94m+\033[1;92m] Scanner started At '+str(t))
                     while i<x:
                         thread.start_new_threads(portscanner,(target.yet))
                         time.sleep(0.1)
                         i  = i+1
                         y = y+1 

print('\033[1;92m[\033[1;94m+\033[1;92m]scanner finished ! ')

main()

1 réponse

yg_be Messages postés 22729 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 26 avril 2024 1 477
19 juil. 2019 à 13:16
bonjour, quelle erreur dans quelle ligne?
0