hide with +

This commit is contained in:
SkyperTHC
2022-08-28 20:00:55 +01:00
committed by GitHub
parent f9dde621cc
commit 9e04167a22
+3 -1
View File
@@ -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)
---
<a id="ais-anchor"></a>
**2.i. Almost invisible SSH**