Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4644b4b

Browse files
committedOct 26, 2024
Fix character escaping in tests
1 parent 0c0731a commit 4644b4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎pwnlib/tubes/tube.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1115,21 +1115,21 @@ def upload_manually(self, data, target_path = './payload', prompt = b'$', chunk_
11151115
>>> l = listen()
11161116
>>> l.spawn_process('/bin/sh')
11171117
>>> r = remote('127.0.0.1', l.lport)
1118-
>>> r.upload_manually(b'some\xca\xfedata\n', prompt=b'', chmod_flags='')
1118+
>>> r.upload_manually(b'some\\xca\\xfedata\\n', prompt=b'', chmod_flags='')
11191119
>>> r.sendline(b'cat ./payload')
11201120
>>> r.recvline()
1121-
b'some\xca\xfedata\n'
1121+
b'some\\xca\\xfedata\\n'
11221122
11231123
>>> r.upload_manually(cyclic(0x1000), target_path='./cyclic_pattern', prompt=b'', chunk_size=0x10, compression='gzip')
11241124
>>> r.sendline(b'sha256sum ./cyclic_pattern')
11251125
>>> r.recvlineS(keepends=False).startswith(sha256sumhex(cyclic(0x1000)))
11261126
True
11271127
1128-
>>> blob = ELF.from_assembly(shellcraft.echo('Hello world!\n') + shellcraft.exit(0))
1128+
>>> blob = ELF.from_assembly(shellcraft.echo('Hello world!\\n') + shellcraft.exit(0))
11291129
>>> r.upload_manually(blob.data, prompt=b'')
11301130
>>> r.sendline(b'./payload')
11311131
>>> r.recvline()
1132-
b'Hello world!\n'
1132+
b'Hello world!\\n'
11331133
>>> r.close()
11341134
>>> l.close()
11351135
"""

0 commit comments

Comments
 (0)
Please sign in to comment.