Vector35 / debugger

Binary Ninja debugger
Other
186 stars 13 forks source link

Sending input to stdin does not work when doing remote debugging from macOS to Linux #497

Open xusheng6 opened 1 year ago

xusheng6 commented 1 year ago

While working with this ctf challenge, I noticed that sending input to stdin does not work when doing remote debugging. The target runs on a Linux box and I connected to it from macOS. After the target asks for input, and I typed something into the console, the target does not stop. Interrupting the target, I can see it is still waiting for input, which means the input was not sent to stdin.

This is a rust binary, not sure it it is relevant.

wargame.zip

gboddin commented 4 months ago

Having the same issue while working on CGI binaries waiting for POST through STDIN.

Sharing a work around:

# term1, create fifo
$ mknod myinput p
$ cat myinput|/bin/binary

# term2, launch lldb debug platform
$ /root/rd/lldb-server p --server --listen 0.0.0.0:1234

# binaryninja
- connect to remote debug server, attach process, it's waiting for stdin anyway

# term4, send input to fifo
$ echo hello > myinput
CHr15W3 commented 7 hours ago

I have a similar issue when using binja from a linux machine with lldb running in a linux vm Is there a better workaround yet?