Oh the power of the shell...

Code junkies hangout here

Moderators: ChriThor, LXF moderators

Oh the power of the shell...

Postby Bazza » Wed May 07, 2014 6:15 pm

The power of the shell got me thinking about obfuscation...
This was originally done on OSX 10.7.5 and tested on PCLinuxOS 2009 and CygWin...

This is a DEMO to use variables only to create a working program.

Yes I know there will be raised eyebrows but this I have found highly interesting.

This is not obfuscated per-se as I have given each alpha-numeric character a similar
alpha-numeric variable...

It certainly is easily crackable but makes for a DEMO of the power of the shell...

Yeah I know it uses "eval" and this example is insecure but it is only a DEMO... ;o)
Just imagine the obfuscation you can create when the variables are obfuscated by reusing them, etc, etc... ;o)

Have fun and enjoy...
Code: Select all
# strings.sh
# OSX 10.7.5, default bash terminal.
for n in a b c d e f g h i j k l m n o p q r s t u v w x y z
   eval A$n="$n"
for n in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
   eval A$n="$n"
for n in a b c d e f g h i j
   eval B$n="$num"
Bk=' ';Bl='!';Bm='"';Bn='#';Bo='$';Bp='%';Bq='&';Br="'"
# A program using $string format only...
# clear
# eval name=""
# eval age=""
# eval printf "Enter your full name:-\n"
# read name
# eval printf "Enter your age:-\n"
# read age
# eval printf "Hi Barry Walker, you are 63 years old.\n"

Code: Select all
Enter your full name:-
Barry Walker
Enter your age:-
Hi Barry Walker, you are 63 years old.
AMIGA:barrywalker~> _

Bazza, G0LCU...

Team AMIGA...

The less that I speak, the smarter I sound.
LXF regular
Posts: 1511
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby IamPete » Fri May 09, 2014 9:42 am

Nice one Bazza.
Like you say it ain't that secure, but I can think of a few uses for it.
Posts: 14
Joined: Thu Apr 03, 2014 11:34 am

Postby IamPete » Fri May 09, 2014 9:44 am

Forgot to mention, could even "combine" it with an ELF executable and extract certain strings from it.
Posts: 14
Joined: Thu Apr 03, 2014 11:34 am

Postby lok1950 » Fri May 09, 2014 1:46 pm

BTW chrome reports this post as a phishing site :shock:

Enjoy the Choice :)
LXF regular
Posts: 1088
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests