Skip to content

Pos1t1veGuy/port_scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

port_scanner

PortScanner class

Create scanner for your IP:

from port_scanner import PortScanner
scanner = PortScanner('localhost')

Start scan process and save result:

result = scanner.scan(port_range, show_time=True, show_progress_bar=True)

result will be dictionary with keys:

  • 'openned_ports': List[int];
  • 'closed_ports': List[int];
  • 'refused_ports': List[int] (These ports is open but refuse scanner connection);

Arguments:

  • 'port_range' must be list or range object and not contain numbers less than 1 or more than 25565 (minimum and maximum port). Ports not in range will be ignored;
  • 'show_time' if is True it will return 'time' key in result with datetime.timedelta, it is scanning time;
  • 'show_progress_bar' if is True it will show TQDM progress bar in console;

ScannerGUI function

It will show in console scan result by arguments:
'IP': str, 'port_range': list or range

from port_scanner import ScannerGUI
ScannerGUI( sys.argv[1], range(int(sys.argv[2]), int(sys.argv[3])) )

It will make console util, you can use it to call " port_scanner/init.py host start_port end_port " from console

About

Small library with multithreading port scan

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages