@@ -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()
@@ -980,7 +980,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
980
980
... detach
981
981
... quit
982
982
... ''')
983
- >>> io.recvline(timeout=10 )
983
+ >>> io.recvline()
984
984
b'Hello from process debugger!\n'
985
985
>>> io.sendline(b'echo Hello from bash && exit')
986
986
>>> io.recvall()
@@ -1007,7 +1007,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1007
1007
1008
1008
Observe the forced line
1009
1009
1010
- >>> io.recvline(timeout=1 )
1010
+ >>> io.recvline()
1011
1011
b'Hello from process debugger!\n'
1012
1012
1013
1013
Interact with the program in a regular way
@@ -1031,7 +1031,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1031
1031
... detach
1032
1032
... quit
1033
1033
... ''')
1034
- >>> io.recvline(timeout=10 )
1034
+ >>> io.recvline()
1035
1035
b'Hello from remote debugger!\n'
1036
1036
>>> io.sendline(b'echo Hello from bash && exit')
1037
1037
>>> io.recvall()
@@ -1074,7 +1074,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1074
1074
>>> io.recvline(timeout=5) # doctest: +SKIP
1075
1075
b'Hello from ssh debugger!\n'
1076
1076
>>> io.sendline(b'This will be echoed back')
1077
- >>> io.recvline(timeout=1 )
1077
+ >>> io.recvline()
1078
1078
b'This will be echoed back\n'
1079
1079
>>> io.close()
1080
1080
"""
0 commit comments