By Waseem Akram on 10/14/2024
Today we’ll learn an advanced shellcode injection technique used by Lazarus group which uses UuidFromStringA API call. In this technique, the malware..
Today we’ll learn an advanced shellcode injection technique used by Lazarus group which uses UuidFromStringA
API call. In this technique, the malware uses the UuidFromStringA
API to convert a string into a UUID
. The malware then uses the UUID to locate the address of the shellcode in memory. The malware then injects the shellcode into the target process using the CreateRemoteThread
API call.
In this demo we’ll be using a calc.exe
shellcode instead of a reverse shell
calc.exe shellcode in Golang format
This technique uses UuidFromStringA
API call from Rpcrt4.dll
which can be used to decode shellcode as uuid and writing it to a heap pointer. In this way it doesn’t use WriteProcessMemory.
It also uses EnumSystemLocalesA
API call from kernel32.dll to resume and execute shellcode
At this point, if you have read my last post talking about CreateRemoteThread
you may have noticed that all shellcode injection technique try to achieve this results:
As you can see the used functions change but the goal is the same so the key is doing this with uncommon API calls
Before allocating any memory we should convert our shellcode to UUID
Once we have converted the shellcode to UUIDs we start creating a heap and allocating memory:
Now we have to use UuidFromStringA
to decode and write the shellcode to memory iterating over all the UUIDs
And finally to execute the shellcode we use EnumSystemLocalesA
as there are some API calls which use callback functions so can be abused to execute shellcode.
Let’s put all together to make it work. The final code should be something like this:
Now compile the final program, transfer it to the “victim” PC and execute it, this is the results
After executing it, a calc.exe appears! It works!
Now let’s upload it to antiscan.me (not VirusTotal as it distributes malware so may burn out our payloads) and here are the results:
As you can see any AV detected our .exe as malicious. However if you wanna add more protection to your shellcode injector you can use XOR or AES decryption
https://research.nccgroup.com/2021/01/23/rift-analysing-a-lazarus-shellcode-execution-method/
https://blog.sunggwanchoi.com/eng-uuid-shellcode-execution/
This course is designed to be hands-on and beginner-friendly, so even if you’re new to the world of network security, you’ll be able to follow along with ease. By the end, you'll have a
Read MoreToday we’re going to see how real malware protect themselves from being analyzed using a technique called Api Hashing. First of all we should...
Read MoreToday we’ll dump LSASS.EXE process memory to obtain credentials and we also will be using some evasion techniques. During red team...
Read MoreToday we’re gonna see an effective technique to mantain access in Windows systems during red team operations just by modifying a registry key...
Read MoreInstahack is a security tool officially designed to test the password strength of Instagram accounts using termux and kali with a brute force attack...
Read MoreToday we’re gonna see a simple malware development technique, Shellcode injection via CreateRemoteThread in Golang...
Read More