- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- Languages and Scripting
- >
- Re: How to convert bash scripts into binary's, so ...
-
-
Forums
- Products
- Servers and Operating Systems
- Storage
- Software
- Services
- HPE GreenLake
- Company
- Events
- Webinars
- Partner Solutions and Certifications
- Local Language
- China - 简体中文
- Japan - 日本語
- Korea - 한국어
- Taiwan - 繁體中文
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Blog, Poland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2022 Hewlett Packard Enterprise Development LP