appsec.fyi › Python

Python Resources

Page 5 of 7: resources 201–250 of 312, added Nov 2023 to Aug 2025.

The newest Python resources are on the Python page. For a reading order instead of a date order, see the Python learning path.

Date AddedLinkExcerpt
2025-08-14 2025How to store your users' API keys securely in Django ? intermediate 2 min readEncrypting user API keys in Django involves creating a model to store the encrypted keys, generating an encryption key, and securely managing it using environment variables. This approach protects sensitive credentials like OpenAI keys by encrypting them within the database, with options to integrate with external services like AWS KMS for enhanced security.
2025-08-14 2025Let’s create a Python Debugger together: Part 1 | Mostly nerdless intermediate 10 min readPython's built-in `breakpoint()` function is leveraged in a custom debugger that allows developers to inspect variables, execute arbitrary code in context, and manage breakpoints. This debugger, built upon the `sys._getframe()` and `sys.breakpointhook` functionalities, provides a command-line interface for interacting with running Python code, similar to the standard `pdb` module but with a simplified feature set for educational purposes.
2025-08-14 2025The easy way to concurrency and parallelism with Python stdlib beginner 9 min readPython's `concurrent.futures` module simplifies concurrency and parallelism using `ThreadPoolExecutor` and `ProcessPoolExecutor`. These abstractions enable developers to distribute tasks across multiple threads or processes with minimal code, efficiently addressing common use cases like web scraping or maintaining UI responsiveness without complex infrastructure or specialized libraries. The module provides a straightforward way to manage task execution and retrieve results for a variety of everyday problems.
2025-08-14 2025Pygoat - Learn Django security the hard way - Speaker Deck beginner 9 min read Bug BountyLearn Django security best practices by attacking and defending Pygoat, an intentionally vulnerable Python application. This resource dives into OWASP Top 10 vulnerabilities, exploring mitigations for common issues like injection flaws, sensitive data exposure, and broken access control within Django applications. Discover how to implement secure design patterns, threat modeling, and proper configuration to safeguard your web services.
2025-08-14 2025Click and Python: Build Extensible and Composable CLI Apps – Real Python beginner 48 min readClick library enables Python developers to build extensible and composable command-line interfaces (CLIs) for their automation and tooling scripts. This mature and feature-rich solution offers a more intuitive alternative to Python's standard `argparse` module, allowing for the easy addition of arguments, options, and subcommands using decorators. Click handles complex tasks like generating usage and help pages, processing diverse data types, and even supports features like environment variable loading and custom input prompts, significantly streamlining CLI development. → realpython.com
2025-08-14 2025Asyncio, twisted, tornado, gevent walk into a bar... beginner 18 min readasyncio, twisted, tornado, and gevent are Python concurrency tools designed to efficiently share a CPU core between multiple network-bound operations. Unlike parallelism, which involves doing many things simultaneously, concurrency handles multiple tasks by interleaving their execution, particularly useful when waiting for network responses. These libraries enable a program to perform other work while awaiting external data, significantly speeding up applications like bots and servers compared to synchronous methods.
2025-08-14 2025How to Launch an HTTP Server in One Line of Python Code – Real Python beginner 27 min readPython's built-in `http.server` module allows launching a functional HTTP server in a single command, ideal for quickly sharing files or experimenting with HTTP. This module serves content from the current directory by default but can be configured to serve from a specified directory, bind to specific network interfaces (including localhost for local-only access), and use custom ports, with commands like `python3 -m http.server [port]` and `python3 -m http.server -d [directory]`. → realpython.com
2025-08-14 2025Build a Vulnerability Scanner Using Python intermediate 7 min readPython script builds a vulnerability scanner by first creating a `portscan` class that identifies open ports and retrieves service banners from a target. This class is then utilized to scan a specified IP address and port range. The scanner compares discovered service banners against a provided file of known vulnerable software signatures, flagging and reporting any identified vulnerabilities along with their corresponding ports.
2025-08-14 2025Build an Arp Spoofer From Scratch | by Rahul Kumar | Jan, 2023 | System Wea intermediateThe content appears to be about creating an ARP spoofer from scratch, authored by Rahul Kumar in January 2023. ARP spoofing is a technique used for network manipulation by sending false Address Resolution Protocol (ARP) messages. The article likely provides instructions or insights on how to build this tool independently. → systemweakness.com
2025-08-14 2025Creating an Advanced Network Packet Sniffer in Python: A Step-by-Step Guide intermediateThe content is a guide on building an advanced network packet sniffer using Python. It likely provides a detailed, step-by-step approach to creating a tool that can intercept and log network traffic for analysis or monitoring purposes. The guide may cover topics such as capturing packets, analyzing their contents, and potentially implementing additional features to enhance the functionality of the packet sniffer. Overall, it aims to help readers understand the process of developing a network packet sniffer using Python. → systemweakness.com
2025-08-14 2025Python Simple HTTP Server With SSL Certificate (Encrypted Traffic) | Python intermediate 2 min readPython's `http.server` module, combined with an SSL certificate, enables simple TLS-encrypted HTTP servers. This technique, referenced in the "Red Team Field Manual," encrypts traffic for covert file transfers, making it harder for defenders to intercept and analyze during penetration tests or CTF challenges. → python.plainenglish.io
2025-08-14 2025Python Decorators (made easy). Decorator can be used to send function… | by beginner 1 min readTutorial on Python decorators, explaining their use for passing functions as arguments and returning functions. It covers simple decorators, decorators that return functions, and implementing decorators using the `@` syntax. The tutorial also demonstrates decorators with arguments and multiple decorators, using concrete examples to illustrate how decorators modify function behavior.
2025-08-14 2025Python Requests Library Caused a Production Outage | by Daryan Hanshew | Ju newsThe Python Requests library caused a production outage, as reported by Daryan Hanshew. The incident likely involved issues or errors related to the use of the Python Requests library, impacting the production environment.
2025-08-14 2025microsoft/picologging: An optimized logging library for Python beginner 3 min readLibrary for high-performance Python logging, picologging offers a drop-in replacement for the standard library's `logging` module, boasting 4-17x speed improvements. It maintains API compatibility, allowing seamless integration into existing applications. Installation is available via pip or conda, and developers can utilize its CPython 3.11 components for enhanced compatibility and debugging capabilities.
2025-08-14 2025TryHackMe | Python Basics. In this story I will be sharing my… | by Mukkara beginnerThe content appears to be about a story shared by Mukkara on TryHackMe regarding Python basics. The story likely includes insights, experiences, or tutorials related to Python programming fundamentals. Mukkara may be sharing tips, tricks, or lessons learned while exploring Python basics on the TryHackMe platform. The content seems to focus on practical applications or explanations of Python concepts for beginners or those interested in learning more about Python programming. → systemweakness.com
2025-08-14 20256 Python Libraries For Cyber Security Professionals and Ethical Hackers | b beginnerThe content mentions 6 Python libraries useful for cyber security professionals and ethical hackers. These libraries likely provide tools and functions that can assist in tasks related to cybersecurity, such as threat detection, vulnerability analysis, or penetration testing. Python is a popular programming language in the cybersecurity field due to its versatility and ease of use for developing security tools and scripts. The libraries mentioned may offer pre-built functionalities that can streamline and enhance the work of professionals in the cybersecurity and ethical hacking domains. → python.plainenglish.io
2025-08-14 2025RegEx in Python: Introduction and The use of Backslash | by Manash Bhele | beginner 4 min readPython's `re` module facilitates pattern matching in strings through regular expressions. This library enables compilation of patterns into objects for operations like `match`, `search`, `findall`, and `finditer`. Understanding metacharacters and the use of backslashes for escaping them is crucial, along with recognizing how to handle literal backslashes using double backslashes or raw strings when defining patterns for data extraction and validation.
2025-08-14 2025How to Create a Reverse Shell in Python - The Python Code intermediate 6 min readPython code implements a reverse shell, enabling interactive command execution on a compromised system by initiating connections from the target to the attacker. The provided server script listens for connections, sends shell commands, and receives output, while the client script executes commands, handles directory changes with `os.chdir`, and returns results. This method bypasses firewalls by establishing outbound connections from the target machine.
2025-08-14 2025(304) Remote Procedural Call via XML-RPC in 5 minutes - YouTube beginnerThe content is a video tutorial on YouTube titled "(304) Remote Procedural Call via XML-RPC in 5 minutes." It likely provides a quick guide or demonstration on how to perform remote procedural calls using XML-RPC within a short timeframe. The video may offer step-by-step instructions or examples to help viewers understand and implement XML-RPC for remote communication.
2025-08-14 2025Python monkey-patching like a boss | by Sergei | Medium intermediate 4 min readPython monkey-patching allows modifying the behavior of third-party libraries. This technique can involve patching module variables, functions, or even closed entities within functions and classes. While straightforward for module-level patching, altering behavior within nested functions or classes may require AST manipulation with `inspect` and `ast` modules to parse and modify the code's structure.
2025-08-14 2025pikepdf/pikepdf: A Python library for reading and writing PDF, powered by QPDF beginner 4 min readLibrary for reading, writing, repairing, and transforming PDFs in Python. Built on the qpdf C++ library, pikepdf offers automatic PDF repair, XMP metadata editing, robust encryption support (AES-256, AES-128, RC4), and linearization for fast web viewing. It provides a Pythonic API for low-level manipulation and object access, along with lossless image extraction and Jupyter integration. Binary wheels are available for all major platforms, simplifying installation.
2025-05-24 2025Django Security Best Practices: A Comprehensive Guide for Software Engineers - Corgea - Home beginner 5 min readDjango security best practices for software engineers address vulnerabilities like XSS, SQL injection, CSRF, and session hijacking by keeping Django updated, enabling HTTPS, using strong SECRET_KEYs, hardening database security with ORM, and enabling built-in features like CSRF protection and strong password validators. Additional measures include dependency auditing with tools like pip-audit, comprehensive logging, access control with permissions, rate limiting, securing API endpoints with OAuth2, and regular security audits. → corgea.com
2025-05-07 2025Using JWTs in Python Flask REST Framework | AppSignal Blog intermediate 8 min read API Sec AuthNFlask-JWT-Extended application for Python Flask REST Framework demonstrates securing APIs with JSON Web Tokens (JWTs). This application details JWT structure, including header, payload, and signature, and explains stateless sessions, security benefits, efficiency, and flexibility. It provides a practical implementation of user registration, login, task creation, retrieval, update, and deletion using Flask and Flask-JWT-Extended, along with methods for managing token expiration and refresh tokens for extended sessions.
2025-03-01 2025GitHub - roshanlam/Spider: Web Crawler built using asynchronous Python and distributed task management that extracts and saves web data for analysis. beginner 4 min readLibrary for asynchronous, distributed web crawling and data extraction. It leverages aiohttp, asyncio, Celery, Redis, and PostgreSQL to manage tasks, store data, and process information. Features include a plugin architecture for custom logic, comprehensive webpage data extraction (metadata, content, links, forms, social metadata), NLP-based entity recognition with spaCy, and JavaScript rendering support via Playwright. The library allows for scalable crawling, real-time metrics, and robust logging.
2025-01-14 2025Build Your Web Scraper with Crawlbase in Python: A Beginner’s Guide beginnerLearn how to build your first web scraper in Python using Crawlbase. This beginner-friendly guide covers web scraping essentials, bypassing
2024-12-31 2024GitHub - danialhalo/SqliSniper: Advanced Time-based Blind SQL Injection fuzzer for HTTP Headers advanced 3 min read Fuzzing SQLiTool for advanced time-based blind SQL injection fuzzing in HTTP headers. SqliSniper utilizes multi-threaded scanning for efficiency and employs response time analysis to reduce false positives. It supports custom payloads and headers, and can send alerts to Discord webhooks upon detecting vulnerabilities. The tool can scan single URLs, lists of URLs from a file, or process piped input from other security tools.
2024-12-29 2024Python for Dark Web OSINT: Automate Threat Monitoring intermediate 5 min read OSINTPython for dark web OSINT leverages scripting with the `requests_tor` library to automate threat monitoring on hidden forums, leak sites, and marketplaces. This approach involves configuring the Tor browser for anonymity and using libraries like BeautifulSoup for parsing scraped HTML, enabling the identification of specific keywords and actionable threat intelligence. The technique can be further enhanced with scheduling, alerts, and more granular control via the Stem library for advanced threat hunting.
2024-12-20 2024GitHub - xnl-h4ck3r/knoxnl: This is a python wrapper around the amazing KNOXSS API by Brute Logic intermediate 8 min read API SecLibrary for interacting with the KNOXSS API, enabling automated scanning for XSS and Open Redirect vulnerabilities. This Python wrapper supports various input methods, including single URLs and files, and allows for custom configurations for API keys, Discord webhooks, and output formats. It integrates with Burp Suite via the Piper extension, facilitating in-proxy security testing. The library respects KNOXSS API rate limits and offers features like Flash Mode for quick polyglot tests and handling of POST requests.
2024-12-19 2024GitHub - WafflesExploits/hide-payload-in-images: A project that demonstrates embedding shellcode payloads into image files (like PNGs) using Python and extracting them using C/C++. Payloads can be retrieved directly from the file on disk or from the image stored in a binary's resources section (.rsrc) advanced 1 min read RCELibrary for embedding and extracting shellcode payloads within image files like PNGs. Utilizes Python for embedding and C/C++ for extraction, supporting retrieval from disk or a binary's `.rsrc` section. Includes stealthy extraction via manual PE header parsing and PEB access, avoiding WinAPI calls for enhanced evasion. Supports both executable and DLL builds with improved PEB structure definitions for portability.
2024-12-12 2024GitHub - mherrmann/helium: Lighter web automation with Python beginner 4 min readLibrary for lighter web automation in Python, Helium offers a high-level API that simplifies tasks compared to Selenium. It allows referencing elements by user-visible labels, resulting in shorter and more stable scripts. Helium also streamlines interaction with iframes, window management, and provides built-in implicit and explicit waits, eliminating the need for complex `WebDriverWait` calls. The library is sponsored by RapidProxy and can be installed via pip.
2024-12-11 2024GitHub - apify/crawlee-python: Crawlee—A web scraping and browser automation library for Python to build reliable crawlers. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with BeautifulSoup, Playwright, and raw HTTP. Both headful and headless mode. With proxy rotation. beginner 5 min readLibrary for building reliable web scrapers and crawlers in Python. It offers a unified interface for both HTTP and headless browser crawling, supporting BeautifulSoupCrawler for HTML parsing and PlaywrightCrawler for JavaScript-heavy sites. Key features include automatic retries, proxy rotation, configurable request routing, persistent queues, and pluggable storage for extracted data and files. Crawlee leverages asyncio for performance and integrates seamlessly with other asynchronous Python libraries.
2024-11-29 2024Python Twisted proxy - how to intercept packets intermediatePython Twisted proxy for intercepting HTTP requests and responses allows developers to print and modify response bodies. This example demonstrates setting up a local proxy using Twisted's `proxy` and `http` modules to capture traffic. The code provides a foundation for inspecting and manipulating HTTP data passing through the proxy server. → stackoverflow.com
2024-10-30 2024Flask & Pydantic: Streamline Python APIs with Seamless Data Validation intermediate 4 min readFlask and Pydantic integration streamlines Python API development by leveraging type hints for robust data validation. This approach simplifies defining validation rules and reduces boilerplate code compared to traditional methods like Marshmallow. By using Pydantic models, developers can ensure data integrity and catch errors early in the execution phase, enhancing the overall development experience for building RESTful APIs with Flask.
2024-10-30 2024SSH Scripting with Fabric and Python - Mouse Vs Python beginner 3 min readFabric 3.2.2 streamlines remote SSH command execution and file management. This Python library simplifies tasks like connecting to servers, running shell commands, and transferring files to and from remote machines. It supports authentication via passwords or SSH keys and allows for privileged operations using `sudo`.
2024-10-24 2024Cryptography — The Hitchhiker's Guide to Python beginner 2 min read SecretsCryptography is an actively developed Python library providing cryptographic recipes and primitives, supporting symmetric encryption via its simple recipes layer and low-level primitives in its hazardous materials (hazmat) layer. It also offers GPGME Python bindings for access to the GNU Privacy Guard suite, enabling encryption, decryption, and key management.
2024-10-17 2024GitHub - cle-b/httpdbg: A tool for Python developers to easily debug the HTTP(S) client requests in a Python program. intermediate 4 min readTool for Python developers to debug HTTP(S) client and server requests. Executing programs via `pyhttpdbg` instead of `python` enables inspection of requests in a web browser at `http://localhost:4909`. Supports HTTP/1.0, HTTP/1.1, and HTTP/2. It can trace requests made by scripts, modules (like `pip`), and tests (`pytest`, `unittest`), and can record requests received by HTTP servers. The tool allows grouping requests by test and offers customization options for the web interface.
2024-10-01 2024GitHub - bl4de/security-tools: My collection of various security tools created mostly in Python and Bash. For CTFs and Bug Bounty. intermediate Bug BountyMy collection of various security tools created mostly in Python and Bash. For CTFs and Bug Bounty. - bl4de/security-tools
2024-09-23 2024Let’s build and optimize a Rust extension for Python intermediate 9 min readBuilding and optimizing Rust extensions for Python involves using libraries like PyO3 and build tools such as Maturin. This process allows for the re-implementation of Python algorithms in Rust to achieve significant performance gains, as demonstrated by optimizing a probabilistic unique value counting algorithm. Rust's memory and thread safety, coupled with modern tooling, contribute to faster and more robust Python applications.
2024-08-28 2024GitHub - mkalioby/django-mfa2: A Django app that handles MFA, it supports TOTP, U2F, FIDO2 U2F (Webauthn), Email Token and Trusted Devices intermediate 5 min read AuthNLibrary providing multi-factor authentication (MFA) for Django applications. It supports TOTP, U2F, FIDO2 (WebAuthn) with various authenticators like security keys and Windows Hello, Email Tokens, and Trusted Devices. The library allows for customizable settings, integration with existing login flows, and offers passwordless login capabilities.
2024-08-21 202417 Mindblowing Python Automation Scripts I Use Everyday beginnerScripts That Increased My Productivity and Performance
2024-08-17 2024GitHub - wapiti-scanner/wapiti: Web vulnerability scanner written in Python3 intermediate 5 min readLibrary for "black-box" web vulnerability scanning, Wapiti leverages Python 3.12-3.14 to act as a fuzzer, discovering vulnerabilities by sending payloads to web applications and analyzing responses. It supports various attack modules, including SQL Injections, XSS, File Disclosure, Command Execution, XXE, Shellshock, and Log4Shell (CVE-2021-44228), Spring4Shell (CVE-2020-5398), and can generate reports in multiple formats. Wapiti offers features like scan suspension, session management, proxy support, and the ability to import cookies from browsers.
2024-08-02 2024GitHub - SpaceWolfWasTaken/httpy: A barebones HTTP server created from raw python sockets. intermediateA barebones HTTP server created from raw python sockets. - SpaceWolfWasTaken/httpy
2024-07-26 2024Release v0.3.0 · joaovitoriasilva/endurain news 1 min read AuthNLibrary release v0.3.0 for endurain, a Python application security library, introduces OAuth scopes, multi-client support (web and mobile), PWA support, theme and language switchers, and dependency management with poetry. This update also includes significant backend changes to password hashing, requiring automatic migration for admin accounts. Frontend improvements focus on UI fixes and pagination, while general updates include multi-arch Docker images and documentation enhancements. Users should back up their database before updating due to schema changes.
2024-07-23 2024Isolating risk in the CPython release process advanced 3 min readAnalysis of CPython's release process improvements, funded by Alpha-Omega, detailing the isolation of source artifact builds using GitHub Actions. This change significantly reduces the dependency footprint for critical build stages, decreasing supply chain risk by separating source artifact generation from documentation builds and testing, with the "Build Source" task now requiring approximately 170 dependencies instead of over 800.
2023-12-18 2023Python Asyncio and Footguns intermediate 2 min readPython asyncio's `asyncio.Lock` can lead to difficult-to-debug, sporadic exceptions under load due to stale event loop references. When a lock is initialized, it captures the current event loop. If `asyncio.run()` later discards and recreates the event loop, the lock may attempt to use the old, invalid loop during contention, causing an error. This "footgun" behavior is particularly problematic in older Python versions (prior to 3.10), though proper scoping of lock instances can mitigate the issue.
2023-12-10 2023timo-reymann/python-oauth2-cli-auth intermediate 1 min readLibrary for simplifying OAuth2 authentication in Python CLIs, supporting OIDC providers like gitlab.com and manual configuration. It offers a straightforward method for obtaining access tokens without external dependencies, facilitating integrations with services requiring OAuth2 authorization. The project encourages community contributions for bug reporting, feature proposals, and code fixes.
2023-11-09 2023How to Download Files From URLs With Python beginner 22 min readTutorial on downloading files from URLs using Python, covering the built-in `urllib` module and the popular `requests` library. It demonstrates using `urlretrieve()` for simple downloads and `requests.get()` for more advanced interactions. The guide also touches on efficient handling of large files through streaming, parallel downloads with `ThreadPoolExecutor` and `aiohttp`, and extracting metadata from HTTP headers for downloaded content, like the `Content-Type` and `Content-Length` of a World Bank CSV file. → realpython.com
2023-11-07 2023Using the bpython Enhanced REPL beginner 1 min readbpython enhances the standard Python REPL with features for improved productivity and a more programmer-friendly experience. This course teaches installation and usage of bpython, exploring its unique productivity boosters, configuration options including color themes, keyboard shortcuts for faster coding, and how to contribute to its open-source project. Familiarity with Python basics and pip is recommended. → realpython.com
2023-11-07 20234 Python Web Scraping Libraries To Mine News Data beginner 7 min readFour open-source Python web scraping libraries—PyGoogleNews, NewsCatcher, Feedparser, and Newspaper3k—enable DIY news data mining without requiring API keys. These tools allow developers to build custom data solutions for NLP projects, extracting titles, links, publication dates, summaries, sources, and more from news articles and RSS feeds.
2023-11-07 2023Peticali/FastHttpPy intermediateLibrary implementing Golang's FastHttp in Python, achieving 63k requests/second, significantly outperforming Uvicorn. Easily installable via `pip install fasthttppy`, it supports static file serving, custom GET/POST request callbacks, and error/404 page configuration. Further performance gains are possible by replacing JSON communication with direct struct handling.