Journey · Beginner → Intermediate
Python for Ethical Hacking & Cybersecurity
Learn Python for ethical hacking and cybersecurity, free and step by step. Write your own port scanner, packet sniffer, subdomain finder and hash checker in Python on Kali Linux. A beginner-friendly Python hacking tutorial for students, SOC analysts and anyone starting in cyber security.
0 of 12 lessons done
Getting started
1
Why ethical hackers learn Python
Python is the ethical hacker's favourite language, and almost every modern security tool is written in it. Here's why. · 6 min · quiz
2
Set up Python on Kali Linux (venv and pip)
Kali ships with Python 3. Here's how to set up a clean virtual environment and install the libraries this path uses. · 6 min · quiz
Python essentials
3
Python basics through a hacker's lens
You don't need a CS degree to script security tools. Here are the six Python building blocks that matter, each with a reason a hacker cares. · 7 min · quiz
4
Files, functions and errors: read wordlists and logs
Real security scripts read their data - huge wordlists and server logs. Here are the three skills that turn a toy script into a real tool. · 7 min · quiz
Network tools
5
Build a Python port scanner with sockets
A port scanner is the hello-world of ethical hacking tools. Build a working one in about 15 lines with Python's built-in socket module. · 8 min · quiz
6
Faster scanning: threads and banner grabbing
Your scanner works but crawls. Speed it up with threads, then teach it to report what each open service actually is. · 8 min · quiz
Web recon
7
Subdomain and directory enumeration with Python requests
Before attacking an app, testers map its attack surface. Here's how to enumerate subdomains and hidden directories with the requests library. · 8 min · quiz
8
Web scraping for OSINT recon
Open-source intelligence lives on web pages. Here is how Python turns a human-readable page into structured data you can act on. · 8 min · quiz
Passwords and crypto
9
Build a hash cracker with hashlib (dictionary attack)
When a site stores a password it should store a hash. Here's how hashes work, and why weak ones fall to a dictionary attack in seconds. · 8 min · quiz
10
Encrypt files with Python (Fernet and AES)
Hashing proves data hasn't changed; encryption keeps it secret and lets you get it back. Encrypt and decrypt a file in a few lines. · 7 min · quiz
Blue team
11
Packet sniffing with Scapy
Every action on a network becomes packets on the wire. A sniffer reads them - the fastest way to grasp how networks really work. · 8 min · quiz
12
Capstone: build a brute-force detector for auth logs
Flip from attacker to defender. Build a script that reads a login log and flags the IPs hammering it with failed passwords. · 9 min · quiz