-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pwntools doesn't in Jupyter because of Jupyter-Curses interactions #826
Comments
This issue exists due to:
A bit of Googling gave me the following issue within another project: ContinuumIO/anaconda-issues#455 Starting ipython like As I have also ran into this issue with pwntools it is really a Jupyter issue instead. |
This is something that can probably be fixed on the Pwntools side, but I don't want to spend the time sorting out Jupyter to fix it. We'd certainly welcome a Pull Request to fix the issue. |
So I've taken a quick look at this, and there seem to be 2 fairly simple fixes. The problem with @Stolas's try is that jupyter uses different environment variables for each kernel, and the kernels don't inherit the environment variables of the jupyter process itself. However one can use the The first fix is to add
at the top of the notebook, this tells curses where it can find terminfo. I don't know how exactly curses interacts with each feature of pwntools, but I've tested pretty much all functions of the log module, all seemed to have been working. I'm slightly more confident in this second fix (though the first one should work as well): pwntools already has a check implemented, which disables curses if the
at the top of a notebook will do exactly what @Stolas proposed. |
With
I still have an error:
Any idea how to fix it ? |
The two fixes above didn't work for me:
I debugged a little and I realized that it's because it cannot open
so I set
The next challenge is to get the stdin work because interactive mode doesn't work. |
Although the github demo works well for IPython, it fails for jupyter notebook.
Here is the received output for "from pwn import *" and "from pwnlib import *":
The text was updated successfully, but these errors were encountered: