
Explore security scripting with Python, covering Python basics, syntax, essential libraries, and the differences between Python 2 and Python 3 for security tasks.
learn python basics and practical networking and security topics, including telnet, udp, email and web servers, http requests, spidering, and basic forensic skills.
Download Python from python.org for Mac OS, Windows, or Linux, then install with the appropriate installer; understand differences between Python 2.x and 3.x and platform-specific setup.
Explore integrated development environments for Python, compare vi’s limitations with autocomplete, and learn how PyCharm community edition and other IDEs speed up writing and running scripts.
Explore the differences between Python 2 and Python 3, why 3 is the current and future version, and how to navigate library compatibility and coexistence.
Learn to access your working files by downloading and extracting the zip, saving to your desktop, and using the player's open working files option to work with the lessons.
Master Python basics by using the Idle console to interactively test Python 3 code, run quick snippets, and explore subroutines before writing full programs.
Learn how to create and run Python scripts across macOS, Linux, and Windows, using the .py extension, a shebang line, and the interpreter from the command line or an IDE.
Discover Python variables and dynamic typing, where the interpreter infers type without declarations. See how mixing integers and strings causes errors and how to fix them with conversion or concatenation.
Learn Python loops, from for loops with range to while loops with break, and practice iterating over lists to print items and manage a loop counter.
Explore scoping in Python by examining how and where variables are defined and used, resolving name error, and ensuring variables are created before use to compute sums.
Explore subroutines in Python, also called functions or methods, and learn how to group statements with def, use parameters, return values, and improve readability through scope awareness.
Convert keyboard input to a number and test it with if and else. Use else if and boolean operators to handle all cases with less than, greater than, and equal.
Discover how to access the operating system from Python using os and subprocess, fetch the current working directory, user ID, and PATH, and run ls -la with system and call.
Explore threading in Python with a thread class, run methods, and a collection of threads that you start and join for concurrent network server or client tasks.
Learn how to use argparse to parse command line arguments in Python, including required and optional parameters, help text, and accessing parsed values.
Explore how to handle exceptions in Python by using try and except blocks, catching io errors, and preserving program flow during file operations.
Install and manage Python libraries using pip to extend your programs and search for packages. Use the PyCharm project interpreter to install and import selected packages, avoiding reinventing the wheel.
Learn how classes encapsulate data and methods in object oriented programming, instantiate objects, use self, and access values with a get val method in Python.
Create multiple instances of the same class to see how each instance maintains its own data and methods, including setting values after instantiation and retrieving them.
Learn how big endian and little endian represent multibyte values, why network byte order is big endian, and how to convert host to network byte order when transmitting numbers.
Use the Python socket library to perform host lookups by address and by name, including reverse lookups and dns lookups with gethostbyaddr and gethostbyname.
Write a simple network client that uses the socket library to connect to localhost port 5555 via tcp, send a message, and close the socket with basic error handling.
Build Python network server using sockets, bind to port 9898, listen for connections, accept client, receive up to 512 bytes, decode UTF 8, and write address and data to file.
Learn banner grabbing with a Python socket script to extract the server name from http headers on port 80, using regular expressions to parse and print the server field.
Make a simple HTTP request in Python using an HTTP client library, create a connection, send GET to the root, and print status, headers, and UTF-8 decoded page text.
Learn to capture packets in Python using the PKP library, listing available devices. Open an Ethernet interface in promiscuous mode, then iterate over packets and print their counts.
Pull and parse captured packets to extract layer 2 and ip headers, uncovering source and destination mac addresses, protocol, and time to live using Python's struct unpack.
Learn to parse offline pcap files by opening a pre-captured file, iterating packets, and extracting header data such as source and destination MAC addresses, protocol, and TTL.
Create a raw packet from scratch using the escapee library, build ethernet, IP, and TCAP layers with a payload, then print and send the frame with sendp on Linux.
Wrap the socket in an SSL wrapper to communicate with servers over port 443, encrypting and decrypting via SSL, then send and receive as byte arrays and print the cipher.
Learn to send email using the smtp library, performing ehlo, mail from, rcpt to, and data against a local server, with optional mime messages and error handling.
Learn how to retrieve email with pop3 and imap, connect to servers, log in, list messages, search, fetch message bodies, and close sessions using python's poplib and imaplib.
Use the FTP protocol with the FTP library to connect, log in, and list directories, while explaining active and passive modes and transferring a binary file.
Explore how to join a multicast group using a UDP datagram socket, sending messages to a multicast IP address and port, and capture traffic with Wireshark to verify delivery.
Send a message over udp using a datagram socket with the socket library, illustrating that udp is faster but less reliable and may drop data, unless application layer handles acknowledgments.
Use Python's telnet library to log into a remote host with a user and password. Read until prompts, run commands like ls, handle exceptions, and close the connection.
Encode the username and password with base64 to create a basic authentication token. Send a request with an authorization header to a protected page using a Python http library.
Learn to send an http get request with the htp library, set the host and user-agent headers, and plug in custom headers for security testing.
Learn to fetch a web page with a Python http request library, read the set cookie field from the response, and print cookies including expires flag from Google.
Use the HTP lib to send a head request to the Infinite Skills site, retrieve status code and headers, and examine cookies and X powered by to identify the server.
Interface with web forms using Python's urllib to post encoded data to a local server, including name, age, and submit button, and read the server's response.
Parse web responses by subclassing an html parser to extract input fields and their attributes from a web form, printing type and name attributes as you parse the page.
Install a proxy handler with urllib, configure a local proxy on port 80, create an opener, install it, and route url requests through the proxy to retrieve and print results.
Learn to download a file via http by using a library that handles the download with urlretrieve, saving it as thing.mp3 and showing start and finish prints.
Learn to build a spidering utility in Python by parsing HTML anchor tags to extract href links and recursively follow them to list all site pages.
Build a multi-threaded socket client to simulate many simultaneous connections for load testing a server. Create a thread class, start multiple instances, and manage the connections to observe threading behavior.
Learn to create and access alternate data streams on NTFS in Windows using the colon separator to attach a stream to a file and read it back.
Explore fuzzing with Python by injecting anomalies into an application's input stream to provoke errors. Use the Peiffer generator to create random ASCII inputs and craft socket-level requests.
Learn to debug with Python by launching or attaching a debugger to a running program. Inspect processes, monitor status, and collect information to understand program behavior.
Discover how to perform steganography by hiding text inside an image, encoding plain text into a jpeg, and verifying the embedded data.
Demonstrates encrypting and decrypting data with the advanced encryption standard in CBC mode, using a symmetric key and a 16-byte initialization vector, including padding to a multiple of 16 bytes.
Pad plaintext to 16 bytes and encrypt with a key. Encode the ciphertext as base64 ascii, embed in an image, then extract, decode, and decrypt to recover plaintext.
Connect to a MySQL database on a Linux server from Python, obtain a cursor, execute a select * from grades, fetch results, and print name and grade with exception handling.
Replay network traffic from a packet capture using the scaping library, adjust source and destination mac and ip, read frames from a pre-cap file, and resend them for testing.
Learn to write to the Windows registry with Python by creating a current user software key, setting a value, and handling errors with a simple library.
Read a Windows registry key with the underscore when read library in Python, open under the current user software key, query value my Val, and print data with error handling.
Parse the master file table on an NTFS volume by reading BIOS parameter block. Extract bytes per sector, sectors per cluster, and MFT mirror locations to compute addresses.
Calculate the first MFT sector on a disk image and read the first MFT attribute, including the 'file' signature, sequence number at offsets 10–11, and 1024-byte size.
Explore parsing a multi-part apache mod_security log, extracting dates, http requests, headers, and messages, and writing structured records to file or screen for later database reporting.
Parse the master boot record by reading the first 512 bytes of a disk image and struct unpack to extract the disk signature, active flag, and partition start and end.
Learn to list processes using a library, loop through each process to print its name, and retrieve memory maps and details such as command line and working directory.
Learn to access an embedded sequel light database by connecting to a database file, create a cursor, and run a select on the origins table to print rows.
Connect to Firefox's cookies SQLite database, extract unique cookie domains, sort them alphabetically, and print the domain list for browser data analysis.
Learn to access the Windows recycle bin with Python’s OS library, walk the hidden per-user directories by security identifier, and print full paths to contained files with proper escaping.
Walk through a file system using os.walk to traverse the directory tree from the root, collect current directories and files, and print each file path.
Walk the home directory to find files modified within the last three days using os and datetime, compare timestamps, and print matching file names and dates.
Learn how Twisted enables event-driven networking in Python by waiting for events in a server context. Use a handler for return traffic and review the Twisted documentation.
Learn how Twisted builds an event-driven echo server with a protocol and a factory, using a reactor to listen on port 8000 and echo received data.
Explore using the twisted library design patterns to implement an echo client with a factory and protocol, handling connection events, data transfer, and reactor control.
Show how to fetch a web page with the Twisted HTTP client in Python, using reactor, getPage, and callbacks to print the HTML and handle errors.
Master Python basics, including classes, instances, loops, and variables, with http libraries and parsing web outputs. Explore security topics like steganography, encryption, and forensics on Windows registry and file systems.
Join the Python security community to extend its functionality through libraries, documentation, and training, advancing encryption, forensics, and penetration testing skills.
In this advanced course, you'll first learn how to create, run, and troubleshoot scripts with Python and then move through specific programming libraries and technologies that allow you to tackle several networking tasks and security measures. No experience is required, although any programming knowledge would be an asset.
You will start with an overview of Python, including how to create and run scripts, use threads, and handle exceptions. From there, Ric will teach you how to network, including how to use the Python libraries for network scripting and develop basic scripts with network functionality. This video tutorial will also cover HTTP programming, security scripting, and forensic scripting. Finally, you will learn about Twisted Python, including the Echo server and HTTP client. Once you have completed the course, you will be fully capable of debugging and security testing using Python, as well as writing Python scripts. Working files are included, allowing you to follow along with the author throughout the lessons.