I would mask the code like this:
def MakeSC(): c = raw_input(" Encode: ") sc = "\\x" + "\\x".join("{0:x}".format(ord(c)) for c in c) print "\n shellcode =('" + sc + "'); exec(shellcode)"; MakeSC(); #Cleartext: import os; os.system("whoami")
#Encoded:
Payload = ('\x69\x6d\x70\x6f\x72\x74\x20\x6f\x73\x3b\x20\x6f\x73\x2e\x73\x79\x73\x74\x65\x6d\x28\x22\x77\x68\x6f\x61\x6d\x69\x22\x29'); exec(Payload);
Payload = ('\x69\x6d\x70\x6f\x72\x74\x20\x6f\x73\x3b\x20\x6f\x73\x2e\x73\x79\x73\x74\x65\x6d\x28\x22\x77\x68\x6f\x61\x6d\x69\x22\x29'); exec(Payload);