SlideShare a Scribd company logo
Look in /etc/passwd for new accounts in sorted list by
UID:
# sort –nk3 –t: /etc/passwd | less
Normal accounts will be there, but look for new,
unexpected accounts, especially with UID < 500.
Also, look for unexpected UID 0 accounts:
# egrep ':0+:' /etc/passwd
On systems that use multiple authentication methods:
# getent passwd | egrep ':0+:'
Look for orphaned files, which could be a sign of an
attacker's temporary account that has been deleted.
# find / -nouser -print
System Administrators are often on the front
lines of computer security. This guide aims
to support System Administrators in finding
indications of a system compromise.
The following tools are often not built into the
Linux operating system, but can be used to
analyze its security status in more detail.
Each is available for free download at the
listed web site.
DISCLAIMER: The SANS Institute is not
responsible for creating, distributing,
warranting, or supporting any of the
following tools.
Chkrootkit looks for anomalies on systems
introduced by user-mode and kernel-mode
RootKits – www.chkrootkit.org
Tripwire looks for changes to critical system
files – www.tripwire.org - free for Linux for
non-commercial use
AIDE looks for changes to critical system files
http://www.cs.tut.fi/~rammer/aide.html
The Center for Internet Security has released
a Linux hardening guide for free at
www.cisecurity.org.
The free Bastille Script provides automated
security hardening for Linux systems,
available at www.bastille-linux.org.
Unusual Accounts
Additional Supporting Tools
Purpose
What to use this sheet for
On a periodic basis (daily, weekly, or each time you
logon to a system you manage,) run through these
quick steps to look for anomalous behavior that
might be caused by a computer intrusion. Each of
these commands runs locally on a system.
This sheet is split into these sections:
β€’ Unusual Processes and Services
β€’ Unusual Files
β€’ Unusual Network Usage
β€’ Unusual Scheduled Tasks
β€’ Unusual Accounts
β€’ Unusual Log Entries
β€’ Other Unusual Items
β€’ Additional Supporting Tools
Intrusion Discovery
Cheat Sheet v2.0
Linux
POCKET REFERENCE GUIDE
SANS Institute
www.sans.org and isc.sans.org
Download the latest version of this sheet from
http://www.sans.org/resources/linsacheatsheet.pdf
If you spot anomalous behavior: DO NOT PANIC!
Your system may or may not have come under
attack. Please contact the Incident Handling Team
immediately to report the activities and get further
assistance.
Look through your system log files for suspicious
events, including:
"entered promiscuous mode"
Large number of authentication or login
failures from either local or remote access
tools (e.g., telnetd, sshd, etc.)
Remote Procedure Call (rpc) programs with a
log entry that includes a large number (> 20)
strange characters (such as ^PM-^PM-^PM-
^PM-^PM-^PM-^PM-^PM)
For systems running web servers: Larger than
normal number of Apache logs saying "error"
Reboots and/or application restarts
Unusual Log Entries
Other Unusual Items
Sluggish system performance:
$ uptime – Look at "load average"
Excessive memory use: $ free
Sudden decreases in available disk space:
$ df
Look for processes running out of or accessing files
that have been unlinked (i.e., link count is zero). An
attacker may be hiding data in or running a backdoor
from such files:
# lsof +L1
On a Linux machine with RPM installed (RedHat,
Mandrake, etc.), run the RPM tool to verify packages:
# rpm –Va | sort
This checks size, MD5 sum, permissions, type,
owner, and group of each file with information from
RPM database to look for changes. Output includes:
S – File size differs
M – Mode differs (permissions)
5 – MD5 sum differs
D – Device number mismatch
L – readLink path mismatch
U – user ownership differs
G – group ownership differs
T – modification time differs
Pay special attention to changes associated with
items in /sbin, /bin, /usr/sbin, and /usr/bin.
In some versions of Linux, this analysis is automated
by the built-in check-packages script.
Unusual Network Usage Continued
Look for unusual port listeners:
# netstat –nap
Get more details about running processes listening
on ports:
# lsof –i
These commands require knowledge of which TCP
and UDP ports are normally listening on your
system. Look for deviations from the norm.
Look for unusual ARP entries, mapping IP address to
MAC addresses that aren’t correct for the LAN:
# arp –a
This analysis requires detailed knowledge of which
addresses are supposed to be on the LAN. On a
small and/or specialized LAN (such as a DMZ), look
for unexpected IP addresses.
Unusual Files Continued
Unusual Scheduled Tasks
Look for cron jobs scheduled by root and any other
UID 0 accounts:
# crontab –u root –l
Look for unusual system-wide cron jobs:
# cat /etc/crontab
# ls /etc/cron.*
Look at all running processes:
# ps –aux
Get familiar with "normal" processes for the machine.
Look for unusual processes. Focus on processes with
root (UID 0) privileges.
If you spot a process that is unfamiliar, investigate in
more detail using:
# lsof –p [pid]
This command shows all files and ports used by the
running process.
If your machine has it installed, run chkconfig to see
which services are enabled at various runlevels:
# chkconfig --list
Unusual Processes and Services
Look for unusual SUID root files:
# find / -uid 0 –perm -4000 –print
This requires knowledge of normal SUID files.
Look for unusual large files (greater than 10
MegaBytes):
# find / -size +10000k –print
This requires knowledge of normal large files.
Look for files named with dots and spaces ("...", ".. ",
". ", and " ") used to camouflage files:
# find / -name " " –print
# find / -name ".. " –print
# find / -name ". " –print
# find / -name " " –print
Unusual Files
Look for promiscuous mode, which might indicate a
sniffer:
# ip link | grep PROMISC
Note that the ifconfig doesn’t work reliably for
detecting promiscuous mode on Linux kernel 2.4, so
please use "ip link" for detecting it.
Unusual Network Usage

