kwcmd
Kwcmd is a minimal Linux backdoor designed for stealthy network access
https://github.com/proxy-bar/kwcmd
@reverseengine
Kwcmd is a minimal Linux backdoor designed for stealthy network access
https://github.com/proxy-bar/kwcmd
@reverseengine
GitHub
GitHub - proxy-bar/kwcmd: hidden linux backdoor
hidden linux backdoor. Contribute to proxy-bar/kwcmd development by creating an account on GitHub.
DllShimmer
DllShimmer is a tool for rapidly creating and injecting backdoors into DLLs, facilitating remote control and exploitation of target processes. It simplifies the process of DLL hijacking for security research and potentially malicious activity.
https://github.com/Print3M/DllShimmer
@reverseengine
DllShimmer is a tool for rapidly creating and injecting backdoors into DLLs, facilitating remote control and exploitation of target processes. It simplifies the process of DLL hijacking for security research and potentially malicious activity.
https://github.com/Print3M/DllShimmer
@reverseengine
GitHub
GitHub - Print3M/DllShimmer: Weaponize DLL hijacking easily. Backdoor any function in any DLL.
Weaponize DLL hijacking easily. Backdoor any function in any DLL. - Print3M/DllShimmer
کرنل چیه؟
تا اینجا گفتیم سیستم عامل بین برنامهها و سختافزار قرار میگیره
اما سوال مهم:
آیا کل سیستم عامل همیشه در حال اجراست؟
نه
در قلب هر سیستم عامل یک بخش بسیار مهم وجود داره به نام Kernel یا هسته
کرنل مهمترین قسمت سیستم عامله و مستقیما با سختافزار کار میکنه
یک مثال ساده:
فرض کنید یک شرکت بزرگ داریم:
کارمندان = برنامهها
ساختمان و تجهیزات = سختافزار
مدیرعامل = Kernel
کارمندها نمیتونن هر کاری خواستن انجام بدن
مثلا نمیتونن مستقیم وارد اتاق سرور بشن یا تجهیزات رو بردارن
باید درخواست شون رو به مدیر عامل یا سیستم مدیریتی بدن
کرنل هم دقیقا همین نقش رو داره
کرنل چه کارهایی انجام میده؟
مدیریت پردازنده (CPU)
تصمیم میگیرد:
کدوم برنامه اجرا بشه؟
چه مدت اجرا بشه؟
چه زمانی متوقف بشه؟
مدیریت حافظه (RAM)
تصمیم میگیرد:
هر برنامه چقدر حافظه بگیره؟
حافظه برنامهها از هم جدا بمونه
یک برنامه نتونه حافظه برنامه دیگه ای رو بخونه
مدیریت فایلها
وقتی برنامهای فایل باز میکنه:
Plain text
در نهایت کرنل مسئول انجام این عملیاته
مدیریت دستگاهها
مثل:
کیبورد
ماوس
هارد
کارت شبکه
USB
همه از طریق کرنل کنترل میشن
User Mode و Kernel Mode
یکی از مهمترین مفاهیم کل سیستم
عامل همینجاست
پردازنده معمولا دو حالت اجرا داره:
User Mode
جایی که برنامههای عادی اجرا میشن
مثل:
در این حالت برنامه محدودیت داره
Kernel Mode
جایی که کرنل اجرا میشه
در این حالت تقریبا دسترسی کامل به سیستم وجود دارد.
چرا این جداسازی مهمه؟
فرض کنید یک برنامه باگ داشته باشه
اگر مستقیم به سختافزار دسترسی کامل داشته باشه:
سیستم کرش میکنه
اطلاعات خراب میشن
امنیت از بین میره
برای همین سیستمعامل برنامهها رو در User Mode نگه میداره
ارتباط برنامه با کرنل چجوریه؟
از طریق System Call
مثلا وقتی برنامه میخاد:
فایل باز کنه
حافظه بگیره
پردازه جدید بسازه
در واقع از کرنل درخواست کمک میکنه
نکته مهم برای مهندسی معکوس:
وقتی داخل دیباگر توابعی مثل اینها رو میبینید:
C
پشت صحنه تقریبا همه اونا در نهایت به کرنل میرسن
به همین دلیل مهندس معکوس باید همیشه بدوند:
الان کد در User Mode اجرا میشه یا در Kernel Mode؟
این سوال پایه بسیاری از مباحث بعدی مثل:
هست
What is a kernel?
So far, we have said that the operating system is located between the programs and the hardware
But the important question:
Is the entire operating system always running?
No
At the heart of every operating system is a very important part called the Kernel
The kernel is the most important part of the operating system and works directly with the hardware
A simple example:
Let's assume we have a large company:
Employees = programs
Buildings and equipment = hardware
CEO = Kernel
Employees cannot do whatever they want
For example, they cannot directly enter the server room or remove equipment
They must direct their requests to the CEO or system management
The kernel has exactly the same role
What does the kernel do?
Processor (CPU) management
Decides:
Which program to run?
How long to run?
When to stop?
Memory Management (RAM)
Decides:
How much memory should each program take?
Program memory should be kept separate
A program cannot read another program's memory
File Management
When a program opens a file:
Plain text
Ultimately, the kernel is responsible for performing this operation
Device Management
For example:
Keyboard
Mouse
Hardware
Network Card
USB
All are controlled by the kernel
User Mode and Kernel Mode
One of the most important concepts of the entire operating system is here
The processor usually has two execution modes:
User Mode
Where normal programs are executed
For example:
In this mode, the program has restrictions
Kernel Mode
Where the kernel is executed
In this mode, there is almost complete access to the system.
Why is this separation important?
Suppose a program has a bug
If it has full access to the hardware directly:
The system crashes
Data gets corrupted
Security is lost
That's why the operating system keeps programs in User Mode
تا اینجا گفتیم سیستم عامل بین برنامهها و سختافزار قرار میگیره
اما سوال مهم:
آیا کل سیستم عامل همیشه در حال اجراست؟
نه
در قلب هر سیستم عامل یک بخش بسیار مهم وجود داره به نام Kernel یا هسته
کرنل مهمترین قسمت سیستم عامله و مستقیما با سختافزار کار میکنه
یک مثال ساده:
فرض کنید یک شرکت بزرگ داریم:
کارمندان = برنامهها
ساختمان و تجهیزات = سختافزار
مدیرعامل = Kernel
کارمندها نمیتونن هر کاری خواستن انجام بدن
مثلا نمیتونن مستقیم وارد اتاق سرور بشن یا تجهیزات رو بردارن
باید درخواست شون رو به مدیر عامل یا سیستم مدیریتی بدن
کرنل هم دقیقا همین نقش رو داره
کرنل چه کارهایی انجام میده؟
مدیریت پردازنده (CPU)
تصمیم میگیرد:
کدوم برنامه اجرا بشه؟
چه مدت اجرا بشه؟
چه زمانی متوقف بشه؟
مدیریت حافظه (RAM)
تصمیم میگیرد:
هر برنامه چقدر حافظه بگیره؟
حافظه برنامهها از هم جدا بمونه
یک برنامه نتونه حافظه برنامه دیگه ای رو بخونه
مدیریت فایلها
وقتی برنامهای فایل باز میکنه:
Plain text
read()
write()
open()
در نهایت کرنل مسئول انجام این عملیاته
مدیریت دستگاهها
مثل:
کیبورد
ماوس
هارد
کارت شبکه
USB
همه از طریق کرنل کنترل میشن
User Mode و Kernel Mode
یکی از مهمترین مفاهیم کل سیستم
عامل همینجاست
پردازنده معمولا دو حالت اجرا داره:
User Mode
جایی که برنامههای عادی اجرا میشن
مثل:
Chrome
Firefox
Telegram
Notepad
در این حالت برنامه محدودیت داره
Kernel Mode
جایی که کرنل اجرا میشه
در این حالت تقریبا دسترسی کامل به سیستم وجود دارد.
چرا این جداسازی مهمه؟
فرض کنید یک برنامه باگ داشته باشه
اگر مستقیم به سختافزار دسترسی کامل داشته باشه:
سیستم کرش میکنه
اطلاعات خراب میشن
امنیت از بین میره
برای همین سیستمعامل برنامهها رو در User Mode نگه میداره
ارتباط برنامه با کرنل چجوریه؟
از طریق System Call
مثلا وقتی برنامه میخاد:
فایل باز کنه
حافظه بگیره
پردازه جدید بسازه
در واقع از کرنل درخواست کمک میکنه
نکته مهم برای مهندسی معکوس:
وقتی داخل دیباگر توابعی مثل اینها رو میبینید:
C
CreateProcess
CreateThread
VirtualAlloc
ReadFile
WriteFile
پشت صحنه تقریبا همه اونا در نهایت به کرنل میرسن
به همین دلیل مهندس معکوس باید همیشه بدوند:
الان کد در User Mode اجرا میشه یا در Kernel Mode؟
این سوال پایه بسیاری از مباحث بعدی مثل:
Process
Memory
System Call
Driver
Windows Internals
هست
What is a kernel?
So far, we have said that the operating system is located between the programs and the hardware
But the important question:
Is the entire operating system always running?
No
At the heart of every operating system is a very important part called the Kernel
The kernel is the most important part of the operating system and works directly with the hardware
A simple example:
Let's assume we have a large company:
Employees = programs
Buildings and equipment = hardware
CEO = Kernel
Employees cannot do whatever they want
For example, they cannot directly enter the server room or remove equipment
They must direct their requests to the CEO or system management
The kernel has exactly the same role
What does the kernel do?
Processor (CPU) management
Decides:
Which program to run?
How long to run?
When to stop?
Memory Management (RAM)
Decides:
How much memory should each program take?
Program memory should be kept separate
A program cannot read another program's memory
File Management
When a program opens a file:
Plain text
read()
write()
open()
Ultimately, the kernel is responsible for performing this operation
Device Management
For example:
Keyboard
Mouse
Hardware
Network Card
USB
All are controlled by the kernel
User Mode and Kernel Mode
One of the most important concepts of the entire operating system is here
The processor usually has two execution modes:
User Mode
Where normal programs are executed
For example:
Chrome
Firefox
Telegram
Notepad
In this mode, the program has restrictions
Kernel Mode
Where the kernel is executed
In this mode, there is almost complete access to the system.
Why is this separation important?
Suppose a program has a bug
If it has full access to the hardware directly:
The system crashes
Data gets corrupted
Security is lost
That's why the operating system keeps programs in User Mode
❤2
How does the program communicate with the kernel?
Through System Call
For example, when the program wants to:
Open a file
Get memory
Create a new process
It actually asks the kernel for help
Important point for reverse engineering:
When you see functions like these in the debugger:
C
Behind the scenes, almost all of them end up in the kernel
That's why the reverse engineer should always know:
Is the code currently running in User Mode or Kernel Mode?
This question is the basis for many subsequent topics such as:
@reverseengine
Through System Call
For example, when the program wants to:
Open a file
Get memory
Create a new process
It actually asks the kernel for help
Important point for reverse engineering:
When you see functions like these in the debugger:
C
CreateProcess
CreateThread
VirtualAlloc
ReadFile
WriteFile
Behind the scenes, almost all of them end up in the kernel
That's why the reverse engineer should always know:
Is the code currently running in User Mode or Kernel Mode?
This question is the basis for many subsequent topics such as:
Process
Memory
System Call
Driver
Windows Internals
@reverseengine
❤1
Diving into the MS-RPC protocol and how to automate vulnerability research using a fuzzing approach.
https://www.incendium.rocks/posts/Automating-MS-RPC-Vulnerability-Research
@reverseengine
https://www.incendium.rocks/posts/Automating-MS-RPC-Vulnerability-Research
@reverseengine
Remco van der Meer
Automating MS-RPC vulnerability research
Diving into the MS-RPC protocol and how to automate vulnerability research using a fuzzing approach.
Escalating privilege in the system from unsigned driver using throttlestop vulnerability
https://github.com/D4rkks/CVE-2025-7771-Vulnerability-Exploration
@reverseengine
https://github.com/D4rkks/CVE-2025-7771-Vulnerability-Exploration
@reverseengine
GitHub
GitHub - D4rkks/CVE-2025-7771-Vulnerability-Exploration: Escalating privilege in the system from unsigned driver using throttlestop…
Escalating privilege in the system from unsigned driver using throttlestop vulnerability - D4rkks/CVE-2025-7771-Vulnerability-Exploration
Forwarded from Source Byte
Static Devirtualization of Themida
This article demonstrates devirtualization of CodeVirtualizer/Themida protected code, however the techniques described here apply to pretty much every virtual machine based obfuscator. Only requiring some minor modifications to support each of them. The following is a non-exhaustive list of obfuscators that can be reduced using the technique described in this article.
https://back.engineering/blog/09/05/2026/
This article demonstrates devirtualization of CodeVirtualizer/Themida protected code, however the techniques described here apply to pretty much every virtual machine based obfuscator. Only requiring some minor modifications to support each of them. The following is a non-exhaustive list of obfuscators that can be reduced using the technique described in this article.
https://back.engineering/blog/09/05/2026/
Shared_library_hijacking.pdf
2.8 MB
Resolving the Correct Library: A Loader-Level Defense Solution Against Shared Object Hijackin
hooking_windows_named_pipes.pdf
1.5 MB
Hooking Windows Named Pipes
Peekaboo updated malware builder modules, added automatic yara rule generator, new APT campaign simulator and VirusTotal scanner
https://github.com/cocomelonc/peekaboo
@reverseengine
https://github.com/cocomelonc/peekaboo
@reverseengine
GitHub
GitHub - cocomelonc/peekaboo: It bridges my research with a functional tool. I want to provide a safe, open-source framework for…
It bridges my research with a functional tool. I want to provide a safe, open-source framework for hackers to test evasion and for defenders to improve detection through hands-on learning. - cocome...
An investigation into calculator integration
https://medium.com/@jnebos/an-investigation-into-calculator-integration-5a0b7d975cdf
@reverseengine
https://medium.com/@jnebos/an-investigation-into-calculator-integration-5a0b7d975cdf
@reverseengine
Medium
An investigation into calculator integration
Recently, I couldn’t help myself doing a “deep dive” into a subject that I was wondering about since my college years. I found that the…
Reverse Engineering a 0day used Against CrowdStrike EDR
https://medium.com/@jehadbudagga/reverse-engineering-a-0day-used-against-crowdstrike-edr-a5ea1fbe3fd4
@reverseengine
https://medium.com/@jehadbudagga/reverse-engineering-a-0day-used-against-crowdstrike-edr-a5ea1fbe3fd4
@reverseengine
Medium
Reverse Engineering a 0day used Against EDRs
Hello again…
بخش هفدهم بافر اورفلو
چطور فقط با نگاه کردن به اسمبلی بافر اورفلو پیدا کنیم
قراره چی کار کنیم
تا الان فهمیدیم توابع خطرناک چی هستن و فریم استک چطوری ساخته میشه
الان میخایم یاد بگیریم حتی اگر سورس کد نداشتیم فقط از روی اسمبلی بفهمیم احتمال بافر اورفلو وجود داره یا نه
نشونه اول
وجود بافر روی استک
مثال:
Asm
sub rsp, 0x40
این یعنی 64 بایت فضا روی استک رزرو شده
اگر چند خط پایین تر دیدید
Asm
lea rax, [rbp-0x40]
یا
Asm
lea rcx, [rsp+0x10]
معمولاً با یک بافر طرف هستید
نشونه دوم
ورودی کاربر وارد بافر میشه
مثال
Asm
mov rdi, rax
call gets
یا
Asm
call fgets
یا
Asm
call read
یعنی یک داده از بیرون وارد برنامه شده
هر وقت ورودی دیدید باید حساس بشید
نشونه سوم
کپی بدون بررسی طول
مثال:
Asm
call strcpy
یا
Asm
call strcat
یا
Asm
call sprintf
اینها زنگ خطرهای کلاسیک هستن
چون طول ورودی رو چک نمیکنن
نشونه چهارم
بافر کوچک ورودی بزرگ
مثلا اینو تو دی کامپایلر ببینید
C
char buf[16];
strcpy(buf,input);
یا تو اسمبلی ببینید
Asm
lea rdi,[rbp-0x10]
call strcpy
بافر فقط 16 بایته
ولی هیچ محدودیتی برای input وجود نداره
پس احتمال بافر اورفلو زیاده
نشونه پنجم
نبودن Canary
اگر اول تابع این چیزها رو ندیدید
Asm
mov rax, qword ptr fs:[0x28]
mov [rbp-0x8], rax
احتمالا Stack Canary وجود نداره
وجود این دستورات معمولا نشون میده کامپایلر محافظ استک فعال کرده
نشونه شیشم
تابع قبل از ret هیچ بررسی انجام نمیده
تابع آسیبپذیر معمولا آخرش این شکلیه
Asm
leave
ret
اگر قبل از ret هیچ بررسی امنیتی انجام نشه و بالاتر strcpy دیده باشید باید بیشتر دقت کنید
مثال واقعی تحلیل:
فرض کنید این اسمبلی رو دیدید
Asm
push rbp
mov rbp,rsp
sub rsp,0x20
mov rdx,rdi
lea rax,[rbp-0x10]
mov rdi,rax
call strcpy
leave
ret
سوال
آیا این مشکوکه؟
جواب
بله
چون
Asm
lea rax,[rbp-0x10]
نشون میده بافر 16 بایتی داریم
و
Asm
call strcpy
هم بدون محدودیت داده رو داخلش میریزید
پس اولین چیزی که باید تست کنیم ارسال ورودی طولانیه
تمرین:
یک باینری ساده رو داخل Ghidra یا IDA باز کنید
سه مورد زیر رو پیدا کنید
محل ساخت بافر
محل ورود داده
محل کپی شدن داده
اگر این سه مورد رو پیدا کردید عملا دارید مثل یک Reverse Engineer واقعی فکر میکنید
Part 17 Buffer Overflow
How to find buffer overflow just by looking at the assembly
What are we going to do
So far we have understood what dangerous functions are and how stack frames are created
Now we are going to learn how to find out if there is a buffer overflow even if we don't have the source code just from the assembly
First example
There is a buffer on the stack
Example:
Asm
sub rsp, 0x40
This means that 64 bytes of space on the stack are reserved
If you see a few lines below
Asm
lea rax, [rbp-0x40]
or
Asm
lea rcx, [rsp+0x10]
Usually you are dealing with a buffer
Second example
User input enters the buffer
Example
Asm
mov rdi, rax
call gets
or
Asm
call fgets
or
Asm
call read
This means that data has entered the program from outside
Whenever you see input, you should be sensitive Besh
Third example
Copy without length check
Example:
Asm
call strcpy
or
Asm
call strcat
or
Asm
call sprintf
These are classic alarms
because they don't check the length of the input
Fourth example
Small input buffer, large input
For example, see this in the decompiler
C
char buf[16];
strcpy(buf,input);
Or see in the assembly
Asm
lea rdi,[rbp-0x10]
call strcpy
The buffer is only 16 bytes
But there is no limit for input
So the probability of buffer overflow is high
Fifth example
No Canary
If you did not see these functions first
Asm
mov rax, qword ptr fs:[0x28]
mov [rbp-0x8], rax
There is probably no Stack Canary
The presence of these commands usually indicates that the compiler has enabled stack protection
Sixth example
The function does not perform any checks before ret
A vulnerable function usually ends like this
Asm
leave
ret
If no security checks are performed before ret and you have seen strcpy above, you should be more careful
Real example of analysis:
Suppose you saw this assembly
Asm
push rbp
mov rbp,rsp
sub rsp,0x20
mov rdx,rdi
lea rax,[rbp-0x10]
mov rdi,rax
call strcpy
leave
ret
Question
Is this suspicious?
Answer
Yes
Because
Asm
lea rax,[rbp-0x10]
shows that we have a 16-byte buffer
and
Asm
you are also pouring data into it without any limit
So the first thing we need to test is sending long input
Exercise:
Open a simple binary in Ghidra or IDA
Find the following three things
Where the buffer is created
Where the data is entered
Where the data is copied
If you can find these three things, you are actually thinking like a real Reverse Engineer
@reverseengine
and
Asm
call strcpy
you are also pouring data into it without any limit
So the first thing we need to test is sending long input
Exercise:
Open a simple binary in Ghidra or IDA
Find the following three things
Where the buffer is created
Where the data is entered
Where the data is copied
If you can find these three things, you are actually thinking like a real Reverse Engineer
@reverseengine
سیستم عامل چجوری یک برنامه رو راهاندازی و اجرا میکنه؟
اولین کاری که سیستم عامل برای اجرای برنامه انجام میده آپلود کردن کد اون و هرگونه دیتای استاتیک مثل متغیرهای مقدار دهی اولیه در حافظه در فضای آدرس فراینده برنامه در ابتدا روی دیسک یا در برخی سیستمهای مدرن ssd های مبتنی بر فلش با نوعی فرمت اجرایی قرار داره
How does an operating system launch and execute a program?
The first thing the operating system does to execute a program is to upload its code and any static data, such as initialized variables, into memory in the program's process address space, initially on disk or, in some modern systems, flash-based SSDs in some kind of executable format.
@reverseengine
اولین کاری که سیستم عامل برای اجرای برنامه انجام میده آپلود کردن کد اون و هرگونه دیتای استاتیک مثل متغیرهای مقدار دهی اولیه در حافظه در فضای آدرس فراینده برنامه در ابتدا روی دیسک یا در برخی سیستمهای مدرن ssd های مبتنی بر فلش با نوعی فرمت اجرایی قرار داره
How does an operating system launch and execute a program?
The first thing the operating system does to execute a program is to upload its code and any static data, such as initialized variables, into memory in the program's process address space, initially on disk or, in some modern systems, flash-based SSDs in some kind of executable format.
@reverseengine
توصیف گرها:
به برنامه ها اجازه میده که به راحتی ورودی رو از ترمینال بخونن و خروجی رو روی صفحه نمایش چاپ کنن
Descriptors:
allow programs to easily read input from the terminal and print output to the screen
@reverseengine
به برنامه ها اجازه میده که به راحتی ورودی رو از ترمینال بخونن و خروجی رو روی صفحه نمایش چاپ کنن
Descriptors:
allow programs to easily read input from the terminal and print output to the screen
@reverseengine