A collection of guides and tutorials by Dante.
The fifth and final phase of the penetration testing methodology: removing evidence of your activity from the target system while maintaining access.
After gaining and stabilizing access, you must erase logs, artifacts, and forensic evidence so the engagement goes undetected — and so the client can’t be blamed for incidents you caused during testing.
⚠️ Ethics first: Log clearing is only legitimate during authorized penetration tests with explicit rules of engagement. Defensive teams use anti-forensics knowledge to build better detection, and red teamers rely on it for realistic stealth simulations. Doing this on systems you don’t own is a crime.
# Wipe specific log files
echo "" > /var/log/auth.log
echo "" > /var/log/syslog
shred -u /var/log/auth.log # overwrite + delete
# Clear bash history
history -c
rm ~/.bash_history
unset HISTFILE
# Clear event logs (requires admin)
wevtutil cl Security
wevtutil cl System
wevtutil cl Application
# Or via the Event Viewer GUI
# Windows Logs → right-click each log → Clear Log
# Never write to history at all
export HISTSIZE=0
export HISTFILESIZE=0
# Run commands without logging
<space>command # prefix with space if HISTCONTROL=ignorespace
rm /tmp/exploit.pytouch -t YYYYMMDDhhmm file to backdate filesThe better you are at erasing tracks, the more defenders should practice:
wevtutil cl, shred, and history clearingYou’ve now covered the full offensive lifecycle:
愛をこめて ダンテが作りました