Privilege Escalation and Post-Exploitation

Commands for exploring systems after gaining access.

• id

• Purpose: Shows user and group IDs.

• Example: id → Output: uid=1000(kali) gid=1000(kali).

• find

• Purpose: Searches for files with specific attributes.

• Example: find / -perm -4000 → Lists SUID binaries (potential privilege escalation).

• passwd

• Purpose: Changes user passwords (if permitted).

• Example: passwd → Prompts for new password.

• crontab

• Purpose: Views or edits scheduled tasks.

• Example: crontab -l → Lists cron jobs for the current user.


Tips for New Students

• Practice Ethically

• Only use these commands on systems you own or have explicit permission to test (e.g., lab VMs like Metasploitable).

• Learn Options

• Most commands have flags (e.g., nmap -A for aggressive scan). Use man <command> to explore.

• Scripting

• Combine commands in scripts (e.g., #!/bin/bash) to automate tasks.

• Safety

• Run destructive commands (e.g., rm, kill) carefully to avoid breaking your system.


Suggested Learning Path

  1. Start with Basics: Master whoami, cd, sudo, cat.
  2. Network Basics: Learn ifconfig, ping, netstat.
  3. Recon Tools: Practice nmap, whois, dig.
  4. Exploitation: Experiment with nikto, sqlmap, hydra in a lab.
  5. Analysis: Use tcpdump, wireshark to understand traffic.