Detect System activity using Python
In this lab, you’ll practice and develop skills related to writing python scripts. The focus of these scripts will be to monitor different aspects of a computer system that would indicate malicious activity, allowing you as the administrator/analyst to achieve early detection of threats. When you’re finished, you’ll have the ability to detect malicious system activity, automatically run these scripts using cron jobs & have these scripts take action to resolve the issue without the need for human intervention.
Terms and conditions apply.
Lab info
Lab author
Challenge
Get Started in the Lab Environment
Here are the initial instructions and explanation of the lab environment. Read this while your environment is busy creating itself from nothing. Yes, this violates physics; we know. How fun!
Challenge
Detecting Malicious User Accounts on a System
This challenge will teach learners how they can create a Python script that will extract a list of active users for a Linux system, compare that to all registered users, and generate an alert if there are any unauthorized user accounts on the system.
Challenge
Monitoring Storage and Memory Usage
In this challenge, we will focus on how to monitor system resources, in particular storage and memory usage on a system. This is important from an availability point of view, for critical applications like a web server you want to ensure that these systems are not overloaded.
Challenge
Monitoring Open Ports
In this challenge, we will look at extracting a list of all open ports and the services running on those ports for our Ubuntu system. This is important because open ports represent the attack surface of your machine to the outside world.
Challenge
Running Scripts Automatically Using Cron Jobs & Automated Detection Using auditd
This challenge will focus on Cron Jobs and how we can use them to automatically run our scripts on a given interval. We will create a cron job that runs our scripts without the need for human intervention. You will also use the tool auditd to monitor the central log file for any changes (which would indicate potential malicious activity) and record who is doing the edits, this would ensure that no one is maliciously modifying the file in a real-world scenario.
Challenge
The Last Challenge
Welcome to the final challenge! This is your last chance to experiment in the environment. Clicking Finish Lab will end this little world that flittered into existence just for you.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.
Recommended prerequisites
- Basic understanding of the Linux command line
- Basic understanding of python
- Basic understanding of systems administration
- Basic understanding of malware and cyber threat tactics