ShellSpells
  • 🧙‍♂️Welcome!
    • ShellSpells
    • FAQs
    • License & Disclaimer
  • 🐧Linux
    • System Ops
      • Transcripts
      • Help
      • System Info
        • Date/Time
        • System Details
        • Patches & Updates
        • Init System Identification
        • Hostname / Host ID
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Shares
        • Packages
        • Connected Devices
        • Kernel Modules (Drivers)
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Jobs
        • Enumerate
        • Modify
      • Processes
        • Enumerate
        • Modify
        • Custom Script and Shared Object
        • Process I/O Redirection
      • Services
        • Enumerate
        • Modify
        • Create a Service
      • Startup/Boot Scripts
        • Enumerate
        • Modify
      • Security
        • Antivirus
        • Firewall
        • SSH Keys
      • History & Logs
        • History
        • Logs
    • File Ops
      • Search
        • Filename
        • Content
        • Users (Owners)
        • Time
        • Size
        • Permission
        • Hidden Files
        • Inode
        • Find + Exec
        • Notes
      • Enumerate Metadata
      • Modify Metadata
      • Read Content
      • Modify Content
      • Extract Content
      • Sort / Compare / Count
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
    • Terminal Ops
      • Keyboard Shortcuts
      • Tmux Shortcuts
  • 🪟Windows
    • System Ops
      • Transcripts
      • Help
      • System Info
        • One-liners
        • Date/Time
        • System Details
        • Hotfixes
        • Domain or Workgroup
        • Data Execution Prevention
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Installed Software
        • Drivers
        • Shares
      • Registry
        • Enumerate
        • Modify
        • Forensically Relevant Keys
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Tasks
      • Processes
        • Enumerate
        • Modify
      • Services
        • Enumerate
        • Modify
      • Autorun / Startup
        • Enumerate
        • Modify
      • Security
        • Permissions
          • Enumerate
          • Page
        • Antivirus
        • Firewall
          • Enumerate
          • Modify
        • Audit Policies
        • Remoting
          • Enumerate
          • Modify
          • Registry Locations
        • Stored Credentials
      • Remote Command Execution
      • Active Directory
        • Enumerate
        • Modify
      • History & Logs
        • History
        • Logs
      • PowerShell Config
      • Scripting
      • WMIC Notes
    • File Ops
      • Search
        • Filename
        • Time
        • Size
        • Permissions
        • Attributes
        • Wildcarding
      • Enumerate Metadata
        • One Liners
        • Users (Owners)
        • Timestamps
        • Size
        • Permissions
        • Attributes
      • Modify Metadata
        • Change Owner
        • Timestamps
        • Size
        • Attributes
      • Read Content
      • Modify Content
        • Overwrite
        • Insert
        • Append
        • Replace / Remove
        • Convert Case
        • Alternate Data Streams
      • Extract Content
      • Sort / Compare / Count
        • Sort
        • Count
        • Compare
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
      • Output Formatting / Filtering
      • File Formatting
      • Operators
  • ⛓️Network
    • Traffic Manipulation
      • iptables
        • Option List
        • General Commands
        • Filter Tables
        • NAT
        • Mangle
        • Filter for SSH Traffic (Example)
      • nftables
    • Packet Capture
      • Syntax
      • TCPDump Examples
    • Packet Analysis
      • Wireshark
  • 🚗Maneuver
    • SSH
    • Control Sockets
    • RDP
    • Windows Port Proxy
  • 🛩️Data Transfer
    • SCP
    • FTP
    • Netcat
      • Netcat Relays
    • Server Interactions
    • Alternate Methods
  • 🪄REGEX
    • Examples
Powered by GitBook
On this page
  • Process Observation
  • Identifying Suspicious Activity
  • PID
  • Finding Process PIDs
  • Finding Processes by PIDs
  • Process Name
  • Shared Objects
  • User
  • Jobs
  • Debugging
  • Solaris

Was this helpful?

  1. Linux
  2. System Ops
  3. Processes

Enumerate

Process Observation

systemd-cgls

Shows process additional context. Useful for finding malware.

ps -A

View all running processes

ps axjf

Process tree

pstree

Process tree

ps -auxf

Processes including CPU and MEM

ps -efH

Processes using standard syntax with process hierarchy

/proc/version

Info about system processes

