String hash/obfuscation in ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting String hash/obfuscation in ksh
# 1  
Old 04-28-2008
String hash/obfuscation in ksh

I have a vendor that needs to install a set of scripts (written in korn) that will be run as root through crontab every day. This set of scripts will need to ssh as root to other servers without getting challenged for user name or password. So I have set up ssh key pairing and authorized_keys file.

But here's the thing. Users who log in to a server as themselves can su to root, then ssh directly to other servers as root. This breaks accountability. So, I decided to yank out the "IdentityFile" line in root user's ssh config, which will force users who are in root to now use the -i parameter when using ssh or scp commands. This obviously needs to be modified in the vendor's scripts as well.

However, I would hate to have the script contain a variable called "ssh_ID" so that the scripts can run something like this: /usr/bin/ssh -i ${ssh_ID} [remote_commands]

I want to see if there are simple string obfuscation scripts for korn shell that I can incorporate into the vendor scripts, so that ssh_ID is assigned the hashed string (instead of "/root/.ssh/id_dsa"). Apparently there are several samples out there for perl, but none for Korn shell. I'm sure I can try something myself, but I'm not exactly mathematically gifted. In fact, I don't even know how to offset a character without using ksh97!

Help?
# 2  
Old 04-29-2008
obfsh ?
shell obfuscator.

freshmeat.net: Project details for obfsh
# 3  
Old 04-29-2008
You mention "ksh97". If you mean ksh93, you could also use the shell script compiler shcomp which comes with ksh93.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Traceback spammers using an obfuscation of their URL

I have on occasion been forced to divulge my address to the odd enterprise, here and there. Some time later I've mysteriously found myself on the receiving end of spam. I have a plan to copy said enterprise's domain or part thereof to a bash terminal and obfuscate it, then paste the obfuscated... (2 Replies)
Discussion started by: nohspamjose
2 Replies

2. Shell Programming and Scripting

Obfuscation Part II.

Hi guys... This sure is gonna raise a few eyebrows. Further to my shell obfuscation ideas from a previous post this is a derivative with ideas that work. Firstly the file 'obfuscate_master.sh' is created and the access rights changed to the owner only. It is called in ths particular case... (0 Replies)
Discussion started by: wisecracker
0 Replies

3. Shell Programming and Scripting

Sort a hash based on the string length of the values

Hi, I want to be able to sort/print a hash based on the string length of the values. For example %hash = ( key1 => 'jeri', key2 => 'corona', key3 => 'una, ); I want to be able to print in the following order (smallest to largest) una,jeri,corona OR... (1 Reply)
Discussion started by: jdilts
1 Replies

4. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

Hi, I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all . my %result ( $abc => { 'data_count' => '10', 'ID' => 'ABC122', } $def => { 'data_count' => '20', 'ID' => 'defASe', ... (1 Reply)
Discussion started by: asak
1 Replies

5. Programming

Hash string

Hello everyone! I'm writing a C++ program and I use a hash table which contains strings. Its the first time I have to deal with strings since the only thing I have done so far is for integers and is the following: int hashFunction(int key){ return key%sizeOfHashTable; } but how... (2 Replies)
Discussion started by: vlm
2 Replies

6. Shell Programming and Scripting

ksh: hash (#) at beginning of a line exits the shell

This is WILD! :eek: Under Ubuntu (where I am cross-posting this problem) I have lately noticed by terminal windows/tabs closing unexpectedly. I finally caught it: I was composing a complicated command so I practices it a few times commented out - that is, with a # at the start of the line. What... (3 Replies)
Discussion started by: rpaskudniak
3 Replies

7. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below. #!/usr/bin/perl use warnings; use Tie::IxHash; use strict; tie (my %programs, "Tie::IxHash"); while (my $line = <DATA>) { chomp $line; my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies

8. Shell Programming and Scripting

Print Entire hash list (hash of hashes)

I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes). Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash. Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies

9. Programming

md5 hash a string or char array in SCO

Can someone provide me with code to md5 hash a string or character array in the SCO environment. All help is appreciated thanks. (5 Replies)
Discussion started by: jcarter2333
5 Replies
Login or Register to Ask a Question