We will store our shellcode as a ASCII string in registry and in our implant, we will read the registry key, convert that string back into hex, and execute that.
To convert your shellcode into an ASCII string, we can use this snippet of code:
try:withopen(sys.argv[1])as shellcode:bytes=bytearray(shellcode.read()) shellcode.close()exceptIOError:print("Error reading file")print("".join("{:02X}".format(c) for c inbytes))
You will get an ASCII string in the output, we can put this in registry key so