• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Gallopsled / pwntools / 1
19%

Build:
DEFAULT BRANCH: dev
Ran 21 Oct 2025 03:41PM UTC
Jobs 2
Files 149
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 May 2023 08:32PM UTC coverage: 19.336% (-54.2%) from 73.494%
1

push

github

web-flow
Handle `context.newline` correctly in `tube.interactive()` (#2129)

* Handle `context.newline` correctly in `tube.interactive()`

The `context.newline` or `self.newline` variable isn't obeyed when typing in interactive mode. It is used when sending and receiving lines through `tube.sendline` though, causing a mismatch.

The receiving end of the `tube.interactive()` already has handling of newlines, but the sending side does not.

Example:
```python
from pwn import *
io = process('cat')
io.newline = b'\r\n'
io.sendline(b'auto')
io.interactive()
```

```
$ python testinteractive.py DEBUG
[x] Starting local process '/usr/bin/cat' argv=[b'cat']
[+] Starting local process '/usr/bin/cat' argv=[b'cat'] : pid 19060
[DEBUG] Sent 0x6 bytes:
    b'auto\r\n'
[*] Switching to interactive mode
[DEBUG] Received 0x6 bytes:
    b'auto\r\n'
auto
$ test
[DEBUG] Sent 0x5 bytes:
    b'test\n'
[DEBUG] Received 0x5 bytes:
    b'test\n'
test
```

The expected outcome would be to send `b'test\r\n'.

The same problem arises in non-term mode (`PWNLIB_NOTERM=1`), where stdin is read in binary mode causing the OS line seperators to come through. Correctly replacing them with the `context.newline` setting allows to use the interactive input on windows hosts as well, without constantly sending `\r\n`.

* Update CHANGELOG.md

* Only replace newlines in TTYs

Don't mess with the line endings when piping data through.

* Always send bytes immediately on receive

Only replace newlines in a tty if NOTERM wasn't explicitly set or
the `newline` setting was set.

* Don't return a newline after term.readline lines

The builtin `input()` doesn't include the newline.

* Remove bogous newline from CHANGELOG

189 of 5940 branches covered (3.18%)

1 of 20 new or added lines in 2 files covered. (5.0%)

9283 existing lines in 112 files now uncovered.

3286 of 16994 relevant lines covered (19.34%)

0.39 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
18.73
-5.74% pwnlib/term/readline.py
18
27.07
-52.24% pwnlib/tubes/tube.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
75.0
-25.0% pwnlib/data/elf/fmtstr/__init__.py
1
75.0
-25.0% pwnlib/data/elf/ret2dlresolve/__init__.py
1
76.92
4.2% pwnlib/filesystem/path.py
1
32.85
4.15% pwnlib/protocols/adb/__init__.py
1
50.0
-50.0% pwnlib/testexample.py
2
27.81
5.19% pwnlib/adb/adb.py
2
0.0
-100.0% pwnlib/elf/maps.py
4
33.33
-22.22% pwnlib/exception.py
6
89.66
-6.77% pwnlib/abi.py
6
42.11
-32.89% pwnlib/config.py
6
25.0
-75.0% pwnlib/elf/__init__.py
6
0.0
-100.0% pwnlib/pep237.py
6
25.0
-75.0% pwnlib/replacements.py
7
68.18
-31.82% pwnlib/encoders/arm/xor.py
8
18.18
-71.82% pwn/__init__.py
8
53.85
-30.77% pwnlib/flag/flag.py
8
82.47
-4.89% pwnlib/term/text.py
8
47.06
-47.06% pwnlib/useragents.py
8
0.0
-21.62% pwnlib/util/splash.py
9
0.0
-64.29% pwnlib/commandline/disablenx.py
9
60.0
-36.0% pwnlib/encoders/i386/xor.py
9
62.96
-33.33% pwnlib/util/hashes.py
10
38.89
-55.56% pwnlib/encoders/arm/alphanumeric/random_funcs.py
11
0.0
-57.89% pwnlib/commandline/version.py
11
56.0
-44.0% pwnlib/encoders/mips/xor.py
12
47.22
-30.56% pwnlib/atexit.py
12
0.0
-75.0% pwnlib/commandline/update.py
13
0.0
-59.09% pwnlib/commandline/elfpatch.py
13
49.32
-15.39% pwnlib/encoders/encoder.py
15
0.0
-33.33% pwnlib/commandline/debug.py
15
0.0
-40.54% pwnlib/commandline/pwnstrip.py
16
0.0
-88.89% pwnlib/commandline/checksec.py
16
0.0
-94.12% pwnlib/commandline/hex.py
16
0.0
-37.21% pwnlib/commandline/template.py
16
0.0
-76.19% pwnlib/commandline/unhex.py
16
55.56
-44.44% pwnlib/encoders/arm/alphanumeric/__init__.py
16
52.63
-41.96% pwnlib/encoders/i386/delta.py
16
34.48
-55.17% pwnlib/util/getdents.py
17
77.67
-16.39% pwnlib/shellcraft/registers.py
18
0.0
-43.9% pwnlib/commandline/elfdiff.py
18
0.0
-81.82% pwnlib/rop/gadgets.py
18
25.0
-75.0% pwnlib/runner.py
19
0.0
-43.18% pwnlib/commandline/scramble.py
19
31.03
-65.52% pwnlib/encoders/arm/alphanumeric/alphanum_byte.py
19
18.73
-5.74% pwnlib/term/readline.py
21
31.82
-46.75% pwnlib/qemu.py
23
0.0
-82.14% pwnlib/commandline/errno.py
26
0.0
-100.0% pwnlib/commandline/common.py
26
26.32
-68.42% pwnlib/util/web.py
27
36.0
-54.0% pwnlib/term/__init__.py
29
8.57
-82.86% pwnlib/commandline/main.py
30
38.64
-34.09% pwnlib/args.py
30
13.46
-57.69% pwnlib/commandline/asm.py
30
14.29
-85.71% pwnlib/util/crc/known.py
31
23.81
-73.81% pwnlib/util/safeeval.py
33
16.98
-62.26% pwnlib/commandline/cyclic.py
33
0.0
-89.19% pwnlib/lexer.py
38
0.0
-90.48% pwnlib/commandline/disasm.py
38
54.33
-29.8% pwnlib/shellcraft/__init__.py
39
0.0
-53.42% pwnlib/rop/ret2csu.py
42
27.38
-50.0% pwnlib/tubes/server.py
45
21.31
-73.77% pwnlib/tubes/buffer.py
46
28.0
-61.19% pwnlib/tubes/remote.py
48
39.77
-54.48% pwnlib/timeout.py
48
29.0
-48.0% pwnlib/update.py
50
0.0
-64.94% pwnlib/elf/config.py
51
0.0
-96.23% pwnlib/commandline/phd.py
53
26.53
-53.68% pwnlib/tubes/listen.py
55
31.4
-61.29% pwnlib/encoders/i386/ascii_shellcode.py
56
0.0
-96.55% pwnlib/commandline/constgrep.py
62
17.12
-56.1% pwnlib/util/sh_string.py
62
22.89
-74.7% pwn/toplevel.py
64
22.11
-67.37% pwnlib/encoders/arm/alphanumeric/ARM_Instructions.py
67
17.73
-47.02% pwnlib/tubes/sock.py
73
16.48
-80.22% pwnlib/util/lists.py
81
22.58
-65.32% pwnlib/util/proc.py
84
0.0
-89.36% pwnlib/elf/plt.py
84
22.69
-70.64% pwnlib/filepointer.py
90
32.28
-46.73% pwnlib/memleak.py
91
10.71
-80.95% pwnlib/shellcraft/internal.py
93
0.0
-86.32% pwnlib/rop/srop.py
98
0.0
-83.76% pwnlib/commandline/libcdb.py
99
12.2
-80.55% pwnlib/regsort.py
99
33.87
-53.01% pwnlib/util/crc/__init__.py
101
22.79
-74.26% pwnlib/util/net.py
105
21.99
-74.47% pwnlib/util/cyclic.py
109
36.47
-40.46% pwnlib/log.py
110
20.31
-42.97% pwnlib/util/misc.py
124
34.73
-46.52% pwnlib/filesystem/ssh.py
124
0.0
-89.55% pwnlib/rop/call.py
124
23.03
-37.58% pwnlib/term/key.py
143
12.43
-84.62% pwnlib/ui.py
145
0.0
-87.04% pwnlib/rop/ret2dlresolve.py
146
0.0
-84.88% pwnlib/commandline/shellcraft.py
148
4.04
-74.75% pwnlib/libcdb.py
175
45.02
-34.19% pwnlib/context/__init__.py
184
18.03
-78.97% pwnlib/util/iters.py
219
18.41
-50.47% pwnlib/tubes/process.py
227
15.29
-72.29% pwnlib/asm.py
227
27.07
-52.24% pwnlib/tubes/tube.py
237
18.29
-57.69% pwnlib/util/packing.py
243
8.93
-83.51% pwnlib/encoders/arm/alphanumeric/builder.py
257
12.89
-53.43% pwnlib/term/term.py
260
3.75
-54.25% pwnlib/gdb.py
275
15.47
-75.92% pwnlib/fmtstr.py
277
15.43
-76.29% pwnlib/util/fiddling.py
304
1.08
-65.29% pwnlib/dynelf.py
308
0.0
-98.37% pwnlib/elf/datatypes.py
471
2.21
-73.56% pwnlib/elf/corefile.py
494
3.25
-84.36% pwnlib/rop/rop.py
505
15.72
-52.37% pwnlib/tubes/ssh.py
677
0.0
-80.32% pwnlib/elf/elf.py
Jobs
ID Job ID Ran Files Coverage
1 1.1 21 Oct 2025 03:41PM UTC 149
19.34
GitHub Action Run
2 1.2 09 Dec 2025 11:04AM UTC 149
19.34
GitHub Action Run
Source Files on build 1
  • Tree
  • List 149
  • Changed 146
  • Source Changed 146
  • Coverage Changed 116
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 58222ccf on github
  • Prev Build on dev (#1998FF09...)
  • Next Build on dev (#18689616375)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc