Skip to content
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

The double quotes around filename breaks pwnlib.debug #1516

Closed
jjyy1946 opened this issue May 25, 2020 · 5 comments · Fixed by #1846
Closed

The double quotes around filename breaks pwnlib.debug #1516

jjyy1946 opened this issue May 25, 2020 · 5 comments · Fixed by #1846

Comments

@jjyy1946
Copy link

I'm referencing a fix at a7678f7
This fix removed "" around the temp script name, it seems that we should also remove the "" around the exe filename as well. I tested this on kali linux with gdb 9.1 + pwntools 4.1.0:
[DEBUG] Received 0x3d bytes:
b'Process ./ropme created; pid = 62257\n'
b'Listening on port 46249\n'
[DEBUG] Wrote gdb script to '/tmp/pwndoi5fs65.gdb'
target remote 127.0.0.1:46249
b main
[*] running in new terminal: /usr/bin/gdb -q "./ropme" -x "/tmp/pwndoi5fs65.gdb"
[DEBUG] Launching a new terminal: ['/usr/bin/x-terminal-emulator', '-e', '/usr/bin/gdb -q "./ropme" -x "/tmp/pwndoi5fs65.gdb"']

From GDB:
GEF for linux ready, type gef' to start, gef config' to configure
80 commands loaded for GDB 9.1 using Python engine 3.8
"./ropme": No such file or directory.
"/tmp/pwndoi5fs65.gdb": No such file or directory.
gef➤

@jjyy1946 jjyy1946 changed the title The double quotes around filename break pwnlib.debug The double quotes around filename breaks pwnlib.debug May 25, 2020
@zachriggle
Copy link
Member

We should likely be using sh_string for these cases, or otherwise building an array of arguments instead of a free-form string to pass to system().

@Arusekk Arusekk modified the milestones: 4.1.1, 4.2.0 Jun 3, 2020
@VortixDev
Copy link

The issue necessitating this appears to relate to the following aspect of qterminal (which x-terminal-emulator is linked to): lxqt/qterminal#665. Setting context.terminal = ["xterm", "-e"] should allow you to work around the problem, for those currently affected. To fix this on my end, I've removed the quotes from the command string and run the file name through bash's printf with the %q formatter (https://stackoverflow.com/questions/5608112/escape-filenames-the-same-way-bash-does-it). I'm unsure if there's a more direct approach.

@zachriggle
Copy link
Member

zachriggle commented Jul 5, 2020 via email

@VortixDev
Copy link

I'm not sure; I run qterminal 0.14.1, but it's possible that it has always behaved that way. That said, I believe Kali only started using qterminal around the start of this year.

@jjyy1946
Copy link
Author

jjyy1946 commented Jul 5, 2020 via email

@Arusekk Arusekk linked a pull request Dec 1, 2020 that will close this issue
@Arusekk Arusekk removed a link to a pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants