diff --git a/pwnlib/gdb.py b/pwnlib/gdb.py index 1315408d0..690e360a4 100644 --- a/pwnlib/gdb.py +++ b/pwnlib/gdb.py @@ -195,7 +195,7 @@ def debug_assembly(asm, gdbscript=None, vma=None, api=False): >>> assembly = shellcraft.echo("Hello world!\n") >>> io = gdb.debug_assembly(assembly) - >>> io.recvline(timeout=1) + >>> io.recvline() b'Hello world!\n' """ tmp_elf = make_elf_from_assembly(asm, vma=vma, extract=False) @@ -230,7 +230,7 @@ def debug_shellcode(data, gdbscript=None, vma=None, api=False): >>> assembly = shellcraft.echo("Hello world!\n") >>> shellcode = asm(assembly) >>> io = gdb.debug_shellcode(shellcode) - >>> io.recvline(timeout=1) + >>> io.recvline() b'Hello world!\n' """ if isinstance(data, six.text_type): @@ -490,12 +490,12 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por Send a command to Bash >>> io.sendline(b"echo hello") - >>> io.recvline(timeout=30) + >>> io.recvline() b'hello\n' Interact with the process - >>> io.interactive(timeout=1) # doctest: +SKIP + >>> io.interactive() # doctest: +SKIP >>> io.close() Create a new process, and stop it at '_start' @@ -514,7 +514,7 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por Send a command to Bash >>> io.sendline(b"echo hello") - >>> io.recvline(timeout=10) + >>> io.recvline() b'hello\n' Interact with the process @@ -526,19 +526,19 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por >>> io = gdb.debug(args=[b'\xde\xad\xbe\xef'], gdbscript='continue', exe="/bin/sh") >>> io.sendline(b"echo $0") - >>> io.recvline(timeout=10) + >>> io.recvline() b'\xde\xad\xbe\xef\n' >>> io.close() Demonstrate that LD_PRELOAD is respected >>> io = process(["grep", "libc.so.6", "/proc/self/maps"]) - >>> real_libc_path = io.recvline(timeout=1).split()[-1] + >>> real_libc_path = io.recvline().split()[-1] >>> io.close() >>> import shutil >>> local_path = shutil.copy(real_libc_path, "./local-libc.so") # make a copy of libc to demonstrate that it is loaded >>> io = gdb.debug(["grep", "local-libc.so", "/proc/self/maps"], gdbscript="continue", env={"LD_PRELOAD": "./local-libc.so"}) - >>> io.recvline(timeout=1).split()[-1] # doctest: +ELLIPSIS + >>> io.recvline().split()[-1] # doctest: +ELLIPSIS b'.../local-libc.so' >>> io.close() >>> os.remove("./local-libc.so") # cleanup @@ -572,7 +572,7 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por >>> io = gdb.debug(args=[b'\xde\xad\xbe\xef'], gdbscript='continue', exe="/bin/sh", ssh=shell) >>> io.sendline(b"echo $0") - >>> io.recvline(timeout=10) + >>> io.recvline() b'$ \xde\xad\xbe\xef\n' >>> io.close() @@ -580,7 +580,7 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por >>> io = gdb.debug(args=[], gdbscript='continue', exe="/bin/sh", ssh=shell) >>> io.sendline(b"echo $0") - >>> io.recvline(timeout=10) + >>> io.recvline() b'$ \n' >>> io.close() @@ -620,12 +620,12 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por Resume the program >>> io.gdb.continue_nowait() - >>> io.recvline(timeout=1) + >>> io.recvline() b'foo\n' >>> io.close() >>> ssh_io.gdb.continue_nowait() - >>> ssh_io.recvline(timeout=1) + >>> ssh_io.recvline() b'foo\n' >>> ssh_io.close() >>> shell.close() @@ -978,7 +978,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr ... detach ... quit ... ''') - >>> io.recvline(timeout=10) + >>> io.recvline() b'Hello from process debugger!\n' >>> io.sendline(b'echo Hello from bash && exit') >>> io.recvall() @@ -1005,7 +1005,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr Observe the forced line - >>> io.recvline(timeout=1) + >>> io.recvline() b'Hello from process debugger!\n' Interact with the program in a regular way @@ -1029,7 +1029,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr ... detach ... quit ... ''') - >>> io.recvline(timeout=10) + >>> io.recvline() b'Hello from remote debugger!\n' >>> io.sendline(b'echo Hello from bash && exit') >>> io.recvall() @@ -1048,7 +1048,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr >>> io.recvline(timeout=5) # doctest: +SKIP b'Hello from ssh debugger!\n' >>> io.sendline(b'This will be echoed back') - >>> io.recvline(timeout=1) + >>> io.recvline() b'This will be echoed back\n' >>> io.close() """