Phase 1 Completed.
Main Topics
Browse All TopicsJust wanted to make sure I'm starting in the right direction with this one. I would start off by replacing the call to smoke() from phase 0 with the address of fizz() correct?
Level 1: Sparkler (20 pts)
Within the file bufbomb there is also a function fizz() having the following C code:
void fizz(int val)
{
entry_check(1); /* Make sure entered this function properly */
if (val == cookie) {
printf("Fizz!: You called fizz(0x%x)\n", val);
validate(1);
}
else
printf("Misfire: You called fizz(0x%x)\n", val);
exit(0);
}
Similar to Level 0, your task is to get bufbomb to execute the code for fizz() rather than returning to test. In this case, however, you must make it appear to fizz() as if you have passed your cookie as its argument. You can do this by encoding your cookie in the appropriate place within your exploit string.
Note that the program wont really call fizz() it will simply execute its code. This has important implications for where on the stack you want to place your cookie.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: purewinPosted on 2009-11-03 at 11:09:21ID: 25732337
Okay so I've looked at the stack as it progresses through fizz() and here is what I have. I need to encode my string so that my cookie ends up in ebx so when fizz reaches this part
0x08048d46 <fizz+22>: cmp 0x804a1b0,%ebx
0x08048d4c <fizz+28>: je 0x8048d70 <fizz+64>
they are equal and phase 1 should be done. OR I have this backwards and my cookie needs to be in the address 0x804a1b0.
So first this is ebp being pushed onto the stack correct?
0x08048d31 in fizz ()
(gdb) x/32xw $sp
0xbfffb40c: 0xbfffb428
then ebx is pushed onto the stack
(gdb) x/32xw $sp
0xbfffb408: 0x00000000 0xbfffb428
Then I'm not sure what happens or sure where the address 0x0804a108 came from. I know at this point esp-14 is executed. Any idea what occurs here? And where 0x0804a108 came from?
Select allOpen in new window