Tell us what’s happening:
Hello Community, how you guys are doing?
So, i started the port scanner project related to Information Security Certification. I’ve written my project very similar to the one that is “given” in the youtube videos. So, i dont yet put in on test because i have a simple problem: Python. Anybody can help me?
The problem is with the input in the main function, how to make it work with my for? I thought using range but seems that not going to work…
ports = port_scanner.get_open_ports("18.104.22.168", [8079, 8090])
Your code so far
import socket def get_open_ports(target, port_range): open_ports =  scan = socket.socket(socket.AF_INET, socket.SOCK_STREAM) for i in range(port_range, 1): port=i; def portScanner(port): if s.connect_ex((target,port)): print("The port ",port," is closed") else: print("The port ",port," is Open") open_ports.push(port) return(open_ports)
Challenge: Port Scanner
Link to the challenge: