You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I am trying to use an shc binary for a chrooted user on my system and I am running into an issue that has had me stumped for several days.
Whenever I run the compiled binary as a non-jailed user, I have no problems at all and it does what it is supposed to do. But when I run the script as the jailed user, it just outputs gibberish to the terminal and doesn't run the code inside the script. I have chmod'd the binaries to make them executable and chown'd them so the jailed user definitely has the permission to execute the script and the commands contained within.
When I run the commands within the compiled shell script manually, the user can do so without issues. But once it is converted into a binary the problem arises. Below is a simplified example of what I am attempting to accomplish:
#!/bin/bash
PASSWORD="passaword_here"if [ -z$1 ];then# Requires a password to run.echo"Usage: ./zork3.sh [password]"echo"Or if converted to binary form: zork3 [password]"exit 1
elif [ "$1"="$PASSWORD" ];then# Runs Zork III if the password is correct.
frotz ./COMPILED/zork3.z3
else# If the password is incorrect, tell the user.echo"That is not the correct password!"exit 1
fi
The script I run to generate the binaries from the shell scripts:
#!/bin/bash
ls -A | grep -E "zork.\.sh"|whileread -r file;doecho"Compiling $file..."
sudo shc -U -f "$file" -o "${file%.*}"done
Any assistance in resolving this would be appreciated, thanks!
The text was updated successfully, but these errors were encountered:
I have this problem too. I executed shc for my commands in /usr/bin/ in docker system. This work amazing, and this commands is executable before i start this docker with new changes again.
Hey there, I am trying to use an
shc
binary for a chrooted user on my system and I am running into an issue that has had me stumped for several days.Whenever I run the compiled binary as a non-jailed user, I have no problems at all and it does what it is supposed to do. But when I run the script as the jailed user, it just outputs gibberish to the terminal and doesn't run the code inside the script. I have
chmod
'd the binaries to make them executable andchown
'd them so the jailed user definitely has the permission to execute the script and the commands contained within.When I run the commands within the compiled shell script manually, the user can do so without issues. But once it is converted into a binary the problem arises. Below is a simplified example of what I am attempting to accomplish:
The script I run to generate the binaries from the shell scripts:
Any assistance in resolving this would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: