From 9e04167a220bb99408653992b2171de1c1517e36 Mon Sep 17 00:00:00 2001 From: SkyperTHC <5938498+SkyperTHC@users.noreply.github.com> Date: Sun, 28 Aug 2022 20:00:55 +0100 Subject: [PATCH] hide with + --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f6ed9ba..6205e43 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ hide() [[ $_pid =~ ^[0-9]+$ ]] && { mount -n --bind /dev/shm /proc/$_pid && echo "[THC] PID $_pid is now hidden"; return; } local _argstr for _x in "${@:2}"; do _argstr+=" '${_x//\'/\'\"\'\"\'}'"; done - [[ $(bash -c "ps -o etimes= -p \$PPID") -eq 0 ]] && exec bash -c "mount -n --bind /dev/shm /proc/\$\$; exec \"$1\" $_argstr" + [[ $(bash -c "ps -o stat= -p \$\$") =~ \+ ]] || exec bash -c "mount -n --bind /dev/shm /proc/\$\$; exec \"$1\" $_argstr" bash -c "mount -n --bind /dev/shm /proc/\$\$; exec \"$1\" $_argstr" } ``` @@ -146,6 +146,8 @@ hide sleep 1234 # Hides 'sleep 1234' hide nohup sleep 1234 &>/dev/null & # Starts and hides the hidden background process 'sleep 1234' ``` +(thanks to *druichi* for improving this) + --- **2.i. Almost invisible SSH**