More Related Content

PDF
SANS Windows Artifact Analysis 2012
PPTX
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
PDF
FINDING FORENSIC ARTIFACTS FROM WINDOW REGISTRY
PPT
Hacking Fundamentals - Jen Johnson , Miria Grunick
ODP
Malware analysis - What to learn from your invaders
PDF
Report on forensics tools
DOCX
Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
PPTX
Linux automated tasks
SANS Windows Artifact Analysis 2012
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
FINDING FORENSIC ARTIFACTS FROM WINDOW REGISTRY
Hacking Fundamentals - Jen Johnson , Miria Grunick
Malware analysis - What to learn from your invaders
Report on forensics tools
Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Linux automated tasks

What's hot (18)

PDF
Windows persistence presentation
PDF
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
PPT
Unix Web servers and FireWall
PPTX
Pet Pen Testing Tools: Zenmap & Nmap
PDF
Footprinting tools for security auditors
PPTX
Ch0 1
PPTX
Basic malware analysis
PPT
Black Energy18 - Russian botnet package analysis
PDF
Pentest with Metasploit
PPT
Intrusion Detection System using Snort
PPTX
Linux remote
PPTX
Operating system enhancements to prevent misuse of systems
PDF
Hunting for Credentials Dumping in Windows Environment
Windows persistence presentation
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
Unix Web servers and FireWall
Pet Pen Testing Tools: Zenmap & Nmap
Footprinting tools for security auditors
Ch0 1
Basic malware analysis
Black Energy18 - Russian botnet package analysis
Pentest with Metasploit
Intrusion Detection System using Snort
Linux remote
Operating system enhancements to prevent misuse of systems
Hunting for Credentials Dumping in Windows Environment
Ad

Similar to Intrusion Discovery Cheat Sheet for Linux (20)

PPT
Anton Chuvakin on Discovering That Your Linux Box is Hacked
PPT
Threats, Vulnerabilities & Security measures in Linux
PDF
Windows Threat Hunting
PDF
Linux security quick reference guide
PPTX
ВячСслав Кабак "Microsoft Sysinternals-Useful Utilities"
PDF
SANS Digital Forensics and Incident Response Poster 2012
PPTX
10 Tips for AIX Security
PPT
Ch11 system administration
PPT
Intrusion Discovery on Windows
Β 
PPTX
First Responders Course - Session 7 - Incident Scope Assessment [2004]
PDF
Linux advanced privilege escalation
PDF
RIoT (Raiding Internet of Things) by Jacob Holcomb
PPTX
Introduction to Malware Analysis
PDF
Intrusion Techniques
PPTX
Windows Registry Forensics with Volatility Framework
PDF
CNIT 126 11. Malware Behavior
PDF
Linux Hardening - nullhyd
PDF
PPTX
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Anton Chuvakin on Discovering That Your Linux Box is Hacked
Threats, Vulnerabilities & Security measures in Linux
Windows Threat Hunting
Linux security quick reference guide
ВячСслав Кабак "Microsoft Sysinternals-Useful Utilities"
SANS Digital Forensics and Incident Response Poster 2012
10 Tips for AIX Security
Ch11 system administration
Intrusion Discovery on Windows
Β 
First Responders Course - Session 7 - Incident Scope Assessment [2004]
Linux advanced privilege escalation
RIoT (Raiding Internet of Things) by Jacob Holcomb
Introduction to Malware Analysis
Intrusion Techniques
Windows Registry Forensics with Volatility Framework
CNIT 126 11. Malware Behavior
Linux Hardening - nullhyd
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Ad

