@@ -195,7 +195,7 @@ def debug_assembly(asm, gdbscript=None, vma=None, api=False):
195
195
196
196
>>> assembly = shellcraft.echo("Hello world!\n")
197
197
>>> io = gdb.debug_assembly(assembly)
198
- >>> io.recvline(timeout=1 )
198
+ >>> io.recvline()
199
199
b'Hello world!\n'
200
200
"""
201
201
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):
230
230
>>> assembly = shellcraft.echo("Hello world!\n")
231
231
>>> shellcode = asm(assembly)
232
232
>>> io = gdb.debug_shellcode(shellcode)
233
- >>> io.recvline(timeout=1 )
233
+ >>> io.recvline()
234
234
b'Hello world!\n'
235
235
"""
236
236
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
490
490
Send a command to Bash
491
491
492
492
>>> io.sendline(b"echo hello")
493
- >>> io.recvline(timeout=30 )
493
+ >>> io.recvline()
494
494
b'hello\n'
495
495
496
496
Interact with the process
497
497
498
- >>> io.interactive(timeout=1 ) # doctest: +SKIP
498
+ >>> io.interactive() # doctest: +SKIP
499
499
>>> io.close()
500
500
501
501
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
514
514
Send a command to Bash
515
515
516
516
>>> io.sendline(b"echo hello")
517
- >>> io.recvline(timeout=10 )
517
+ >>> io.recvline()
518
518
b'hello\n'
519
519
520
520
Interact with the process
@@ -526,19 +526,19 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por
526
526
527
527
>>> io = gdb.debug(args=[b'\xde\xad\xbe\xef'], gdbscript='continue', exe="/bin/sh")
528
528
>>> io.sendline(b"echo $0")
529
- >>> io.recvline(timeout=10 )
529
+ >>> io.recvline()
530
530
b'\xde\xad\xbe\xef\n'
531
531
>>> io.close()
532
532
533
533
Demonstrate that LD_PRELOAD is respected
534
534
535
535
>>> io = process(["grep", "libc.so.6", "/proc/self/maps"])
536
- >>> real_libc_path = io.recvline(timeout=1 ).split()[-1]
536
+ >>> real_libc_path = io.recvline().split()[-1]
537
537
>>> io.close()
538
538
>>> import shutil
539
539
>>> local_path = shutil.copy(real_libc_path, "./local-libc.so") # make a copy of libc to demonstrate that it is loaded
540
540
>>> io = gdb.debug(["grep", "local-libc.so", "/proc/self/maps"], gdbscript="continue", env={"LD_PRELOAD": "./local-libc.so"})
541
- >>> io.recvline(timeout=1 ).split()[-1] # doctest: +ELLIPSIS
541
+ >>> io.recvline().split()[-1] # doctest: +ELLIPSIS
542
542
b'.../local-libc.so'
543
543
>>> io.close()
544
544
>>> os.remove("./local-libc.so") # cleanup
@@ -572,15 +572,15 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por
572
572
573
573
>>> io = gdb.debug(args=[b'\xde\xad\xbe\xef'], gdbscript='continue', exe="/bin/sh", ssh=shell)
574
574
>>> io.sendline(b"echo $0")
575
- >>> io.recvline(timeout=10 )
575
+ >>> io.recvline()
576
576
b'$ \xde\xad\xbe\xef\n'
577
577
>>> io.close()
578
578
579
579
Using an empty args[0] on a remote process
580
580
581
581
>>> io = gdb.debug(args=[], gdbscript='continue', exe="/bin/sh", ssh=shell)
582
582
>>> io.sendline(b"echo $0")
583
- >>> io.recvline(timeout=10 )
583
+ >>> io.recvline()
584
584
b'$ \n'
585
585
>>> io.close()
586
586
@@ -620,12 +620,12 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por
620
620
Resume the program
621
621
622
622
>>> io.gdb.continue_nowait()
623
- >>> io.recvline(timeout=1 )
623
+ >>> io.recvline()
624
624
b'foo\n'
625
625
>>> io.close()
626
626
627
627
>>> ssh_io.gdb.continue_nowait()
628
- >>> ssh_io.recvline(timeout=1 )
628
+ >>> ssh_io.recvline()
629
629
b'foo\n'
630
630
>>> ssh_io.close()
631
631
>>> shell.close()
@@ -978,7 +978,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
978
978
... detach
979
979
... quit
980
980
... ''')
981
- >>> io.recvline(timeout=10 )
981
+ >>> io.recvline()
982
982
b'Hello from process debugger!\n'
983
983
>>> io.sendline(b'echo Hello from bash && exit')
984
984
>>> io.recvall()
@@ -1005,7 +1005,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1005
1005
1006
1006
Observe the forced line
1007
1007
1008
- >>> io.recvline(timeout=1 )
1008
+ >>> io.recvline()
1009
1009
b'Hello from process debugger!\n'
1010
1010
1011
1011
Interact with the program in a regular way
@@ -1029,7 +1029,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1029
1029
... detach
1030
1030
... quit
1031
1031
... ''')
1032
- >>> io.recvline(timeout=10 )
1032
+ >>> io.recvline()
1033
1033
b'Hello from remote debugger!\n'
1034
1034
>>> io.sendline(b'echo Hello from bash && exit')
1035
1035
>>> io.recvall()
@@ -1048,7 +1048,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1048
1048
>>> io.recvline(timeout=5) # doctest: +SKIP
1049
1049
b'Hello from ssh debugger!\n'
1050
1050
>>> io.sendline(b'This will be echoed back')
1051
- >>> io.recvline(timeout=1 )
1051
+ >>> io.recvline()
1052
1052
b'This will be echoed back\n'
1053
1053
>>> io.close()
1054
1054
"""
0 commit comments