Permalink
Cannot retrieve contributors at this time
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?
harbourmaster/src/harbourmaster.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
32 lines (19 sloc)
714 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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}") | |