ReverseEngineering – Telegram
ReverseEngineering
1.24K subscribers
40 photos
10 videos
55 files
666 links
Download Telegram
DiffRays

ابزاری پژوهش‌ محور برای مقایسه پچ‌های باینریه که به منظور کمک به تحقیقات آسیب‌پذیری توسعه اکسپلویت و مهندسی معکوس طراحی شده

A research-oriented tool for comparing binary patches designed to aid in vulnerability research, exploit development, and reverse engineering.

https://github.com/pwnfuzz/diffrays

@PfkSecurity
4
3
نمونه کد Python: Hotspot Player شبیه‌ سازی شده

import sys
import ctypes
from PyQt5 import QtWidgets

# --- Anti-Debug ساده ---
if ctypes.windll.kernel32.IsDebuggerPresent():
    sys.exit("Debugger detected! Exiting...")

# --- الگوریتم سریال ساده ---
def check_serial(serial):
    # سریال صحیح (مثال: HSP-1234-5678)
    correct_serial = "HSP-1234-5678"
    return serial == correct_serial

# --- GUI ساده ---
class HotspotPlayer(QtWidgets.QWidget):
    def init(self):
        super().init()
        self.initUI()

    def initUI(self):
        self.setWindowTitle("Hotspot Player (Simulated)")
        self.setGeometry(100, 100, 300, 150)

        # ورودی سریال
        self.serial_input = QtWidgets.QLineEdit(self)
        self.serial_input.setPlaceholderText("Enter Serial")
        self.serial_input.setGeometry(50, 30, 200, 30)

        # دکمه ورود
        self.button = QtWidgets.QPushButton("Activate & Play", self)
        self.button.setGeometry(80, 80, 140, 30)
        self.button.clicked.connect(self.check_activation)

        # Label پیام
        self.label = QtWidgets.QLabel("", self)
        self.label.setGeometry(50, 120, 200, 20)

    def check_activation(self):
        serial = self.serial_input.text()
        if check_serial(serial):
            self.label.setText("Activation successful! Playing...")
        else:
            self.label.setText("Invalid Serial!")

# --- اجرای برنامه ---
if name == "main":
    app = QtWidgets.QApplication(sys.argv)
    player = HotspotPlayer()
    player.show()
    sys.exit(app.exec_())


مرحله بعدی

این برنامه رو میتونیم با PyInstaller به EXE ویندوزی تبدیل کنیم:


pyinstaller --onefile --windowed hotspot_player.py

بعد از ساخت EXE ما میتونیم

مسیر چک سریال رو با x64dbg پیدا کنیم

anti-debug
رو بررسی و دور بزنیم

شرط سریال رو تغییر میدیم تا EXE بدون سریال صحیح اجرا بشه



Python Code Example: Simulated Hotspot Player

import sys
import ctypes
from PyQt5 import QtWidgets

# --- Simple Anti-Debug ---
if ctypes.windll.kernel32.IsDebuggerPresent():
sys.exit("Debugger detected! Exiting...")

# --- Simple serial algorithm ---
def check_serial(serial):
# Correct serial (e.g. HSP-1234-5678)
correct_serial = "HSP-1234-5678"
return serial == correct_serial

# --- Simple GUI ---
class HotspotPlayer(QtWidgets.QWidget):
def init(self):
super().init()
self.initUI()

def initUI(self):
self.setWindowTitle("Hotspot Player (Simulated)")
self.setGeometry(100, 100, 300, 150)

# Serial input
self.serial_input =  QtWidgets.QLineEdit(self)
         self.serial_input.setPlaceholderText("Enter Serial")
         self.serial_input.setGeometry(50, 30, 200, 30)

         # Login button
         self.button = QtWidgets.QPushButton("Activate & Play", self)
         self.button.setGeometry(80, 80, 140, 30)
         self.button.clicked.connect(self.check_activation)

         # Label message
         self.label = QtWidgets.QLabel("", self)
         self.label.setGeometry(50, 120, 200, 20)

     def check_activation(self):
         serial = self.serial_input.text()
         if check_serial(serial):
             self.label.setText("Activation successful! Playing...")
         otherwise:
             self.label.setText("Invalid Serial!")

# --- Run the program ---
if name == "main":
     app =  QtWidgets.QApplication(sys.argv)
player = HotspotPlayer()
player.show()
sys.exit(app.exec_())


Next step

We can convert this program to a Windows EXE with PyInstaller:

pyinstaller --onefile --windowed hotspot_player.py

After building the EXE we can

Find the serial check path with x64dbg

Check and bypass anti-debug

Change the serial condition so that the EXE runs correctly without a serial
7
Forwarded from Sec Note
How to kill AV/EDR (of different kinds) with a couple of clicks

Requirements:
- Admin rights on the machine;
- Ability to deliver procmon.
And then everything is more than straightforward.

1. Enable the "EnableBootLogging" feature;
2. Create a symbolic link:
mklink C:\Windows\Procmon.pmb "<Full path to the file that needs to be overwritten>"
3. Reboot the machine.

Magic happens.

More details:
https://www.zerosalarium.com/2025/09/Break-Protective-Shell-Windows-Defender-Folder-Redirect-Technique-Symlink.html
4
Wannacry Documentary

واناکرای (WannaCry) یک باج‌افزار مخرب بود که در می ۲۰۱۷ جهان را تکان داد. این بدافزار از آسیب‌پذیری EternalBlue در ویندوز (MS17-010) سوءاستفاده کرد که توسط NSA توسعه یافته و توسط Shadow Brokers فاش شده بود. واناکرای فایل‌ها را با رمزنگاری AES-128 و RSA قفل می‌کرد و برای بازگردانی داده‌ها، باج (۳۰۰ تا ۶۰۰ دلار) به صورت بیت‌کوین طلب می‌کرد. این حمله بیش از ۲۰۰,۰۰۰ سیستم در ۱۵۰ کشور را آلوده کرد و خسارت‌های میلیونی به سازمان‌ها (مثل NHS بریتانیا) وارد آورد. یک kill switch کشف‌شده توسط Marcus Hutchins گسترش آن را متوقف کرد. واناکرای به گروه لازاروس (مرتبط با کره شمالی) نسبت داده شده است.

Wannacry Documentary

WannaCry was a ransomware attack that shook the world in May 2017. The malware exploited the EternalBlue vulnerability in Windows (MS17-010), which was developed by the NSA and disclosed by the Shadow Brokers. WannaCry locked files with AES-128 and RSA encryption and demanded a ransom ($300-$600) in Bitcoin to restore the data. The attack infected over 200,000 systems in 150 countries, causing millions in damage to organizations (such as the UK's NHS). A kill switch discovered by Marcus Hutchins stopped its spread. WannaCry has been attributed to the Lazarus Group (linked to North Korea).

#Ransomware #wannacry
@GoSecurity
4
Android App Reverse Engineering

https://www.ragingrock.com/AndroidAppRE/
4
تکنیک‌های ساده مهندسی معکوس

توی این مرحله یاد می‌گیریم چطور برنامه‌های ساده‌ای رو که یه محافظ ابتدایی یا قفل ساده دارن آنالیز کنیم و رفتار پشتشون رو بفهمیم

قدم‌ به‌ قدم:

باز کردن فایل با ابزار استاتیک و دیباگر
همون‌ طور که قبلا یاد گرفتیم اول با IDA Ghidra ساختار برنامه رو ببینید و بعد با x64dbg بذارید روی Entry Point وایسته این پایه همه کاراست

پیدا کردن قسمت چک لایسنس یا شرط‌ ها
تو برنامه‌ های ساده معمولا یه شرط if هست که میگه اگه لایسنس درست بود برو جلو اگه نه پیام خطا بده این بخش معمولا کنار توابعی مثل strcmp یا strncmp یا توابع ورودی رشته‌ای قرار داره

ردیابی با Breakpoint
روی تابعی که شک دارید بررسی لایسنسه Breakpoint بذارید برنامه رو اجرا کنید و ببینید کی و کجا متوقف میشه از اونجا می‌تونید مسیر منطقی برنامه رو بفهمید

بررسی دستورهای شرطی
معمولا یه دستور JE، JNE، JZ یا JNZ هست که تصمیم میگیره ادامه برنامه چی بشه اگه اینو پیدا کنید دقیقا اونجاست که برنامه تصمیم میگیره لایسنس درسته یا نه

دستکاری ساده برای فهم منطق
به جای عوض کردن فایل میتونید تو دیباگر دستور پرش رو موقتا عوض کنید مثلا JNE رو به JE تغییر بدید تا ببینید اگه شرط برعکس بشه چی میشه این تمرین کمک میکنه منطق چک رو کامل درک کنید

 
تمرین:

یه برنامه ساده بسازید که یه رمز مشخص داره مثلا "1234" و اگه درست وارد شد پیام موفقیت بده
بعد با IDA و x64dbg بررسیش کنید:

تابع مقایسه رمز رو پیدا کنید

نقطه پرش تصمیم‌ گیرنده رو شناسایی کنید

با تغییر پرش ببینید برنامه چطور رفتار میکنه



Simple Reverse Engineering Techniques

In this step we will learn how to analyze simple programs that have a basic guard or a simple lock and understand the behavior behind them

Step by step :

Open the file with static tools and debugger
As we learned before, first see the structure of the program with IDA Ghidra and then place it on the Entry Point with x64dbg and that's it

Find the license check section or conditions
In simple programs there is usually an if condition that says if the license is correct go ahead if not give an error message This section is usually next to functions like strcmp or strncmp or string input functions

Tracing with Breakpoint
Run the program and see when and where it stops From there you can understand the logical path of the program

Examining conditional statements
Usually there is a JE, JNE, JZ or JNZ statement that decides whether to continue the program What if you find this? This is exactly where the program decides whether the license is valid or not

A simple manipulation to understand the logic
Instead of changing the file you can temporarily change the jump instruction in the debugger, for example, change JNE to JE to see what happens if the condition is reversed This exercise will help you fully understand the logic of the check

Exercise :

Create a simple program that has a specific password for example "1234", and if it is entered correctly it will give a success message

Then check it with IDA and x64dbg :

Find the password comparison function

Identify the decision-making jump point

See how the program behaves by changing the jump
2👏1