Commit Graph

10011 Commits

Author SHA1 Message Date
Maximilian Hils 51611be2dd
share `SSL.Context` for all client <-> proxy connections (#5340)
* share `SSL.Context` for all client connections

This should cause not functional differences, but increase performance.

* update tests
2022-09-07 13:57:27 +02:00
Maximilian Hils bfea2f27ce update test resources 2022-09-07 13:56:34 +02:00
Aldo Cortesi 704708dfef
[requires.io] dependency update on main branch (#5572)
* [requires.io] dependency update

* [requires.io] dependency update

Co-authored-by: requires.io <support@requires.io>
2022-09-07 13:44:19 +02:00
lauren 6494e97e78
render application/prpc as grpc protobuf (#5568) 2022-09-02 09:22:54 -05:00
Manuel Meitinger 1706a9b9fe
Unify proxy modes, introduce UDP protocol detection. (#5556)
* [modes] new unified syntax

* [modes] full coverage udp.py

* [modes] mypy and coverage

* [modes] split mode_spec into two files

* [modes] adjust DNS layer

* [modes] add udp layer decision

* [modes] use 1:1 ServerInstances

* [modes] fix paste issue

* [modes] update tests

* [modes] fix typo

* [modes] updated docs

* [modes] fix typo
2022-08-30 05:27:51 +02:00
Maximilian Hils 3865e6f8dd
Merge pull request #5555 from mhils/mitmweb-state
Mitmweb: Show Proxy State
2022-08-28 08:52:32 -05:00
Maximilian Hils 0ce20c55a2 fix web tests 2022-08-28 01:36:45 +02:00
Maximilian Hils 928094c916 improve signal handling 2022-08-27 19:22:38 +02:00
Maximilian Hils 0b7ad85377 [web] add capture setup screen 2022-08-25 21:38:49 +02:00
Maximilian Hils ee14373770 [web] add `/state` API endpoint
This endpoint will be used to communicate the mitmproxy server state that is
not part of flows/eventlog/options. As a first use case, we now transmit the
state of all proxy server instances.
2022-08-25 21:38:49 +02:00
Maximilian Hils d9b4ef1fee refactor `Servers.update` to retain order
`set()` does not guarantee order, which means the list of servers is not in sync with `options.modes`.
Also removed modes from signals - we readd them once we have a concrete use case.
Finally, we only try to start each server once. Retrying should be done by the UI.
2022-08-25 21:38:49 +02:00
Aldo Cortesi be77761310
[requires.io] dependency update on main branch (#5551)
* [requires.io] dependency update

* [requires.io] dependency update

* [requires.io] dependency update

* Update setup.py

Co-authored-by: requires.io <support@requires.io>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-08-24 11:56:44 +02:00
Joran van Apeldoorn cba66953a3
Magisk module onboarding for Android (#5547)
* Added magisk module generation

* Fixed typo

* changelog

* Fixed mypy bug

* Changed action based on ubuntu 18.04 due to https://bit.ly/3QOw87Z

* Workflow pinned to ubuntu 20.04

* Moved magisk code to utils and gen on download

* Styling

* Removed magisk from git repo

* Added tests

* Fixed dead line

* Update CHANGELOG.md

* Hardcoded hash

Co-authored-by: Joran van Apeldoorn <joran@bitsoffreedom.nl>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2022-08-23 14:52:11 +00:00
Maximilian Hils 269b23fca1
improve handling of port=0 (#5549) 2022-08-23 11:35:56 +02:00
Maximilian Hils 6ff5d0cc78 use correct option when determining TLS min/max versions, fix #5546 2022-08-22 15:19:18 +02:00
Maximilian Hils 6d6d2bcdb1
Merge pull request #5542 from mhils/os-proxy
Simplify transparent mode, fix listening on port 0
2022-08-21 23:58:33 +02:00
Maximilian Hils 40ac31da02 remove `GetSocket`, simplify transparent mode destination resolution 2022-08-21 23:52:39 +02:00
Aldo Cortesi 7911636a5c
[requires.io] dependency update on main branch (#5537)
* [requires.io] dependency update

* [requires.io] dependency update

* Update tox.ini

* Update setup.py

Co-authored-by: requires.io <support@requires.io>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-08-21 23:30:12 +02:00
Maximilian Hils c29a938cab port=0: use same port for IPv4 and IPv6 2022-08-18 15:52:52 +02:00
Maximilian Hils bc370276a1 flask: fix tests
Flask 2.2 has compatibility issues with pytest-asyncio (https://github.com/pallets/flask/issues/4773),
but it turns out we don't even need our tests to be async here. So we just use sync tests to fix the CI issues.
2022-08-17 18:56:04 +02:00
Maximilian Hils f4dc2f2cfd
Replace blinker with custom implementation (#5528)
* replace blinker with custom implementation

The major benefit here is type checking, followed by proper support for async receivers.

* fix compatibility with Python 3.9

* fix nits

* try harder to force gc

* try harderer

* coverage++

* coverage++

* nits
2022-08-16 12:21:55 +00:00
Maximilian Hils 5a0165fd2b
mitmweb: compress dump files (#5532) 2022-08-16 12:07:30 +00:00
Manuel Meitinger e11626395e
Fix running hook issue and signal proxyserver updates. (#5512)
* add startup hook

* remove StartupHook

* add instance state reports

* make server stop log entries clearer

* fix default param issue

* add SyncSignal and AsyncSignal

* fix signal issues

* simpler update handling

* fix coverage

* minor change to better reflect server update state

* fix reuse tests on linux/wsl

* exterminate `mitmproxy.exceptions.TypeError`

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-08-14 00:11:01 +02:00
juesexiangyang 51684e1e2d
Update mode_servers.py (#5526) 2022-08-11 20:45:50 +02:00
Manuel Meitinger fbcffee87f
Include server information in bind/listen errors. (#5495)
* include host and port in listen errors

* common UDP server and reuse message

* update tests

* fix reuse test for master
2022-08-02 19:00:34 +02:00
Manuel Meitinger 73c38f698d
update pyOpenSSL to version 22 (#5505) 2022-07-31 09:40:56 +02:00
Maximilian Hils 6cfde13b02
Merge pull request #5397 from kckeiks/add-dtls-support
Add dtls support
2022-07-29 19:10:33 +02:00
Maximilian Hils c3f238f9c8 use latest kaitai compiler 2022-07-29 19:03:30 +02:00
Miguel Guarniz f60af70d9d remove deleted file from excluded list
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:06 +02:00
Miguel Guarniz 30ddb1130f add DTLS ksy file
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:06 +02:00
Miguel Guarniz 05c8ce150e use valid port number in test
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:06 +02:00
Miguel Guarniz 5f93227685 update tests after merging DTLS into TLS
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:06 +02:00
Miguel Guarniz 544f60c1e6 merge DTLS layer into TLS layer
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:06 +02:00
Miguel Guarniz 0860cb1dda remove conflicts and fix lint errors
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:06 +02:00
Miguel Guarniz 9cb16c8f6d remove duplicate test
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 8a175b3754 update multi-server mode tests
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 7349619312 integrate with multi-server mode
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz afaf6fc939 fix coverage failures
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz a51c6f7e86 fix mypy errors
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 70f150203d fix lint errors
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 9b80878115 update changelog
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 5d1c622a65 add UDP layer tests
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz de20be8f62 add tests for Kaitai DTLS ClientHello decoder
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 709916ef91 add dtls parser tests
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 7da17c6bd8 fix tests
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 5a3a8c5653 move dtls client hello parse functions to dtls layer file
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz e23875072c display UDP flow in flowlist and flowview in tui
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz edeeb938e8 reuse TLS layers and hooks
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz cda68c6e5d parse dtls client hello
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00
Miguel Guarniz 7101bac356 add UDP layer
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 19:02:05 +02:00