Commit Graph

3086 Commits

Author SHA1 Message Date
Maximilian Hils
0fa7c46368
fix cut addon to work with binary content, fix #3965 (#5230) 2022-03-30 12:24:18 +00:00
Maximilian Hils
31add1a7c0
console: improve flowlist performance (#5228)
Co-authored-by: BkPHcgQL3V <BkPHcgQL3V@gmx.com>
2022-03-29 19:32:40 +02:00
Maximilian Hils
1bc265ace7
Merge pull request #5226 from mhils/cleanup
`pyupgrade --py38-plus`
2022-03-29 15:36:32 +02:00
Maximilian Hils
9d1e3107e8 pyupgrade --keep-runtime-typing --py38-plus 2022-03-29 15:29:37 +02:00
Maximilian Hils
b8bed1d770
errorcheck: print message to stderr for console UI (#5225) 2022-03-29 15:26:46 +02:00
Maximilian Hils
beb49ab121 don't use #noqa for imports 2022-03-29 13:51:08 +02:00
Maximilian Hils
f0da667516
tlsconfig: make sure to use the correct connection, fix #5109 (#5224) 2022-03-29 08:27:53 +00:00
Paulo Romeira
e534086053
Add flatpak support to the browser addon (#5200) 2022-03-23 13:56:20 +01:00
Maximilian Hils
426cea5bd6 reopen main for development 2022-03-19 17:35:34 +01:00
Maximilian Hils
7352811eef bump to 8.0.0 2022-03-19 17:20:32 +01:00
Maximilian Hils
41ebb24414 update mitmweb assets 2022-03-19 17:20:32 +01:00
Maximilian Hils
b06fb6d157 security: reject whitespace in HTTP/1 header names
This commit fixes GHSA-gcx2-gvj7-pxv3 by making mitmproxy
reject header names that contain whitespace characters by default.
A new `validate_inbound_headers` option is provided to turn this behavior
off at the expense of allowing HTTP smuggling vulnerabilities.
2022-03-19 17:20:32 +01:00
Maximilian Hils
9243ba4e25 fix vt code detection on Windows 2022-03-19 17:20:32 +01:00
Alexander Prinzhorn
e8ae38c8b6
Fixed encoding guessing: only search for meta tags in HTML bodies (#4566) 2022-03-17 14:25:26 +00:00
Maximilian Hils
a9283befad
improve self-connect error message (#5192) 2022-03-17 14:24:42 +00:00
EndUser509
3a5550a09c
Rotate stream files (#5097)
* Example addon for saving streamed data including a small bug fix to make it work.

* Revert "Example addon for saving streamed data including a small bug fix to make it work."

This reverts commit 02ab78def9a52eaca1a89d0757cd9475ce250eaa.

* Add support for rotating stream files every hour or day

* Added tests

* Modified to change the stream file every time the formating string changes as time moves on.

* Update to more compact version

* simplify save addon logic

* make mypy happy

* fix compatibility with Python 3.8

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-03-17 10:41:05 +00:00
Maximilian Hils
ecd4790cbb
vendor click.style instead of depending on click (#5188)
click introduces subdependencies like colorama, this approach is much simpler.
2022-03-16 17:02:53 +00:00
Maximilian Hils
e2f42ddb30
exit for all tools on startup error, fix #4544 (#5187) 2022-03-16 13:23:32 +00:00
Maximilian Hils
148429c0b3
lowercase user-added HTTP/2 headers, fix #4746 (#5186) 2022-03-16 10:59:30 +01:00
Maximilian Hils
6f0587734e
Refactor how we process --set options (#5067)
* refactor how we process `--set` options

* minor improvements based on @marwinxxii's review

* fix nits

* update changelog
2022-03-16 07:33:30 +00:00
Alexander Prinzhorn
8e1adbc5df
Add WebSocketMessage.injected flag (#5105)
* Add WebSocketMessage.injected flag

* add flow format migration

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-03-16 07:10:23 +00:00
Vinayak Khandelwal
3d5f6da048
ISSUE_5068 (#5161)
* changes for custom port number

* indent correction

* test coverage

* coverage correction

* simplify LDAP auth

* make mypy hapy

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-03-15 20:39:38 +00:00
Maximilian Hils
6ec97d0b8e fix compatibility with Python 3.8 2022-03-15 21:02:35 +01:00
Maximilian Hils
5a4dbffbae update dependencies 2022-03-15 19:50:06 +01:00
Maximilian Hils
a7d473c1c1 fix compatibility with Python <3.10 2022-03-15 19:50:06 +01:00
Maximilian Hils
5fc20e3e8c tests++ 2022-03-15 18:43:56 +01:00
Maximilian Hils
bbc65e5f37 clean up initialization mess
We now manage the eventloop ourselves no matter which tool.
2022-03-15 11:22:03 +01:00
Maximilian Hils
46ccf6049c add asyncio_utils.run() 2022-03-15 10:28:53 +01:00
Maximilian Hils
c3dade0950 inline _change_reverse_host to make sure it is not used elsewhere 2022-03-14 14:11:01 +01:00
Maximilian Hils
33742122a5 set an exception handler for asyncio, fix #5159, refs #5016 2022-03-14 14:06:05 +01:00
Maximilian Hils
8bb7ad468f remove workaround for a Python <=3.7 bug 2022-03-13 19:20:26 +01:00
Maximilian Hils
2387719ace urwid: support sgr mouse reporting
this commit vendors e2423b5069
so that we don't have to wait for a new release.
2022-03-13 19:16:01 +01:00
Maximilian Hils
6c4b3954aa urwid windows: use utf8 2022-03-13 19:15:55 +01:00
Maximilian Hils
3387dac679 remove leftover import 2022-03-08 17:44:20 +01:00
Maximilian Hils
e077e60590 tls: gracefully catch connection errors 2022-03-07 18:59:00 +01:00
Maximilian Hils
65773cc9c0 speculative fix for #5158 2022-02-27 07:58:20 +01:00
Maximilian Hils
5cdd2bc6ec docs: TCPFlow.messages 2022-02-27 07:58:00 +01:00
Maximilian Hils
2480eae5b0 Revert "Fix websocket view jumps to top bug (#4845)"
This reverts commit 278611bf77,
which introduced a bug for the regular HTTP views,
which would initially scroll to the bottom.

fix #5089
2022-02-05 18:24:56 +01:00
Maximilian Hils
372a632161 reintroduce Flow.live
We previously relied on the state of `Flow.reply` to check if a flow can be killed,
but this doesn't work anymore with `Flow.reply` being removed. Instead, we now
reintroduce the `Flow.live` attribute, which signals if we are on a live connection.
Killing still is not ideal (see comment in `Flow.killable`), but this paves the way.
2022-02-04 17:30:58 +01:00
Maximilian Hils
068204fc59 perf: fast path for sync hooks 2022-02-04 17:30:20 +01:00
Robert Xiao
6dc6269b8e Remove no-longer-used tctx.invoke function 2022-02-04 17:30:20 +01:00
Robert Xiao
794c18bec0 Entirely remove the reply system.
The major, breaking change is that it is no longer possible to "take" a reply in
order to block the effect of a later addon hook.

This is patch 4/4 of the reply-ectomy.
2022-02-04 17:30:20 +01:00
Robert Xiao
ede269fce4 Flow.intercept: use an Event instead of the reply system
This is patch 3/4 of the reply-ectomy.
2022-02-04 17:30:20 +01:00
Robert Xiao
fd43ca19c4 Flow.kill: don't depend on reply status.
In principle, a flow is killable as long as the connection handler is still
checking the error status of the flow.

This is patch 2/4 of the reply-ectomy.
2022-02-04 17:30:20 +01:00
Robert Xiao
4448550746 Rewrite @concurrent to use async instead of the reply mechanism.
This should improve behaviour, since calls to @concurrent will now be serialized
relative to other hooks on the same flow (but will still run in parallel with
hooks on different flows). Unlike a plain async hook, @concurrent allows blocking
sync APIs to run concurrently (e.g. requests).

This is patch 1/4 of the reply-ectomy.
2022-02-04 17:30:20 +01:00
Robert Xiao
caf49300c2 Use async for tctx.cycle/tctx.invoke. 2022-02-04 17:30:20 +01:00
Robert Xiao
ee4999e8e4 Rename new async helper functions.
async_trigger -> trigger_event
invoke_addon -> invoke_addon_sync (API breakage)
async_invoke_addon -> invoke_addon
2022-02-04 17:30:20 +01:00
Robert Xiao
cee4b72459 Support async hooks. Fixes #4207. 2022-02-04 17:30:20 +01:00
Alexander Prinzhorn
437e55c2c2
await server_connected hook before doing something with the connection, fixes #5108 (#5110)
* await server_connected hook before doing something with the connection

* refine changelog wording

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2022-02-04 13:49:57 +00:00
Remigiusz Żętkowski
59033371e8
iOS 15 certificate installation instructions update (#5107)
* Update certificate intructions for iOS 15

* Formatting fixes
2022-02-03 12:53:50 +01:00