Closed zaphoxx closed 7 months ago
I suppose we could ask @peace-maker about this.
Oh, I missed this somehow, sorry for the regression. The change of readline not returning a b'\n'
was done to match normal Python behavior https://github.com/Gallopsled/pwntools/pull/2129#issuecomment-1540379942
I thought I tested all cases, but sending plain newlines should be possible of course. I'll see how we can get interactive() up to speed again, maybe just reverting the removal of \n from readline?
Thanks a lot for the great support. thumps up
Description
Since version 4.11.0 the interactive mode does not work properly any more. In particular the following effect takes place. If I switch to interactive mode (from within a script) and i press "enter" pwntools will stop the process and exit.
From what I could identify as root cause for the problem is the following commit: https://github.com/Gallopsled/pwntools/commit/58222ccf8b943dffc889e550990f5cb0604a8d46) The line 407 of the module readline.py was changed so that the
+b"\n"
has been removed.For the interactive() function in tube.py (around line 902 in tube.py) this has the consequence that when entering
<enter>
aka\n
only, the variable data isdata=b""
instead ofdata=b"\n"
(as it was in version 4.10.0 and before). Now withdata=b""
the script exits the while loop (which would normally keep the interactive mode alive) and stops the process instead of continuing and simply sending a b"\n" to the process as it did before. I am not sure about the reasons regarding the change but if this can be fixed it would be great and much appreciated.Example with debug context
Affected Version
This Bug affects versions 4.11.0+ including the latest stable release 4.11.1. This has only been tested on the following systems: