How To Make Nmap/Zenmap & Port Scanner in Python

How To Make Nmap/Zenmap & Port Scanner in Python

project



This video : 



This project code :  {:-)


import socket

import colorama

import concurrent.futures

import threading

from colorama import Fore

colorama.init()


print_lock = threading.Lock()

ip = input('Enter The IP To Scan: ')

def scan(ip, port):

    scanner = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    scanner.settimeout(1)

    try:

        scanner.connect((ip, port))

        scanner.close()

        with print_lock:

            print(Fore.WHITE + f"[{port}]" + Fore.GREEN + " Opened")

    except:

        pass

with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor:

    for port in range(3400):

        executor.submit(scan, ip, port + 1)

No comments

Theme images by luoman. Powered by Blogger.