Commit graph

9808 commits

Author SHA1 Message Date
Manuel Meitinger
afdd3db07c [dns] extend filt.peg 2022-04-24 18:20:52 +02:00
Manuel Meitinger
ffca36cf9b [dns] set timeout to 20 seconds 2022-04-24 16:24:16 +02:00
Manuel Meitinger
ebaacfd850 [dns] additional intercept test 2022-04-24 15:25:07 +02:00
Manuel Meitinger
bda488d871 [dns] flowfilter url test 2022-04-24 15:09:06 +02:00
Manuel Meitinger
4229c7c85c [dns] offline tests for proxyserver 2022-04-24 14:56:55 +02:00
Manuel Meitinger
dd61b21ce3 [dns] offline dns_resolve tests at 100% coverage 2022-04-24 14:28:11 +02:00
Manuel Meitinger
0553b73d36 [dns] 100% coverage 2022-04-23 23:31:41 +02:00
Manuel Meitinger
99bcfb7f55 [dns] move resolve code into addon 2022-04-23 22:45:51 +02:00
Manuel Meitinger
c821d02e09 [dns] update layer tests and bugfix 2022-04-23 21:57:22 +02:00
Manuel Meitinger
c1761033d9 [dns] put DNS id into connection id 2022-04-23 21:22:40 +02:00
Manuel Meitinger
08df89618e Merge branch 'dns' of https://github.com/Meitinger/mitmproxy into dns 2022-04-23 20:51:49 +02:00
Manuel Meitinger
f9b55385df [dns] fix issue with rr records containing compressed names 2022-04-23 20:51:41 +02:00
Maximilian Hils
fab7016b31 beautify flowtable dns entries
this isn't perfect (the whole table needs to be refactored properly),
but good enough for now.
2022-04-23 20:05:42 +02:00
Maximilian Hils
196c881971 flowfilter: match ~u on DNS name
`~u` is special in that it is matched naked, i.e. a filter of `foo`
is interpreted as `~u foo`. We want `example.com` to match on DNS
queries for example.com.
2022-04-23 20:03:53 +02:00
Maximilian Hils
51b640b600 skip internet tests, fix nits 2022-04-23 19:03:25 +02:00
Maximilian Hils
af1974b301 -> Coroutine -> async def
this results in nicer tracebacks
2022-04-23 18:49:17 +02:00
Maximilian Hils
8b731ed770 temporary stopgap for timestamp_tcp_setup 2022-04-23 18:49:16 +02:00
Maximilian Hils
9c33870ac8 move DNS resolution into own addon, simple -> regular 2022-04-23 18:49:16 +02:00
Maximilian Hils
0407d9697b proxy modes: use mitmproxy terminology
We consistently use "reverse proxy" and not "forward proxy",
so we should do the same for DNS. Also removed "custom" mode.
If users want such things, the correct approach is to specify a reverse
proxy and set `.response` in the request hook (similar to how it works for HTTP)
2022-04-23 17:05:30 +02:00
Maximilian Hils
2bc43fc10d self-connect: don't resolve
resolving domains here would leak DNS requests if the user aborts,
we don't want that. It's very much a heuristic only anyways.
2022-04-23 16:50:55 +02:00
Maximilian Hils
74f0965a0b Connection.protocol -> Connection.transport_protocol
This is less ambiguous. Also use a string literal to simplify things.
2022-04-23 16:42:11 +02:00
Maximilian Hils
c17e3a16ec dumper: improve dns query display 2022-04-23 16:12:28 +02:00
Maximilian Hils
5c9ab2e774 str -> to_str
`str` is a bit of a footgun because it overrides the builtin `str()` if imported directly.
2022-04-23 13:34:04 +02:00
Maximilian Hils
8d6a279818 add very basic DNS API docs
the rest still needs to be done, but this should serve as a template
2022-04-23 13:33:18 +02:00
Maximilian Hils
d9338f80a2 exterminate BypassInitStateObject
idea and intent were good, I merely want to keep things aligned with other StateObject
subclass implementations to simplify some planned refactorings for StateObject.
2022-04-23 13:11:50 +02:00
Maximilian Hils
7b84848be2 fix save addon memory leak
introduced by copying the also-broken `request()` implementation.
7004d694b73d0ea3031012e6071706fbc5ad88c7 will fix it there next week.
2022-04-23 12:48:34 +02:00
Manuel Meitinger
976b1a5f27
Merge branch 'mitmproxy:main' into dns 2022-04-22 22:18:14 +02:00
EndUser509
35703b0b6b
HTTP/2 keepalive (#5144)
* 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 https_ping_threshold option to enable keep-alive for HTTP/2 server connections by sending PING frames if the conection is idle longer than the threshold.

* Fixed test

* Fix test

* Adding pragma

* Moved timer logic to _http2.py

* Small code improvement

* Update mitmproxy/options.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update mitmproxy/options.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update mitmproxy/proxy/commands.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update mitmproxy/proxy/commands.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update mitmproxy/proxy/layers/http/_http2.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Sending Wakup back to right client

* Update mitmproxy/proxy/server.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update mitmproxy/proxy/server.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update mitmproxy/proxy/server.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Incorporated suggested changes
Fixed almost all tests

* make `Wakeup` a `CommandCompleted` event.

This allows us to use it with `reply()` in tests,
which makes sure that the correct instance is reused.
 # Please enter the commit message for your changes. Lines starting

* nits

`typing.Set` for Python 3.8 compatibility and a few minor stylistic changes.

* nits nits

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-04-22 13:59:55 +02:00
Manuel Meitinger
6692baed83
Merge branch 'mitmproxy:main' into dns 2022-04-22 13:34:00 +02:00
Will Monge
a863f529ab
Example: manipulate http cookies (#5278)
* added example on how to manipulate (outbound and inbound) cookies for http flows

* added entry to the CHANGELOG
2022-04-22 12:40:23 +02:00
Lijiawei
d1d854f012
Fix mitmweb export copy failed in non-secure domain (#5265)
* Fix mitmweb export copy failed in non-secure domain

https://github.com/mitmproxy/mitmproxy/issues/5264

* Set the generic type of Promise to void

* move clipboard copy to contrib, adjust for TypeScript

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-04-20 20:00:31 +02:00
Aldo Cortesi
a8b6f48374
[requires.io] dependency update on main branch (#5244)
* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

Co-authored-by: requires.io <support@requires.io>
2022-04-17 17:54:06 +02:00
Manuel Meitinger
98e1143916 [dns] corrected spelling of error message 2022-04-11 12:27:37 +02:00
Manuel Meitinger
bc671de397 [dns] allow all possible op and response codes 2022-04-11 12:23:15 +02:00
Manuel Meitinger
5b69087a19 [dns] coverage response codes 2022-04-11 01:42:46 +02:00
Manuel Meitinger
9a55989b25 [dns] refactored enums 2022-04-11 01:38:19 +02:00
Manuel Meitinger
e5139c5a4c [dns] fix selector_events issue 2022-04-10 23:37:38 +02:00
Manuel Meitinger
16e04d1c49 [dns] use random test ports 2022-04-10 23:05:29 +02:00
Manuel Meitinger
f2c17a7198 [dns] alternate DNS test port 2022-04-10 18:09:49 +02:00
Manuel Meitinger
383dd67a61 [dns] set DNS test port > 1024 2022-04-10 17:57:39 +02:00
Manuel Meitinger
ec1f736171 [dns] proxyserver tests 2022-04-10 17:49:19 +02:00
Manuel Meitinger
079a59039d [dns] fix mypy issues 2022-04-10 11:53:41 +02:00
Manuel Meitinger
563f041ba6 [dns] generalize self-connect test 2022-04-10 11:16:13 +02:00
Manuel Meitinger
93d495f103 [dns] fix forward mode 2022-04-09 04:32:53 +02:00
Manuel Meitinger
c43dbdc79b [dns] minor fixes 2022-04-09 04:29:11 +02:00
Manuel Meitinger
7acc1b2590 Merge branch 'main' of https://github.com/mitmproxy/mitmproxy into dns 2022-04-09 04:03:23 +02:00
Manuel Meitinger
ef3f9e492e [dns] rewrite of udp, merge dnsserver>proxyserver 2022-04-09 03:58:23 +02:00
Maximilian Hils
0b4cbfab99
console: be more tolerant on UTF8 checks, but enforce encoding (#5250) 2022-04-06 20:13:19 +02:00
Maximilian Hils
02d2b6d310
warn users if sse flows are received without streaming, refs #4469 (#5249) 2022-04-06 10:51:58 +00:00
kjy00302
0454f63e98
Fix text truncation for full-width characters (#4278)
* Fix text truncation for full-width characters

* Add test for TruncatedText
2022-04-06 11:17:55 +02:00