- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to convert bash scripts into binary's, so ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 12:40 AM
тАО01-13-2008 12:40 AM
Can you please help me to create a binary file for a bash script, I need step by step procedure for doing this .....decent points assured for helpfull answers ..Thanks in advance
Abi
Solved! Go to Solution.
- Tags:
- bash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 01:02 AM
тАО01-13-2008 01:02 AM
SolutionTHis is what is commonly called
security through obscurity. Most
of those binary converters can be broken.
Anyway, one of the most popular ones
is Generic Shell Script Converter:
http://directory.fsf.org/project/shc/
or go directly to it:
http://www.datsi.fi.upm.es/~frosal/
Easy to use. Its current version is 3.8.6.
Typical install:
make test
make strings
make install
One example of usage:
shc -r -T -f myscript
C complier is required to compile this utility.
Cheers,
VK2COT
- Tags:
- shc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 07:52 AM
тАО01-13-2008 07:52 AM
Re: How to convert bash scripts into binary's, so no one can read it
If have tried what you said ,but I am getting the below error .Please let me know where I am wrong .
FYI:- SHC has been installed .
root@hp:/var/abi/c/shc-3.7# ls
CHANGES c2s.sed s2c.sed shc.c test.csh
Copying match shc.1 shc.html
Makefile pru.sh shc.README test.bash
root@hp:/var/abi/c/shc-3.7# make test
cc -Wall -O6 -pedantic -o shc
(Bundled) cc: error 1914: bad form for `-W' option
*** Error exit code 1
Stop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 08:33 AM
тАО01-13-2008 08:33 AM
Re: How to convert bash scripts into binary's, so no one can read it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 08:43 AM
тАО01-13-2008 08:43 AM
Re: How to convert bash scripts into binary's, so no one can read it
Thanks for your advice , I will install ac++ developer bundle tomorrow and update you .
Abi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 10:59 AM
тАО01-13-2008 10:59 AM
Re: How to convert bash scripts into binary's, so no one can read it
My first thought is the same as Dusan's. My curiosity is up.
I might guess that you don't work for a vendor who has and uses the tool about which you asked.
I might guess that you're a free-lance consultant who would like to make sure that any modifications your client might want to the shell you have provided requires them to come back (pay?) you.
Are you trying to hide the (human) readability of the code because it has a password buried in it? There are better ways.
Are you writing a shell script and trying to make it a 'setuid' script? There are ways to implement this without resort to translating shell into binary (C) code.
Since you responded that you were going to install the HP-UX C/aC++ bundle I assume that you are going to pay for the full version since the evaluation copy will expire leaving you high-and-dry when you want to change your shell script.
Frankly, I'd ask you, "What problem are you trying to solve?"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 05:50 PM
тАО01-13-2008 05:50 PM
Re: How to convert bash scripts into binary's, so no one can read it
cc -Wall -O6 -pedantic -o shc
(Bundled) cc: error 1914: bad form for `-W' option
>Clay: I rather doubt that you are going to be able to compile this utility using the Bundled C compiler.
We don't know because the above error is related to using gcc options that HP's IPF compiler doesn't allow.
>I will install aC++ developer bundle tomorrow
You will have to remove these gcc options: -Wall -O6 -pedantic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 06:06 PM
тАО01-13-2008 06:06 PM
Re: How to convert bash scripts into binary's, so no one can read it
...and if you should want to use the GNU gcc compiler, you can obtain it free from either:
http://mirrors.develooper.com/hpux/
or:
http://hpux.connect.org.uk/hppd/hpux/Gnu/gcc-4.2.2/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2008 11:43 PM
тАО01-13-2008 11:43 PM
Re: How to convert bash scripts into binary's, so no one can read it
Sorry ,let me clear about my requirement.
I need to convert my Unix shell script file to binary file.
Clay ,
I have installed C developers bundle and gcc too ,still am getting the below error while doing make
fyi:-
# pwd
/var/abi/shc/shc-3.8.6
# ls
CHANGES Makefile pru.sh shc.1 shc.c test.bash
Copying match shc shc.README shc.html test.csh
# make test
*** Compiling script "match"
CFLAGS="-Wall -O6 -pedantic" ./shc -v -f match
/usr/bin/sh: ./shc: Execute permission denied.
*** Error exit code 1
Stop.
# swlist |grep -e aC++ -e gcc
B9007AA C.11.23.12 HP C/aC++ Developer's Bundle
gcc 4.2.2 gcc
#
Please help me to resolve this issue at the earliest
Thanks,
Abi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 12:53 AM
тАО01-14-2008 12:53 AM
Re: How to convert bash scripts into binary's, so no one can read it
(You still haven't said why.)
CFLAGS="-Wall -O6 -pedantic" ./shc -v -f match
sh: ./shc: Execute permission denied.
Was this the gcc or cc run?
Is shc executable?
You'll probably have to do a clean and then show all errors.