bsh: Hide base64 string from process list
This commit is contained in:
parent
6b07cc0cbe
commit
c145803881
|
@ -42,12 +42,16 @@ then
|
|||
grep -o '^\s*[^#]*' $SCRIPT_DIR/.bsh/inputrc | sed 's/^\s\+//' > "${WORK}/i"
|
||||
grep -o '^\s*[^"]*' $SCRIPT_DIR/.bsh/vimrc | sed 's/^\s\+//' > "${WORK}/v"
|
||||
|
||||
# Creating entrypoint
|
||||
echo "bash --rcfile ${DEST}/b" > "${WORK}/e"
|
||||
echo "rm -rf ${DEST}" >> "${WORK}/e"
|
||||
# TODO Do not remove unless last one connected
|
||||
|
||||
# Crafting command
|
||||
b64="$(cd "$CACHE_DIR"; tar czf - "$FOLDER_NAME" | base64 -w 0)"
|
||||
echo "echo $b64|base64 -d|tar xzC /tmp" > "${CACHE_DIR}/cmd"
|
||||
echo "bash --rcfile ${DEST}/b" >> "${CACHE_DIR}/cmd"
|
||||
echo "rm -rf ${DEST}" >> "${CACHE_DIR}/cmd"
|
||||
# TODO Do not remove unless last one connected
|
||||
# Due to magic, if the last command executed is bash, it disappears from the list of processes
|
||||
echo "sh ${DEST}/e" >> "${CACHE_DIR}/cmd"
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$WORK"
|
||||
|
|
Loading…
Reference in a new issue