هذا أول درس عن اكتشاف الثغرات، قمت بتبسيط الموضوع لأقصى حد ممكن مع شرح الأساسيات اللازمة لاكتشاف و استثمار هذه الثغرة.
مقدمة:
In software, a stack buffer overflow or stack buffer overrun occurs when a program writes to a memory address on the program's call stack outside of the intended data structure, which is usually a fixed-length buffer.[1][2] Stack buffer overflow bugs are caused when a program writes more data to a buffer located on the stack than what is actually allocated for that buffer. This almost always results in corruption of adjacent data on the stack, and in cases where the overflow was triggered by mistake, will often cause the program to crash or operate incorrectly. Stack buffer overflow is a type of the more general programming malfunction known as buffer overflow (or buffer overrun).[1] Overfilling a buffer on the stack is more likely to derail program execution than overfilling a buffer on the heap because the stack contains the return addresses for all active function calls.
}
: K لب المترجمات تقوم بتوليد الكود التالي في بداية كل دا åwٔ
MyProc:
push ebp
mov ebp, esp
...
Passing Parameters Using The Stack | تعمامامامال الملململمكدس M سN ر ا لبارامترترترترات u 2. تمتمتمتمر .1
يمكن K تدعية. و في هذه الحا M المس K اç: لال و ضعها في إطار المكدس التابع وال من رامترات ا N ر u تمر Ì تعمال المكدس M يمكن اس
تدعية. M المس K ا شير إلى إطار مكدس ا ² ي هو بدوره c ا EBP ل® تعمال المس M سN بر المكدس 7 الوصول إلى البارامترات الممررة
ال: â م
void MyProc(int a, int b, int c)
{
...
}
int main()
{
...
MyProc(10,20,30);
...
}
كالتالي: MyProc K ا اء ا 7 تد M كون اس u
push 30
push 20
push 10
call MyProc
: K ا اء ا 7 تد M شكل المكدس بعد اس
عنوان الرجوع
(10) 0000000Ah
(20) 00000014h
(30) 0000001Eh
Stack Buffer Overflow ض مخمخمخمخزن الملململمكدس % ف
ASSEMBLY IS POWER Page 4
EBP
ESP | EBP-20
ت G ن البيا u اتجاه تخز
ESP+14 | EBP-4
ESP+10 | EBP-8
تأليف:
Z3r0n3
كتاب
Stack Buffer Overflow
يمكنك تحميله من خلال الدخول الى صفحه التحميل من