|
Level 4: Nitroglycerin (10 pts Extra Credit)If you have completed the first four levels, you have earned 100 points. You have mastered the principles of the runtime stack operation, and you have gained firsthand experience with buffer overflow attacks. We consider this a satisfactory mastery of the material. You are welcome to stop right now. The next level is for those who want to push themselves beyond our baseline expectations for the course, and who want to face a challenge in designing buffer overflow attacks that arises in real life. This part of the assignment only counts 10 points, even though it requires a fair amount of work to do, so don’t do it just for the points.
From one run to another, especially by different users, the exact stack
positions used by a given procedure will vary. One reason for this variation
is that the values of all environment variables are placed near the base of
the stack when a program starts executing. Environment variables are stored as
strings, requiring different amounts of storage depending on their values.
Thus, the stack space allocated for a given user depends on the settings of
his or her environment variables. Stack positions also differ when running a
program under
In the code that calls For this level, we have gone the opposite direction, making the stack positions even less stable than they normally are. Hence the name “nitroglycerin”—an explosive that is notoriously unstable.
When you run int getbufn() { char buf[KABOOM_BUFFER_SIZE]; Gets(buf); return 1; }
This function is similar to
In addition, when run in Nitro mode,
Your task is identical to the task for the Dynamite level. Once again, your job
for this level is to supply an exploit string that will cause
Some Advice:
Back to the assignment page |