Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

COMPUTER SCIENCE // CRYPTOLOGY In addition to stack-based buffer overflow attack

ID: 3839627 • Letter: C

Question

COMPUTER SCIENCE // CRYPTOLOGY

In addition to stack-based buffer overflow attacks (i.e., smashing the stack), heap overflows can also be exploited. Consider the following C code, which illustrates a heap overflow. int main() {int diff, size 8; char *buf, *buf2; buf1 = (char*)malloc (size); buf2 = (char*)malloc (size); diff = buf2 - bufi; memset (buf2, '2', size); printfCBEFORE: buf2 = %s", buf 2); memset (buf, ', diff + 3); print AFTER: buf 2 = */.s" buf 2); return 0} Compile and execute this program. What is printed? Explain the results you obtained in part a. Explain how a heap overflow might be exploited by Trudy.

Explanation / Answer

A)After compiling and execute a progam it will print Declaration of syntax error.

B)The result seen in part a are malloc(),memset() should have a prototype and 'BEFORE' is an undefind symbole.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote