Background This is an upgrade scripts to check for open ports on every addresses found in subnets. The upgrade uses Processpoolexecutor, a minor re-write uses the processpoolexecutor and theadpoolexecutor together. network_discovery.py - obtains directly connected subnets scanner.py This script does the port scanning based on the subnets obtained from network_discovery.py. start_now.py - main script to … Continue reading [python]Multiprocess and multithreading for port scan version 3
Tag: ipaddress
[python]Auto discover your laptop’s interface ip address belongs to which subnet
The use case for this is I want to create an automated pentest when my laptop is connected to the network. When my laptop connects to a network, the directed connected network is scanned for host running on which ports, then the ports are evaluated to check if it is vulnerable to EternalBlue, if it … Continue reading [python]Auto discover your laptop’s interface ip address belongs to which subnet
[python]Making a list of dictionaries
Use case I am trying to write a script for doing security group based on user's input. the IpRanges is a list of dictionary. I intend to do a method which generate multiple dictionaries with the same key but different values, and put these dictionaries into a list. ipaddress.ip_network method can evaluate both host ip … Continue reading [python]Making a list of dictionaries
[python]Extension to validate ip address
On previous post I have written a sample code to validate ip address using the ipaddress module. The sample code is further extended to check for subnets. Algorithm 1. Get user's ip_address. 2. IF ip_address does not have '/' or ip_address has '/32' THEN use ipaddress.ip_address() ELSE use ipaddress.ip_network() THEN tell user the ip address … Continue reading [python]Extension to validate ip address
[python]Validate an ip address
On python3 there is a build in ipaddress module which can be referenced to check if the user's input is an ip address, no more using the complicated regex to match, this module helps to check and throws an exception if the ip address is invalid. See below sample code So here are several tests: … Continue reading [python]Validate an ip address