vinitshahdeo/PortScanner

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

Aperta

#1 aperta il 4 giu 2020

 (6 commenti) (0 reazioni) (0 assegnatari)Python (122 fork)auto 404
beginner friendlyfirst-timers-onlygood first issuehelp wantedup for grabs

Metriche repository

Star
 (150 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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()

Guida contributor