1834912 Members
3260 Online
110071 Solutions
New Discussion

Shell Script to EXE ???

 
Paul Murray
Occasional Contributor

Shell Script to EXE ???

Hello Gurus,

Does anyone know of a tool that will safely encrypt a shell script but still leave it in an executable state ??

I have some shell scripts that include various security information that I would like to shield from prying eyes ......

Any ideas ??????


Regards,
Paul M.
My Brain Hurts !!!!!
7 REPLIES 7
Sandor Horvath_2
Valued Contributor

Re: Shell Script to EXE ???

Hi !

I doesn't know any tool for this, but
You can put the secur information to file.
You can hide it anybody except root.
In Your shell script use
$(cat filename ) | ....
of course file permissions 400.

regards, Saa
ps: Your scripts rights can modify to 510 or 500 it depends who can run this script.
If no problem, don't fixed it.
James R. Ferguson
Acclaimed Contributor

Re: Shell Script to EXE ???

Hi Paul:

At least centralize and/or isolate the sensitive information in a file that your scripts source (read).

#!/usr/bin/sh
. /.includeme

...JRF...
Dan Hetzel
Honored Contributor

Re: Shell Script to EXE ???

Hi Paul,

Unfortunately, I never heard about such a 'shell script compiler'.

What you could do to hide your script, at least to the average user, is call it from a C program (with the system() call).
This C program could possibly do all setuid, setgid before calling the script.

Make sure your script has the right read/write permission.

This looks like 'quick and dirty job', doesn't it?

Good luck

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Paul Murray
Occasional Contributor

Re: Shell Script to EXE ???

Dan,

I have only one problem ..... I have never written a C program in my life !

Is there any particular resource that you would suggest in order to "learn" how to write C for HP-UX ??


Many thanks in advance,
Paul.
My Brain Hurts !!!!!
Dan Hetzel
Honored Contributor

Re: Shell Script to EXE ???

Hi Paul,

Here is the kind of program you need. You see it's quite simple. Simply replace the "/usr/bin/ls /etc" with the command you want to run.

--CUT HERE
#include

main()
{
system("/usr/bin/ls /etc");
}
-\CUT

Put the text into a file ending in '.c' (my_prog.c for example) and type "make myprog".
The executable will be created.

There are many books on the C language available on the market. I couldn't recommend any because I'm still happy with "The C programming Language - from K&Richie" that I've discovered 20 years ago ;-)
It's still a good reference.

All the best,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Tommy Palo
Trusted Contributor

Re: Shell Script to EXE ???

Edward Sedgemore
Trusted Contributor

Re: Shell Script to EXE ???


You can indeed get compilers for shell scripts which should make them impossible to read. They advertise all the time in SysAdmin Magazine (www.sysadminmag.com)