appsec.fyi › Python

Python Resources

Page 6 of 7: resources 251–300 of 312, added Nov 2021 to Oct 2023.

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
2023-10-29 2023fortra/impacket intermediate 2 min readLibrary of Python classes for low-level network protocol interaction, including Ethernet, IP, TCP, UDP, SMB1-3, MSRPC, TDS, and LDAP. Impacket supports Plain, NTLM, and Kerberos authentication and offers tools for security researchers to facilitate network protocol research and educational activities.
2023-09-20 2023Episode 99: OAuth 2 and Authentication Choices for Your Python Project beginner 2 min read AuthNTalk on OAuth 2 and authentication choices for Python projects. Features Dan Moore from FusionAuth discussing system setup, device grants, social login, and privacy. Includes a spotlight on a course for implementing Google Login with Flask, covering OAuth 2, OpenID Connect, and session management. Mentions RFC 6749 and RFC 6750 as key resources. → realpython.com
2023-09-20 2023How to Authenticate using Keys BasicAuth OAuth2 inPython beginner 1 min read AuthNPython authentication methods including BasicAuth and OAuth2 are detailed in this guide, covering their implementation for securing applications. The article focuses on practical application development and is not an advisory or writeup about a specific product.
2023-09-19 2023dnspython intermediate 2 min readdnspython provides Python examples for manipulating DNS records, including fetching MX targets and preferences, performing dynamic DNS updates, and managing domain names. It also demonstrates generating reverse mapping information for IPv4 addresses and converting both IPv4 and IPv6 addresses to their corresponding DNS reverse map names. Furthermore, it shows how to convert E.164 phone numbers to and from ENUM names.
2023-09-02 2023Containerized PDF Summarizer with FastAPI and Hamilton intermediate 10 min readHamilton, a declarative Python micro-framework, enables building modular LLM applications, like a containerized PDF summarizer, by expressing logic as dataflows. This approach separates core LLM functionality from platform concerns, allowing for easier iteration, testing, and reuse of code between development and production environments, as demonstrated with FastAPI and Streamlit.
2023-09-02 2023trafilatura: Web scraping tool for text discovery and retrieval beginner 4 min readLibrary for web scraping and text extraction. Trafilatura is a Python package and command-line tool that simplifies gathering text from raw HTML, offering robust discovery and processing components for web crawling, downloads, and extraction of main texts, metadata, and comments. It balances precision and recall, outperforming other open-source libraries in benchmarks, and is used by HuggingFace, IBM, and Microsoft Research. Output formats include TXT, Markdown, CSV, JSON, HTML, XML, and XML-TEI.
2023-09-02 2023Running Untrusted Python Code intermediate 5 min readRunning untrusted Python code is addressed by leveraging Linux kernel features like `seccomp` to restrict system calls and `setrlimit` to manage resource allocation, such as CPU time, virtual memory, and file size. This approach avoids common pitfalls of in-application sandboxing by isolating the execution in a separate process with carefully defined permissions, offering a more robust alternative to solely manipulating Python's built-in functions.
2023-08-24 2023The subprocess Module: Wrapping Programs With Python beginner 51 min readPython's `subprocess` module enables running shell commands and managing external processes, allowing for integration of command-line operations into Python applications. This library provides functions like `subprocess.run()`, `subprocess.call()`, and `subprocess.Popen()` to execute commands, handle input/output streams, and manage process return codes, offering a flexible way to interact with the operating system's process management. → realpython.com
2023-08-24 2023dis Disassembler for Python bytecode Python 3.9.6 documentation beginner 30 min readPython's `dis` module analyzes CPython bytecode, providing insights into instruction sequences and code object details. It supports disassembling functions, methods, and code objects, offering granular views of bytecode operations through its API and command-line interface. Recent versions enhance this analysis by allowing the display of inline caches, specialized bytecode, and instruction offsets for a deeper understanding of interpreter behavior.
2023-08-13 2023Swing in Python Burp Extensions - Part 1 intermediate 5 min read BurpJython Swing GUI development for Burp extensions is detailed, covering tab creation, `JPanel` usage with `BorderLayout`, `JButton` actions, `JSplitPane` for layout, `JScrollPane` and `JList` for displaying selectable items, handling `ListSelectionEvent` with `valueIsAdjusting` checks, `JTabbedPane` for multiple tabs, and `JTextPane` with `StyledDocument` for rich text display.
2023-08-05 2023Socket Programming in Python Part 1: Handling Connections beginnerPython sockets and the socket API enable network communication and inter-process communication (IPC). This video course guides you through building a simple socket server and client, an enhanced version capable of handling multiple connections concurrently, and a robust server-client application featuring custom headers and content for comprehensive socket functionality. → realpython.com
2023-08-05 2023How To Keep A Secret in Python Apps beginner 67 min read SecretsPython security practices for managing secrets like API keys and database passwords are discussed, emphasizing why never storing secrets in source code is critical. The conversation highlights the use of the Python `keyring` library for secure local credential storage, drawing on OS-native solutions like macOS Keychain and Windows Credential Manager. It also touches on threat modeling, password managers, and the importance of local machine security as foundational practices for preventing credential leaks.
2023-06-08 2023Test website for SQL injection vulnerabilities using Python intermediate SQLiTest website for SQL injection vulnerabilities using Python https://ift.tt/msKlYeM
2023-06-06 2023Reversing Pickles with r2pickledec intermediate 10 min read Deserr2pickledec is a Radare2 plugin that decompiles Python pickle files up to protocol 5, enabling analysis of serialized Python objects and potential security vulnerabilities. It works by leveraging Radare2's disassembler and its own pickle-specific architecture to translate pickle instructions into a more readable format, aiding in the reverse engineering of potentially malicious or data-laden pickle payloads. → blog.doyensec.com
2023-04-13 2023Understanding Python Bytecode beginnerUnderstanding Python Bytecode https://ift.tt/1NED8CP
2023-04-10 2023How to Implement OAuth 2.0 Login for Python Flask Web Server Applications intermediate 4 min read API Sec AuthNTutorial on implementing OAuth 2.0 login for Python Flask web server applications. This guide details enabling Google APIs, creating OAuth client IDs, securely storing credentials, and writing Python code using Flask to handle user authentication and consent. It covers setting up a `requirements.txt` file, environment variables, and Jinja2 templates for a seamless Google single sign-on experience, with runnable code available on GitHub.
2023-04-03 2023Download and Installation Scapy 2.4.5. documentation beginner 5 min readScapy installation instructions are provided for Unix-like systems, macOS, OpenBSD, Solaris, and Windows, with options to install via pip for the latest release or development version. The documentation also details necessary optional dependencies for advanced features like plotting, 2D/3D graphics, PKI operations, fingerprinting, and VoIP, alongside guidance on building the documentation and generating UML diagrams.
2023-04-03 2023Scapy beginnerScapy http://scapy.net/
2023-04-03 2023Usage Scapy 2.4.5. documentation beginner 38 min readScapy 2.4.5's usage documentation details how to start the interactive shell, requiring root or administrator privileges for packet sending. It covers building and dissecting packets using layer stacking and the `/` operator, and manipulating packet fields. The library also supports reading and writing PCAP files, generating graphical dumps with PyX, and creating sets of packets through field combinations. Sending packets at layer 2 (`sendp`) or layer 3 (`send`) is explained, along with options for multicast and scope identifiers. Finally, the `fuzz()` function is introduced for randomizing packet values.
2023-04-03 2023Basic and Low-level Python Network Attacks intermediate RCEhttps://ift.tt/SxGhvBQ
2023-04-02 2023Writing a Network Scanner using Python intermediate ReconWriting a Network Scanner using Python https://ift.tt/DAWbHwz
2023-01-31 2023Build an Arp Spoofer From Scratch intermediateThe content discusses creating an ARP spoofer from scratch. ARP spoofing involves manipulating network traffic by sending false ARP messages. By building an ARP spoofer, one can intercept and modify data packets within a network. This technique is commonly used for malicious purposes like eavesdropping or conducting Man-in-the-Middle attacks. The content likely provides a guide or instructions on how to create an ARP spoofer independently.
2023-01-31 2023Creating an Advanced Network Packet Sniffer in Python: A Step-by-Step Guide intermediateThe content is a step-by-step guide on creating an advanced network packet sniffer using Python. It provides detailed instructions on how to build the sniffer tool, which can capture and analyze network packets for various purposes. The guide likely covers topics such as setting up the necessary libraries, capturing packets, analyzing packet data, and potentially implementing additional features for advanced functionality. Overall, the content aims to help readers understand the process of creating a network packet sniffer using Python through a structured and informative guide.
2022-10-19 2022Python Simple HTTP Server With SSL Certificate (Encrypted Traffic) intermediateThe content discusses setting up a Python Simple HTTP Server with an SSL certificate to enable encrypted traffic. This configuration enhances security by encrypting data transmitted over the network. The SSL certificate ensures secure communication between the server and clients, protecting sensitive information from potential eavesdropping or tampering. By implementing SSL encryption, the Python Simple HTTP Server can provide a more secure environment for data exchange.
2022-09-18 2022Python Cybersecurity beginnerThe content titled "Python Cybersecurity" likely discusses the intersection of Python programming language and cybersecurity. Python is commonly used in cybersecurity for tasks like scripting, automation, and developing security tools. It is a versatile language known for its simplicity and readability, making it a popular choice among cybersecurity professionals. By leveraging Python's libraries and frameworks, cybersecurity experts can efficiently analyze data, detect vulnerabilities, and enhance security measures. The link provided likely leads to more detailed information on how Python is utilized in the field of cybersecurity.
2022-09-13 2022OWASP Pygoat beginnerOWASP Pygoat is a Python-based application security training platform built on the Django framework. It provides developers and testers with a hands-on environment to learn about common web application vulnerabilities, such as XSS and SQL injection, by allowing them to view and remediate vulnerable source code. Pygoat's vulnerabilities are inspired by OWASP Top Ten, MITRE CVE, and SANS Top 25. → owasp.org
2022-08-17 202210 Killer Automation Scripts For Your Daily Stuff | by Haider Imtiaz | Aug, intermediateThe content provides a list of ten Python scripts designed to automate daily tasks and streamline work processes. These scripts aim to simplify common problems and routines by leveraging automation. By utilizing these scripts, individuals can save time and effort on repetitive tasks, enhancing productivity and efficiency in their daily activities. → python.plainenglish.io
2022-08-17 2022Fake webcam for your online meetings, with Python | by Francois Le Roux | C intermediate 6 min readFake webcam implementation in Python allows users to create a virtual camera for online meetings. This tool leverages OpenCV for video frame manipulation, enabling seamless transitions between pre-recorded video modes like smiling or nodding. It includes advanced features such as optimizing transitions based on pixel similarity, adding optional freezes to mask changes, and integrating voice detection to synchronize avatar speech with microphone input. The script, when run with user-provided video recordings, sets up a virtual camera that can be selected in meeting applications via OBS.
2022-08-15 2022A Guide to Python Libraries For Pentesters, Ethical Hackers and System Admi beginner 3 min readPython libraries like `python-nmap` for automated scanning, Twisted for asynchronous networking, Scapy for packet manipulation, BeautifulSoup4 for web scraping, Pymetasploit3 for Metasploit automation, yara-python for rule-based scanning, mechanize for stateful web browsing, and cryptography for cryptographic primitives are essential tools for penetration testers and cybersecurity professionals. These libraries streamline development and automation of penetration testing activities, enhancing efficiency and capability.
2022-08-11 2022The Impossible Web Scraping. Scraping a dynamic website with… | by Nyv Mond intermediate 6 min readScraping dynamic websites that detect automation can be achieved using Selenium to interact with the browser and retrieve HTML, followed by BeautifulSoup for parsing the content. This process involves mimicking user actions like scrolling and clicking "Load More" buttons, then extracting specific data points such as job titles, ranks, and salary information into a structured format like a CSV file.
2022-08-10 2022How to Protect Text Input from XML External Entity (XXE) Attacks using Pyth intermediate 1 min read XXEXXE Detection API for Python identifies XML External Entity attacks in text input by analyzing serialized data. This library helps prevent attacks that can infect files and compromise internal systems by providing a simple boolean response indicating the presence of a threat, allowing for timely isolation and elimination.
2022-05-05 2022Favorite tweet by @_zwink intermediate ReconFavorite tweet: Just created a Python script which given a list of /24 IP address ranges, will crawl them, extract domains and subdomains from SSL certs, check the domains, and write out a CSV file o...
2022-04-25 2022Favorite tweet by @JasonFord beginner OSINT ReconFavorite tweet: I'm continuing to work on my python skills to gather data using threat intel APIs. I've shared this script on GitHub that you can use (with your own API key) to query @EmergingThreats...
2022-03-27 2022Python Useful Regex Quick Reference beginnerThe content highlights the importance of regular expressions (regex) in Python for text processing. It emphasizes that regex is a crucial tool for manipulating and searching text efficiently in Python programming.
2022-03-27 2022An Intro To HTTPX beginnerThe httpx package is a Python library that provides an alternative to the requests library for making HTTP requests. It offers features like HTTP/2 support, async and await syntax, and better performance. HTTPX aims to be a more modern and efficient tool for handling HTTP requests in Python applications.
2022-03-27 2022Python Cybersecurity — Build a Port Scanner intermediateThe content discusses creating a Python script for a port scanner to detect open ports on a network. It provides a tutorial on the implementation process.
2022-03-27 202210 Advanced Automation Scripts for Your Python Projects intermediateThe content discusses the use of Python for automating tasks in projects. It highlights the importance of automation for handling both interesting and mundane tasks efficiently. The focus is on utilizing Python scripts to automate various processes in projects, making work easier and more streamlined.
2022-03-27 20225 Python Libraries That Will Help Automate Your Life beginnerThe content discusses five Python libraries that can automate tasks such as sending emails, extracting data from PDFs, and performing data analysis. These libraries offer resources for quick learning and implementation to streamline daily tasks and improve efficiency.
2022-03-27 2022Malware extraction in Python with Scapy intermediateLearn how to extract malware files from network captures using Python and Scapy in under 200 lines of code. This tutorial demonstrates a concise method for extracting malicious files from network traffic, showcasing the power and efficiency of Python programming for cybersecurity tasks. By leveraging Scapy, a powerful packet manipulation tool, users can quickly and effectively identify and extract malware files for further analysis or mitigation. This streamlined approach highlights the effectiveness of Python and Scapy for cybersecurity professionals in handling malicious content within network traffic.
2022-01-15 2022Capturing Network Traffic With Python And TShark intermediateCapturing Network Traffic With Python And TShark
2022-01-15 202210 Handy Automation Scripts You Should Try Using Python beginner10 Handy Automation Scripts You Should Try Using Python
2022-01-03 2022Writing fast async HTTP requests in Python intermediate 7 min readFast async HTTP requests in Python leverage the `aiohttp` library for concurrent network operations. This approach, utilizing `asyncio` and a semaphore for concurrency control, significantly speeds up web scraping tasks compared to iterative or threaded methods. The library offers robust features for managing connections and rate limiting, making it ideal for handling large volumes of requests efficiently on a local machine.
2021-12-30 2021Golang Offensive Tools with C-Sto and capnspacehook intermediate RCETalk featuring Golang offensive tool developers C-Sto and capnspacehook, discussing Go for red teaming, challenges, and future malware trends. Highlights include C-Sto's goWMIexec and BananaPhone, capnspacehook's pandorasbox, and tools like HackBrowserData, go-netscan, sliver, DeimosC2, and garble for obfuscation and reverse engineering.
2021-12-09 2021Python 201 for Hackers beginner 1 min readPython 201 for Hackers, a course focused on enhancing offensive security skills, covers advanced Python programming techniques relevant to penetration testing. This program is designed to equip learners with the ability to develop custom tools and scripts for various hacking scenarios, progressing beyond fundamental programming knowledge.
2021-12-06 2021How to Brute-Force SSH Servers in Python intermediate 3 min read RCEPython Paramiko library enables building an SSH brute-force script. This method repeatedly tries password combinations against an SSH server, using the `paramiko` library to connect and authenticate. The script handles connection timeouts, authentication failures, and SSH protocol exceptions, including rate limiting, and can save successful credentials to a file.
2021-11-28 2021Quickstart Web3.py 5.22.0 documentation beginner 2 min readweb3.py is an application security library for interacting with the Ethereum blockchain. It supports connecting to local nodes via IPC, HTTP, and WebSocket protocols, as well as remote nodes. The library facilitates reading block data, signing and sending transactions, and deploying and interacting with smart contracts, offering both synchronous and asynchronous interfaces.
2021-11-28 2021Quickstart Web3.py 5.23.1 documentation beginner 2 min readWeb3.py 5.23.1 documentation provides a quickstart for interacting with the Ethereum blockchain using Python. The library supports various connection providers, including test providers like `eth-tester` for prototyping, local node connections via IPC, HTTP, or WebSockets, and remote node providers. Once connected, `w3` instances can be used to read block data, sign and send transactions, and deploy or interact with smart contracts. The documentation also points to further guides on features, the `w3.eth` API, contract usage, and transaction handling.
2021-11-27 2021Bit Twiddling in Python beginnerBit Twiddling in Python
2021-11-20 2021Python Scripting for Hackers Part 1: Getting Started beginner 5 min readLibrary for learning Python scripting for hacking, covering installation of third-party modules like the `python-nmap` module via `pip` and `wget`, fundamental syntax, formatting importance, running files with `chmod`, and incorporating comments. It emphasizes Python's extensive standard libraries and numerous third-party modules available from PyPI for reconnaissance and other hacking tasks. → hackers-arise.com
2021-11-14 2021A Beginners Guide to Python for Cybersecurity beginner 5 min readPython is a crucial programming language for cybersecurity, widely utilized by professionals for tasks like penetration testing and automating security processes. Key Python libraries such as NLTK, NumPy, Pandas, Scikit, Nmap, Twisted, Scapy, Beautiful Soup, Cryptography Library, YARA, Pymetasploit3, and Mechanize offer extensive capabilities for data analysis, malware identification, network scanning, packet manipulation, and web scraping, all contributing to a more robust security posture.