0

I am attempting a binary exploitation challenge, but am yet to even get round to trying to exploit it as I'm having some trouble with pwntools.

My code is currently very simple:

from pwn import *
p = process("./restaurant")
gdb.attach(p)

but when it launches with gdb (with pwndbg extension) I am met with the following

Reading symbols from ./restaurant...
(No debugging symbols found in ./restaurant)
Attaching to program: /home/dnw/Desktop/htb/pwn/pwn_restaurant/restaurant, process 2704
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...
Reading symbols from /usr/lib/debug/.build-id/1c/5391371d36e92a1c9d8074696881e98f5a5cc8.debug...
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from /usr/lib/debug/.build-id/5b/e47e85c990f390b0dccb6ca9dc3e70f410dc6a.debug...
0x00007fc558394e8e in __GI___libc_read (fd=0, buf=0x7fc558464a03 <_IO_2_1_stdin_+131>, nbytes=1) at ../sysdeps/unix/sysv/linux/read.c:26
26  ../sysdeps/unix/sysv/linux/read.c: No such file or directory.

I get the same error if I run it without attaching it through pwntools and instead attach it with gdb -p PID but not if I just open the program in gdb (gdb restaurant)

I have been banging my head against for wall for hours trying to solve this so any insight/help would be great.

elmuscovado
  • 114
  • 3
  • 6
  • 13
  • 1
    When you attach to a running process with GDB, it pauses the process. If the program was waiting for a system call to complete, that’s where it’ll pause. Just give GDB the `c` or `continue` command. – Mark Plotnick Mar 03 '21 at 12:35
  • @MarkPlotnick I reckon that's correct, and that the issue I'm having is that I'm not keeping the process open (i.e. adding a p.interactive() after I launch with GDB) should allow me to do that. I will confirm later this evening. – elmuscovado Mar 03 '21 at 13:03
  • Same problem for me, even with `continue`. Did you find a solution ? I think we are doing the same "challenge" :) – cactuschibre Aug 08 '21 at 12:50
  • @cactuschibre I can't remember what I did exactly but I *think* the issue was that I'd attach to gdb then the program would immediately close, so adding a pause() (pwntools function) to the end of your code should do the job – elmuscovado Aug 08 '21 at 19:48

1 Answers1

0

I get the same error if I ...

This isn't an error. GDB is telling you that it can't locate source to GLIBC.

If you don't plan to look at GLIBC sources, you can safely ignore this. If you do intend to look there, install the sources and tell GDB where to look for them with the dir command.

I have been banging my head against for wall for hours trying to solve this

There is nothing to solve here. Just move along to your actual tasks.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • 1
    I have the same problem and cannot ignore it. Because the program is stuck at this step, even with "continue" command. We gdb is launch without "attach", it runs perfectly without any error like this. So ... what can I do ? glibc6-dbg is already installed. – cactuschibre Aug 08 '21 at 12:49
  • I still got the same error.. any news on that problem? – Mr. Muh Sep 06 '21 at 08:18