Commands given to what, the system shell? An SQL database manager? A screen pager? Vim?
– forestMay 30 '19 at 00:35
I think you can use all of these in the terminal. And I guess all commands will be saved in the .bash_history file. I am trying to find out where else these commands will be logged (if performed only through the terminal)
– brkrootMay 30 '19 at 02:46
no. For example for less, it will store files in ~/.lesshst. But also if I use less -I , or any less command for screen navigation, those commands will be logged in bash history. I think the same commands should be stored somewhere else?
– brkrootMay 30 '19 at 03:01
I think I am asking, if there is a copy file of the .bash_history file somewhere hidden in the system, or similar file containing executed commands in the terminal
– brkrootMay 30 '19 at 03:03
Yes, most likely in unallocated space, but you need to be able to read the raw block device to find it (i.e. a regular user can't obtain it). This is a result of how bash processes history.
– forestMay 30 '19 at 03:04
a regular user could obtain root privileges and read them? if that's what you mean by regular user
– brkrootMay 30 '19 at 03:06
If a regular user got root (legitimately or otherwise), they could read the block device directly.
– forestMay 30 '19 at 03:07
please have a look on my other question to better understand my worries (
Are my passwords at risk if they are stored at my desktop?)
– brkrootMay 30 '19 at 03:09
I think I see what you mean. No that is not a secure design. Use a password manager.
– forestMay 30 '19 at 03:12
fair enough. Can you please explain why it is not a secure way, so I can improve it. I use password manager. This is just an idea I am trying.
– brkrootMay 30 '19 at 03:15
It is not secure because an attacker could try every single password-sized range of bytes from your disk and attempt to use it directly as a password, and they could do so far more quickly than if they were to just brute force it. In fact, forensic investigators actually do something like that.
– forestMay 30 '19 at 03:17
thank you. but there is no password-sized ranges(unless the passwords are being stored somehow on the disk, while using them on the website. It is a 100+ long string of characters and only I know what password starts and finish where on that string. Can a Hacker break it down? Is there such tools.
– brkrootMay 30 '19 at 03:23
Yes, a hacker can break it down. You know where it starts and finishes within a very finite amount of data. For it to be secure, you would need a 2^128+ long string. That's obviously impossible.
– forestMay 30 '19 at 03:24
1
that's bad. So in my case it doesn't really matter where and how commands from the terminal are logged. It is just the file very much vulnerable and shouldn't store it on the disk. Thanks for answering.
– brkrootMay 30 '19 at 03:28
vimorlesshistory stored in their own files count? – forest May 30 '19 at 02:48