No such file or directory error when attempting to attach to gdb with pwntools

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")

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/
Reading symbols from /usr/lib/debug/.build-id/1c/5391371d36e92a1c9d8074696881e98f5a5cc8.debug...
Reading symbols from /lib64/
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.

Read more here:

Content Attribution

This content was originally published by Monkeybike123 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: