Skip to content

Commit

Permalink
Fix character escaping in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Oct 26, 2024
1 parent 0c0731a commit 4644b4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pwnlib/tubes/tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,21 +1115,21 @@ def upload_manually(self, data, target_path = './payload', prompt = b'$', chunk_
>>> l = listen()
>>> l.spawn_process('/bin/sh')
>>> r = remote('127.0.0.1', l.lport)
>>> r.upload_manually(b'some\xca\xfedata\n', prompt=b'', chmod_flags='')
>>> r.upload_manually(b'some\\xca\\xfedata\\n', prompt=b'', chmod_flags='')
>>> r.sendline(b'cat ./payload')
>>> r.recvline()
b'some\xca\xfedata\n'
b'some\\xca\\xfedata\\n'
>>> r.upload_manually(cyclic(0x1000), target_path='./cyclic_pattern', prompt=b'', chunk_size=0x10, compression='gzip')
>>> r.sendline(b'sha256sum ./cyclic_pattern')
>>> r.recvlineS(keepends=False).startswith(sha256sumhex(cyclic(0x1000)))
True
>>> blob = ELF.from_assembly(shellcraft.echo('Hello world!\n') + shellcraft.exit(0))
>>> blob = ELF.from_assembly(shellcraft.echo('Hello world!\\n') + shellcraft.exit(0))
>>> r.upload_manually(blob.data, prompt=b'')
>>> r.sendline(b'./payload')
>>> r.recvline()
b'Hello world!\n'
b'Hello world!\\n'
>>> r.close()
>>> l.close()
"""
Expand Down

0 comments on commit 4644b4b

Please sign in to comment.