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

launcing gdb via pwnlib.tubes.ssh (in a tmux split?) causes an rm of tmpfile locally instead of remotely #629

Closed
justinsteven opened this issue Jun 16, 2016 · 0 comments
Labels
Milestone

Comments

@justinsteven
Copy link
Contributor

cmd += ['gdb %r %s -x "%s" ; rm "%s"' % (target.exe, target.pid, tmpfile, tmpfile)]
seems to do the rm locally instead of remotely, even though argv seems to be getting set properly. This might be due to the way everything is being wrapped in 'tmux splitw' by run_in_new_terminal()

The following happens to fix the issue:

index 536282f..8b902fa 100644
--- a/pwnlib/gdb.py
+++ b/pwnlib/gdb.py
@@ -207,7 +207,7 @@ def attach(target, execute = None, exe = None, arch = None):
             cmd = ['sshpass', '-p', shell.password] + cmd
         if shell.keyfile:
             cmd += ['-i', shell.keyfile]
-        cmd += ['gdb %r %s -x "%s" ; rm "%s"' % (target.exe, target.pid, tmpfile, tmpfile)]
+        cmd += ['gdb %r %s -x "%s" \\; rm "%s"' % (target.exe, target.pid, tmpfile, tmpfile)]

         misc.run_in_new_terminal(' '.join(cmd))
         return

I'm going to look in to it further, just raising the flag now in case it's biting or will bite someone.

@zachriggle zachriggle added the bug label Jul 26, 2016
@TethysSvensson TethysSvensson added this to the 3.1.0 milestone Aug 18, 2016
Kyle-Kyle pushed a commit to Kyle-Kyle/pwntools that referenced this issue Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants