Anti-Forensic Techniques: Hiding Processes on Linux and Detection Methods

Listen to this Post

Featured Image

Introduction

Anti-forensic techniques are used to evade detection during cybersecurity incidents, making forensic investigations challenging. One such method involves hiding processes from tools like ps, as demonstrated by the “zapper” tool. This article explores how attackers conceal processes on Linux and how defenders can uncover them using `/proc` analysis.

Learning Objectives

  • Understand how the `zapper` tool hides processes from ps.
  • Learn forensic techniques to detect hidden processes using /proc.
  • Explore defensive strategies against anti-forensic evasion.

You Should Know

1. Hiding Processes with Zapper

Command:

git clone https://github.com/THCorg/zapper 
cd zapper 
make 
./zapper -p <PID> 

Step-by-Step Guide:

  1. Clone the zapper tool from The Hacker’s Choice GitHub repository.

2. Compile it using `make`.

  1. Run `zapper` with the `-p` flag followed by the target process ID (PID).
  2. Verify the process is hidden by running ps aux | grep <process_name>.

This tool manipulates process visibility by altering how the kernel reports process information, making it invisible to ps.

2. Detecting Hidden Processes via `/proc`

Command:

ls -la /proc/<PID>/exe 

Step-by-Step Guide:

  1. List all processes in `/proc` using ls /proc.
  2. Identify suspicious PIDs (e.g., high numbers or unusual names).
  3. Check the `exe` symlink for the process to reveal its true binary path.

4. Compare with `ps` output to detect discrepancies.

Even if `ps` hides a process, `/proc` retains metadata, including the executable path.

3. Analyzing Process Memory for Anomalies

Command:

cat /proc/<PID>/maps 

Step-by-Step Guide:

  1. Use `cat` to inspect the memory mappings of a suspicious PID.
  2. Look for unusual memory regions or unauthorized libraries.

3. Cross-reference with known legitimate process behavior.

Memory analysis can reveal hidden code injections or unauthorized process modifications.

4. Monitoring Process Activity with `strace`

Command:

strace -p <PID> 

Step-by-Step Guide:

  1. Attach `strace` to a suspicious PID to monitor system calls.
  2. Look for unusual file accesses, network connections, or privilege escalations.

3. Terminate malicious processes identified via anomalous activity.

`strace` provides real-time insights into process behavior, bypassing anti-forensic tricks.

5. Hardening Systems Against Process Hiding

Command:

chmod 700 /proc 

Step-by-Step Guide:

  1. Restrict `/proc` access to root only to prevent tampering.

2. Implement auditd rules to log process creation/deletion:

auditctl -a always,exit -S execve -k process_monitoring 

3. Deploy endpoint detection tools (e.g., Falco) to alert on hidden processes.

Limiting `/proc` access and auditing process activity reduces anti-forensic effectiveness.

What Undercode Say

  • Key Takeaway 1: Anti-forensic tools like `zapper` exploit kernel reporting mechanisms, but `/proc` remains a reliable detection source.
  • Key Takeaway 2: Proactive monitoring (e.g., strace, auditd) is critical to counter advanced evasion techniques.

Analysis:

While attackers continuously refine anti-forensic methods, defenders can leverage low-level system artifacts (/proc, memory dumps) to uncover hidden activity. The arms race between evasion and detection underscores the need for layered defenses, including strict access controls and behavioral analytics. Future threats may leverage kernel-level rootkits, making memory forensics and hardware-assisted security (e.g., Intel CET) essential.

Prediction

As anti-forensic tools evolve, defenders will increasingly rely on machine learning and hardware-based security to detect anomalies. Kernel integrity monitoring and eBPF-based tracing will become standard practices in incident response.

IT/Security Reporter URL:

Reported By: Stephan Berger – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram