2022-07-13 - Malware Development Tricks Run Shellcode Via - Chromium - Anna's Archive
2022-07-13 - Malware Development Tricks Run Shellcode Via - Chromium - Anna's Archive
2 minute read
This article is the result of my own research into another interesting trick: run shellcode via
enumerates the child windows.
EnumChildWindows
Enumerates the child windows of the specified parent window by providing the handle to
each child window to a callback function that has been created by the application.
EnumChildWindows continues until either the final child window has been enumerated or the
1/7
callback function returns FALSE:
BOOL EnumChildWindows(
HWND hWndParent,
WNDENUMPROC lpEnumFunc,
LPARAM lParam
);
practical example
Let’s go to look at a practical example. The trick is pretty simple, similar to previous trick:
/*
* hack.cpp - run shellcode via EnumChildWindows. C++ implementation
* @cocomelonc
* https://cocomelonc.github.io/
*/
#include <windows.h>
2/7
First we allocate memory buffer in a current process via VirtualAlloc:
And then, as a pointer to the callback function in EnumChildWindows we specify this memory
region:
demo
3/7
and run in our victim’s machine:
.\hack.exe
4/7
As you can see, everything is work perfectly :)
https://www.virustotal.com/gui/file/71c4294f90d6d6c3686601b519c2401a58bb1fb03ab9ca39
75eca7231af77853/detection
I hope this post spreads awareness to the blue teamers of this interesting technique, and
adds a weapon to the red teamers arsenal.
Now about the most important. This month has been very difficult for my family. At the
moment, I decided to release a book on the topic of malware development in sha Allah. The
book will be based on my posts from this blog. I ask those who have the opportunity to pay
5/7
for this book. The entire amount will be directed to the treatment of my 4-month-old daughter
named Munira:
6/7
The book will cost 16 USD
EnumChildWindows
source code in github
Donate 16 USD
7/7