Network Mapper
Phase 1 — Data parsing & IP handling
- Parse a CIDR input (e.g.,
192.168.0.0/24) into individual IP addresses. - Validate input format and ensure only valid IPv4 addresses are accepted.
- Provide a simple function to iterate over IPs in the subnet.
Functional result: user can input a CIDR, and the program generates a list of valid IP addresses for scanning.
Phase 2 — Basic connectivity scanning
- Implement a function to check whether an IP is online (e.g., via a ping or socket attempt).
- Limit checks to a predefined set of common ports or user-specified ports.
- Handle timeouts gracefully to avoid long delays.
Functional result: program identifies which IPs are online and which ports respond, without crashing on unreachable hosts.
Phase 3 — Command-line interface & output formatting
-
Accept input from command line:
network_mapper.py 192.168.0.0/24 [port1, port2, ...]. -
Display results in a readable format, e.g.:
192.168.0.1:80 (HTTP) :443 (HTTPS) 192.168.0.105:445 (SMB) -
Map common ports to service names where possible.
Functional result: user runs the program and receives a clean, readable summary of online hosts and their open ports.
Phase 4 — Robustness & polish
- Handle invalid inputs (bad CIDR, invalid port numbers).
- Implement basic exception handling for network errors.
- Ensure program exits cleanly if interrupted.
- Allow sorting of output by IP or by port, for clarity.
- Make the CLI easy to interact with and visually pleasant, using coloured text output.
- Allow saving the identified IP:port pairs to a
.txtfile.
Functional result: program is stable, handles edge cases gracefully, and consistently produces correct results for valid inputs.