Writing Python Functions and Recursion Basics
# Writing Python Functions and Recursion Basics ## Defining a simple function A function packages reusable logic under a name. You define it with `def`, give it parameters, and …
15 published notes
# Writing Python Functions and Recursion Basics ## Defining a simple function A function packages reusable logic under a name. You define it with `def`, give it parameters, and …
# PowerShell as an Acquisition Engine PowerShell is described in Hosmer's book as a powerful **acquisition engine** for digital investigations. Its role is to gather raw informat…
# Installing and Troubleshooting pip and uv Most [[Python Essentials for Security Scripting|Python]] installations ship with `pip`, but it can be missing, outdated, or not on you…
# Parsing Binary Formats with Construct `construct` is a Python library that lets you describe binary file layouts as data structures instead of writing manual `struct.unpack` ca…
# Normalization vs Canonicalization in Pentest Input Handling In security tooling, you often compare inputs against a signature database. The attacker controls the input, and you…
# Python File Handling Pitfalls Cheat Sheet When writing security scripts that ingest logs, configs, signatures, or binary payloads, small file-handling mistakes can silently bre…
# Global Variables in Python A **global variable** in Python is a variable declared at the top level of a module file, outside any function or class. It is accessible anywhere in…
# Single Responsibility Principle in Security Scripts The **Single Responsibility Principle** (SRP) says a function or module should have one reason to change — it should do one …
# Defensive Input Handling for Security Scripts Security scripts often process data that comes from untrusted or messy sources: scan output, logs, network traffic, user uploads, …
# Counter in Python `Counter` is a specialized dictionary class from the `collections` module in Python's standard library. It is designed for **counting hashable objects**. ## …
# Designing Python Scripts for Automation and Pipelines A script is rarely the final destination. In pentest, forensics, and reverse engineering work, Python tools usually feed o…
# Exiting a Python Script Cleanly Scripts need to finish in a way that tells the caller (or the shell) whether they succeeded or failed. The way you exit matters for automation, …
# Python Syntax Recall and Fluency for Security Work Many learners struggle with Python syntax not because they are "bad at memorizing," but because they are trying to memorize *…
# Python Essentials for Security Scripting A review of core Python syntax, data structures, and file I/O with an emphasis on writing clean, maintainable security scripts for pent…
# PowerShell + Python Acquisition Pipeline A practical exercise pattern from the book's philosophy: use **PowerShell** for acquiring raw data from Windows systems and **Python** …