Clearing tracks on windows
A good practice is to store all your scripts, exploits and binaries in the C:/Temp directory on windows and the /tmp on linux
Take note of where exploits and payloads you run are stored so they can be deleted afterwards
To run resource scripts on windows meterpreter
resource /path/to/file.rc
Resource scripts can actually help with clearing uploaded packages and binaries, saves you the stress of removing them one by one
Another thing to do is clear event logs, meterpreter has a module that can do this
clearev
Clearing tracks on Linux
Instead of deleting the “.bash_history” file, you can just delete the commands you ran so it won’t be obvious that someone messed it up
so to clear the history
history -c
If the commands are being stored in the “.bash_history” file, another thing that can be done is
cat /dev/null > .bash_history
history -c
so, this moves the content of the .bash_history file to the history file which makes it easier to clear since we do not want to delete the .bash_history file