More from Muhammad FAHAD (8)

PDF
CISA GOV - Seven Steps to Effectively Defend ICS
PDF
Vulnerabilities on the Wire: Mitigations for Insecure ICS Device Communication
PDF
Computer Security Incident Handling Guide
PDF
Steps to Improve Cyber Security of SCADA Networks by U.S. Department of Energy
PDF
The Cyber Kill Chain. 7 Stages of Cyber Kill Chain Supplementary Reading
PDF
Common Malware Types Vulnerability Management
PDF
CRASHOVERRIDE Analysis of the Threat to Electric Grid Operations. Cyber-attac...
PDF
The Top 20 Cyberattacks on Industrial Control Systems
CISA GOV - Seven Steps to Effectively Defend ICS
Vulnerabilities on the Wire: Mitigations for Insecure ICS Device Communication
Computer Security Incident Handling Guide
Steps to Improve Cyber Security of SCADA Networks by U.S. Department of Energy
The Cyber Kill Chain. 7 Stages of Cyber Kill Chain Supplementary Reading
Common Malware Types Vulnerability Management
CRASHOVERRIDE Analysis of the Threat to Electric Grid Operations. Cyber-attac...
The Top 20 Cyberattacks on Industrial Control Systems

Recently uploaded (20)

PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
Introduction to the IoT system, how the IoT system works
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
PPTX
artificial intelligence overview of it and more
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
innovation process that make everything different.pptx
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
The Internet -By the Numbers, Sri Lanka Edition
Β 
Module 1 - Cyber Law and Ethics 101.pptx
Introduction to the IoT system, how the IoT system works
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Unit-1 introduction to cyber security discuss about how to secure a system
Decoding a Decade: 10 Years of Applied CTI Discipline
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Sims 4 Historia para lo sims 4 para jugar
INTERNET------BASICS-------UPDATED PPT PRESENTATION
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
artificial intelligence overview of it and more
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PptxGenJS_Demo_Chart_20250317130215833.pptx
innovation process that make everything different.pptx
Introuction about ICD -10 and ICD-11 PPT.pptx
Introuction about WHO-FIC in ICD-10.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
Job_Card_System_Styled_lorem_ipsum_.pptx
international classification of diseases ICD-10 review PPT.pptx
The Internet -By the Numbers, Sri Lanka Edition
Β 

