Contents

Issue a Linux command without it going into history

Contents

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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..