Back

SecureCorp Incident Response Case Study | bakeery

February 1, 2025

3 min read

Table of Contents

  1. Abstract
  2. Footprinting and Reconnaissance
  3. Gaining Access
  4. Privilege Escalation & Persistence
  5. Data Exfiltration
  6. Incident Response and Analysis
  7. Recovery and Remediation
  8. Lessons Learned

Abstract

This case study documents a simulated penetration test against SecureCorp, a deliberately vulnerable lab environment running on Ubuntu. The exercise mirrors a real-world compromise scenario, covering the full kill chain: from initial reconnaissance to privilege escalation, persistence, and data exfiltration. It concludes with an incident response investigation using Redline and native Linux forensic techniques. The study emphasizes both offensive (red team) and defensive (blue team) operations, and provides remediation strategies for preventing similar breaches.


1. Footprinting and Reconnaissance

The first phase of the attack focused on identifying the target’s exposed services and software versions through both passive and active scanning.

Tools Used: nmap, searchsploit, john

Network Scan

nmap -A -sV -Pn <target_ip>

This scan revealed several key services:

scan

Anonymous login on FTP is a critical finding. However, accessing it did not reveal any useful files at the time.

ftp

Software versions were checked for known exploits using searchsploit, but none were found for the discovered versions:

scan

Web Login Page Enumeration

The application on port 8000 exposed a login page without any registration functionality. This could be vulnerable to:


2. Gaining Access

A brute-force attack was launched on the login portal using Burp Suite Professional.

Brute-Force Attack Procedure

burpd capture intruder

A successful login resulted in a 302 redirect response indicating access to the admin dashboard:

Username: admin
Password: password123

320 320


3. Privilege Escalation & Persistence

Upon logging into the admin dashboard:

dasboard

Features such as file download and a search bar hinted at potential vulnerabilities. A Path Traversal attack on the search bar successfully retrieved the /etc/shadow file:

shadow

Cracking the Shadow Hash

The extracted hash was cracked using john with a simple wordlist:

john shadow --wordlist=/usr/share/wordlists/rockyou.txt

crack

Using the cracked password, SSH access was obtained:

ssh

Persistence

A new user was added for persistent access:

sudo useradd attacker -m -s /bin/bash
sudo usermod -aG sudo attacker

pers


4. Data Exfiltration

An exfiltration script was created to send sensitive data to an attacker-controlled server:

script

Executed successfully:

exfil


5. Incident Response and Analysis

The blue team noticed unusual outbound traffic and began investigating.

Process and Network Review

Running processes were reviewed using:

ps aux | grep script

Identified an unauthorized script (script.sh):

find

Network connections were checked:

netstat -tunap

An active SSH connection to 192.168.10.4 was observed:

net

Log Review

Apache Logs indicated brute-force activity and successful login.

Authentication Logs (/var/log/auth.log) revealed:

auth


6. Recovery and Remediation

Steps Taken:

  1. User Removal and Credential Reset
sudo userdel -r attacker
passwd server

del

  1. Application Fixes

    • Patched the path traversal vulnerability.
    • Changed admin credentials.
    • Hardened file upload and search mechanisms.
  2. Infrastructure Hardening

    • Disabled anonymous FTP.
    • Implemented rate-limiting on login endpoints.
    • Enforced strong password policies.
  3. Monitoring

    • Enabled real-time log monitoring and alerts.
    • Set up file integrity monitoring (e.g., with AIDE).
  4. Firewall and Network Controls

    • Blocked IP 192.168.10.4.
    • Restricted SSH to internal IPs or VPN access.
  5. Full Host Forensic Analysis

    • Collected Redline memory dump for timeline and malware analysis.
    • Used chkrootkit, rkhunter, and logwatch for deeper investigation.

7. Lessons Learned


⚠️ Recommendation: Conduct regular penetration testing, enable MFA, and train staff on recognizing unusual behavior. Security is a continuous process — not a product.