Last active
May 12, 2017 00:29
-
-
Save p0c/8315843 to your computer and use it in GitHub Desktop.
.bashrc auto logging with script // I use it during pentests to automatically log console activity - useful if you forgot to grab some evidences and also for keeping track of your actions / timeline reconstruction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# auto logging - source: https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/7131 | |
if [ -z "$UNDER_SCRIPT" ]; then | |
logdir=$HOME/Log | |
if [ ! -d $logdir ]; then | |
mkdir $logdir | |
fi | |
logfile=$logdir/$(date +%F_%T).$$.log | |
export UNDER_SCRIPT=$logfile | |
script -f -q $logfile | |
exit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment