This chapter provides hands-on exercises to test and reinforce the concepts you have learned in the previous chapters. These tasks are designed to help you apply theoretical knowledge to practical scenarios, focusing on Linux basics, advanced scripting, and cybersecurity skills.
- Create a directory structure for a project:
project/ ├── src/ ├── docs/ ├── tests/
- List all files in the
/etc
directory that contain the word "conf" in their name. - Find the largest 5 files in your home directory.
- Create a tar archive of the
/var/log
directory and compress it using Gzip.
- Create a file
secure.txt
withrw-r-----
permissions. - Add a sticky bit to a shared directory so that only file owners can delete their files.
- Use ACL to grant a specific user write access to a file they don’t own.
- Use
ping
to check connectivity with an external server. - Capture network packets on a specific interface using
tcpdump
and analyze them in Wireshark. - Create a simple script that scans a range of IP addresses for open ports.
- Write a script to back up a directory to a specified location, appending the date to the archive’s name.
- Automate cleaning up old log files (older than 7 days) in a specific directory.
- Create a script to monitor CPU usage and alert if it exceeds 80%.
- Create a Python script to encrypt and decrypt a file using the
cryptography
library. - Write a script to fetch and display the latest weather information from a public API.
- Build a chat application using Python sockets for communication between two systems.
- Configure a firewall using
ufw
to allow SSH traffic and block all other incoming connections. - Set up Tor for anonymous browsing and verify its functionality.
- Monitor failed login attempts using
/var/log/auth.log
and write a summary report.
- List all loaded kernel modules and find their sizes.
- Insert and remove a custom kernel module.
- Enable IP forwarding using
sysctl
and verify its effect.
- Schedule a cron job to clean up temporary files every day at midnight.
- Create a
systemd
timer to run a backup script weekly. - Use the
at
command to schedule a task to send an alert email in 1 hour.
- Use
airodump-ng
to capture packets for a specific wireless network. - Test the signal strength of nearby networks using
nmcli
. - Secure your wireless router by disabling WPS and enabling WPA3.
- Rebuild the Linux kernel with a custom configuration and test it.
- Develop a Python tool to log keystrokes (for educational purposes only).
- Create a full penetration testing report for a virtual lab environment, including vulnerabilities found and mitigations applied.
These exercises are designed to provide a mix of theoretical and practical challenges to strengthen your skills. By completing them, you will gain deeper insights into Linux system management, scripting, and cybersecurity practices.
Feel free to revisit previous chapters for reference while working on these tasks. 🚀