This blog post has been created for completing the requirements of the SecurityTube Linux Assembly Expert certification.
Student ID: PA-7449
The goal of this assignment is to create a custom crypter for a shellcode in any language.
The code is very simple, I’m only using 3 functions:
The first function does the execution, it loads the payload into the memory and executes it.
The second and third function takes care of the encryption/decryption of the payload. I used Fernet because the algorithm only requires the key and takes care of everything else for you.
Other than these three functions, only the basic I/O handling is implemented.
python ./crypter.py <encrypt/decrypt> <payload/encrypted payload>
When an encrypted payload is fed in, the script decrypts the payload and tries to execute it, otherwise the plaintext payload is encrypted and printed to the stdout.
Python is awesome, Fernet is easy to use. A+++.