HOW TO: Cripting unix shell script

HOW TO: Cripting unix shell script

Post by Gianluca S » Thu, 21 Jul 2005 05:59:46



Hi all!!

I need to crypt a shell script (maked with korn shell) but i want that the
users of my system can run it...
Do you have an idea to make this operation?

Thanks in advance
Gianluca

 
 
 

HOW TO: Cripting unix shell script

Post by nasi » Thu, 21 Jul 2005 06:07:55


There are some 3rd party utilies to do that. Check out ShellGuard
http://www.fstha.com/
I am not sure if there is any bundled utility in Solaris or HPUX that
does that.

- nasir


> Hi all!!

> I need to crypt a shell script (maked with korn shell) but i want that the
> users of my system can run it...
> Do you have an idea to make this operation?

> Thanks in advance
> Gianluca


 
 
 

HOW TO: Cripting unix shell script

Post by johngnu » Thu, 21 Jul 2005 06:17:37


Quote:>From my notes:

- Hooking the enc data from the gpg command. The command line will ask
for the pass to the file controled by gpg, the info var return will
have the info kept in the gpg file.

info=$(gpg -d foo.gpg 2>err |grep label)
echo "$info"

But, keep in mind, this will force a stdin passwd for the file that was
gpg. Also gpg is not avil on many OS.

OR:
Can you pass the word or even the shell via a env var. Then pass it
back out.

Some times:
To keep just any one from `more foo.sh` I use compress, then to run the
file, `zcat foo.ksh.Z
|ksh `

Just 2 cents. JB

 
 
 

HOW TO: Cripting unix shell script

Post by Gianluca S » Thu, 21 Jul 2005 07:14:21


In my case i have sun solaris 5.8......work on it this suggestion?

Thanks
Gianluca



Quote:> >From my notes:
> - Hooking the enc data from the gpg command. The command line will ask
> for the pass to the file controled by gpg, the info var return will
> have the info kept in the gpg file.

> info=$(gpg -d foo.gpg 2>err |grep label)
> echo "$info"

> But, keep in mind, this will force a stdin passwd for the file that was
> gpg. Also gpg is not avil on many OS.

> OR:
> Can you pass the word or even the shell via a env var. Then pass it
> back out.

> Some times:
> To keep just any one from `more foo.sh` I use compress, then to run the
> file, `zcat foo.ksh.Z
> |ksh `

> Just 2 cents. JB

 
 
 

HOW TO: Cripting unix shell script

Post by bsh » Thu, 21 Jul 2005 08:01:18



> I need to crypt a shell script (maked with korn shell) but i want that the
> users of my system can run it...
> Do you have an idea to make this operation?

I interpret your use of "crypt" to mean "compile", not
"encrypt", which is something intrinsically different.

Gianluca, there are a variety of tools to "compile" scripts into
equivalent C source, "shroud" scripts with a binary executable shell,
or "obfuscate" the script source to discourage reuse, BUT all of
these techniques and resources either do not accomplish what you
want to do, are commercial software, or are for very specific
environments.

(Excuse me for the complex language of the above :)

Here is a list of all(?) available software that can do this.
You do not mention what your host system is, so you will have
to research and experiment yourself. I recommend "shcomp.c" as
part of the kornshell version 1993 package (free).

Reply to this newsgroup with your experience of success or
failure.

=Brian

COMPILE,"CCsh",,http://www.comeaucomputing.com/faqs/ccshfaq.html;http://www.comeaucom...,"compile
sh(1)"
COMPILE,"shc.c",2.4;3.8,http://www.datsi.fi.upm.es/~frosal/;ftp://hpux.csc.liv.ac.uk/hpux/Lan...,"script

COMPILE,"shcomp.c",,<ast-ksh>/src/cmd/ksh93/{DESIGN,README,sh/shcomp.c},$0,"compile

COMPILE,"Shell
Protector",,http://www.bungisoft.com/html/purchase.html,$0,"compile

COMPILE,"Shell-Lock",,http://www.cactus.com/shellock.html;http://seclists.org/lists/bugtraq...,"compile
sh(1): NCA"
COMPILE,"ShellGuard;fstsg",0.2,http://www.fstha.com/sg.html,$0,"turn

COMPILE,"wzshSDK",,http://wzce.tripod.com/wzsh.html,$$;/etc/wzshSDK.lic:Q420030915:fzRm2...,"compile/encrypt
shellscript (Body:Apply for wzsh DEMO)","Roger Gong"

 
 
 

HOW TO: Cripting unix shell script

Post by Stefaan A Eeckel » Thu, 21 Jul 2005 08:00:37


On Tue, 19 Jul 2005 20:59:46 GMT


> I need to crypt a shell script (maked with korn shell) but i want that the
> users of my system can run it...
> Do you have an idea to make this operation?

ksh93, available from  http://www.research.att.com/sw/download/
(package ast-ksh) contains shcomp, a utility that compiles ksh93
scripts to an intermediary (ie unreadable) format.
Whether this will work for your version of ksh I don't know, but you
can install ksh93 if the feature is important to you (there are
binaries for quite a few OSes on the AT&T site, but compiling from
source is pretty straightforward).

Take care,

--
Stefaan
--
As complexity rises, precise statements lose meaning,
and meaningful statements lose precision. -- Lotfi Zadeh

 
 
 

HOW TO: Cripting unix shell script

Post by Dawid Michalczy » Tue, 26 Jul 2005 07:43:42



> Hi all!!

> I need to crypt a shell script (maked with korn shell) but i want that the
> users of my system can run it...
> Do you have an idea to make this operation?

I wrote a shell script obfuscator:
http://comp.eonworks.com/scripts/obfsh

--
Dawid Michalczyk
http://www.art.eonworks.com

 
 
 

HOW TO: Cripting unix shell script

Post by Andrew Smallsha » Thu, 28 Jul 2005 04:23:35



Quote:> Hi all!!

> I need to crypt a shell script (maked with korn shell) but i want that the
> users of my system can run it...
> Do you have an idea to make this operation?

There is a tool called 'shc' specially designed for this purpose.  Its
homepage is at http://www.datsi.fi.upm.es/~frosal/

--
Andrew Smallshaw

 
 
 

1. how to use [ in shell cripts as a link to GNU'S test???

I have installed gtest (= GNU's test) and in the same /usr/local/bin "[" is a
link to gtest. So how can I use "[" in shell scripts?

E.g., "if [ -L SM ]; then echo Symbolic link; fi" doesn't work because the
old [ is used by the shell. On the other hand, "gtest -L SM && echo Symbolic
link" is OK but I want to use it with the "if then fi" construction.

Please respond by email. Thanks. Take care...Paul


Dept Math - Ohio State University     1-614-292-3317 (Office)
Columbus, Ohio 43210-1174, U.S.A.     1-614-292-1479 (Math Dept Fax)

2. file dates incorrect under RH6.2

3. ? Unix Shell Syntax to log out user from a shell script ?

4. Documentation

5. unix shell commands within ftp shell script

6. Please help me

7. . sed script unix shell script ispell

8. Borland style IDE--where is it?

9. calling CGI scripts from UNIX shell scripts->html

10. Job-Oklahoma; Unix Systems Administrator; UNIX, Shell Scripts

11. hoe do I post to a unix script through a unix shell?

12. handling SIGINT in shell scripts when executing another shell script.

13. Q: How can I have a shell script call another shell script...