General Command Syntax
Instead of spending time on figuring out what arguments to use in a command each time you use it, you can look at your terminal history for what you previously used.

However, with many different commands and terminals this can become quite difficult and time consuming.
\\\\====== Presenting the Command Syntax List ======////
Below you can find all available commands. Either select one from the ToC list or use Ctrl+F to look for it. Below the ToC there is a list of separate cheat sheets for some more complex commands.
In the commands you will find variables enclosed by <variable>. This simply means it needs to be replaced by your own value (e.g., <ip> becomes 10.10.101.81).
Subjects
- Separate command sheets
- Aircrack-ng
- Apt
- Arp
- Auditctl
- Aureport
- Ausearch
- Binwalk
- Capa
- Curl
- Df
- Dig
- Dmesg
- Dpkg
- Dumpzilla.py
- Enum4Linux
- Free
- Gobuster
- Hostname
- Hostnamectl
- Ifconfig
- Iftop
- Ip
- Iptables
- Journalctl
- Lsblk
- Lscpu
- Lsof
- MFTECmd
- Netcat
- Netstat
- Neo-ReGeorg
- Nmap
- Nslookup
- oledump.py
- Osquery
- Ping
- Ps
- Pspy64
- Pstree
- Route
- RsaCTFtool
- Rsatool
- Smbclient
- Ss
- Systemctl
- Tcpdump
- Top
- Traceroute
- Uptime
- Wget
- Whois
Separate command sheets
Some tools are so vast, they have many commands. Too many to include in this document whilst keeping it nice and organized. That is why I created a separate document specifically for such programs.
| đ° Name |
|---|
| âMetasploit Framework |
| âPowershell |
| **** |
Aircrack-ng
Aircrack- ng is a complete suite of tools to assess WiFi network security. More info here
Crack wifi passwords from a network capture file (must include EAPOL handshake).
aircrack-ng -w <wordlist> <capture_file>
aircrack-ng -w /usr/share/wordlists/rockyou.txt capture.pcap
Apt
apt (Advanced Package Tool) handles package management on Debian-based Linux systems, including installing, updating, and removing software and their dependencies.
List all installed packages.
List installed packages (first 30).
Update package lists.
Search for a package.
Subcommands
| Subcommand | Description | |------------|-------------| | `list --installed` | List all installed packages | | `update` | Refresh package index from repositories | | `installArp
arp displays and modifies the system's ARP (Address Resolution Protocol) table, which maps IP addresses to MAC addresses on a local network.
Display the ARP table.
Display the ARP table in numeric format.
Delete an ARP entry.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-a` | - | Display all ARP entries | | `-n` | - | Show numeric addresses instead of resolving hostnames | | `-d` | `Auditctl
auditctl is used to control the Linux audit system. It configures audit rules that define which system calls, file accesses, and user activities are logged by auditd. Rules added with auditctl are temporary; for persistent rules, edit /etc/audit/audit.rules.
Watch a file for read, write, and attribute changes.
Log all program executions via execve syscall (64-bit).
List all active audit rules.
Delete all active audit rules.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-w` | `Aureport
aureport generates summary reports from the Linux audit log. It is typically used by piping output from ausearch to produce structured, human-readable reports of audit events.
Generate a summary report of file events.
Generate a named file report.
Generate a report of all authentication events.
Generate a report of executable events.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-f` | - | Generate a file access report | | `--summary` | - | Produce a summary report | | `--auth` | - | Report on authentication events | | `--executable` | - | Report on executable events | | `--login` | - | Report on login events | | `--user` | - | Report on user-related events | | `--failed` | - | Show only failed events |Ausearch
ausearch queries the Linux audit log (/var/log/audit/audit.log) for events matching specified criteria such as rule keys, usernames, or syscalls.
Search by audit rule key.
Search by username.
Search within a time range.
Pipe to aureport for a structured report.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-k` | `Binwalk
List and extract known files
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-e` | - | `Automatically extract known file types` | | `` | `` | `` | | `` | `` | `` | | `` | `` | `` | | `` | `` | `` |More info here.
Capa
Capa is the FLARE team's free and open-source tool to identify capabilities in executable files.
Analyse a bin file.
Log more detailed information.
Log more detailed information and direct the result to a .json file.
cURL
curl transfers data from or to a server using various protocols (HTTP, HTTPS, FTP, etc.). Useful for testing network connections, downloading files, and interacting with web APIs.
Basic GET request
Basic POST request for a login form.
Download a file.
Save output to a specific filename.
Send a GET request and print the response.
Send a POST request with data.
Use through a SOCKS5 proxy.
Follow redirects.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-i` | - | To view exactly what the server returns (including headers and potential redirects). | | `-O` | - | Save to a file with the remote filename | | `-o` | `Df
df reports the amount of disk space used and available on filesystems.
Display disk usage in human-readable format.
Display disk usage for a specific path.
Show inode usage instead of block usage.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-h` | - | Human-readable sizes (KB, MB, GB) | | `-H` | - | Human-readable using powers of 1000 instead of 1024 | | `-i` | - | Show inode usage instead of block usage | | `-T` | - | Show filesystem type | | `Dig
dig (Domain Information Groper) queries DNS servers for information about domain names. Useful for diagnosing DNS-related issues and gathering DNS records.
Query DNS records for a domain.
Query a specific DNS server.
Query a specific record type.
Perform a DNS zone transfer.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `@Dmesg
dmesg prints and controls the kernel ring buffer â a circular log of messages generated by the kernel. Useful for detecting hardware events, unusual module loads, and signs of kernel-level tampering.
View the kernel ring buffer.
View with human-readable timestamps.
Filter output by keyword.
Follow new messages in real time.
View the persistent kernel log file.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-T` | - | Print timestamps in human-readable format | | `-w` | - | Follow/watch for new messages in real time | | `-l` | `err,warn` | Filter by log level (emerg, alert, crit, err, warn, notice, info, debug) | | `-f` | `kern` | Filter by facility (kern, user, daemon, etc.) | | `-H` | - | Human-readable output with color and relative timestamps | | `--clear` | - | Clear the ring buffer |Dpkg
dpkg is the low-level package management tool for Debian-based systems. It installs, removes, and provides information about .deb packages directly, without handling dependencies.
List all installed packages.
List installed packages filtered by name.
Show detailed info about an installed package.
List files installed by a package.
Find which package owns a file.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-l` | - | List all installed packages | | `-s` | `Dumpzilla.py
DumpZilla is a forensic tool for extracting data from Firefox browser profiles. It can retrieve cookies, passwords, bookmarks, history, downloads, and other browser artifacts.
Extract all available data from a Firefox profile.
Extract bookmarks only.
Extract cookies and saved passwords.
The Firefox profile path is typically ~/.mozilla/firefox/<profile>/. Profile name can be found in ~/.mozilla/firefox/profiles.ini.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `--All` | - | Extract all available data | | `--Bookmarks` | - | Extract saved bookmarks | | `--Cookies` | - | Extract browser cookies | | `--Passwords` | - | Extract saved passwords | | `--History` | - | Extract browsing history | | `--Downloads` | - | Extract download history | | `--Addons` | - | List installed extensions/add-ons |More info here.
Enum4Linux
enum4Linux is a Linux alternative to enum.exe for enumerating data from Windows and Samba hosts.
More info here.
Free
free displays the total amount of physical and swap memory in the system, including what is used, free, and available.
Display memory usage in human-readable format.
Display memory in megabytes.
Continuously update every N seconds.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-h` | - | Human-readable sizes (KB, MB, GB) | | `-m` | - | Display in megabytes | | `-g` | - | Display in gigabytes | | `-s` | `Gobuster
Gobuster is a software tool for brute forcing directories on web servers. It comes preinstalled with Kali Linux, a Linux distribution designed for digital forensics and penetration testing.
Enumerate common files in directories
gobuster dir -u http://TARGET_IP:80 -w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt -x bak,txt,html -t 20
Arguments
| Argument | Value | Description |
|---|---|---|
dir |
Mode â use directory/file enumeration | |
-u |
http://TARGET_IP:80 |
Target URL including port |
-w |
common.txt |
Wordlist to use for brute-forcing paths |
-x |
bak,txt,html |
File extensions to append to each wordlist entry |
-t |
20 |
Number of concurrent threads |
More info here.
Hostname
hostname displays or sets the hostname of the system. It is useful for identifying the local system's network identity.
Display the current hostname.
Display the system's IP address.
Display the fully qualified domain name (FQDN).
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-I` | - | Display all IP addresses of the host | | `-f` | - | Display the fully qualified domain name | | `-s` | - | Display the short hostname (up to the first dot) | | `-d` | - | Display the DNS domain name |Hostnamectl
hostnamectl queries and changes the system hostname and related settings. It provides more detail than hostname, including machine ID, OS, kernel version, and virtualisation type.
Display all hostname and system information.
Set the system hostname.
Subcommands
| Subcommand | Description | |------------|-------------| | *(no subcommand)* | Display hostname, machine ID, OS, kernel, architecture | | `set-hostnameIfconfig
ifconfig configures and displays information about network interfaces. Largely replaced by ip in modern Linux systems, but still widely available.
Display all network interfaces.
Display a specific interface.
Bring an interface up or down.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `Note:
ip ais the modern equivalent and preferred in current Linux distributions.
Iftop
iftop provides a real-time display of bandwidth usage on a network interface, showing which connections are using the most bandwidth.
Monitor bandwidth on the default interface.
Monitor a specific interface.
Show port numbers.
Run in non-interactive mode and output to a file.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-i` | `Ip
ip is the modern, versatile replacement for ifconfig and route. It configures network interfaces, routing, tunnels, and more.
Display all network interfaces and IP addresses.
Display a specific interface.
Display the routing table.
Display ARP/neighbour table.
Bring an interface up or down.
Subcommands
| Subcommand | Description | |------------|-------------| | `ip a` / `ip address` | Show/configure IP addresses | | `ip r` / `ip route` | Show/configure routing table | | `ip link` | Show/configure network interfaces | | `ip neigh` | Show/modify ARP/neighbour table | | `ip tunnel` | Configure IP tunnels |Iptables
iptables displays, sets up, and maintains IP packet filter rules. It is used to manage firewall rules and monitor network traffic on Linux systems.
List all active rules.
Allow incoming traffic on a port.
Allow outgoing traffic on a port.
Block traffic from an IP.
Save and restore rules.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-L` | - | List all rules in the selected chain | | `-v` | - | Verbose output | | `-n` | - | Numeric output (no DNS resolution) | | `-A` | `INPUT/OUTPUT/FORWARD` | Append a rule to a chain | | `-D` | `Journalctl
journalctl is the command-line utility for querying and displaying messages from the systemd journal. Used in forensics to investigate service logs and detect malicious activity.
Follow (tail) logs for a specific service in real time.
View all journal logs for a specific service.
View logs since a relative or absolute timestamp.
View logs between two timestamps.
Show logs from the current boot only.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-f` | - | Follow â stream new log entries in real time | | `-u` | `Lsblk
lsblk lists information about block devices (disks and partitions), including their sizes, mount points, and type.
List all block devices.
Show filesystem type and UUID.
Show all columns including permissions.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-f` | - | Show filesystem type, UUID, and label | | `-o` | `Lscpu
lscpu displays detailed information about the CPU architecture, including the number of cores, threads, speed, and vendor.
Display CPU architecture information.
Output in JSON format.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-J` | - | Output in JSON format | | `-p` | - | Output in parseable (CSV-like) format | | `-e` | - | Extended readable format | | `--all` | - | Include all CPUs including offline ones |Lsof
lsof (LiSt Open Files) lists information about files opened by processes. Since everything in Linux is treated as a file, this includes regular files, directories, network sockets, and devices â making it extremely powerful for spotting suspicious behavior.
List all open files and the processes that opened them.
List all open files for a specific process by PID.
List open network connections.
List open connections on a specific port.
List all open files for a specific user.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-p` | `MFTECmd
Command-line tool for parsing the NTFS Master File Table ($MFT), $J, and other NTFS metadata files.
Extract the records from the Files and save it in the same folder
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-f` | `..\Evidence\$MFT` | `MFT file location` | | `--csv` | `..\Evidence` | `Output directory` | | `--csvf` | `..\Evidence\MFT_record.csv` | `Output file name` |More info here.
Neo-ReGeorg
Neo-reGeorg is an HTTP tunneling and pivot tool that can create a tunnel over the HTTP(S) protocol. It encapsulates other protocols and sends them back and forth via the HTTP protocol. Create an HTTP tunnel communication channel to pivot into the internal network and communicate with local network devices through HTTP protocol. It is used for proxying HTTP traffic when encountering servers that do not allow internet access during traffic proxying.
Generate a Neo-ReGeorg key
Connect to the tunnel (must be uploaded to the machine).
Connect to a machine behind the webserver through the tunnel curl, proxychains, FoxyProxy, Firefox, etc.
curl --socks5 127.0.0.1:1080 <address of machine / file>
curl --socks5 127.0.0.1:1080 http://172.20.0.120:80/flag
More info here.
Netcat
netcat (nc) reads and writes data across network connections using TCP or UDP. It is a versatile tool for debugging, testing network connections, and creating bind or reverse shells.
Set up a listener on a port.
Connect to a remote host and port.
Transfer a file (receiver side).
Transfer a file (sender side).
Create a bind shell (on target).
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-l` | - | Listen mode | | `-n` | - | Do not resolve hostnames (numeric only) | | `-v` | - | Verbose output | | `-p` | `Netstat
netstat displays network connections, routing tables, interface statistics, and more. Largely replaced by ss in modern systems but still widely encountered.
Show all active connections.
Show listening ports and services.
Show connections with PIDs.
Show the routing table.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-a` | - | Show all sockets (listening and non-listening) | | `-t` | - | Show TCP connections | | `-u` | - | Show UDP connections | | `-l` | - | Show only listening sockets | | `-n` | - | Show numeric addresses (no DNS resolution) | | `-p` | - | Show PID and program name | | `-r` | - | Show routing table |Note:
ssis the modern equivalent and preferred on current Linux distributions.
Nmap
nmap scans networks to discover hosts and services. Useful for identifying devices on a network, open ports, running services, and OS versions.
Basic scan of a host.
Fast scan of the most common ports.
Scan a specific port range.
Service and version detection.
OS detection.
Full scan with service/OS detection and scripts.
Scan without sending ICMP ping (useful when ICMP is blocked).
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-sS` | - | SYN (stealth) scan | | `-sV` | - | Service/version detection | | `-O` | - | OS detection (requires root) | | `-A` | - | Aggressive scan (OS, version, scripts, traceroute) | | `-p` | `Nslookup
nslookup queries DNS servers to obtain domain name or IP address mappings. Useful for diagnosing DNS issues.
Look up a domain name.
Reverse lookup â find the hostname for an IP.
Query a specific DNS server.
Query a specific record type.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-type` | `A/MX/TXT/NS/PTR` | Query a specific DNS record type | | `oledump.py
Oledump.py is a Python tool that analyzes OLE2 files, commonly called Structured Storage or Compound File Binary Format. OLE stands for Object Linking and Embedding, a proprietary technology developed by Microsoft.
Analyse a file and investigate the 4th datastream. Then decompress any VBA code.
Firefox
Configure a manual proxy in the network setting and use the ip and port as listed in the Neo-reGeorge CLI output for the SOCKS host.
Osquery
osquery exposes the operating system as a relational database, allowing you to query system information using SQL. Useful for forensics, introspection, and endpoint monitoring.
Launch the interactive osquery shell.
Query running processes.
Query listening ports.
Query installed packages.
Query user accounts.
Processes Running From the tmp Directory
Hunting for Fileless Malware / Process
Orphan Processes
Finding Processes Launched from User Directories
SELECT pid, name, path, cmdline, start_time FROM processes WHERE path LIKE '/home/%' OR path LIKE '/Users/%';
Network Connections
SELECT pid, family, remote_address, remote_port, local_address, local_port, state FROM process_open_sockets LIMIT 20;
Examining DNS Queries
Listing Down Network Interfaces
Listing Down Network Interfaces
Open Files
Files Being Accessed From the tmp Directory
Hidden Files
Recently Modified Files
SELECT filename, path, directory, type, size FROM file WHERE path LIKE '/etc/%' AND (mtime > (strftime('%s', 'now') - 86400));
Recently Modified Binaries
SELECT filename, path, directory, mtime FROM file WHERE path LIKE '/opt/%' OR path LIKE '/bin/' AND (mtime > (strftime('%s', 'now') - 86400));
Run osquery in daemon mode (for scheduled queries).
More info here.
Ping
ping tests connectivity to other network devices by sending ICMP echo request packets. Useful for checking whether a host is reachable and measuring latency.
Ping a host.
Limit to N packets.
Send a ping with a custom payload (hex).
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-c` | `Ps
ps reports a snapshot of currently running processes.
List all running processes with detailed info (user, CPU, memory, command).
Full-format listing of all processes.
Show processes for a specific user.
Show processes sorted by CPU usage.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `a` | - | Show processes for all users | | `u` | - | User-oriented format (shows user, CPU %, memory %) | | `x` | - | Include processes not attached to a terminal | | `-e` | - | Show all processes (equivalent to `a`) | | `-f` | - | Full-format listing | | `-u` | `Pspy64
pspy is an unprivileged Linux process snooping tool. It monitors process executions and filesystem events without requiring root privileges â making it ideal for detecting cron jobs, scripts run by other users, and other scheduled executions that would otherwise be invisible.
Run pspy64 to monitor process executions.
Run with a custom scan interval (milliseconds).
Also watch filesystem events in addition to processes.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-i` | `More info here.
Pstree
pstree displays running processes as a tree, showing parent-child relationships. Useful for identifying abnormal process spawning patterns.
Display all processes as a tree.
Show tree with PIDs, user transitions, and full command arguments.
Show tree for a specific user.
Show the parent chain for a specific PID.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-a` | - | Show command-line arguments | | `-u` | - | Show user transitions in parentheses | | `-p` | - | Show PIDs | | `-s` | `Route
route displays or modifies the IP routing table. It shows how packets are directed through the network.
Display the routing table.
Display in numeric format (no DNS resolution).
Add a route.
Delete a route.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-n` | - | Show numeric addresses (no hostname resolution) | | `add` | - | Add a new route | | `del` | - | Delete a route | | `-net` | `Note:
ip ris the modern equivalent and preferred on current Linux distributions.
RsaCTFtool
RSA attack tool (mainly for ctf) - retrieve private key from weak public key and/or uncipher data
This tool is an utility designed to decrypt data from weak public keys and attempt to recover the corresponding private key. Also this tool offers a comprehensive range of attack options, enabling users to apply various strategies to crack the encryption.
More info and commands can be found here.
Rsatool
Rsatool can be used to calculate RSA and RSA-CRT parameters.
Can be installed from here: đ https://github.com/ius/rsatool
Create the PEM and output it to key.pem by supplying modulus and private exponent.
Create the DER and output it to key.der by supplying two primes.
Smbclient
Smbclient is a client that can 'talk' to an SMB/CIFS server and is part of the Samba suite.
'Exploit' misconfiguration of the anonymous login ability.
Ss
ss (socket statistics) is the modern replacement for netstat. It dumps socket statistics and shows active connections and listening ports, with faster and more detailed output.
Show all listening TCP and UDP sockets with process info.
Show all active connections.
Show TCP connections with process names.
Show connections to a specific port.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-t` | - | Show TCP sockets | | `-u` | - | Show UDP sockets | | `-l` | - | Show only listening sockets | | `-n` | - | Show numeric addresses (no DNS resolution) | | `-p` | - | Show process name and PID | | `-a` | - | Show all sockets | | `-s` | - | Show socket statistics summary |Systemctl
systemctl is the primary tool for managing and inspecting systemd services and units. Used in forensics to enumerate services, identify backdoors, and inspect service configurations.
List all services including inactive and failed ones.
List only currently running services.
View the status and recent logs of a service.
Print the full unit file for a service.
Start, stop, or restart a service.
sudo systemctl start <service-name>
sudo systemctl stop <service-name>
sudo systemctl restart <service-name>
Enable or disable a service at boot.
Arguments / subcommands
| Subcommand / Argument | Value | Description | |----------|-------|-------------| | `list-units` | `--all --type=service` | List all services including inactive/failed | | `status` | `More info here.
Tcpdump
tcpdump captures and analyzes network packets in real time. Packets can be saved to a file for later analysis or filtered to focus on specific traffic types.
Capture packets on an interface.
Capture and save to a file.
Read a capture file.
Filter by host.
Filter by port.
Capture N packets then stop.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-i` | `Top
top provides a dynamic real-time view of running processes, showing system resource usage including CPU, memory, and process information.
Launch top interactively.
Filter to a specific user.
Run in batch mode (non-interactive, useful for scripting or logging).
Update every N seconds.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-b` | - | Batch mode â non-interactive, suitable for output piping | | `-n` | `Interactive keys while running: k to kill a process, q to quit, M to sort by memory, P to sort by CPU, u to filter by user.
Traceroute
traceroute traces the path packets take to reach a destination, identifying each hop along the way. Useful for diagnosing where network delays or connectivity issues occur.
Trace the route to a host.
Use ICMP instead of UDP.
Limit the maximum number of hops.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-m` | `Note: On Windows, the equivalent command is
tracert.
Uptime
uptime provides a quick snapshot of the system's current status â how long it has been running, the number of logged-in users, and CPU load averages.
Display system uptime and load.
Display in a more readable format.
Show the time the system was last booted.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-p` | - | Show uptime in a human-readable format (e.g. "up 2 hours, 30 minutes") | | `-s` | - | Show the date and time the system was last started |Wget
wget is a non-interactive network downloader. Primarily used to download files from the web and useful for testing download speeds and connectivity.
Download a file.
Save to a specific filename.
Download in the background.
Continue an interrupted download.
Mirror a website.
Arguments
| Argument | Value | Description | |----------|-------|-------------| | `-O` | `Whois
whois queries the WHOIS database for domain registration information. Useful for gathering information about domain owners, registrars, and registration dates.
Query WHOIS information for a domain.
Query WHOIS for an IP address.