1 730
مکانیسم ها:
روش ها یا پروتوکول های سطح پایینی هستند که یک قطعه مورد نیاز رو پیاده سازی میکنن
Mechanisms:
are low-level methods or protocols that implement a required component
@reverseengine
31 may, 16:07
magnet:xt=urn:btih:ce86306a417dd64fab8d26a4983a58412008a9e&dn=ida92
@reverseenginepop rdi retیا: Copy code
mov rax, rdi retاینها به تنهایی کار بزرگی نمیکنن ولی وقتی پشت سر هم قرار بگیرن تبدیل میشن به یه برنامه کامل چرا ret مهمه؟ چون ret ادرس بعدی رو از استک برمیداره و میره اجراش میکنه یعنی اگر استک رو کنترل کنید میتونید تعیین کنی بعد از هر gadget کجا بره در نتیجه: RIP → gadget اول ret → gadget دوم ret → gadget سوم و همینطور ادامه پیدا میکنه CPU عملاً داره برنامهای رو اجرا میکنه که شما از روی استک نوشتید ROP Chain? ROP Chain یعنی یه لیست از آدرس gadget ها که روی استک میذارید مثلا مفهومش اینه: Copy code
offset addr(pop rdi) value("/bin/sh") addr(system)یعنی: مقدار ارگومان ست میشه بعد تابع اجرا میشه بدون اینکه حتی یک بایت کد جدید اجرا کرده باشید چرا ROP اینقدر قدرتمنده؟ چون: NX رو دور میزنه از کد trusted استفاده میکنه تقریبا روی هر برنامهای قابل انجامه پایهی خیلی از exploitهای واقعی دنیاست بیشتر حملات مدرن عملا یه نوع ROP هستن یک نکته خیلی مهم که تازه کارها نمیفهمن ROP یعنی کد ننویسید جریان اجرای CPU رو با قطعات آماده بسازید شما دارید CPU رو گول میزنید که فکر کنه این مسیر طبیعی برنامست ROP Gadget When NX stopped Shellcode execution, the exploiters realized something important: There is a whole bunch of ready-made code inside every program and library. Can this ready-made code be executed in any way you want? Yes, and this is called a ROP Gadget? Gadget A very small piece of code that is already inside the binary, usually with ret at the end For example: Copy code
pop rdi retor: Copy code
mov rax, rdi retThese don't do much on their own, but when they are put together, they become a complete program Why is ret important? Because ret takes the next address from the stack and executes it That is, if you control the stack, you can determine where it goes after each gadget As a result: RIP → first gadget ret → second gadget ret → third gadget And so on The CPU is actually executing the program that you wrote from the stack ROP Chain? ROP Chain That is, a list of gadget addresses that you put on the stack For example, its meaning is: Copy code
offset addr(pop rdi) value("/bin/sh") addr(system)That is: The value of the argument is set, then the function is executed Without you executing a single new byte of code Why is ROP so powerful? Because: Bypasses NX Uses trusted code Can be executed on almost any program Is the basis of many real world exploits Most modern attacks are actually a type of ROP A very important point that beginners don't understand ROP means don't write code Build the CPU execution flow with ready-made parts You are tricking the CPU into thinking that this is the natural path of the program @reverseengine

Utilizamos cookies para mejorar tu experiencia de navegación.
Al hacer clic en «Aceptar todo», aceptas la política de uso de cookies.