Intrusion Discovery Cheat Sheet for Linux

  • 1. Look in /etc/passwd for new accounts in sorted list by UID: # sort –nk3 –t: /etc/passwd | less Normal accounts will be there, but look for new, unexpected accounts, especially with UID < 500. Also, look for unexpected UID 0 accounts: # egrep ':0+:' /etc/passwd On systems that use multiple authentication methods: # getent passwd | egrep ':0+:' Look for orphaned files, which could be a sign of an attacker's temporary account that has been deleted. # find / -nouser -print System Administrators are often on the front lines of computer security. This guide aims to support System Administrators in finding indications of a system compromise. The following tools are often not built into the Linux operating system, but can be used to analyze its security status in more detail. Each is available for free download at the listed web site. DISCLAIMER: The SANS Institute is not responsible for creating, distributing, warranting, or supporting any of the following tools. Chkrootkit looks for anomalies on systems introduced by user-mode and kernel-mode RootKits – www.chkrootkit.org Tripwire looks for changes to critical system files – www.tripwire.org - free for Linux for non-commercial use AIDE looks for changes to critical system files http://www.cs.tut.fi/~rammer/aide.html The Center for Internet Security has released a Linux hardening guide for free at www.cisecurity.org. The free Bastille Script provides automated security hardening for Linux systems, available at www.bastille-linux.org. Unusual Accounts Additional Supporting Tools Purpose What to use this sheet for On a periodic basis (daily, weekly, or each time you logon to a system you manage,) run through these quick steps to look for anomalous behavior that might be caused by a computer intrusion. Each of these commands runs locally on a system. This sheet is split into these sections: β€’ Unusual Processes and Services β€’ Unusual Files β€’ Unusual Network Usage β€’ Unusual Scheduled Tasks β€’ Unusual Accounts β€’ Unusual Log Entries β€’ Other Unusual Items β€’ Additional Supporting Tools Intrusion Discovery Cheat Sheet v2.0 Linux POCKET REFERENCE GUIDE SANS Institute www.sans.org and isc.sans.org Download the latest version of this sheet from http://www.sans.org/resources/linsacheatsheet.pdf If you spot anomalous behavior: DO NOT PANIC! Your system may or may not have come under attack. Please contact the Incident Handling Team immediately to report the activities and get further assistance. Look through your system log files for suspicious events, including: "entered promiscuous mode" Large number of authentication or login failures from either local or remote access tools (e.g., telnetd, sshd, etc.) Remote Procedure Call (rpc) programs with a log entry that includes a large number (> 20) strange characters (such as ^PM-^PM-^PM- ^PM-^PM-^PM-^PM-^PM) For systems running web servers: Larger than normal number of Apache logs saying "error" Reboots and/or application restarts Unusual Log Entries Other Unusual Items Sluggish system performance: $ uptime – Look at "load average" Excessive memory use: $ free Sudden decreases in available disk space: $ df
  • 2. Look for processes running out of or accessing files that have been unlinked (i.e., link count is zero). An attacker may be hiding data in or running a backdoor from such files: # lsof +L1 On a Linux machine with RPM installed (RedHat, Mandrake, etc.), run the RPM tool to verify packages: # rpm –Va | sort This checks size, MD5 sum, permissions, type, owner, and group of each file with information from RPM database to look for changes. Output includes: S – File size differs M – Mode differs (permissions) 5 – MD5 sum differs D – Device number mismatch L – readLink path mismatch U – user ownership differs G – group ownership differs T – modification time differs Pay special attention to changes associated with items in /sbin, /bin, /usr/sbin, and /usr/bin. In some versions of Linux, this analysis is automated by the built-in check-packages script. Unusual Network Usage Continued Look for unusual port listeners: # netstat –nap Get more details about running processes listening on ports: # lsof –i These commands require knowledge of which TCP and UDP ports are normally listening on your system. Look for deviations from the norm. Look for unusual ARP entries, mapping IP address to MAC addresses that aren’t correct for the LAN: # arp –a This analysis requires detailed knowledge of which addresses are supposed to be on the LAN. On a small and/or specialized LAN (such as a DMZ), look for unexpected IP addresses. Unusual Files Continued Unusual Scheduled Tasks Look for cron jobs scheduled by root and any other UID 0 accounts: # crontab –u root –l Look for unusual system-wide cron jobs: # cat /etc/crontab # ls /etc/cron.* Look at all running processes: # ps –aux Get familiar with "normal" processes for the machine. Look for unusual processes. Focus on processes with root (UID 0) privileges. If you spot a process that is unfamiliar, investigate in more detail using: # lsof –p [pid] This command shows all files and ports used by the running process. If your machine has it installed, run chkconfig to see which services are enabled at various runlevels: # chkconfig --list Unusual Processes and Services Look for unusual SUID root files: # find / -uid 0 –perm -4000 –print This requires knowledge of normal SUID files. Look for unusual large files (greater than 10 MegaBytes): # find / -size +10000k –print This requires knowledge of normal large files. Look for files named with dots and spaces ("...", ".. ", ". ", and " ") used to camouflage files: # find / -name " " –print # find / -name ".. " –print # find / -name ". " –print # find / -name " " –print Unusual Files Look for promiscuous mode, which might indicate a sniffer: # ip link | grep PROMISC Note that the ifconfig doesn’t work reliably for detecting promiscuous mode on Linux kernel 2.4, so please use "ip link" for detecting it. Unusual Network Usage