Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ Or of course: $ cat cloakedAndNoisy.txt | cut -d" " -f3- > cloakedNoiseStripped.
<img src=https://github.com/TryCatchHCF/Cloakify/blob/master/screenshots/pokemonGoExample.png></img>



* Updated to python3 by John Aho
28 changes: 15 additions & 13 deletions cloakify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Filename: cloakify.py
#
# Version: 1.1.0
# Version: 1.1.1
#
# Author: Joe Gervais (TryCatchHCF)
#
Expand Down Expand Up @@ -39,6 +39,7 @@
#
# $ ./cloakify.py payload.txt ciphers/desserts > exfiltrate.txt
#
# Updated to Python3 by John Aho

import os, sys, getopt, base64

Expand All @@ -48,36 +49,37 @@ def Cloakify( arg1, arg2, arg3 ):

payloadFile = open( arg1, 'rb' )
payloadRaw = payloadFile.read()
payloadB64 = base64.encodestring( payloadRaw )
payloadB64 = base64.encodebytes( payloadRaw)

try:
with open( arg2 ) as file:
cipherArray = file.readlines()
except:
print ""
print "!!! Oh noes! Problem reading cipher '", arg2, "'"
print "!!! Verify the location of the cipher file"
print ""
print("")
print("!!! Oh noes! Problem reading cipher '", arg2, "'")
print("!!! Verify the location of the cipher file" )
print("")

if ( arg3 != "" ):
try:
with open( arg3, "w+" ) as outFile:
for char in payloadB64:
for char2 in payloadB64:
char = chr(char2)
if char != '\n':
outFile.write( cipherArray[ array64.index(char) ] )
except:
print ""
print "!!! Oh noes! Problem opening or writing to file '", arg3, "'"
print ""
except Exception as ex:
print("")
print("!!! Oh noes! Problem opening or writing to file '", arg3, "'", ex)
print("")
else:
for char in payloadB64:
if char != '\n':
print cipherArray[ array64.index(char) ],
print( cipherArray[ array64.index(char) ],)


if __name__ == "__main__":
if ( len(sys.argv) != 3 ):
print "usage: cloakify.py <payloadFilename> <cipherFilename>"
print("usage: cloakify.py <payloadFilename> <cipherFilename>")
exit

else:
Expand Down
Loading