Hello, I am writing a shell command with a basic Hello World for testing
saved it as chanrio.sh and it runs fine. I have compiled it using shc (shell script compiler) to encrypt and no one can see the code inside when they open my script.
It compiled successfully but when running ./chanrio.sh.x it is showing syntax error
even renaming it to chanrio.sh and running sh chanrio.sh doesnt work
Am I missing any step ?
you need to use the -b option for shc. Its been eons since i played with it but there is a patched version for openwrt that has the -b option. Honestly I cannot even remember what the -b option is ... but i do clearly remember the fight to get it going.
from what i recall, the steps were something to this effect..
download the patched version
compile it for openwrt
create the script or upload it to openwrt
run the shc -b some.sh
the two main points are ...you need the patched version of shc (I just recalled, -b is for busybox) do a search for busybox shc
And the second point is, it must been run in openwrt or against busybox while compiling the script.
This is going back on 10 years ago so you may have to do some digging.
Also, its worth mentioning, shc is just obfuscation, it is not very secure, if the attacker, for lack of better words, knows that shc has been used to compile/encrypt the script, shc can be used to unpack/decrypt the script just the same.