This repository contains Python scripts designed to demonstrate defensive security concepts, performance optimization, and low-level memory management crucial for cybersecurity tooling.
Network_Mapping.py- Concept: Implements a graph data structure to map network paths between hosts.
- Technique: Uses Breadth-First Search (BFS) to determine reachability and shortest paths in a network topology.
-
port_collation.py- Concept: Efficiently groups and deduplicates open ports by IP address.
-
Technique: Utilizes
defaultdict(set)for$O(1)$ grouping and sorting.
-
set_diff_Perf.py-
Concept: Benchmarks the speed difference between
listandsetlookups. -
Key Finding: Demonstrates why
setoperations are critical for handling large wordlists or blacklists (milliseconds vs. seconds).
-
Concept: Benchmarks the speed difference between
Deep_copy_Pitfall.py- Concept: Demonstrates the dangers of "Shallow Copies" when handling mutable payloads (like shellcode).
- Technique: Uses
copy.deepcopy()to safely generate unique exploit instances without corrupting the original template.
Immutable_config_key.py- Concept: Using
frozensetas a dictionary key. - Use Case: Storing firewall rules or configurations where the order of flags/attributes does not matter (e.g.,
{TCP, 80, IN}is the same as{IN, 80, TCP}).
- Concept: Using
intro.py- Concept: Basic scalar types, endianness conversions, and byte manipulation essential for binary exploitation.
Run any script individually to see the demonstration:
python3 Network_Mapping.py
python3 set_diff_Perf.py