vinitshahdeo/PortScanner

The low & high range of ports in scanner.py is hardcoded

Ouverte

#1 ouverte le 4 juin 2020

 (6 commentaires) (0 réaction) (0 personne assignée)Python (122 forks)auto 404
beginner friendlyfirst-timers-onlygood first issuehelp wantedup for grabs

Métriques du dépôt

Stars
 (150 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Reading config.json and using range.low and range.high in scanner.py


The range for ports shouldn't be hardcoded. It should be ideally fetched from config.json as it's being used in server/index.js.

for port in range(1,8888):  
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        result = sock.connect_ex((remoteServerIP, port))
        if result == 0:
            print "Port {}: 	 Open".format(port)
        sock.close()

Guide contributeur