By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(Ransomware, Trojans, Worms, Rootkits, Logic Bombs)
Malware is the #1 cause of security incidents in production environments. If you ignore it, you’re one click away from: - A $5M ransomware payout (or a career-ending breach). - A worm spreading across your cloud VPCs in minutes. - A rootkit hiding in your CI/CD pipeline, stealing API keys for months.
Real-world scenario: You’re a SOC analyst. At 3 AM, your SIEM alerts on unusual SMB traffic (port 445) from a developer’s laptop. Your boss asks: - "Is this ransomware? A worm? How do we stop it?" - "Could this be a Trojan from that ‘free’ IDE plugin the dev installed?" - "How do we know if it’s already in our Active Directory?"
If you can’t answer these instantly, you’re already behind. This guide gives you: ? Instant recognition of malware types (no theory—just what you’ll see in logs). ? CLI commands to detect and contain them. ? Checklists for incident response (IR) when the alarm goes off.
chkrootkit
rkhunter
volatility
Symptoms: - Files renamed with .lockbit, .revil, or .encrypted. - Ransom note (README.txt, DECRYPT-FILES.html) in every folder. - High CPU/disk usage (encryption in progress).
.lockbit
.revil
.encrypted
README.txt
DECRYPT-FILES.html
Commands to confirm:
# Check for suspicious processes (e.g., encrypting files) Get-Process | Where-Object { $_.CPU -gt 50 } | Select-Object Name, CPU, Path # Look for ransom notes Get-ChildItem -Path C:\ -Recurse -Filter "*README*.txt" -ErrorAction SilentlyContinue # Check for unusual SMB connections (ransomware spreads via SMB) netstat -ano | findstr "445"
Containment steps:1. Isolate the machine (unplug network cable or disable Wi-Fi).2. Kill the malicious process (use taskkill /PID <ID> /F).3. Restore from backups (if available—test backups first!).4. Block known ransomware IPs in firewall: bash # Example: Block LockBit C2 servers (replace with actual IPs) iptables -A INPUT -s 185.141.63.120 -j DROP
taskkill /PID <ID> /F
bash # Example: Block LockBit C2 servers (replace with actual IPs) iptables -A INPUT -s 185.141.63.120 -j DROP
Symptoms: - Unusual outbound connections (e.g., to 185.141.63.120:443). - Suspicious startup entries (msconfig or autoruns). - Unexpected .exe files in %APPDATA% or %TEMP%.
185.141.63.120:443
msconfig
autoruns
.exe
%APPDATA%
%TEMP%
# Check for suspicious startup programs Get-CimInstance Win32_StartupCommand | Select-Object Name, Command, Location # Look for unusual scheduled tasks (Trojans often persist here) Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "\Microsoft*" } | Select-Object TaskName, TaskPath # Check for unusual network connections (e.g., to known C2 servers) netstat -ano | findstr "ESTABLISHED"
Containment steps:1. Kill the process (taskkill /PID <ID> /F).2. Delete the malicious file (check Path in Get-Process).3. Remove persistence (delete registry keys, scheduled tasks, or startup entries).4. Scan with Microsoft Defender Offline (or another AV).
Path
Get-Process
Symptoms: - High network traffic (worms spread aggressively). - Unusual processes (e.g., minerd, cryptonight—crypto mining worms). - New users or SSH keys added.
minerd
cryptonight
# Check for unusual processes ps auxf | grep -i "minerd\|cryptonight\|worm" # Look for suspicious network connections ss -tulnp | grep -E "445|139|135" # SMB ports (WannaCry) # Check for new users (worms often add backdoors) cat /etc/passwd | grep -v "root\|daemon\|bin" # Check for unusual cron jobs (persistence) crontab -l ls -la /etc/cron.* /etc/crontab
Containment steps:1. Isolate the machine (ifconfig eth0 down or iptables -A INPUT -j DROP).2. Kill the worm process (kill -9 <PID>).3. Remove persistence (delete cron jobs, SSH keys, or malicious users).4. Patch the vulnerability (e.g., apt update && apt upgrade -y for EternalBlue).
ifconfig eth0 down
iptables -A INPUT -j DROP
kill -9 <PID>
apt update && apt upgrade -y
Symptoms: - AV scans come back clean, but the system is still compromised. - Hidden processes (not visible in ps or top). - Modified system binaries (ls, ps, netstat behave strangely).
ps
top
ls
netstat
# Check for hidden processes (compare ps vs. /proc) ps aux ls /proc | grep -E "^[0-9]+$" | sort -n | xargs -I {} ls -la /proc/{}/exe 2>/dev/null | grep -v " (deleted)" # Check for modified system binaries (compare hashes) rpm -Va # For RPM-based systems (RHEL, CentOS) debsums -c # For Debian/Ubuntu # Use chkrootkit (basic rootkit detection) sudo apt install chkrootkit -y sudo chkrootkit # Use rkhunter (more thorough) sudo apt install rkhunter -y sudo rkhunter --check
Containment steps:1. Assume the system is fully compromised (rootkits are extremely hard to remove).2. Wipe and rebuild the machine (do not try to "clean" it).3. Rotate all credentials (SSH keys, API keys, passwords).4. Investigate how it got in (e.g., unpatched software, weak SSH passwords).
Symptoms: - No immediate signs (logic bombs lie dormant). - Unexpected system behavior (e.g., files deleted at a specific time). - Suspicious scripts in cron jobs, scheduled tasks, or CI/CD pipelines.
# Check for time-based triggers (cron jobs) crontab -l ls -la /etc/cron.* /etc/crontab # Check for suspicious scripts in CI/CD (e.g., GitHub Actions) find / -name "*.sh" -o -name "*.ps1" -o -name "*.py" 2>/dev/null | xargs grep -l "rm -rf\|shutdown\|reboot" # Check for unusual file modifications (e.g., "delete if user X is disabled") auditctl -l # Linux auditd rules
Containment steps:1. Review all automation scripts (cron, CI/CD, GPOs).2. Remove suspicious entries (e.g., crontab -e to edit cron jobs).3. Monitor for unexpected behavior (e.g., file deletions, reboots).4. Rotate all credentials (logic bombs are often planted by insiders).
crontab -e
fapolicyd
env=prod
data=PII
FileCreate
.locked
netstat -ano | findstr "445"
rpm -Va
aws s3 cp s3://backup-bucket/test-file ./
Event ID 4624
Trojan (requires user action).
"A user’s files are encrypted, and a ransom note appears. What’s the next step?"
Pay the ransom (never recommended).
"Which malware hides its presence by modifying the OS kernel?"
Logic bomb (triggers on condition, doesn’t hide).
"An employee’s account is disabled, and all files are deleted. What malware is this?"
You’re a SOC analyst. A user reports their files are renamed with .locked. You suspect ransomware. Task: Write a PowerShell one-liner to:1. Find all .locked files.2. Kill any process using high CPU (likely the encryptor).3. Output the results to a file for IR.
# Find .locked files, kill high-CPU processes, and log results Get-ChildItem -Path C:\ -Recurse -Filter "*.locked" -ErrorAction SilentlyContinue | Select-Object FullName | Out-File -FilePath "C:\ransomware_files.txt" Get-Process | Where-Object { $_.CPU -gt 50 } | ForEach-Object { taskkill /PID $_.Id /F; "Killed process: $($_.Name) (PID: $($_.Id))" } | Out-File -FilePath "C:\ransomware_processes.txt" -Append
Why it works: - Get-ChildItem finds all encrypted files (ransomware leaves a trail). - Get-Process + taskkill stops the encryptor (high CPU = likely malware). - Out-File logs evidence for IR.
Get-ChildItem
taskkill
Out-File
Get-ChildItem -Filter "*.locked"
Get-ScheduledTask \| Where-Object { $_.TaskPath -notlike "\Microsoft*" }
schtasks /delete /tn "MaliciousTask" /f
ss -tulnp \| grep "445"
iptables -A INPUT -s <IP> -j DROP
crontab -l
Exam Traps: - "Which malware requires user interaction?"-Trojan (not worm). - "Which malware hides in the OS?"-Rootkit (not spyware). - "Which spreads via SMB?"-Worm (not ransomware).
Malware isn’t just a theory—it’s a daily threat in production. The difference
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.