Python for Cybersecurity
By Wanderson Leandro de Oliveira
This course assumes you already know Python Intermediate — classes and objects, working with the requests library, JSON, decorators, context managers and basic testing — and builds security skills on top of that foundation. You will script with sockets, parse and analyze logs, build a simple port scanner, query DNS and WHOIS, capture packets with Scapy, test APIs and detect common web vulnerabilities, work with hashing, HMAC and the cryptography library, automate defensive checks like dependency audits and file integrity monitoring, and finish by building a small CLI security scanner. Every scanning or reconnaissance example in this course targets localhost, 127.0.0.1, or clearly fictitious example hosts — never scan or test a system you do not own or have explicit authorization to test.
Course content
Security scripting fundamentals
- 🔒 Why Python for security text
- 🔒 Working with sockets: the basics text
- 🔒 Parsing and analyzing logs text
Reconnaissance and networking
- 🔒 Building a simple port scanner text
- 🔒 DNS lookups and WHOIS with Python text
- 🔒 Working with Scapy: the basics text
Web and APIs
- 🔒 Testing APIs with requests text
- 🔒 Detecting common web vulnerabilities with scripts text
- 🔒 Scripts for rate limit and auth testing text
Cryptography and hashing in Python
- 🔒 Hashing and HMAC in Python text
- 🔒 Working with the cryptography library text
- 🔒 Detecting weak hashes in a codebase text
Defensive automation
- 🔒 Parsing and alerting on suspicious logs text
- 🔒 Automating dependency vulnerability checks text
- 🔒 Writing a simple file integrity checker text
Hands-on project
- 🔒 Building a password strength auditor text
- 🔒 Building a basic network recon tool text
- 🔒 Practical project: a security scanner CLI text