Post Exploitation Tactics - pentestfunctions/Hacking-For-Beginners GitHub Wiki
Post-Exploitation Tactics
This document covers post-exploitation tactics in cybersecurity, focusing on techniques for data exfiltration, maintaining access, and privilege escalation. Theoretical examples are provided for a deeper understanding of these tactics.
Table of Contents
Data Exfiltration
Techniques for Extracting Data Stealthily
- Example: After gaining access to
example.com
's server, locate sensitive files like.bash_history
or log files and exfiltrate them using encrypted channels or steganography to avoid detection.
Maintaining Access
Methods for Creating Backdoors, Persistence
- Example: Plant a reverse shell script on the compromised system or modify existing system scripts to maintain access. Utilize methods like cron jobs or modifying startup scripts for persistence.
Privilege Escalation
Escalating Access to Higher Privileges Within the Application
- SUID Bit Exploitation: Look for files with the SUID bit set and use tools like GTFOBins to find ways to exploit them.
- Example: If a file like
/bin/cp
has the SUID bit set, use it to copy sensitive files or modify critical files.
- Example: If a file like
- Cron Jobs: Check for
.sh
or.py
scripts used in cron jobs. If they have write permissions, modify them to execute malicious commands. - Docker Escapes: If running inside a Docker container, look for misconfigurations or vulnerabilities to escape the container and gain access to the host system.
- Editing File Availability Paths: If certain files are executed with root permissions, modify the PATH environment variable to point to a malicious script instead, resulting in execution with elevated privileges.
Note: These tactics should be used responsibly and legally within the scope of authorized penetration testing or ethical hacking activities. Unauthorized use of these techniques can lead to legal repercussions.