Commit graph

701 commits

Author SHA1 Message Date
shuyiLiu
3ccfad1896
fix issue #5198: mitmWeb crash (#5507)
* fix issue #5198: mitmWeb crash

* fix mitmWeb crash

* test cases

* fix test cases

* fix mistake

* update snapshots

* why line221 not covered by test?

Co-authored-by: liushuyi.sputnik <liushuyi.sputnik@bytedance.com>
2022-09-09 17:27:25 +02:00
sanlengjingvv
9223c178c9
Make mitmweb use option "content_view_lines_cutoff" (#5548) 2022-09-09 17:20:30 +02:00
Maximilian Hils
bfea2f27ce update test resources 2022-09-07 13:56:34 +02: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
Manuel Meitinger
cd4a74fae7
Add support for raw UDP. (#5414) 2022-07-27 02:20:30 +02:00
Manuel Meitinger
6b6ec2983a
fix optional int issue (#5483) 2022-07-25 11:53:48 +02:00
Maximilian Hils
83e543c3e6 add multi proxy mode
This commit makes it possible for mitmproxy to spawn multiple
TCP/UDP proxy servers at the same time, see
https://github.com/mitmproxy/mitmproxy/discussions/5288
2022-07-21 15:24:11 +02:00
Maximilian Hils
d003038803 fix nits 2022-06-28 15:53:49 +02:00
Maximilian Hils
330243f2ab dns: improve web display, coverage++ 2022-04-24 23:09:11 +02:00
Manuel Meitinger
afdd3db07c [dns] extend filt.peg 2022-04-24 18:20:52 +02:00
Maximilian Hils
9c33870ac8 move DNS resolution into own addon, simple -> regular 2022-04-23 18:49:16 +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
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
Manuel Meitinger
7acc1b2590 Merge branch 'main' of https://github.com/mitmproxy/mitmproxy into dns 2022-04-09 04:03:23 +02:00
Maximilian Hils
6d67a405a9
add Flow.timestamp_created, which retains list order on replay (#5227) 2022-04-06 10:34:17 +02:00
Manuel Meitinger
ea6f9727da [dns] use snake_case in web flows 2022-04-04 05:29:05 +02:00
Manuel Meitinger
3d1e525f0a
[dns] better no-export check
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2022-04-02 14:07:54 +02:00
Manuel Meitinger
f2f918a17e [dns] build and improve web UI 2022-03-29 22:29:34 +02:00
Manuel Meitinger
49a91d5ffc [dns] fix emty domain name issue 2022-03-27 22:32:46 +02:00
Manuel Meitinger
2445360a47 [dns] cosmetic changes 2022-03-26 21:03:34 +01:00
Manuel Meitinger
d62cfc7079
Merge branch 'mitmproxy:main' into dns 2022-03-20 04:10:16 +01:00
Maximilian Hils
41ebb24414 update mitmweb assets 2022-03-19 17:20:32 +01:00
Manuel Meitinger
0c12db9e42
Merge branch 'mitmproxy:main' into protocol-agnostic 2022-03-19 16:20:14 +01:00
Manuel Meitinger
8c700ec6e4 [dns] first commit 2022-03-19 16:17:44 +01:00
Maximilian Hils
a0e04a7833 web: display WS/WSS as method 2022-03-19 14:44:02 +01:00
Maximilian Hils
628d6201ae web: fix ~websocket filter 2022-03-19 14:37:06 +01:00
Maximilian Hils
148429c0b3
lowercase user-added HTTP/2 headers, fix #4746 (#5186) 2022-03-16 10:59:30 +01:00
ian klatzco
1abb8f6921
add keyboard shortcut n to mitmweb (by using runCommand inside the kb shortcut handler) (#5061)
* add keyboard shortcut n to mitmweb (by creating /flows/create route)

* add keyboard shortcut n to mitmweb (simplified, by using runCommand instead of a new route)
2022-01-16 15:34:07 +01:00
ian klatzco
33e58e2c2b
Clarify web frontend docs (#5055) 2022-01-14 13:00:47 +01:00
Shubhangi Choudhary
9b75f52073
migrated the files to tsx (#4972)
* migrated the files to tsx

* reverted unecessary changes

* reverted unecessary changes to app.css

* fixed the fails

* fixed the fails
2021-12-21 13:05:55 +00:00
Marius
1c93a93696
Add font types to asset filter (~a) (#4928)
* Add font types to asset filter (~a)

* Add PR number to changelog

* remove flash mention

* restore asset test

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2021-11-21 15:47:09 +01:00
Maximilian Hils
0ad4a5983e web: update timestamp column style, fix #4092 2021-10-18 15:12:35 +02:00
mame82
480052f58b
Grpc contentview (#4851)
* Partial gRPC contentview prototype, not linted, no tests, not as add-on

* Linted (flake8)

* Save dev state

* Rewrote of protobuf parser, use decoding strategy, reduced rendered data. Parser uses  generators

* minor cleanup

* fix: preferred encoding was provided as function instead of value

* flake8: line length

* Backlinked message tree objects, temporary debug out

* Partial implementation of gRPC definitions. Save state to fix a cras (data invalidate in edit mode)

* hack: deal with missing exception handling for generator based content views

* gRPC/Protoparser descriptions (with test code)

* replaced manual gzip decoding with mitmproxy.net.encoding.decode

* Refactored typing imports

* Reafctoring

* distinguish request vs response definitions, separate view config from parser config

* Code cleaning, moved customized protobuf definitions to example addon

* final cleanup

* changelog

* Stubs for tests

* Fixed render_riority of addon example

* Started adding tests

* Work on tests

* mypy

* Added pseudo encoder to tests, to cover special decodings

* Example addon test added

* finalized tests, no 100 percent coverage possible, see comments un uncovered code

* minor adjustments

* fixup tests

* Typos

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2021-10-12 13:32:56 +02:00
Maximilian Hils
aad92c9d5a
Merge pull request #4847 from mhils/flowfilter
Flowfilter Improvements
2021-10-09 18:38:56 +02:00
Vinh Quang Tran
0b48fdfc29
Prevent connection lost in mitmweb when pressing Download button. (#4849) 2021-10-09 18:32:07 +02:00
Maximilian Hils
25bdf2f9d8 web: update filters 2021-10-08 18:39:22 +02:00
Maximilian Hils
c2d8674a7b web: minor fixes 2021-10-08 18:39:22 +02:00
Maximilian Hils
c43a2ef8dc improve flowfilter api: raise on invalid input, add ~all 2021-10-08 17:45:47 +02:00
Maximilian Hils
adfccb90a5 minor fixes 2021-10-08 17:36:16 +02:00
Matthew Hughes
d9cac6fbcd
Make Cert.not{before,after} timezone aware (#4805)
I noticed when running tests the output of
`web/src/js/__tests__/ducks/_tflow.ts` would change depending on how I
set my timezone, e.g.

    $ TZ=America/Los_Angeles pytest --quiet \
        test/mitmproxy/tools/web/test_app.py >/dev/null \
        && grep --extended-regexp 'not(after|before)' web/src/js/__tests__/ducks/_tflow.ts
                "notafter": 2235132207,
                "notbefore": 1604415807,
    $ TZ=Asia/Tokyo pytest --quiet \
        test/mitmproxy/tools/web/test_app.py >/dev/null \
        && grep --extended-regexp 'not(after|before)'  web/src/js/__tests__/ducks/_tflow.ts
                "notafter": 2235074607,
                "notbefore": 1604354607

It looks like this is because the `cert_to_json` function simply calls
`timestamp` the `datetime` object from
`x509.Certificate.not_valid_before`, however, this `datetime` object is
not timestamp aware, from the docs [1]:

> A naïve datetime representing the beginning of the validity period for
the certificate in UTC

So when serializing to JSON, first convert the `datetime` to UTC then
call `timestamp`.

A test was added by inspecting one of the test certs with:

    $ openssl x509 -in test/mitmproxy/net/data/text_cert_2 -text

Extracting the date and asserting on that.

The corresponding test has also been re-run so that `_tflow.ts` was
regenerated with it's correct value. Snapshots were also updated via:

    $(npm bin)/jest --updateSnapshot

[1] https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate.not_valid_after
2021-09-16 10:53:36 +02:00
Maximilian Hils
0437d2935e make flake8 happy 2021-09-04 00:23:45 +02:00
Maximilian Hils
c0fd6cfc09
Merge pull request #4779 from mhils/mitmweb-tcp
web: add support for viewing tcp flows
2021-08-25 13:35:37 +02:00
Maximilian Hils
89beb31c8e web: make icon column sortable 2021-08-23 18:59:38 +02:00
Maximilian Hils
e483aa544f force less variable calculation 2021-08-23 14:58:56 +02:00
Maximilian Hils
d55aa7ea42 tests++ 2021-08-23 11:48:27 +02:00