LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Return to libc attack (https://www.linuxquestions.org/questions/linux-security-4/return-to-libc-attack-859163/)

msridhar87 01-28-2011 12:50 AM

Return to libc attack
 
Hi,
Am currently doing Return to libc attack as part of an assignment. I have analysed the code and I have replaced the return address to point to system() with /bin/sh as argument. I have the following pattern in the stack.
4 bytes - return address - address of system()
4 bytes - address of exit()
4 bytes - Address of /bin/sh.

When I execute the code in gdb my program spawns a shell, whereas when I execute without gdb my program goes for a gracefull exit and I dont get a shell prompt. Please help me out with this?

Regards
Sridhar M

Noway2 01-28-2011 03:59 AM

I notice that you are new to LQ and would like to suggest that you please review the LQ Rules, here.

Unfortunately, your question is a violation of two of them:
  • Do not expect LQ members to do your homework - you will learn much more by doing it yourself.
  • Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed.

win32sux 01-28-2011 06:30 AM

And on that note, I'm closing the thread.

msridhar87, LQ isn't the place to get help with attack code.


All times are GMT -5. The time now is 09:30 PM.