
Learn python from a hacker's perspective to automate tasks, debug scripts, and tackle projects on login brute-forcing, web injection, and using packages like requests.
Explore Python as a dynamic, interpretive, high-level, object-oriented language that abstracts details for faster scripting, cross-platform compatibility, and a rich standard library for hacking tasks and automated scripts.
Discover why hackers learn Python: understand, debug, and modify scripts and proofs of concepts; build your own tools and automate tasks with a beginner-friendly, mature language.
Install VirtualBox to run a Linux guest on your Windows host, set up a Python environment, and learn to write and execute Python scripts in a virtual machine.
Download and install Kali Linux from an ISO, set up a 64-bit VirtualBox VM with a 40 GB dynamic disk, boot, and enable bidirectional clipboard for host-guest Python development.
Discover how the python interpreter provides an interactive sandbox to test commands and functions line by line, enabling quick one-liners and hands-on exploration before running full scripts.
Learn to run Python scripts using Python 3 or Python 2, make scripts executable, and understand __name__ == '__main__' and import behavior.
Install sublime text on a linux system via apt, using the stable version from sublime text dot com and enable syntax highlighting for Python scripts.
Master Python syntax by understanding indentation defines code blocks and the rules for spaces or tabs. Explore variables, the print function, backslash line continuations, and Python docs and pep8.
Explore variables and data types in Python, including strings, integers, lists, tuples, dictionaries, booleans, ranges, and bytes, with casting, printing, and type checks.
Master python strings by defining single, double, and multiline literals, escaping quotes and newlines, and manipulating with upper, lower, strip, split, and replace, then formatting with format or f-strings.
Explore booleans and operators in Python, evaluate true and false values, use not, and, or, compare with equals and inequalities, and practice bitwise and/or and bit shifts with binary formatting.
Learn how dictionaries store data as unique key–value pairs in curly brackets, offering fast lookups in Python; create, access, update, remove, iterate keys/values/items, nest dictionaries, and build empty dicts.
Learn how Python sets store multiple values, are unordered, and disallow duplicates. Define sets with literals or set(), then add, update, and remove items, including using discard and pop.
Explore Python conditionals by branching on true or false comparisons, using if, elif, and else, combining conditions with and/or, and applying inline ternary expressions for concise decisions.
Master Python loops, from while and for loops to range and nested iterations, and learn loop control statements break, continue, and pass, plus iterating over strings and dictionaries.
Learn to read and write files in python using open in text and binary modes, use read, readlines, seek, and write, handle encoding, iterate lines, and manage file objects safely.
Master Python comprehensions to build lists from iterables with concise syntax. Utilize conditionals, range, nested structures, and the join method to compare with long form and apply ternaries.
Explore lambda functions as anonymous one-expression tools in Python, including simple adds, even/odd checks, and breaking strings into blocks, with one-line demos and function rewrites.
Master Python virtual environments to isolate packages, run multiple versions simultaneously, and manage dependencies across scripts with activation and deactivation workflows.
Explore the sys standard library module, learning how to access version info, the interpreter executable, platform, standard in, standard out, standard error, command line arguments, and exit codes.
Learn to use the Pontus library, a capture-the-flag framework and exploit development library, to interact with local and remote processes, pack data, work with contexts and assembly, and search gadgets.
If you are looking for a wordlist to use (such as a similar file to the top-100 text file used in the lesson), you can download similar lists from: https://github.com/danielmiessler/SecLists/tree/master/Passwords/Common-Credentials
An SSH service you are authorised to test (such as on your localhost) is required to test this script.
Note that the default Kali SSH configuration will block authentication attempts after 10 attempts (MaxStartups 10:30:10). If you want to test 100 connections + the valid password using the above wordlist, you will need to edit your sshd_config (for example, by setting MaxStartups 101) and restarting the service. Alternatively to test, use a wordlist with less than 10 invalid passwords.
Explore sha256 password cracking in Python, reading a password list from a file on the command line, hashing each guess, and comparing to a target hash with progress logs.
A web application you are authorised to test is required to test this script.
A web application you are authorised to test is required to test this script.
A web application you are authorised to test is required to test this script.
For example, you can test out your knowledge for free, by solving the “The Flag API Key” challenge hosted at https://247CTF.com in the Web category.
Learn the importance of comments in Python and how to document your scripts with single-line, end-of-line, and multi-line comments using the pound and triple quotes.
The Python 101 for Hackers course teaches an introduction to Python programming and concepts, with a focus on techniques, modules and examples which are useful for a hacker. No prior Python programming knowledge is required to be successful in this introductory course.
Students should take this Python 101 for Hackers course if they are interested in:
Understanding fundamental Python programming concepts, required to automate common hacking and bug bounty related tasks
Learning how to identify and mitigate Python programming errors which may occur when attempting to execute code snippets or proof of concept (PoC) scripts
Bridging the gap between generic programming concepts and practical hacking applications such as password cracking, web login brute forcing or exploitation of SQL injections
The following concepts will be taught in this course:
The difference between Python2 and Python3, and how to leverage both as hacking and automation tools
How to install, setup and configure a Python environment in Kali Linux with Virtual Box
Fundamental programming concepts: variables, data types, string formatting, booleans, operators, tuples, lists, dictionaries, sets conditionals, functions and loops
Python programming concepts useful for solving hacking and automation tasks: reading files, writing files, handling user input, exception and error handling, comprehensions and lambdas
How to leverage and extend Python using common and hacking focused modules
Practical examples demonstrating how to perform SSH login brute forcing, SHA256 password cracking, web login form brute forcing and SQL injection exploitation using Python
Understanding the importance of documenting and commenting your work and recommendations to continue mastering Python and programming moving forward