A crypter is a tool that obfuscate / encrypt any executable to make the executable difficult to analyze by debugger or to make it undetectable by malware analysis software. Here in this exercise we are supposed to create a custom crypter
I am using the slight concept of one-time pad using the XOR operation to achieve it. In XOR, the property is A ^ B = C and C ^ B = A
genkey.py
Generate Key first
I am using the slight concept of one-time pad using the XOR operation to achieve it. In XOR, the property is A ^ B = C and C ^ B = A
genkey.py
- Add the original shellcode to the script
- Add any random passcode , but keep it shorter or equal to the length of the shellcode
- Fixed character will be added to passcode if the length is lesser than size of shellcode and it will be the key
- Copy the shellcode to an array
- Copy the key to an array
- Copy the shellcode to another array, called cipher( we will overwrite this array)
- For each element in shellcode XOR each element in key , and store them in the cipher array
- Run the program and obtain the xorkey and the encrypted_shellcode
assignment7.c
- Copy the encrypted_shellcode and put in in one standard C file that executes shellcode
- Implement the logic inside the C code to take argument of key from command line
- Repace each element of encrypted_shellcode by the XOR of each element of encrypted shellcode and each corresponding element of key )
- Compile and run and pass the key during execution of the program
Generate Key first
With wrong key
With correct key
This blog post has been created for completing the requirements of SecurityTube Linux Assembly Expert Certification:
http://www.securitytube-training.com/online-courses/securitytube-linux-assembly-expert/
Student ID: PA-1191