0

enter image description hereI run a encrypted shell script through crontab, while checking for process of script through ps -ef | grep script_name it is showing process along with script code in plain text

# ps -ef | grep test_script.x

root      5134  2901  0 12:16 pts/3    00:00:00 ./test_script.x -c

#!/bin/bash if [ `echo $?` == 0 ]; then echo "This is my test script"  apt-get update else echo "This is end test script" fi sleep 3    ./test_script.x

root      5164 15802  0 12:16 pts/0    00:00:00 grep --color=auto test_script.x
  • Is it not supposed to decrypt the script before running it? – George Udosen Nov 30 '17 at 6:21
  • It should execute in background only but why it is showing script while checking of process ? – srinuab4u Nov 30 '17 at 9:43
  • 1
    I am not an expert but I think it's supposed to show the command that is running for that PID? – George Udosen Nov 30 '17 at 10:09
  • Are you sure you're running the encrypted version of the script (the one ending in .x?). Also, ps normally won't show the contents of a shell script, just the name-- could you give us an example of what's happening (redacting sensitive information or creating a separate script for posting purposes)? – barrycarter Nov 30 '17 at 16:20
  • 2
    Please don't post pictures of text. Instead, copy-paste the text, and use the formatting tools to make it look nice. This makes it easier for more people to find and read your question. (For more details, see Why do people post screenshots of their terminals?) – wjandrea Dec 4 '17 at 6:35

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.