Unix Technical Forum

HOW TO: Shell Script crypting

This is a discussion on HOW TO: Shell Script crypting within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi All Can I hide the code and deliver the shell script so that nobody else can change or ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 08:01 AM
Gianluca S.
 
Posts: n/a
Default HOW TO: Shell Script crypting

Hi All

Can I hide the code and deliver the shell script so that nobody else can
change or view that.

Thanks in advance for the answer.
Gianluca


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 08:01 AM
Sensei
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

On 2005-07-19 16:02:59 -0500, "Gianluca S." <gianluca2@email.it> said:

> Hi All
>
> Can I hide the code and deliver the shell script so that nobody else
> can change or view that.
>
> Thanks in advance for the answer.
> Gianluca
>

No. It's a text file anyway.

If you're mastering shell scripting you can produce an obfuscated code,
but it's really difficult.

--
Sensei <senseiwa@tin.it>

cd /pub
more beer

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 08:01 AM
Slor
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

Despite all prevention efforts, Sensei <senseiwa@tin.it> wrote in
news:dbjqkj$ajf$2@news.doit.wisc.edu:

> On 2005-07-19 16:02:59 -0500, "Gianluca S." <gianluca2@email.it> said:
>
>> Hi All
>>
>> Can I hide the code and deliver the shell script so that nobody else
>> can change or view that.
>>
>> Thanks in advance for the answer.
>> Gianluca
>>

> No. It's a text file anyway.
>
> If you're mastering shell scripting you can produce an obfuscated code,
> but it's really difficult.
>


Perhaps I'm missing something (not in front of my AIX box at the moment),
but can't you just make the script executable (chmod +x) and not readable
(chmod -r) to your users?

--
Slor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 08:01 AM
Gianluca S.
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

Too simple!! :-)

Gianluca

"Slor" <slor@comcast.net> ha scritto nel messaggio
news:1121811165.8ade102a908c96145815dce8079b57c8@t eranews...
> Despite all prevention efforts, Sensei <senseiwa@tin.it> wrote in
> news:dbjqkj$ajf$2@news.doit.wisc.edu:
>
>> On 2005-07-19 16:02:59 -0500, "Gianluca S." <gianluca2@email.it> said:
>>
>>> Hi All
>>>
>>> Can I hide the code and deliver the shell script so that nobody else
>>> can change or view that.
>>>
>>> Thanks in advance for the answer.
>>> Gianluca
>>>

>> No. It's a text file anyway.
>>
>> If you're mastering shell scripting you can produce an obfuscated code,
>> but it's really difficult.
>>

>
> Perhaps I'm missing something (not in front of my AIX box at the moment),
> but can't you just make the script executable (chmod +x) and not readable
> (chmod -r) to your users?
>
> --
> Slor



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 08:01 AM
Sensei
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

On 2005-07-19 17:12:43 -0500, Slor <slor@comcast.net> said:
> Perhaps I'm missing something (not in front of my AIX box at the
> moment), but can't you just make the script executable (chmod +x) and
> not readable (chmod -r) to your users?


You cannot execute something you cannot read:

username@aixserver:~$ cat a.sh
#!/bin/sh
echo "Hi!"
echo

username@aixserver:~$ ls -l a.sh
-rw-r--r-- 1 username usergrp 26 Jul 20 00:47 a.sh

username@aixserver:~$ chmod a-r a.sh
username@aixserver:~$ chmod a-w a.sh
username@aixserver:~$ chmod a+x a.sh

username@aixserver:~$ ls -l a.sh
---x--x--x 1 username usergrp 26 Jul 20 00:47 a.sh*

username@aixserver:~$ ./a.sh
/bin/sh: /afs/cell.name/user/u/username/a.sh: 0403-016 Cannot find or
open the file.

username@aixserver:~$ uname -a
AIX aixserver 2 5 0053447A4C00

username@aixserver:~$



--
Sensei <senseiwa@tin.it>

cd /pub
more beer

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-05-2008, 08:01 AM
Adrian Bridgett
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

That trick (execute but no read) works for binaries, but not shell
scripts since you really execute the shell binary (/bin/ksh for
example) which then has to read the shell script (a.sh). It does this
as your user id.

you could try using perl and the perl compiler

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-05-2008, 08:01 AM
tmpolzin@netscape.net
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting



Gianluca S. wrote:
> Hi All
>
> Can I hide the code and deliver the shell script so that nobody else can
> change or view that.
>
> Thanks in advance for the answer.
> Gianluca


I use a thrid party program called shell-lock from Cactus software. I
then keep the source in a RCVS. You can't totally get rid of the
source.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-05-2008, 08:01 AM
Sensei
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

On 2005-07-20 03:45:58 -0500, "Adrian Bridgett"
<adrian.bridgett@gmail.com> said:

>
> you could try using perl and the perl compiler


He asked for a shell script anyway. He could use python, lisp, C,
whatever, but he wouldn't have a shell script

--
Sensei <senseiwa@tin.it>

cd /pub
more beer

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-05-2008, 08:01 AM
steven_nospam at Yahoo! Canada
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

Hi Gianluca,

Try Shell-Lock from Cactus (like tmpolzin mentioned). It has worked
well for us on AIX 4.3, 5.1, and 5.2 so far. They probably have a newer
version, but here is thedetails on the copy we are using:

SHELL-LOCK(tm)
Shell Script Security Software
Copyright (C) 1989-1998
Cactus International, Inc.
(Version: 1.6.2 1/2/98)


btw - we did have a version that used to leave the shell script
compiled until you ran the script. Then it would uncompile it in the
/tmp directory and (lo and behold) the user had the source to look at
again. Version 1.6.2 does not do this anymore, or at least I can't find
where it uncompiles it to. ;-)

Steve

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-05-2008, 08:02 AM
gianluca2@email.it
 
Posts: n/a
Default Re: HOW TO: Shell Script crypting

The problem is: I can't find the download link of "shell-lock"
software!! I have serached by google ...without success!!
Can you send me a copy of it or a valid link?

Many Thanks
Gianluca


steven_nospam at Yahoo! Canada ha scritto:
> Hi Gianluca,
>
> Try Shell-Lock from Cactus (like tmpolzin mentioned). It has worked
> well for us on AIX 4.3, 5.1, and 5.2 so far. They probably have a newer
> version, but here is thedetails on the copy we are using:
>
> SHELL-LOCK(tm)
> Shell Script Security Software
> Copyright (C) 1989-1998
> Cactus International, Inc.
> (Version: 1.6.2 1/2/98)
>
>
> btw - we did have a version that used to leave the shell script
> compiled until you ran the script. Then it would uncompile it in the
> /tmp directory and (lo and behold) the user had the source to look at
> again. Version 1.6.2 does not do this anymore, or at least I can't find
> where it uncompiles it to. ;-)
>
> Steve


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:27 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com