ansistego iconansistego 0.9

ansistego is a software for terminal-level steganography of ASCII files.
ansistego is a software for terminal-level steganography of ASCII files, using comments to allow a script in the hidden stream to execute normally. Viewed with 'cat', only the front stream will be visible. Interpreted as a script, it will be ignored.

Given a text to hide (evil.py in the examples below) and a front text (eg harmless.txt), ansistego.py writes to stdout a new file in which the first lines are the commented-out contents of harmless.txt, with ANSI codes to disguise the comment string. It's followed by the code of evil.py, with every other line containing ANSI directives to move the cursor back to the start of the line before and clear it. The last line of harmless.txt appears at the end of the output to fill the space Python inserts when it emits a newline on closing stdout.

Usage:

$ # Our evil python script, which we wish to hide:
$ cat evil.py
print "This is the evil.py!!!"
print "pwned?!"
$

$ # Our harmless memo:
$ cat harmless.txt
This is a harmless text file.
Get outta my home directory!
D:<
$

$ # cat evil data to ansistego.py, providing harmless file on cmdline:
$ cat evil.py | ./ansistego.py harmless.txt > stego.py.txt
$

$ # cat the output:
$ cat stego.py.txt
This is a harmless text file.
Get outta my home directory!
D:<
$

Only the contents of harmless.txt are visible. If evil.py is longer than
harmless.txt -- no matter how long evil.py is, in fact, the screen won't
even scroll, although the file may visibly redraw one line for a while if
it is very long. This effect would be more visible at console than over ssh.

$ # run the output:
$ python stego.py.txt
This is the evil.py!!!
pwned?!
$

harmless.txt and the ANSI screen codes are commented out to python. It's
practically a polyglot... >_>

$ # size of all three files:
$ ls -la evil.py harmless.txt stego.py.txt
-rw-r--r-$ # 1 root root 47 Mar 24 02:06 evil.py
-rw-r--r-$ # 1 root root 65 Mar 24 02:42 harmless.txt
-rw-r--r-$ # 1 root root 195 Mar 24 02:43 stego.py.txt
$

Yep

$ # hexdump of the output:
$ hexdump -C stego.py.txt
00000000 23 1b 5b 31 44 1b 5b 4b 54 68 69 73 20 69 73 20 |#.[1D.[KThis is |
00000010 61 20 68 61 72 6d 6c 65 73 73 20 74 65 78 74 20 |a harmless text |
00000020 66 69 6c 65 2e 0a 23 1b 5b 31 44 1b 5b 4b 0a 23 |file..#.[1D.[K.#|
00000030 1b 5b 31 44 1b 5b 4b 47 65 74 20 6f 75 74 74 61 |.[1D.[KGet outta|
00000040 20 6d 79 20 68 6f 6d 65 20 64 69 72 65 63 74 6f | my home directo|
00000050 72 79 21 0a 23 1b 5b 31 44 1b 5b 4b 0a 70 72 69 |ry!.#.[1D.[K.pri|
00000060 6e 74 20 22 54 68 69 73 20 69 73 20 74 68 65 20 |nt "This is the |
00000070 65 76 69 6c 2e 70 79 21 21 21 22 0a 23 1b 5b 31 |evil.py!!!".#.[1|
00000080 41 1b 5b 31 44 1b 5b 4b 1b 5b 31 44 20 1b 5b 31 |A.[1D.[K.[1D .[1|
00000090 41 0a 70 72 69 6e 74 20 22 70 77 6e 65 64 3f 21 |A.print "pwned?!|
000000a0 22 0a 23 1b 5b 31 41 1b 5b 31 44 1b 5b 4b 1b 5b |".#.[1A.[1D.[K.[|
000000b0 31 44 20 1b 5b 31 44 23 1b 5b 31 44 1b 5b 4b 44 |1D .[1D#.[1D.[KD|
000000c0 3a 3c 0a |: stego.py.txt

[p2] bt ansistego-0.9 # cat stego.py.txt
This is a harmless text file.
Get outta my home directory!
D:<

[p2] bt ansistego-0.9 # python stego.py.txt
This is the evil.py!!!
pwned?!

[p2] bt ansistego-0.9 #

last updated on:
May 11th, 2008, 15:15 GMT
price:
FREE!
developed by:
flamoot
license type:
GPL (GNU General Public License) 
category:
ROOT \ Utilities

FREE!

In a hurry? Add it to your Download Basket!

user rating 17

UNRATED
3.0/5
 

0/5

1 Screenshot
ansistego

Add your review!

SUBMIT