Tuesday
Mar012011
Issue a Linux command without it going into history
Tuesday, March 1, 2011 at 2:38PM CORRECTION:
Thanks to jduck for pointing it out, but you need to actually make a change to get this to work, reference: http://www.catonmat.net/blog/the-definitive-guide-to-bash-command-line-history/ and search for: Modifying History Behavior
You simply put a space before it
mubix@localhost:/tmp/demo$ ls -alh total 8.0K drwxr-xr-x 2 mubix mubix 4.0K Mar 1 19:43 . drwxrwxrwt 3 root root 4.0K Mar 1 19:43 .. -rw-r--r-- 1 mubix mubix 0 Mar 1 19:43 bob mubix@localhost:/tmp/demo$ cat ~/.bash_history ls -alh mubix@localhost:/tmp/demo$ mysecretlogin -u bobsuruncle -p allacazaam mubix@localhost:/tmp/demo$ cat ~/.bash_history ls -alh mubix@localhost:/tmp/demo$
Works well for backdoors you don't want caught via the .bash_history as well ;-)
More CCDC tricks as I think of them..
Rob Fuller | Comments Off | tagged
ccdc
ccdc
Reader Comments (4)
It's a known "funny" trick - thx :)
Another option is to use "history -r" to reload the history file after you have run the command. Very useful when you have run the command and think "I don't want that showing up in the history!".
you can also 'unset HISTFILE' to prevent your whole session from going into .bash_history
What happened to sym linking .bash_history to /dev/null