Skip to content
Permalink
4f0749f441
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 32 lines (19 sloc) 714 Bytes
#!python
"""Simple program for scanning ports on a given host and acting on results"""
from h_sockets import testPort
import colored
if __name__=="__main__":
target="172.17.0.1"
for p in range(1,500):
message=colored.fg("red")+"Closed"
result=testPort(target,p)
if not result is None:
message=colored.fg("green")+"Open"
if len(result)>0:
message+=colored.fg("yellow")
message+=" - Data recieved"
for i in result:
message+="\n"+i
message+="\n"
message+=colored.attr('reset')
print(f"{p}: {message}")