platform; including automated penetration tests and risk assesments culminating in a "cyber risk score" out of 1,000, just like a credit score.
First slide label
Some representative placeholder content for the first slide.
Second slide label
Some representative placeholder content for the second slide.
Third slide label
Some representative placeholder content for the third slide.
How to get plain text source from shc compiled bash script?
published on 2013-08-25 07:39:00 UTC by nirav desai Content:
Shc is used to protect your shell script from modification or inspection. If you created bash script want to distribute it , but dono`t want them to easily readble by other people , then you can use it.
First we see how to compiled bash script to binary?
Now we have script which we want to convert in binary.
./shc -f /script_path
So now you can see that it will convert plain text bash source into binary which extension is .sh.x.
How to retrieve plain text from binary?
The shc compiled binary decrypts and loads the script into memory when started right after we started the binary, just segfault it and retrieve our script from the core dump.
Core dumps are often used to debug errors in Linux or UNIX programs. A core file is generated when an application program abnormally
terminates due to bug, operating system security protection schema, or
program simply try to write beyond the area of memory it has allocated.
By default most of linux distributions turn off core file creation.
So we need to turn on core file creation.
ulimit -c
If output is zero means that core file is not created.
Now we set core file size limit to 70000 byte
ulimit -c 70000
Now we start binary & segfault it right away.I used IP-Digger binary to get plain text from it.
sleep 0.02 will give the binary enough time to start up and decrypt the
original script. The variable $! contains the pid of the last background
process started, so we can easily kill it with the segmentation fault
signal SIGSEGV (same as kill -11 $!).