Skip to content

KingLinux24/security-tools

Repository files navigation

Python Security Tools & Internals

This repository contains Python scripts designed to demonstrate defensive security concepts, performance optimization, and low-level memory management crucial for cybersecurity tooling.

📂 Repository Contents

1. Network & Graph Analysis

  • 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.

2. Data Structures & Performance

  • 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 list and set lookups.
    • Key Finding: Demonstrates why set operations are critical for handling large wordlists or blacklists (milliseconds vs. seconds).

3. Memory & Safety

  • 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 frozenset as 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}).

4. Fundamentals

  • intro.py
    • Concept: Basic scalar types, endianness conversions, and byte manipulation essential for binary exploitation.

🚀 Usage

Run any script individually to see the demonstration:

python3 Network_Mapping.py
python3 set_diff_Perf.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages