1 730
چرا گجت یک دفعه کرش میکنن؟
خیلی وقتا ROP Chain رو درست مینویسید آفستها هم درسته ولی برنامه بعد از یکی دو گجت کرش میکنه
90 درصد مواقع دلیلش اینه:
دارید ROP رو داخل Red Zone میذارید
یعنی شما فکر میکنی RSP اینجاست ولی داده هایی که تزریق کردید تو 160 بایت پایین تره جایی که اصلا تضمین نشده سالم بمونه
یه تابع داخلی صدا زده میشه → Red Zone رو overwrite میکنه → ROP میره هوا
یه interrupt میاد → سیستم عامل اون فضا رو میگیره کرش میکنه
حتی یه printf ساده → Red Zone رو زیر پا میذاره → گجت بعدی اجرا نمیشه
سادهترین نمونه کرش در ROP
برنامه بعد از اجرای اولین گجت روی گجت دوم سیگنال میگیره و از بین میره
چون payload داخل Red Zone بوده و libc اون محدوده رو با دادههای خودش پر کرده
Why do gadgets crash all at once?
Many times you write the ROP Chain correctly, the offsets are correct, but the program crashes after one or two gadgets
90% of the time the reason is this:
You are putting the ROP in the Red Zone
That is, you think the RSP is here, but the data you injected is 160 bytes below where it is not guaranteed to be intact
An internal function is called → It overwrites the Red Zone → ROP goes to the air
An interrupt comes → The operating system takes that space and crashes
Even a simple printf → It violates the Red Zone → The next gadget does not run
The simplest example of a crash in ROP
After executing the first gadget, the program receives a signal on the second gadget and dies
Because the payload was in the Red Zone and libc filled that area with its own data
@reverseengine
20 Nov 2025, 15:45

