从base64解码并执行命令

Dav*_*ypr 3 linux bash shell base64

我想在Linux机器上执行命令,但我应该以base64格式发送命令.

如何在Linux命令上解码base64字符串然后执行解码后的字符串?

cod*_*ter 5

用途base64 -d:

# 'string' variable contains a base64 encoded command
command=$(base64 -d <<< "$string"); decode_status=$?
# run the command only if decode was successful
# we shouldn't enclose $command in double quotes in this case
[[ $decode_status == 0 ]] && $command
Run Code Online (Sandbox Code Playgroud)