Greetings course seekers. My course, “Ethical Hacking: Design Command and Control using Python 3” is hot off the press here in 2024 and 2025. The way this course works is as follows:
Greetings course seekers. My course, “Ethical Hacking: Design Command and Control using Python 3” is hot off the press here in 2024 and 2025. The way this course works is as follows:
I will start at ground zero and show you how to design and build a fully featured command and control tool using Python 3. I will take the time to explain to you every bit of the code that I use to make this project happen. This is a project that I accomplished myself a couple of years ago, but during my recording sessions for this class, I decided to re-do the code quite a bit, to make it better, and thus, you will get a live and realistic experience, because when bugs show up, they are new for me just as they are for you. I will record for you how I handle these situations and hopefully you can learn from this process.
I will show you how I started the project with a very humble beginning with a small little w3schools search, but then gradually expanded the code, turning it into a fully featured command and control tool over time, including both a client and server portion with many custom commands built in and with full end to end symmetric encryption.
I will move slowly and try to explain everything to you, including the Python code and best practices. I am not trying to rush through anything here with you. I really do want you to learn. However, if you are looking for contrived exercises to do and those sorts of things, this is not the course for that. I am showing you real code for a real Red Team tool that will have real application for you, if you work in or have an interest in Cybersecurity or Ethical Hacking.
The way this course will progress is that we will build the tool together starting from just a couple of lines of code. During every video, I am always using the term “we” because I expect you to be following along with me every step of the way. I will also provide you with 100% of the source code after each lesson, and the final state of the code at the end of the course. My code will become your code and you can take the tool to the next level, although it will be at a prominent level already.
The course is divided up into sections with each video building upon the last. At the end of each section, I always do a Python summary review that speaks directly to the new Python code we covered during a section of the course. Some of you that have Python experience may want to skip these videos, but for beginners or for those who are rusty, I recommend watching them.
The entire course is just over 18 hours in length and unlike other courses that cover many different topics and speed through everything, that is not what happens here. This course covers one topic, or you might consider it to be two topics and that is it. We have the command-and-control tool itself and we have the Python code that is building the tool. That is where all my energy and time will be directed, and this allows you to focus and learn.
My goal is that my course here will be a spark that some of you need to start building your own tools, or to make this tool even better. Learning is easy and fun when you have an interest in something, thus if you have that interest, give my course a try. If you do not care about coding your own custom tools for ethical hacking, then this course is not going to be the right fit for you.
Enough reading already. Go watch a few of my free preview videos and see what you think.
This video explains the instructor's background, as well as the content and style of the course.
This video explains that the command and control tool is to be used with authorization only and always in an ethical manner.
This video explains why Python is a popular choice for offensive cybersecurity tools.
This video explains what is required for the course versus what is optional. It also explains the differences between a build system, target system, and server. The instructor's preference for your configuration is presented, but as you will see, you have the freedom to choose whatever suits you the best.
This video will show how to install the latest version of Python 3.
This video will show how to install the latest version of the PyCharm Community Edition Integrated Development Environment (IDE).
This video will show how to install Ubuntu Linux inside of Windows Subsystem for Linux (WSL) and how to use it.
This video will show how to setup and configure Ubuntu Linux in the Amazon Web Services cloud.
This video will show how to install and configure the PuTTY SSH client tool.
This video will show how to install the Wireshark packet capture tool.
This video will show how to create your project and begin the client code for command and control.
This video will show how to obtain the request headers that were sent to the web server.
This video will show how to change the request headers that are sent to the web server. In particular, you will learn how to make your c2 client look like a modern web browser.
This video will show how to add a proxy option for your c2 client.
This quiz will test your knowledge of the first three sections of the course.
This video shows how to begin putting together the code for the c2 server.
This video will show you how to change the version information for the c2 server.
This video shows how to properly and uniquely identify the compromised windows computers to the c2 server.
This video shows how to override a parent class method with our own method.
This video shows how to properly and uniquely identify the compromised Linux computers to the c2 server.
This video shows how to implement exception handling for the getenv function.
This video provides a summary review of all the Python code used so far in the course.
This quiz covers the Server Code Beginnings section of the course.
This video will show how to begin implementation for a reverse shell capability.
This video will show how to implement exception handling for the requests module's get function.
This video will show how to send a command from the c2 server to the compromised computer.
This video shows how to run the command on the compromised computer that was sent from the c2 server.
This video shows how to send a command's output from the compromised computer to the c2 server.
This video shows how to create and use a settings module. Linux testing is also covered in this video.
This video covers a summary review of all the Python code utilized in the Command Code Beginnings section of this course.
This quiz covers the Command Code Beginnings section of this course.
This video shows how to add a change directory capability for the command and control tool.
This video shows how to handle the exceptions that can occur when changing directory on a compromised computer.
This video shows how to fix the prompt at the c2 server and how to correct another issue with the command being blank.
This video shows how to handle a broken pipe exception and how to obtain a new active client.
This video shows how to place the current working directory from the compromised computer in to the prompt on the c2 server.
This video shows how to implement a client kill command to exit the malware on the compromised computer. It also includes information for putting the malware to sleep via a client sleep command.
This video covers the implementation of a solution that allows the command and control tool to avoid being timed out when the c2 server is hosted within an Azure environment.
This video shows how to obtain a new active client when a client kill command has been issued.
This video provides a summary review of all the Python code introduced during the Begin Adding Features section of the course.
This quiz aligns with the Begin Adding Features section of this course.
This video shows how to implement end-to-end symmetric key encryption in the command and control tool.
This quiz covers the Implementing Encryption section of the course.
This video provides a summary review of all the code introduced during the Implementing Encryption section of the course. Python type hinting is also covered.
This video shows how to implement code on the client to allow for a file to be downloaded from the c2 server to the compromised computer. This is accomplished via a client download FILENAME command.
This video shows how to implement code on the c2 server to allow for a file to be downloaded to the compromised computer.
This video shows how to implement code to allow for a file to be uploaded from the the compromised computer to the c2 server. This is accomplished via a client upload FILENAME command.
This video shows how to implement code to allow for a file to be uploaded from the the compromised computer to the c2 server.
This video shows how to zip and encrypt a file on the compromised computer. The command for this is client zip FILENAME.
This video shows how to refactor code and addresses a bug in the program.
This video shows how to unzip and decrypt a file on the compromised computer. This is accomplished via the client unzip FILENAME.zip command.
This video explains how to go about testing the command and control tool's code.
This video addresses a bug in the program when spaces are in filenames. It also shows how to reset the prompt when a new compromised computer is active.
This video provides a summary review of all the Python code that was introduced during the File Related Features section of the course.
This quiz covers the File Related Features section of the course.
This video explains how to implement threading capabilities for the c2 server.
This video shows how to implement a server show clients command to list each of the compromised clients at the c2 server.
This video shows how to implement a server control PWNED_ID command. This allows the red team operator to switch over control to a different compromised computer. The video also shows how to implement a server exit command to allow a clean shutdown of the c2 server.
This video shows how to implement a server unzip FILENAME command at the c2 server. This allows the red team operator to unzip and decrypt encrypted zip files that are are uploaded from the compromised computers.
This video shows how to implement a server zip FILENAME command at the c2 server. This allows the red team operator to zip and encrypt files that can then be staged for download to compromised computers. The video also covers some exception handling.
This video shows how to implement a server list DIRECTORY command and a server shell command. These commands allow the red team operator to list files on the server, or to access a shell prompt on the server and then be able to easily return to the c2 server terminal window once done working in the shell.
This video shows how to implement a server help command, which gives some quick help to the screen regarding all of the client and server commands available within the tool. The video also covers the setup of logging on the c2 server.
This video shows how to respond to the compromised computer's HTTP GET request if commands are being run at the server instead of on the compromised computer itself.
This video is a Python summary review of all of the code introduced during the Server Commands section of the course.
This quiz covers the Server Commands section of the course.
This video shows how to implement a client delay SECONDS command. This command sets the amount of time an inactive compromised computer waits in between HTTP GET requests to the c2 server.
This video shows how to implement a client get clipboard command. This command will allow the red team operator to steal the compromised computer's cached clipboard information.
This video shows how to implement client keylog on and client keylog off commands. These commands allow the red team operator to log keystrokes from the compromised system.
This video shows how to implement a client type TEXT command. The command allows the red team operator to type text using the compromised computer's keyboard from the c2 server.
This video shows how to implement a client screenshot command. The command allows the red team operator to take a screenshot of the compromised computer's monitors from the c2 server.
This video shows how to implement a client display IMAGE command. The command allows the red team operator to display an image file on the compromised computer's screen from the c2 server.
This video shows how to implement a client flip screen command. The command allows the red team operator to flip the compromised computer's screens upside down from the c2 server. The video also shows how to implement a client roll screen command. That command allows the red team operator to barrel roll the compromised computer's screens from the c2 server.
This video shows how to implement a client max volume command. The command allows the red team operator to turn up the volume to 100% on the compromised computer from the c2 server. The video also shows how to implement a client play FILENAME.wav command. That command allows the red team operator to play a sound file on the compromised computer from the c2 server.
This video shows how to code the command and control tool to allow for operating system commands or other scripts to run in the background, even on compromised Windows computers.
This video was a late addition. I had missed a few Try/Except statements when creating the course. Those are covered now in this video.
This video provides a summary review of all of the Python code introduced during the Client Commands section of the course.
This quiz covers the Client Commands section of the course.
This video shows how to create individual client code bases for Linux and Windows operating systems and explains why.
This video shows the Linux client to Linux c2 server test results. It also covers some bug fixes.
This video covers serveral useful topics related to the command and control tool being used for Linux targets.
This video covers testing of the command and control tool's code.
This video shows how to package the Windows-based target's command and control tool as a single executable file that contains all of the files necessary for operation, including Python itself and all of the dependencies. When run, everything will extract and run silently in the background with no visible evidence of this fact on the compromised computer's screen.
This video shows how to package the Linux-based target's command and control tool as a single executable file that contains all of the files necessary for operation, including Python itself and all of the dependencies. The video also shows how to run this executable file on the target system without being noticed.
This video shows how to package the target's command and control tool as a folder that contains all of the files necessary for operation, including Python itself and all of the dependencies.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.