lsof

Lists all open files belonging to all active processes

lsof -c <command_name>

Listing of files for processes executing the command

lsof -i <4|6>

Only files of the indicated IP version, IPv4 or IPv6

top

Display real-time system statistics

top -u <username>

User-specific processes

htop

Interactive process viewer (May need install)

Identifying Suspicious Activity

Network connections: View open network connections and identify processes making unusual connections. Resource usage: Processes consuming excessive resources might be suspicious. File access: Monitor file access to identify processes accessing sensitive files or system locations.

PID

Finding Process PIDs

pidof [process_name]

Finds the PIDs of running processes by name

pgrep [process_name]

Finds process IDs for matching processes

Finding Processes by PIDs

ps -p [PID]

Displays information for a specific process ID.

ps -fp [PID]

Info about a specific process, given its process ID (PID)

pgrep [pattern]

Lists process IDs matching a pattern.

lsof -p [PID]

Lists all open files by PID.

ls -al /proc/[PID]

Shows the PIDs of processes in /proc.

cat /proc/[PID]/maps

Displays the memory mappings of a specific process identified by its process ID (PID).

ls -al /proc/[PID]/fd | grep \\/

Shows only directories

readlink -f /proc/[PID]/exe

Examines running processes

Process Name

grep [process_name] /var/log/*

Search through all files in the directory for a file containing [process_name].

tail -f /var/log/messages

Prints the last 10 lines of /var/log/messages and monitors the file for new lines.

find / -name *[process_name]*

Starting in "/", find something containing the phrase [process_name]

chkconfig --list | grep [process_name]

Queries runlevel information for system services

chkconfig --list

Queries runlevel info for system services.

ps -p [PID] -o comm=

Displays the name of the process with the specified PID.

Shared Objects

lsof -N -n | grep '.so'

Lists open files, including shared objects (libraries) mapped into memory by processes.

find /proc/*/maps -type f -exec grep -H '\.so' {} \;

Inspects processes and their mapped shared objects directly using the proc filesystem.

pmap [PID] | grep '/lib/'

Displays the memory map of a process, including shared objects.

ldd /executable | grep '/lib/'

Lists dynamic dependencies of an executable, including shared objects.

pldd [PID]

Gets shared objects used by that process

Lists processes and filters by shared objects using awk:

ps aux | awk '{print $2}' | xargs -I{} readlink /proc/{}/exe | grep '/lib/'

Lists shared objects being used by running processes:

ps aux | awk '{print $2}' | xargs -I{} readlink /proc/{}/exe | xargs lsof -p | grep -E '.so(..+)?$'

User

ps aux

Processes for all users

ps -u <username>

Lists processes running under a specific user.

ps aux | grep euid=<-UUID>

Find process by user UUID.

ps aux | grep root

Root processes

ps -U UID

Shows processes for a user specified by the UID (User ID).

pgrep -u <username>

Retrieves PIDs of processes owned by the user

ps -eo user,pid,cmd

Lists the process owner, process ID, and command for all processes.

top

Provides a dynamic real-time view of system processes, including the user who started each process.

w

Shows all users and their processes.

sacct

If process accounting is enabled, this tool shows historical processes run by users.

Jobs

jobs

Lists active jobs within the current shell.

Debugging

strace [command]

Traces system calls and signals for a process.

gdb [command]

The GNU Debugger, allows interactive debugging of processes.

strace [command]

Traces system calls and signals for a specific command.

ltrace [command]

Traces library calls for a specific command.

gdb [executable]

The GNU Debugger, used for debugging programs.

valgrind [executable]

A tool for memory debugging, memory leak detection, and profiling.

tcpdump

Captures and displays packets transmitted or received over a network interface.

dmesg

Displays kernel ring buffer messages, useful for diagnosing hardware issues and kernel errors.

tail -f /var/log/syslog

Monitors system log messages in real-time.

strace -p [PID]

Attaches to an existing process and traces its system calls.

lsof

Lists open files and the processes that opened them, helpful for debugging file-related issues.

vmstat

Reports information about processes, memory, paging, block I/O, traps, and CPU activity.

Solaris

Command
Description

ptree

Show processes in tree format.

ps

Show processes

svcs

Dump services

PreviousProcessesNextModify

Last updated 1 year ago

Was this helpful?

🐧