Go XOR Cipher Encoding and Shellcode Execution Analysis
This Go program seems to be encoding a payload binary file using a XOR cipher and then decoding it back before executing it in memory using 'VirtualAlloc' and 'RtlMoveMemory' functions. The encoded payload is then passed to the 'exec' function, which allocates memory for the shellcode, copies it to the allocated memory location, and finally executes it.
The XOR cipher used in this program is a simple byte-by-byte XOR operation, where each byte of the input data is XORed with a byte from the key. The key used is a two-dimensional byte array, where each row represents a different key. In this program, only the first row of the key is used.
The program reads the payload binary file from disk and encodes it using the XOR cipher with the first row of the key. The resulting encoded payload is then passed to the 'exec' function, which decodes it using the same XOR cipher and then executes it in memory.
The use of 'VirtualAlloc' and 'RtlMoveMemory' functions suggests that the program is creating and executing shellcode in memory, which is a common technique used in malware to evade detection by antivirus software. The program also waits for a short time before and after executing the shellcode, which may be an attempt to evade detection by anti-malware software that monitors for suspicious activities.
原文地址: https://www.cveoy.top/t/topic/lPgh 著作权归作者所有。请勿转载和采集!