Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking on Medium
OSCP — Meu caminho até a terra prometida.
https://cdn-images-1.medium.com/max/1200/1*9GJR-_hpQYcYXI-HrGlceg.jpeg
Numa das brilhantes palestras dadas pelo incrível Clóvis de Barros Filho, ele nos passa um ensinamento — para mim essencial — de…
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
OSCP — Meu caminho até a terra prometida.
https://cdn-images-1.medium.com/max/1200/1*9GJR-_hpQYcYXI-HrGlceg.jpeg
Numa das brilhantes palestras dadas pelo incrível Clóvis de Barros Filho, ele nos passa um ensinamento — para mim essencial — de…
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
OSCP — Meu caminho até a terra prometida.
Numa das brilhantes palestras dadas pelo incrível Clóvis de Barros Filho, ele nos passa um ensinamento — para mim essencial — de…
Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking on Medium
Hungry programmers took $3k worth of snacks from CIA candy machines
https://cdn-images-1.medium.com/max/640/1*MvejH8fCp9dcLZtzNBkotA.jpeg
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Hungry programmers took $3k worth of snacks from CIA candy machines
https://cdn-images-1.medium.com/max/640/1*MvejH8fCp9dcLZtzNBkotA.jpeg
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
Hungry programmers took $3k worth of snacks from CIA candy machines
The powerful Central Intelligence Service (CIA) is a non military personnel association entrusted by the American Government to assemble data and examining it concerning public safety data from…
Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking on Medium
AArch 64 Bytes: Part 1 (Reversing Exit)
https://cdn-images-1.medium.com/max/1280/1*Fvq5caqqhQunJGD_TEMBEA.png
For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the…
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
AArch 64 Bytes: Part 1 (Reversing Exit)
https://cdn-images-1.medium.com/max/1280/1*Fvq5caqqhQunJGD_TEMBEA.png
For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the…
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
AArch 64 Bytes: Part 1 (Reversing Exit)
For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics…
Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking on Medium
Days 5&6 of #100DaysOfSmartContractHacking (Dravee’s journal)
https://cdn-images-1.medium.com/max/2600/0*ZI7kS6lf97272N1F
23–24/10/2021
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Days 5&6 of #100DaysOfSmartContractHacking (Dravee’s journal)
https://cdn-images-1.medium.com/max/2600/0*ZI7kS6lf97272N1F
23–24/10/2021
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
Days 5&6 of #100DaysOfSmartContractHacking (Dravee’s journal)
23–24/10/2021
Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking on Medium
Vulnerabilities in Blockchain Always Exists
https://cdn-images-1.medium.com/max/2600/0*NW1mNWOV8MbYzfhJ
Blockchain is a distributed and decentralized technology, It has a relatively fair, anonymous, and free world through a consensus…
Continue reading on Crypto Pundit »
___________________________
@hacking_Attack
@Hacking_Video
Vulnerabilities in Blockchain Always Exists
https://cdn-images-1.medium.com/max/2600/0*NW1mNWOV8MbYzfhJ
Blockchain is a distributed and decentralized technology, It has a relatively fair, anonymous, and free world through a consensus…
Continue reading on Crypto Pundit »
___________________________
@hacking_Attack
@Hacking_Video
Medium
Vulnerabilities in Blockchain Always Exists
Blockchain is a distributed and decentralized technology, It has a relatively fair, anonymous, and free world through a consensus…
SQL Injection JR. Pentester -TryHackMe
Hi, amazing hackers in this story you are gonna how to what is SQL injections and how to find them in different types.Continue reading on Medium »
Read more...
Hi, amazing hackers in this story you are gonna how to what is SQL injections and how to find them in different types.Continue reading on Medium »
Read more...
ThreadStackSpoofer - PoC For An Advanced In-Memory Evasion Technique Allowing To Better Hide Injected Shellcode'S Memory Allocation From Scanners And Analysts
http://www.kitploit.com/2021/10/threadstackspoofer-poc-for-advanced-in.html
___________________________
@hacking_Attack
@Hacking_Video
http://www.kitploit.com/2021/10/threadstackspoofer-poc-for-advanced-in.html
___________________________
@hacking_Attack
@Hacking_Video
Kitploit
Kitploit – Maintenance in Progress
Kitploit is temporarily under maintenance. We’ll be back shortly with improvements.
A PoC implementation for an advanced in-memory evasion technique that spoofs Thread Call Stack. This technique allows to bypass thread-based memory examination rules and better hide shellcodes (https://www.kitploit.com/search/label/Shellcodes) while in-process memory.
Intro
This is an example implementation for Thread Stack Spoofing technique aiming to evade Malware Analysts, AVs and EDRs looking for references to shellcode's frames in an examined thread's call stack. The idea is to hide references to the shellcode on thread's call stack thus masquerading allocations containing malware's code.Implementation along with my ShellcodeFluctuation (https://github.com/mgeeky/ShellcodeFluctuation) brings Offensive Security community sample implementations to catch up on the offering made by commercial C2 products, so that we can do no worse in our Red Team toolings.
Implementation has changed
Current implementation differs heavily to what was originally published. This is because I realised there is a way simpler approach to terminate thread's call stack processal and hide shellcode's related frames by simply writing 0 to the return address of the first frame we control:
void WINAPI MySleep(DWORD _dwMilliseconds)
{
[...]
auto overwrite = (PULONG_PTR)_AddressOfReturnAddress();
const auto origReturnAddress = *overwrite;
*overwrite = 0;
[...]
*overwrite = origReturnAddress;
}
The previous implementation, utilising StackWalk64 can be accessed in this commit c250724 (https://github.com/mgeeky/ThreadStackSpoofer/tree/c2507248723d167fb2feddf50d35435a17fd61a2).This implementation is much more stable and works nicely on both Debug and Release under two architectures - x64 and x86.
Demo
This is how a call stack may look like when it is NOT spoofed:
___________________________
@hacking_Attack
@Hacking_Video
Intro
This is an example implementation for Thread Stack Spoofing technique aiming to evade Malware Analysts, AVs and EDRs looking for references to shellcode's frames in an examined thread's call stack. The idea is to hide references to the shellcode on thread's call stack thus masquerading allocations containing malware's code.Implementation along with my ShellcodeFluctuation (https://github.com/mgeeky/ShellcodeFluctuation) brings Offensive Security community sample implementations to catch up on the offering made by commercial C2 products, so that we can do no worse in our Red Team toolings.
Implementation has changed
Current implementation differs heavily to what was originally published. This is because I realised there is a way simpler approach to terminate thread's call stack processal and hide shellcode's related frames by simply writing 0 to the return address of the first frame we control:
void WINAPI MySleep(DWORD _dwMilliseconds)
{
[...]
auto overwrite = (PULONG_PTR)_AddressOfReturnAddress();
const auto origReturnAddress = *overwrite;
*overwrite = 0;
[...]
*overwrite = origReturnAddress;
}
The previous implementation, utilising StackWalk64 can be accessed in this commit c250724 (https://github.com/mgeeky/ThreadStackSpoofer/tree/c2507248723d167fb2feddf50d35435a17fd61a2).This implementation is much more stable and works nicely on both Debug and Release under two architectures - x64 and x86.
Demo
This is how a call stack may look like when it is NOT spoofed:
___________________________
@hacking_Attack
@Hacking_Video
KitPloit - PenTest & Hacking Tools
Leading source of security tools, hacking tools, cybersecurity and network security. Learn about new tools and updates in one place.
This in turn, when thread stack spoofing is enabled:
___________________________
@hacking_Attack
@Hacking_Video
___________________________
@hacking_Attack
@Hacking_Video
Above we can see that the last frame on our call stack is our MySleep callback. One can wonder does it immediately brings opportunities new IOCs? Hunting rules can look for threads having call stacks not unwinding into following expected thread entry points located within system libraries:kernel32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21
However the call stack of the spoofed thread may look rather odd at first, a brief examination of my system shown, that there are other threads not unwinding to the above entry points as well:
___________________________
@hacking_Attack
@Hacking_Video
ntdll!RtlUserThreadStart+0x21
However the call stack of the spoofed thread may look rather odd at first, a brief examination of my system shown, that there are other threads not unwinding to the above entry points as well:
___________________________
@hacking_Attack
@Hacking_Video
The above screenshot (https://www.kitploit.com/search/label/Screenshot) shows a thread of unmodified Total Commander x64. As we can see, its call stack pretty much resembles our own in terms of initial call stack frames.Why should we care about carefully faking our call stack when there are processes exhibiting traits that we can simply mimic?
How it works?
The rough algorithm is following:Read shellcode's contents from file.Acquire all the necessary function pointers from dbghelp.dll, call SymInitializeHook kernel32!Sleep pointing back to our callback.Inject and launch shellcode via VirtualAlloc + memcpy + CreateThread. The thread should start from our runShellcode function to avoid having Thread's StartAddress point into somewhere unexpected and anomalous (such as ntdll!RtlUserThreadStart+0x21)As soon as Beacon attempts to sleep, our MySleep callback gets invoked.We then overwrite last return address on the stack to 0 which effectively should finish the call stack.Finally a call to ::SleepEx is made to let the Beacon's sleep while waiting for further communication.After Sleep is finished, we restore previously saved original function return addresses and execution is resumed.Function return addresses are scattered all around the thread's stack memory area, pointed to by RBP/EBP register. In order to find them on the stack, we need to firstly collect frame pointers, then dereference them for overwriting:
___________________________
@hacking_Attack
@Hacking_Video
How it works?
The rough algorithm is following:Read shellcode's contents from file.Acquire all the necessary function pointers from dbghelp.dll, call SymInitializeHook kernel32!Sleep pointing back to our callback.Inject and launch shellcode via VirtualAlloc + memcpy + CreateThread. The thread should start from our runShellcode function to avoid having Thread's StartAddress point into somewhere unexpected and anomalous (such as ntdll!RtlUserThreadStart+0x21)As soon as Beacon attempts to sleep, our MySleep callback gets invoked.We then overwrite last return address on the stack to 0 which effectively should finish the call stack.Finally a call to ::SleepEx is made to let the Beacon's sleep while waiting for further communication.After Sleep is finished, we restore previously saved original function return addresses and execution is resumed.Function return addresses are scattered all around the thread's stack memory area, pointed to by RBP/EBP register. In order to find them on the stack, we need to firstly collect frame pointers, then dereference them for overwriting:
___________________________
@hacking_Attack
@Hacking_Video
KitPloit - PenTest & Hacking Tools
Leading source of security tools, hacking tools, cybersecurity and network security. Learn about new tools and updates in one place.