r = gdb.debug([exe.path]) not opening new terminal

53 Views Asked by At

This is my code:

#!/usr/bin/env python3

from pwn import *

exe = ELF("./misfortune_patched")
libc = ELF("./libc.so.6")
ld = ELF("./ld-2.27.so")

context.binary = exe


def conn():
    if args.LOCAL:
        # r = process([exe.path])
        r = gdb.debug([exe.path])
    else:
        r = remote("127.0.0.1", 9999)

    return r


def main():
    r = conn()

    # good luck pwning :)

    r.interactive()


if __name__ == "__main__":
    main()

The code was suppose to open new terminal and attach gdb to it. But when I run the script I couldn't see any new terminal opening.

The output is given below:

pegasus@pegasus:~/Documents/pwntools/misfortune-ctf-challenge/play$ python3 solve.py LOCAL
[*] '/home/pegasus/Documents/pwntools/misfortune-ctf-challenge/play/misfortune_patched'
    Arch:     amd64-64-little
    RELRO:    Full RELRO
    Stack:    No canary found
    NX:       NX enabled
    PIE:      No PIE (0x3ff000)
    RUNPATH:  b'.'
[*] '/home/pegasus/Documents/pwntools/misfortune-ctf-challenge/play/libc.so.6'
    Arch:     amd64-64-little
    RELRO:    Partial RELRO
    Stack:    Canary found
    NX:       NX enabled
    PIE:      PIE enabled
[*] '/home/pegasus/Documents/pwntools/misfortune-ctf-challenge/play/ld-2.27.so'
    Arch:     amd64-64-little
    RELRO:    Partial RELRO
    Stack:    No canary found
    NX:       NX enabled
    PIE:      PIE enabled
[+] Starting local process '/usr/bin/gdbserver': pid 36739
[*] running in new terminal: ['/usr/bin/gdb', '-q', '/home/pegasus/Documents/pwntools/misfortune-ctf-challenge/play/misfortune_patched', '-x', '/tmp/pwn4c5ysgbv.gdb']
[*] Switching to interactive mode
$ 

The code was suppose to spawn new terminal. But it's not working how can I solve it?

0

There are 0 best solutions below