0

Im working on a class assignment which requires us to create sploit.c file which exploits a given /usr/bin program. The sploit.c file initiates the /usr/bin program with an execve(TARGET, args, env) call.

I do not know how to debug the /usr/bin program when its called by sploit.c program?

My sploit program currently causes the /usr/bin program to segfault. I am able to gdb the sploit.c program and examine registers/stack and time of segfault but I want to be able to step through the execution of the /usr/bin program?

Note: we have been provided with the source that generated the /usr/bin program

Note: We are provided with virtual machine which have limited ability to download/install new software.

lufthansa747
  • 1,923
  • 3
  • 26
  • 39
  • use the **attach** command in gdb. ' attach ' – london-deveoper Jan 24 '17 at 18:18
  • The /usr/bin program executes and segfaults too quickly to print and attach to the pid. Im hoping for a way to inform gdb of the /usr/bin program before doing `run` while gdb'ing my sploit program – lufthansa747 Jan 24 '17 at 18:25
  • Are you using `fork()` ? Try to set `set follow-fork-mode child` in gdb before debugging. – ks1322 Jan 24 '17 at 18:28
  • @lufthansa747 a couple questions. which OS are using? is your sploit code the cause of the segv? if so can you not add a pause between the start of the binary and further actions from sploit which will give you enough time to attach a debugger ? – london-deveoper Jan 24 '17 at 18:35

0 Answers0