Search
Social Media - Mubix
Login
« Psychological Warfare with NirCMD | Main | PHP Web Shell »
Tuesday
Mar012011

Issue a Linux command without it going into history

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..

 

Reader Comments (4)

It's a known "funny" trick - thx :)

March 1, 2011 | Unregistered CommenterMalwareScene

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!".

March 2, 2011 | Unregistered CommenterJason Cooper

you can also 'unset HISTFILE' to prevent your whole session from going into .bash_history

March 6, 2011 | Unregistered Commenteregyp7

What happened to sym linking .bash_history to /dev/null

March 16, 2011 | Unregistered CommenterAnonymous
Comments for this entry have been disabled. Additional comments may not be added to this entry at this time.