liberize / ssc Goto Github PK
View Code? Open in Web Editor NEWConvert shell script to binary
License: GNU General Public License v3.0
Convert shell script to binary
License: GNU General Public License v3.0
How do we get rid of this message from the kernel log?
Thank you.
原脚本是source了一个脚本,以加载一些函数,现在这两个脚本都被加密了,由于它们都是二进制文件,所以无法正常source
When running the binary in the embedded environment I need to create the symlink manually after mounting devtmpfs:
ln -s /proc/self/fd /dev/fd
Perhaps SSC could create this link by itself if its missing?
Once symlink is in place then binary works as expected.
Unless I'm missing something here is a simple way to bypass the '-u' flag:
#!/bin/sh
strace -vf -p $$ -s 256 -o strace.log &
exec ./ssc-script
ssc-script is the real script compiled by the SSC utility.
Can we make that SSC will abort execution if strace is attached already to its process?
Thank you.
edit
Does it support fish script?
Please add CXXFLAGS for rc4 otherwise cross compilation fails when '-s' (static) and '-4' flags are used.
Please change:
[ -f ./rc4 ] || $CXX -std=$CXX_STANDARD "$DIR/rc4.cpp" -o rc4 || exit 1
to:
[ -f ./rc4 ] || $CXX $CXXFLAGS -std=$CXX_STANDARD "$DIR/rc4.cpp" -o rc4 || exit 1
Thank you
ho uno script shell dove all'interno mi serve recuperare il nome dello script, esempio:
#!/bin/bash
script_name=$(basename "$0")
echo "$script_name"
./test.sh
test.sh
ssc -u test.sh test
./test
3
once the script has been compiled with ssc, it seems that it no longer retrieves basename... how can this be remedied?
Thanks
There are two scripts:
Use ssc to compile scriptA, got scriptA.x, and compile scriptB, got scriptB.x.
Run the cmd, ./scriptA
, and I got the following message,
/bin/bash: --: invalid option
Usage: /bin/bash [GNU long option] [option] ...
/bin/bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--pretty-print
--rcfile
--rpm-requires
--restricted
--verbose
--version
Shell options:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
While the same script works fine with shc.
Hi, love the project, thank you so much for it!
I am trying to use this to hide a process from myself such that I cannot kill it. Using this project I was able to get rid of the script name being listed (and greppable) in ps
output. However, all processes spawned that were compiled using ssc
are now called /bin/zsh /dev/fd/3
. Is there any way I can change this? Ideally I would set it to a random string that mimic or closely resemble existing processes on my PC.
Thanks!
When I launch the bin file generated by ssc, I need to be at least sudoer, that I would like to avoid as non root or sudoer user should launch the bin file. How I can do that ? Do I have any parameters that I need to set when I launch ssc ?
For information, I compile bash scripts.
Thank you for your reply.
When I was trying to convert a file in another directory, It threw an error in Perl Regex:
Used command:
./ssc -u -s ~/exec.sh mains -v
Result:
+ CXXFLAGS=' -DUNTRACEABLE -static -static-libgcc -static-libstdc++ -v'
+ shift
+ '[' -n '' ']'
+ eval set -- '"/home/oem/exec.sh"' '"mains"'
++ set -- /home/oem/exec.sh mains
+ '[' -n '' -o 2 '!=' 2 ']'
++ dirname ./ssc
+ DIR=.
+ perl -pe 's/SCRIPT_FILE_NAME//home/oem/exec.sh/g; s/SCRIPT_CONTENT/`cat '\''/home/oem/exec.sh'\''`/ge' ./main.cpp
Unknown regexp modifier "/h" at -e line 1, at end of line
Unknown regexp modifier "/h" at -e line 1, near "; "
Can't find string terminator "`" anywhere before EOF at -e line 1.
+ exit 1
Maybe need to escape \
character?
please provide a setup tutorial
Hi Paul,
Can we mount proc filesystem automatically in case:
a) its not mounted already
b) ssc script was run as root
Right now I need to use another utility to mkdir /proc and mount 'proc' filesystem before I can use SSC compiled script.
Thank you.
what packages are necessary to successfully build the binary pls?
UTSL, I saw perl, g++, and clang++?
I.e., clang
is "C, C++ and Objective-C compiler", if I have clang do I still need g++
, or vice versa?
I.e., what are the minimum packages necessary for building under Debian and MacOS (homebrew & macport) please?
Thanks
The design of ssc is significantly secure than shc, but one major question --
can the script read from pipe as input, to act as a filter?
I.e., can the compiled binary "behaves exactly like the original script"?
Hello,
I'm compiling my script with following options:
ssc -0 -4 -u -s -r -i /bin/bash -e ./bash script.src script
I know the interpreter gets unpacked to a subfolder in /tmp upon execution.
Is there a way to find a real path to the unpacked interpreter from the script?
I want to run MD5 sum check on it before executing the main part of the script.
Or maybe to force a path where the interpreter should be unpacked?
(must overwrite the existing file)
Thanks
This happen while using Termux for compile a shell script, as my attempts to make a working binary on Android environment since binary that compiled on linux won't work in Android, throwing error env: exec mtkfest: No such file or directory
.
$ bash ssc -u mtkfest mtkfest.x
mtkfest.cpp:10:10: fatal error: 'wordexp.h' file not found
10 | #include <wordexp.h>
| ^~~~~~~~~~~
1 error generated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.