- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to hide shell programming source code
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
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
тАО03-17-2004 08:11 PM
тАО03-17-2004 08:11 PM
How to hide shell programming source code
I would like to seek ITRC forum whom which have an idea on how to compile shell script as similiar likes c program to avoid intruder copy the source code and break the ownership and copyright.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 08:21 PM
тАО03-17-2004 08:21 PM
Re: How to hide shell programming source code
Having said that, I have heard of shell compilers but have never actaully seen one. I would assume that, as they are not common, that they are not really up to date and therefore some scripts wouldn't work properly. Could be wrong though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 08:22 PM
тАО03-17-2004 08:22 PM
Re: How to hide shell programming source code
Don't look further, shell scripts are interpreted, thus, we cannot give the shell away and keep the source for yourself.
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 08:24 PM
тАО03-17-2004 08:24 PM
Re: How to hide shell programming source code
chmod 111 script
Will execute but you cannot read or write it
Or copy it
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 08:28 PM
тАО03-17-2004 08:28 PM
Re: How to hide shell programming source code
1. Write a small 'C' code say test.c as below:
main()
{
system ("script_name_with_full_path");
}
2. #chmod 755 script_name_with_full_path
3. Compile test.c as below.
#cc test.c
4. Execute the output a.out which can be renamed as well.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 08:37 PM
тАО03-17-2004 08:37 PM
Re: How to hide shell programming source code
/bin/ksh: exemple.ksh: cannot open
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 10:46 PM
тАО03-17-2004 10:46 PM
Re: How to hide shell programming source code
I have an idea,
try
#include
#include
main()
{
int i;
char fifoname[256];
sprintf(fifoname,"/tmp/fifoname_%d",getpid());
mkfifo(fifoname,0777);
signal(SIGCLD,SIG_IGN);
if(fork())
{/*parent process is ksh*/
execl("/usr/bin/ksh","/usr/bin/ksh",fifoname,0);
perror("exec");
kill(0,SIGHUP);
exit(1);
}
/*child process write to the pipe*/
i=open(fifoname,O_WRONLY);
/* you write your script, after some processing like crypto to the fifo*/
write(i,"echo oui\n",9);
close(i);
unlink(fifoname);
}
To test it in shell:
mkfifo /tmp/xxx$$
echo echo ok it works'$$':$$ >/tmp/xxx$$&
exec /usr/bin/ksh /tmp/xxx$$
# ksh titi
6651
ok it works6651:6651
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 10:53 PM
тАО03-17-2004 10:53 PM
Re: How to hide shell programming source code
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=151147
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2004 10:55 PM
тАО03-17-2004 10:55 PM
Re: How to hide shell programming source code
If you really want it be not possible to read it even with a strings a.out, you will need to uncrypt the script before writing to the fifo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2004 12:51 AM
тАО03-18-2004 12:51 AM
Re: How to hide shell programming source code
# /usr/bin/crypt 'passwd'
# /usr/bin/crypt 'passwd'
So all you need to do is run crypt on all your shell scripts AND REMEMBER YOUR PASSWORD
You could also do something like this from a system command in a C-program.
system("/usr/bin/crypt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2004 12:20 PM
тАО03-18-2004 12:20 PM
Re: How to hide shell programming source code
Thanks for the ideas and it works fine. Close the case.