Compare commits

...

3506 Commits

Author SHA1 Message Date
Maximilian Hils
0a1ca53689 bump version to 0.18.2 2016-10-25 22:28:23 -07:00
Maximilian Hils
d0c27c76af fix the linter, knuth ftw! 2016-10-25 22:27:57 -07:00
Maximilian Hils
b72f3ee568 backport fix for #1620 2016-10-25 22:15:44 -07:00
Maximilian Hils
2fcc0458d1 backport fix for #1666 2016-10-25 22:09:58 -07:00
Maximilian Hils
fb1d2a8c89 constrain h2 version, refs #1671 2016-10-25 22:07:33 -07:00
Aldo Cortesi
6b524c9054 Merge pull request #1641 from cortesi/v0.18.x
console: correct handling of logs
2016-10-21 10:45:38 +13:00
Aldo Cortesi
ffe7eb94f1 console: correct handling of logs 2016-10-21 09:32:51 +13:00
Aldo Cortesi
5db860a334 Bump to 0.18.1 to fix pypi obstreperousness
Also include contriburors update.
2016-10-16 23:52:47 +13:00
Aldo Cortesi
e4a32d6844 Merge pull request #1602 from cortesi/scriptdocs
docs: stub out new script documentation
2016-10-16 20:50:09 +13:00
Aldo Cortesi
00603021d9 docs: concurrency, developing scripts 2016-10-16 20:39:34 +13:00
Aldo Cortesi
9a0195bf64 scripts: keep scripts just after the ScriptLoader in addon chain
We need scripts to run _before_ filestreamer, so we can't just add them to the
end of the chain. This patch also fixes an issue that could cause scripts to be
initialised un-necessarily if only the order of scripts in options changed.
2016-10-16 20:26:06 +13:00
Aldo Cortesi
57b8ed21a9 docs: scripts on saved flows 2016-10-16 20:26:06 +13:00
Aldo Cortesi
97b594b848 mitmdump: fix addon order - dumper must be last
This is so we can see the effects of script rewriting using -dd.
2016-10-16 20:26:06 +13:00
Maximilian Hils
072fff90f1 docs: link to correct tag 2016-10-16 20:26:06 +13:00
Aldo Cortesi
55cb2a8547 docs: logging and the context 2016-10-16 20:26:06 +13:00
Aldo Cortesi
a6c7a1ff91 scripts: handle SystemExit from scripts explicitly 2016-10-16 20:26:06 +13:00
Aldo Cortesi
dc19ff7a9d mitmdump: show script errors on startup
Add the terminal logger before any other addons, so we see script errors on
startup.
2016-10-16 20:26:06 +13:00
Aldo Cortesi
fb69c9c345 docs: overview, classes, arguments 2016-10-16 20:26:06 +13:00
Aldo Cortesi
61040a7bcd docs: improve external source links, tweak code docs 2016-10-16 20:26:06 +13:00
Aldo Cortesi
c8f2f1019d Clean up models.http a bit
- We don't need a deprecation warning here
- Bring imports inline with policy
2016-10-16 20:26:06 +13:00
Aldo Cortesi
fdb6a44245 docs: cleanups improvements and fighting sphinx
- Hide links to internal code listings, and link to github instead
- Improve formatting of code/example captions
- Fix outdated documentation of command-line options
- Complete documentation of all events + improved formatting
- tcp_open -> tcp_start, tcp_close -> tcp_end to reduce confusion
2016-10-16 20:26:06 +13:00
Maximilian Hils
26af9b29fc fix #1611 2016-10-15 18:25:18 -07:00
Maximilian Hils
8c3eed16d4 update CHANGELOG 2016-10-15 18:15:28 -07:00
Maximilian Hils
d5873302c1 Merge pull request #1610 from mhils/issue-1605
Fix #1605
2016-10-14 02:00:36 -07:00
Maximilian Hils
e9284ab7ee add regression test for #1605 2016-10-14 01:22:30 -07:00
Maximilian Hils
5fab94580e fix #1605 2016-10-13 20:31:14 -07:00
Sanchit Sokhey
61a1b96ca4 Issue 1461 (#1609)
* doc changes

* doc changes

* doc changes

* doc changes

* Documentation updated

* Documentation for custom certificate updated
2016-10-13 19:46:12 -07:00
Maximilian Hils
8be0d78eaa Merge pull request #1603 from mhils/eof
Simplify EOF detection
2016-10-05 19:37:22 -07:00
Maximilian Hils
b422ba5328 simplify eof detection 2016-10-05 17:45:48 -07:00
Aldo Cortesi
8e7ec6117a Merge pull request #1601 from cortesi/certcap
certutils: cap the cert store size at 100 by default
2016-10-05 11:32:05 +11:00
Aldo Cortesi
89d36713e3 certutils: cap the cert store size at 100 by default
This should be enough to give us reuse without growing infinitely. This is part
of fixing the memory situation in mitmdump.

TODO: There's an opportunity here for a better algorithm, that expires certs
based on least-recently-accessed time, rather than oldest generated time.
2016-10-05 10:44:31 +11:00
Aldo Cortesi
6d343c7ca3 debug: use correct fp for memory object output 2016-10-05 09:54:23 +11:00
Thomas Kriechbaumer
ff388f2e62 Merge pull request #1598 from cortesi/dummystate
mitmdump: use a dummy state object
2016-10-04 15:36:31 +02:00
Thomas Kriechbaumer
90898f9084 use flt instead of filt for flowfilter expressions 2016-10-04 14:51:04 +02:00
Aldo Cortesi
76ae9fdbaa Merge pull request #1597 from cortesi/debug
debug: add a dump of objects in memory
2016-10-04 17:00:44 +11:00
Aldo Cortesi
e189652680 mitmdump: use a dummy state object
Most of the mitmdump memory leak turns out to be due to our leaky handling of
the state object. Since mitmdump doesn't actually use the state object, we can
replace it with a shell.
2016-10-04 16:52:58 +11:00
Aldo Cortesi
882c363ec5 debug: Hard exit after debug signal 2016-10-04 16:48:13 +11:00
Aldo Cortesi
2130f248de Merge pull request #1596 from cortesi/addons
Consolidate logging
2016-10-04 16:30:25 +11:00
Aldo Cortesi
3318e531a6 debug: add a dump of objects in memory 2016-10-04 16:22:01 +11:00
Aldo Cortesi
7fe09f4d26 Consolidate logging
- Make log event handler work
- Move terminal event log into an addon
- Clean various log related errors and duplications
2016-10-04 13:00:15 +11:00
Aldo Cortesi
3d5b811994 Merge pull request #1592 from cortesi/ws
docs and API-related cleanups
2016-10-04 10:54:15 +11:00
Aldo Cortesi
2bd8686629 http2: support the requestheaders event
We do this by splitting read_request into read_request_headers and
read_request_body.
2016-10-04 10:33:57 +11:00
Aldo Cortesi
2e48b60ff1 Clarify channel interaction pattern
Before this patch, it wasn't clear when the arguments to an event could be
modified, and when a new object should be returned. After this patch, the right
thing to do is to modify the arguments in 99% of cases. The only exception to
this is root_layer, for which we can find a better structure down the track.
2016-10-04 08:13:56 +11:00
Aldo Cortesi
8cec187f9a http2: frames don't have a human_readable method 2016-10-04 08:13:56 +11:00
Aldo Cortesi
1ae73b9157 Add requestheaders event
HTTP1 only for now, HTTP2 coming next.
2016-10-04 08:13:56 +11:00
Aldo Cortesi
b735694653 websockets_handshake -> websocket_handshake
The plural feels awkward.
2016-10-04 08:13:56 +11:00
Aldo Cortesi
b0add569b9 Merge pull request #1587 from Kriechi/rename-filt
rename mitmproxy.filt -> mitmproxy.flowfilter
2016-10-04 08:13:19 +11:00
Maximilian Hils
13fb384c19 update dependencies 2016-10-03 13:39:30 -07:00
Maximilian Hils
73c95efacc Merge pull request #1590 from rofreg/chain_file_conflict
Fix SSL error on OS X
2016-10-03 13:26:26 -07:00
Thomas Kriechbaumer
36c04f1631 fix flowfilter.match args 2016-10-03 12:04:17 +02:00
Thomas Kriechbaumer
bb60b76af4 use flowfilter.match 2016-10-03 11:45:54 +02:00
Thomas Kriechbaumer
5f8b8bf35e move flow.match to flowfilter.match 2016-10-03 11:45:54 +02:00
Thomas Kriechbaumer
ba84248910 rename mitmproxy.filt -> mitmproxy.flowfilter 2016-10-03 11:45:54 +02:00
Maximilian Hils
611dad12a7 Revert "Add API to programmatically create new requests (#1534)"
This reverts commit ccbdcd684b,
which yielded a test timeout.
2016-10-02 23:08:51 -07:00
Maximilian Hils
19abb54919 fix docs 2016-10-02 23:08:51 -07:00
Tyler St. Onge
ccbdcd684b Add API to programmatically create new requests (#1534) 2016-10-01 13:06:59 +02:00
Ryan Laughlin
fbf8567a79 Fix SSL error
This fixes an issue that occurs when a user supplies a custom SSL cert w/ intermediate certs that contradict the default certifi set of root certificates. In particular, this addressed an issue where the "COMODO RSA Certification Authority" cert in certifi is NOT trusted on OS X by default as of OS X 10.11.6. Even when the user manually supplied a different valid "COMODO RSA Certification Authority" cert in their custom SSL cert .pem file, that cert would be overridden by certifi's default cert.
2016-09-30 16:39:44 -04:00
Aldo Cortesi
05e2e55eb8 Merge pull request #1588 from cortesi/consolereplay
console: fix client replay
2016-09-30 12:35:41 +10:00
Aldo Cortesi
66825568d7 console: fix client replay 2016-09-30 12:13:49 +10:00
Aldo Cortesi
6d1f036021 Merge remote-tracking branch 'upstream/master' 2016-09-30 11:02:08 +10:00
Aldo Cortesi
825b0917bd docs: minor formatting/cleanups 2016-09-30 10:59:40 +10:00
Aldo Cortesi
e8aca92ef1 docs: remove auto-generated stubs
These are too verbose/low info for these docs. We should include pointers to
where to start reading the code, and perhaps later we can include full
auto-generated API docs separately.
2016-09-30 09:54:35 +10:00
Aldo Cortesi
7998c1ff86 docs: make sidebar headings more legible 2016-09-30 09:34:24 +10:00
Maximilian Hils
d068000f16 fix typo 2016-09-28 17:44:48 -07:00
Maximilian Hils
e0cd33b586 fix host header modification, refs #1571 2016-09-28 11:06:39 -07:00
Aldo Cortesi
070aa27cf5 parse_set_cookie header returns an empty list if no cookies are found
This matches parse_cookie, and is more idiomatic.
2016-09-28 15:10:31 +10:00
Aldo Cortesi
b21f076cc8 Merge branch 'multi-cookie' of https://github.com/dufferzafar/mitmproxy 2016-09-28 12:44:40 +10:00
Maximilian Hils
1ed0dbddbc Merge pull request #1571 from rofreg/server-sni-flag
Add command line arg to force specific SNI
2016-09-27 16:00:14 -07:00
Shadab Zafar
fba7fe101e Clarify that 'expires' values MUST have a comma now 2016-09-27 21:28:54 +05:30
Shadab Zafar
5383c15ff2 Add tests for comma separated Set-Cookies 2016-09-27 21:28:54 +05:30
Shadab Zafar
6e6ed35e3e Modify format_set_cookie_header to take cookie list
and return a comma separated string of cookies
2016-09-27 21:28:51 +05:30
Ryan Laughlin
ad6d675b20 In reverse proxy mode, always send SNI 2016-09-27 10:49:04 -04:00
Shadab Zafar
a104d65851 Fixup an error with indices 2016-09-27 16:44:09 +05:30
Shadab Zafar
e8ffc5167b Can't have , in the sticky cookie test
Since we support comma separated cookies now
2016-09-27 16:44:09 +05:30
Shadab Zafar
9ec0790271 Make needed changes in tests 2016-09-27 16:44:09 +05:30
Shadab Zafar
fd4f662871 Refactor functions 2016-09-27 16:44:09 +05:30
Shadab Zafar
06804e5448 Add a new pairs reader for SetCookie headers 2016-09-27 16:44:09 +05:30
Shadab Zafar
7802a0ba22 Rename _read_pairs to _read_cookie_pairs
We will have a separate _read_set_cookie_pairs
2016-09-27 16:44:09 +05:30
Shadab Zafar
90a48ccc06 Rename _read_token to _read_key
Since we also have a _read_value
2016-09-27 16:44:09 +05:30
Shadab Zafar
29046e6b48 Move CookieAttrs and SetCookie to top 2016-09-27 16:44:09 +05:30
Shadab Zafar
734a7d8a68 Minor refactor 2016-09-27 16:44:09 +05:30
Shadab Zafar
85bf5e18f6 Update cookie tests
This is needed since _read_pairs now returns a list of cookies each of which
is a list of [name, value] tuples.
2016-09-27 16:44:08 +05:30
Shadab Zafar
e80b2af4ae Add support for comma separated cookies 2016-09-27 16:44:08 +05:30
Thomas Kriechbaumer
160f158372 Merge pull request #1583 from mhils/patch-makesocket
allow socket creation monkeypatchs
2016-09-27 10:03:41 +02:00
Maximilian Hils
24ceb0f7ac allow socket creation monkeypatchs 2016-09-27 00:46:54 -07:00
Ryan Laughlin
e0f9aef89c Update reverse proxy host header docs 2016-09-26 22:30:01 -07:00
Maximilian Hils
1a762cdce5 override host header in reverse proxy mode, refs #1571 2016-09-26 22:30:01 -07:00
Maximilian Hils
ebccc103d8 Revert "minor fixes"
This reverts commit f94219e737.
2016-09-26 18:07:04 -07:00
Maximilian Hils
f94219e737 minor fixes 2016-09-26 17:53:10 -07:00
phackt
8021427ab9 Fixes - #1555 sslstrip.py flow.response.headers (#1556)
* Fixes - #1555 sslstrip.py flow.response.headers

* #1557 - add enhancements in inline script sslstrip.py with upgrade-insecure-requests stripping

* #1557 - update to match python style guide

* #1555, #1556, update to a bytes pattern
2016-09-25 19:29:26 -07:00
Maximilian Hils
afe6bf0309 fix #1221 (#1578) 2016-09-24 22:12:02 -07:00
Maximilian Hils
eeec17902f update dependencies, minor fixes (#1577) 2016-09-24 21:01:48 -07:00
Maximilian Hils
de65aebfdf fix tests 2016-09-24 18:28:30 -07:00
Maximilian Hils
6f86741574 minor fixes 2016-09-24 18:21:58 -07:00
Maximilian Hils
0a643ad20f remove option argument for addons.add (#1576) 2016-09-24 18:21:12 -07:00
Maximilian Hils
92dd030c22 minor cleanups 2016-09-24 16:34:20 -07:00
Maximilian Hils
20bcfbb5d0 fix #1492 2016-09-24 15:37:19 -07:00
Thomas Kriechbaumer
258958e073 Merge pull request #1574 from mhils/issue-1393
Fix #1393
2016-09-24 18:41:32 +02:00
Maximilian Hils
276b467b0e fix #1393 2016-09-23 22:52:58 -07:00
Maximilian Hils
9142da1a7d Merge pull request #1566 from mhils/issue-1546
add websocket on/off switch, improve logging (fix #1546, fix #1547)
2016-09-22 03:06:39 -07:00
Maximilian Hils
d585236a82 Merge pull request #1567 from mhils/issue-1467
Scripts: cut traceback properly, fix #1467
2016-09-22 03:06:11 -07:00
Maximilian Hils
77868434e7 fix tests 2016-09-22 02:10:02 -07:00
Maximilian Hils
2510cd3111 add websocket on/off switch, improve logging (fix #1546, fix #1547) 2016-09-22 02:10:02 -07:00
Maximilian Hils
a3329c5a80 scripts: cut traceback properly, fix #1467 2016-09-22 02:03:12 -07:00
Maximilian Hils
f59ae4a57f Merge branch 'fully_transparent' 2016-09-22 01:58:08 -07:00
Maximilian Hils
e5b79a6d72 minor cleanup 2016-09-22 01:58:01 -07:00
smill@cuckoo.sh
ec588f8822 Removed obsolete code. 2016-09-22 08:51:17 +00:00
smill@cuckoo.sh
ab546a7348 Introduced comment regarding socket manipulation through the server_conn stub. 2016-09-22 08:29:07 +00:00
smill@cuckoo.sh
3962a11575 Commented on IP_TRANSPARENT and changed an exception type. 2016-09-22 08:15:34 +00:00
Maximilian Hils
0dbb7033ee ci: enable verbose test logging by default 2016-09-21 22:42:01 -07:00
Maximilian Hils
dbc6344c8c Merge pull request #1522 from chhsiao90/dump-ready-#1505
Notify when proxy server started
2016-09-21 22:26:59 -07:00
chhsiao90
d044786ac8 Notify when proxy server started 2016-09-22 13:23:30 +08:00
Maximilian Hils
e4ae35dabb fix mitmdump error logging, fix #1549 (#1565)
This commit replaces the logging statement introduced in
afe34e8b28 with the previous implementation
where an exception is raised. ProtocolExceptions are normally logged as regular warnings,
achieving the same effect for the end user. However, this retains the full stack trace
for debug-level logging, which makes the analysis of client errors considerably easier.
2016-09-21 21:49:32 -07:00
Maximilian Hils
9e0b935fa2 Merge pull request #1564 from mhils/issue-1554
Fix Response.make content-length header
2016-09-21 21:49:14 -07:00
Maximilian Hils
d5427c7298 Merge pull request #1563 from mhils/fix-1562
Raise TypeError on invalid header assignment, fix #1562
2016-09-21 21:00:07 -07:00
Maximilian Hils
f1d519d7c4 fix pathod http2 response creation 2016-09-21 20:36:26 -07:00
Maximilian Hils
0b532789a0 fix Response.make content-length header 2016-09-21 20:34:01 -07:00
Maximilian Hils
770936f1f9 raise TypeError on invalid header assignment, fix #1562 2016-09-21 19:21:32 -07:00
Maximilian Hils
1e5a5b03f8 Merge pull request #1509 from arjun23496/regex_star_mod
Fixes #1471 - Change .* to match entire body
2016-09-21 18:13:14 -07:00
Thomas Kriechbaumer
7d4ce1da98 Merge pull request #1559 from dwfreed/patch-1
console/options: kill -> replay_kill_extra
2016-09-18 12:49:00 +02:00
Doug Freed
3130d58267 console/options: kill -> replay_kill_extra
@cortesi renamed the kill option to replay_kill_extra in b0213a2, but
missed a usage here because it was in a string. This fixes opening the
options menu in console.
2016-09-17 20:10:08 -04:00
Thomas Kriechbaumer
d5c7f78b24 Merge pull request #1558 from vulnminer/patch-1
Update app.py
2016-09-17 18:36:41 +02:00
vulnminer
e1f021d732 Update app.py 2016-09-17 18:45:37 +03:00
smill
2d4e4eafe1 Fixed restructuredText error. 2016-09-15 18:54:55 +00:00
smill
7cd8456445 Added a description to the shim loader, and renamed it. 2016-09-14 19:25:53 +00:00
smill
83a28021ad Fixed travis-ci issues. 2016-09-14 19:11:57 +00:00
smill
9429f1bc7b Prevent crash in case of a connection timeout. 2016-09-14 19:10:13 +00:00
Aldo Cortesi
f17c0fdac6 Merge pull request #1552 from cortesi/creplay
revamp client replay
2016-09-12 12:29:58 +12:00
Aldo Cortesi
f2e010ebc0 Misc cleanups 2016-09-12 11:27:30 +12:00
Thomas Kriechbaumer
7ecc966d51 Merge pull request #1553 from Kriechi/bump
bump brotlipy
2016-09-11 17:14:03 +02:00
Thomas Kriechbaumer
0166f90cbe bump brotlipy 2016-09-11 16:28:07 +02:00
Aldo Cortesi
97b15b58b7 console: update flow list when state is modified 2016-09-11 20:06:21 +12:00
Aldo Cortesi
34e17efaa0 Remove obsolete exceptions.ScriptException 2016-09-11 20:02:05 +12:00
Aldo Cortesi
cfb943bfdd Redesign client replay
- Move to an addon
- Use a much simpler synchronisation mechanism
2016-09-11 20:00:34 +12:00
Aldo Cortesi
c3f07f354f Merge pull request #1551 from cortesi/sreplay
console: fix/improve server replay
2016-09-11 17:48:30 +12:00
Aldo Cortesi
6427176cf1 console: fix/improve server replay
- Fix "S" shortcut in list view
- Consolidate replay from file in global R shortcut
- Fix help
2016-09-11 15:37:11 +12:00
Aldo Cortesi
734d177007 Merge pull request #1550 from cortesi/script
Add "run_once" support to the script addon, use it in mitmproxy
2016-09-11 13:43:20 +12:00
Aldo Cortesi
6b9221ffeb Add "run_once" support to the script addon, use it in mitmproxy
Fixes #1418
2016-09-11 13:22:01 +12:00
Aldo Cortesi
387e91f9a6 Merge pull request #1548 from cortesi/opts
Make various replay-related options clearer
2016-09-10 12:39:21 +12:00
Aldo Cortesi
9b814ca067 options.replay_ignore* -> options.server_replay_ignore* 2016-09-10 10:21:52 +12:00
Aldo Cortesi
8677e91074 options.nopop -> options.server_replay_nopop 2016-09-10 10:09:07 +12:00
Aldo Cortesi
5ebe8c1bc8 options.rheaders -> options.server_replay_use_headers 2016-09-10 10:09:07 +12:00
Aldo Cortesi
b0213a2c0e options.kill -> options.replay_kill_extra 2016-09-10 10:09:07 +12:00
Aldo Cortesi
01cdaf4133 Merge pull request #1545 from cortesi/tsync
Roll out synchronisation for mitmproxy tests
2016-09-10 10:07:11 +12:00
Aldo Cortesi
4ff8a72521 Roll out synchronisation for mitmproxy tests
This extends some of the work I did for pathod and netlib to the mitmproxy test
suite. It also fixes what may be a leak in replays.

Failing on connection leak is disabled on Windows for the moment.

Fixes #1535
2016-09-10 09:18:11 +12:00
arjun23496
2e1265f75e Changed filter to match replacement for DOTALL 2016-09-09 10:46:16 +05:30
arjun23496
f6ed06bf16 Convert to flags=value for future compatibility 2016-09-09 10:39:28 +05:30
arjun23496
79bbc41cb4 Fixes #1471 - Change .* to match entire body 2016-09-09 10:39:28 +05:30
Aldo Cortesi
9c54432253 Merge pull request #1542 from cortesi/replayconsole
Fix server replay in mitmproxy console
2016-09-09 13:24:18 +12:00
Aldo Cortesi
c1bb582129 Fix interactive server replay in mitmproxy console 2016-09-09 11:15:07 +12:00
Aldo Cortesi
715e47e3d4 Extend addons.Addons with a get method that retrieves an addon by name 2016-09-09 10:31:34 +12:00
Aldo Cortesi
d4f291a8ad Fix immediate server replay-related crash in mitmproxy 2016-09-09 10:03:36 +12:00
Aldo Cortesi
ea49b8a2e2 Merge pull request #1532 from cortesi/playback
Playback and fix construct breakage
2016-09-07 12:59:11 +12:00
Aldo Cortesi
6c970cfd4c Fix byte/string comparison error in server playback 2016-09-07 12:11:10 +12:00
Thomas Kriechbaumer
7841d73cb2 Merge pull request #1531 from Schamper/encoding-patch
Fix decoding when content-encoding: none
2016-09-06 20:29:59 +02:00
Schamper
5728a1c900 Make 'none' synonymous to 'identity' 2016-09-06 17:00:08 +02:00
Aldo Cortesi
9abdd3a8d9 Move server playback in to an addon
- Move server playback into an addon
- Implement a better sync strategy to decide when to exit if keepserving is
off. We now wait for the final flow played back to no longer be live.
- Leave interactive server playback in mitmproxy console broken for now - there
are broader addon-related changes that need to be made for that, and this patch
is already big.

Fixes #1229
2016-09-06 23:48:02 +12:00
Schamper
85e1539d0a Add test 2016-09-06 11:07:50 +02:00
Schamper
c16417248c Also fix for encoding 2016-09-06 10:37:24 +02:00
Schamper
8702c9357d Fix decoding when content-encoding: none 2016-09-06 10:24:36 +02:00
smill
fad6ee6437 Improved the documentation. 2016-09-05 14:19:08 +00:00
smill
2ecd89fc51 Made it possible to modify the server_conn.connection attribute,
using the serverconnect stub.
2016-09-05 10:49:39 +00:00
Aldo Cortesi
c76d83f749 Merge pull request #1515 from Kriechi/bump-brotli
bump brotli dependency
2016-09-05 10:15:23 +12:00
Thomas Kriechbaumer
c0b12da401 change test value 2016-09-04 09:31:45 +02:00
Thomas Kriechbaumer
4c7f99d2be improve netlib.encoding 2016-09-04 09:31:44 +02:00
Thomas Kriechbaumer
09d60b2fa3 bump brotli dependency 2016-09-04 09:31:44 +02:00
smill
e278ce6455 Removed a mistakenly inserted newline character. 2016-09-04 01:35:03 +00:00
smill
fbfedbdc8f Improved error-handling / supplemented documention. 2016-09-04 01:30:27 +00:00
Aldo Cortesi
0483486c62 Merge pull request #1523 from Kriechi/http2
improve error handling in http2
2016-09-04 11:02:48 +12:00
Thomas Kriechbaumer
3da9e37d9e http2: improve connection lost 2016-09-03 16:56:21 +02:00
smill
377921fa99 Introduced some minor improvements to the shim loader. 2016-09-03 13:34:17 +00:00
smill
a6e0c7e8f0 Introduced the capability to spoof the source address
of outgoing sessions + an accompanying shim loader.
2016-09-03 12:22:09 +00:00
Thomas Kriechbaumer
d895d6caf0 improve CI 2016-09-03 13:48:28 +02:00
Thomas Kriechbaumer
e273a29a8c http2: improve kill and cleanup threads 2016-09-03 13:46:54 +02:00
Thomas Kriechbaumer
69b770469e http2: assemble connect-request from object 2016-09-03 12:31:35 +02:00
Thomas Kriechbaumer
ea2a51d3be http2: fixes 2016-09-03 11:50:37 +02:00
Thomas Kriechbaumer
5dda9505b6 http2: improve framereader 2016-09-03 10:00:31 +02:00
Thomas Kriechbaumer
043180a8fa http2: improve closed connection handling 2016-09-03 10:00:31 +02:00
Thomas Kriechbaumer
9b5acc19e2 http2: improve zombie exception handling 2016-09-03 10:00:31 +02:00
Thomas Kriechbaumer
0badb3ec91 cleanup 2016-09-03 10:00:31 +02:00
Aldo Cortesi
b476966a45 Merge pull request #1513 from Kriechi/bump-dep
cryptography 1.5
2016-09-03 11:08:53 +12:00
Aldo Cortesi
46143ba004 Merge pull request #1482 from Kriechi/improve-docs
update docs: how mitmproxy works
2016-09-03 09:59:54 +12:00
Thomas Kriechbaumer
cf53a93c4c cleanup travis 2016-09-01 13:37:40 +02:00
Thomas Kriechbaumer
76854b7770 cryptography 1.5 2016-09-01 13:37:40 +02:00
Thomas Kriechbaumer
55d938b880 Merge pull request #1488 from mitmproxy/websockets
add WebSockets support
2016-09-01 10:39:57 +02:00
Thomas Kriechbaumer
0d0c2c788d cleanup tests 2016-09-01 10:12:13 +02:00
Thomas Kriechbaumer
823d8a5da8 add docs for websocket_handshake hook 2016-09-01 09:57:36 +02:00
Thomas Kriechbaumer
cd3d30633f websockets: update protocol detection 2016-09-01 09:57:35 +02:00
Thomas Kriechbaumer
e5b0dae7e9 add websockets support to mitmproxy 2016-09-01 09:57:18 +02:00
Thomas Kriechbaumer
d12515f84b websockets: refactor implementation and add tests 2016-09-01 09:56:14 +02:00
Thomas Kriechbaumer
281d779fa3 Merge pull request #1517 from cortesi/httperrs
Improve the way we handle upstream errors
2016-09-01 09:55:51 +02:00
Aldo Cortesi
afe34e8b28 Improve the way we handle upstream errors
- Don't log a traceback for either HTTP or HTTPS DNS resolution or TCP
connection errors. These are "ordinary" errors, not mitmproxy issues.
- Ensure that the error handler is correctly called for SSL-related protocol
errors.
2016-09-01 12:32:09 +12:00
Aldo Cortesi
9306e80e65 Adjust flowbasic example for Options API changes 2016-09-01 12:11:00 +12:00
Thomas Kriechbaumer
b4b2e5fd34 Merge pull request #1511 from arjun23496/count_in_replace
Fixes #1495 - Added count argument for replacing contents in body
2016-08-31 13:49:03 +02:00
arjun23496
a8deed1f4e Lint fix - minor 2016-08-31 16:39:04 +05:30
arjun23496
2476809ff8 Lint fix - replace tests 2016-08-31 16:27:22 +05:30
arjun23496
e5766550f1 Lint fix - netlib headers 2016-08-31 16:22:20 +05:30
arjun23496
dd2e0d1df3 minor bug fix header replace 2016-08-31 16:11:59 +05:30
arjun23496
d2cfa5ca41 Added tests for replace in request,message,header 2016-08-31 10:23:33 +05:30
arjun23496
b3f0596652 Minor bug fix - messages.py replace 2016-08-29 16:57:20 +05:30
arjun23496
99744cc780 Added replace for request and headers - Fixed missing replace option 2016-08-29 16:50:14 +05:30
arjun23496
70f94c7171 Added count argument for replace for contents in body 2016-08-26 21:26:38 +05:30
Thomas Kriechbaumer
6afbfc8526 Merge pull request #1493 from dufferzafar/long-urls
Truncate URLs in console
2016-08-26 16:44:44 +02:00
Thomas Kriechbaumer
af0a58256a Merge pull request #1510 from mkagenius/dividebyzero
fixed #1501 : Divide by zero error came when string was empty, also a test
2016-08-26 10:54:08 +02:00
Manish Kumar
2cf4efab07 fixing lint error 2016-08-26 14:22:02 +05:30
Manish Kumar
16401d5be8 fixed : Divide by zero error came when string was empty, also a test 2016-08-26 12:52:51 +05:30
Thomas Kriechbaumer
51771c01c6 allow test classes to dynamically specify ssl context 2016-08-24 09:19:42 +02:00
Thomas Kriechbaumer
bee7d368dd refactor http 2016-08-24 09:19:35 +02:00
Thomas Kriechbaumer
87b5312bd5 ignore all coverage temp files 2016-08-24 09:19:22 +02:00
Thomas Kriechbaumer
ec370fbc02 wrap long lines 2016-08-24 09:19:09 +02:00
Thomas Kriechbaumer
72811e20e0 bump h2 dependency
This fixes a bug with empty HEAD responses:
https://github.com/python-hyper/hyper-h2/issues/255
2016-08-24 09:09:34 +02:00
Maximilian Hils
8926becf92 fix #1504 2016-08-23 23:25:27 -07:00
Maximilian Hils
06c499f76e Merge pull request #1500 from mhils/simple-response-creation
Introduce Response.make for simple response creation
2016-08-23 00:39:30 -07:00
Maximilian Hils
f27028f58e introduce Response.make for simple response creation 2016-08-23 00:17:06 -07:00
Shadab Zafar
2e48f9c345 Show full URL in flowview 2016-08-23 12:44:39 +05:30
Shadab Zafar
7b5d5d3a54 Use unicode elipsis & make extra params a part of dict 2016-08-23 12:43:45 +05:30
Maximilian Hils
798ce96bd0 remove redundant property 2016-08-22 21:01:24 -07:00
Maximilian Hils
53ccbaf4f5 Merge pull request #1489 from mitmproxy/web_refactor
Web refactor
2016-08-22 20:52:03 -07:00
Clemens
eddc424379 fix dropdown css, add new selection after delete 2016-08-22 08:57:55 +02:00
Maximilian Hils
62ab2f2fd5 Merge pull request #1490 from mitmproxy/web_write_tests
[web] add tests
2016-08-21 00:25:47 -07:00
Shadab Zafar
41e4526a33 Use terminal width rather than a constant 2016-08-20 16:01:01 +05:30
Shadab Zafar
22283dd373 Truncate URLs in console 2016-08-20 16:00:50 +05:30
Clemens
bbe6556bfc added tests 2016-08-19 14:12:32 +02:00
Clemens
d0b420f383 fix refactoring bug 2016-08-19 09:58:29 +02:00
Clemens
d4b18eae81 refactoring 2016-08-19 09:23:41 +02:00
Clemens
9a86750e9d add static files 2016-08-18 18:48:18 +02:00
Clemens
66e9db3713 refactor contentviews, dropdown, filemenu and footer 2016-08-18 18:05:38 +02:00
Clemens
a416732665 refactor dropdown menu, view selector 2016-08-18 16:44:49 +02:00
Maximilian Hils
cacee3871c Merge pull request #1486 from dufferzafar/mouse-drag-text
Better status message on mouse drag
2016-08-17 12:03:49 -07:00
Shadab Zafar
ed88bcad72 Better status message on mouse drag 2016-08-18 00:24:52 +05:30
Clemens
0f4eb24a8d fix viewselector bug 2016-08-17 12:19:04 +02:00
Clemens
cc838f6c28 refactor codeeditor 2016-08-17 12:12:32 +02:00
Clemens
2236ed4ba5 fix deselection on delete, fix toggleInputButton props 2016-08-17 11:07:56 +02:00
Thomas Kriechbaumer
9671fd8d62 update docs: introduction 2016-08-17 05:13:49 +02:00
Maximilian Hils
f922b7aaf5 Merge pull request #1484 from mitmproxy/fix-1476
fix #1476
2016-08-16 13:18:54 -07:00
Clemens
dbec2e0940 refactor flow menu 2016-08-16 13:17:37 +02:00
Clemens
779e5e84e3 refactor file up and download 2016-08-16 12:37:35 +02:00
Clemens
57fafd3281 refactor header_options 2016-08-16 11:57:12 +02:00
Thomas Kriechbaumer
eb83107e1c reenable options test 2016-08-16 11:05:57 +02:00
Thomas Kriechbaumer
cd35a6ff47 add regression test for #1476 2016-08-16 11:05:57 +02:00
Thomas Kriechbaumer
516e64a8fa fix #1476 2016-08-16 10:40:46 +02:00
Thomas Kriechbaumer
bfe22e739c Merge pull request #1481 from Kriechi/http2-simplify-zombies
http2: simplify zombie detection
2016-08-16 10:10:39 +02:00
Thomas Kriechbaumer
8ade51d4b4 fix style 2016-08-16 10:09:05 +02:00
Thomas Kriechbaumer
17c65e46cb Merge pull request #1480 from mhils/reverse-proxy-auth
Add basic auth support for reverse proxy mode
2016-08-16 10:07:59 +02:00
Maximilian Hils
f9f0ac848e Merge pull request #1483 from gzzhanghao/history
[web] Use history object instead of react-router
2016-08-15 23:13:57 -07:00
Jason
81b726bab1 [web] bug fix 2016-08-16 00:27:57 +08:00
Jason
900b3d74ba [web] fix testRegex 2016-08-15 23:14:29 +08:00
Jason
1d27334ff7 [web] remove react-router 2016-08-15 23:09:45 +08:00
Thomas Kriechbaumer
709ed0c0be update docs: how mitmproxy works 2016-08-15 13:08:10 +02:00
Thomas Kriechbaumer
2419ab153d Merge pull request #1464 from dufferzafar/har
HAR
2016-08-15 12:49:28 +02:00
Shadab Zafar
239eaf0078 Remove timezone specific value 2016-08-15 15:05:32 +05:30
Shadab Zafar
bc175b58f2 Use test times less than 2038
So that tests pass on 32bit systems too
2016-08-15 12:00:23 +05:30
Shadab Zafar
ec0bae35c5 Assert cookie groups explicitly rather than just the length 2016-08-15 12:00:23 +05:30
Shadab Zafar
b9426fcec1 Add a test for base64 encoding 2016-08-15 12:00:23 +05:30
Shadab Zafar
bf4425de80 Fix issue with binary content in json 2016-08-15 12:00:23 +05:30
Shadab Zafar
4f1fb43dcc Use postData field in PUT, PATCH requests too
The HAR spec isn't really clear on whether this should be the case,
but Google Chrome does this, so I think we should too.
2016-08-15 12:00:23 +05:30
Shadab Zafar
15c488225f Refactor format_cookies 2016-08-15 12:00:23 +05:30
Shadab Zafar
988174246b Add some cookie formatting related tests 2016-08-15 12:00:23 +05:30
Shadab Zafar
567cbe6cb9 Support .zhar compression 2016-08-15 12:00:23 +05:30
Shadab Zafar
ac97e5efa1 Add text field to response content 2016-08-15 12:00:23 +05:30
Shadab Zafar
9aa230707d Add serverIPAddress field 2016-08-15 12:00:23 +05:30
Shadab Zafar
7de48fc197 Add postData field 2016-08-15 12:00:23 +05:30
Shadab Zafar
b14eb57db1 Add SSL & Connect timings 2016-08-15 12:00:23 +05:30
Shadab Zafar
23b9ef799e Add a ctx.log on finish 2016-08-15 12:00:23 +05:30
Shadab Zafar
456f80d862 Open JSON file in text mode 2016-08-15 12:00:23 +05:30
Shadab Zafar
2c9240fd22 Simplify name_value 2016-08-15 12:00:23 +05:30
Shadab Zafar
e9c6563367 Fix wrong import 2016-08-15 12:00:23 +05:30
Shadab Zafar
a2a8283fa4 Improve cookies formatting 2016-08-15 12:00:23 +05:30
Shadab Zafar
3caebe7e73 Simplify cookies.is_expired 2016-08-15 12:00:23 +05:30
Shadab Zafar
03e6117042 Add a function to get cookie expiration time 2016-08-15 12:00:23 +05:30
Shadab Zafar
55f1ffe0b1 Format Cookies according to the HAR Spec 2016-08-15 12:00:23 +05:30
Shadab Zafar
a479c51465 Add method to group pairs by cookies 2016-08-15 12:00:23 +05:30
Shadab Zafar
99b32094d8 Add simple har_dump test 2016-08-15 12:00:23 +05:30
Shadab Zafar
a0932af55c Remove pages object
The HAR Spec says that the field can be left out by applications that don't
group by pages.

http://www.softwareishard.com/blog/har-12-spec/#log
2016-08-15 12:00:23 +05:30
Shadab Zafar
2cabc65f62 Remove harparser dependency 2016-08-15 12:00:23 +05:30
Shadab Zafar
250e4a17d0 Welcome har_dump 2016-08-15 12:00:23 +05:30
Shadab Zafar
8ba34be7ab Goodbye har_extractor 2016-08-15 12:00:23 +05:30
Thomas Kriechbaumer
8f4baf42ea http2: cleanup 2016-08-14 13:06:33 +02:00
Thomas Kriechbaumer
0cc695407d http2: simplify zombie detection 2016-08-14 12:43:56 +02:00
Thomas Kriechbaumer
65677bdd28 style fixes 2016-08-14 12:43:18 +02:00
Maximilian Hils
a9401472cd add basic auth support for reverse proxy mode 2016-08-13 11:04:53 -07:00
Maximilian Hils
b39c6e0883 Merge pull request #1441 from mitmproxy/integrate_mitmproxy_contentviews
Integrate mitmproxy contentviews
2016-08-13 10:27:53 -07:00
Maximilian Hils
9da55e2047 Merge pull request #1479 from Kriechi/fix-1430
fix #1430
2016-08-13 08:17:50 -07:00
Thomas Kriechbaumer
0c3f2a3806 fix #1430 2016-08-13 16:56:05 +02:00
Maximilian Hils
a0391db1ae update dependencies (#1478) 2016-08-11 16:51:39 -07:00
Maximilian Hils
346a702589 fix lxml binary link 2016-08-10 19:37:04 -07:00
Maximilian Hils
ea2f23feff Merge pull request #1474 from mhils/reply-fix
Improve controller.Reply semantics
2016-08-10 02:22:39 -07:00
Clemens
8b43972b95 move content to redux, add lines to view 2016-08-10 10:49:27 +02:00
Maximilian Hils
4f5e312fbc allow tox workdir reconfiguration for ubuntu on windows 2016-08-09 22:29:48 -07:00
Maximilian Hils
5a22496ee8 clean up code, improve DummyReply 2016-08-09 22:29:07 -07:00
Maximilian Hils
818840f553 finalize Reply semantics, fix tests 2016-08-09 20:26:24 -07:00
Maximilian Hils
f719644aa1 make Reply.state readonly 2016-08-09 17:23:30 -07:00
Clemens
6397c4d02f fix css bug 2016-08-09 20:45:36 +02:00
Clemens
b27e456ce2 merge with master 2016-08-09 19:49:36 +02:00
Clemens
78bd99f97c little changes in css 2016-08-09 16:15:45 +02:00
Clemens
adfdcc9391 added hints from mhils 2016-08-09 08:40:24 +02:00
Maximilian Hils
0ee1b40c17 improve reply semantics 2016-08-08 19:20:06 -07:00
Clemens
ab322f0be4 add sticky footer contentview 2016-08-06 09:09:45 +02:00
Clemens
9b0b007a5d change some style 2016-08-05 12:47:34 +02:00
Maximilian Hils
a52a1df23c fix reply concurrency 2016-08-04 17:03:27 -07:00
Maximilian Hils
dcfa7027ae fix tests 2016-08-04 15:39:48 -07:00
Maximilian Hils
f89455fd07 minor improvements 2016-08-04 15:23:44 -07:00
Maximilian Hils
951885a5dd simplify contentview logic 2016-08-04 15:23:44 -07:00
Clemens
a8aa1f2d1c fix get contentview in mitmweb 2016-08-04 09:34:36 +02:00
Clemens
fd7b6b958e litte style changes 2016-08-03 15:40:23 +02:00
Clemens
e036bc9304 integrate simplified contentviews 2016-08-03 12:17:19 +02:00
Clemens
34fe391afb add view all button, add dropdown for contentviews 2016-08-03 12:08:10 +02:00
Maximilian Hils
3aa2d59f62 Update install.rst 2016-08-02 23:20:58 -07:00
Maximilian Hils
4ff9dba7d2 fix #1465, fix ssl_insecure 2016-08-02 20:08:04 -07:00
Maximilian Hils
49ce50d5d0 Revert "Add missing ssl_insecure option"
This reverts commit 1d33d76bfd.
2016-08-02 19:08:20 -07:00
Thomas Kriechbaumer
2199ed1d9c Merge pull request #1463 from dufferzafar/options-hotfix
Add missing ssl_insecure option
2016-08-02 13:11:08 +02:00
Shadab Zafar
1d33d76bfd Add missing ssl_insecure option 2016-08-02 15:58:40 +05:30
Thomas Kriechbaumer
8136a2f6f3 Merge pull request #1457 from mkagenius/interger_division
integer division for python 3 compatibility
2016-08-01 21:12:33 +02:00
Clemens
bcc496527e replace get_content_view in dumper and flowview 2016-08-01 15:21:00 +02:00
Manish Kumar
8701705504 integer division for python 3 compatibility 2016-08-01 15:37:26 +05:30
Maximilian Hils
7ea9726e5d Merge pull request #1453 from dufferzafar/limit-to-filter
Rename "Limit" feature to "Filter View"
2016-07-31 23:13:31 -07:00
Aldo Cortesi
ca0eab0f05 Merge pull request #1447 from mitmproxy/secure-by-default
Verify upstream certificates by default
2016-08-01 14:44:16 +12:00
Shadab Zafar
10ad56c853 Rename "Limit" feature to "Filter View" 2016-07-31 16:54:09 +05:30
Maximilian Hils
ca2e338876 Merge pull request #1449 from mhils/fix-1448
Add escape_single_quotes=False arg to bytes_to_escaped_str
2016-07-30 15:56:55 -07:00
Maximilian Hils
f008bdf590 Merge pull request #1451 from YanchWare/master
Integrated encode/decoder for brotli
2016-07-30 15:56:15 -07:00
Maximilian Hils
47f0c21417 Merge pull request #1450 from vhaupert/master
Fix platform import, substitute "~" with user's home
2016-07-30 13:50:08 -07:00
Angelo Agatino Nicolosi
6792ec4058 Integrated encode/decoder for brotli 2016-07-30 14:43:53 +02:00
Vincent Haupert
07f77f0866 Substitute tilde with user's home.
When downloding the mitmproxy certificate using mitm.it, '~' currently
is not expanded causing a FileNotFoundException. This patch uses
expanduser() to replace the initial tilde with the user's home.
2016-07-30 12:49:00 +02:00
Vincent Haupert
73b7da1a03 Fix platform import on Linux using python3
Using python3, sys.platform returns "linux" instead of "linux2" using
python2. This patch accepts "linux" as well as "linux2".
2016-07-30 12:42:33 +02:00
Maximilian Hils
4534363671 add escape_single_quotes=False arg to bytes_to_escaped_str 2016-07-29 19:54:44 -07:00
Maximilian Hils
63f64cd660 minor fixes 2016-07-29 19:07:48 -07:00
Maximilian Hils
3b71c19af3 clean up release tool, build linux binaries 2016-07-29 18:37:37 -07:00
Clemens
cb7da1ee44 moved getlines to contentviews 2016-07-29 15:37:41 +02:00
Clemens
a56c2ca731 combine clientside and serverside contentviews 2016-07-29 09:45:15 +02:00
Maximilian Hils
e800f321af Merge pull request #1436 from dufferzafar/jsbeautifier
Use jsbeautifier from pip
2016-07-28 15:37:06 -07:00
Clemens
2807329fb2 add image to mitmproxy.contentview.image 2016-07-28 17:28:05 +02:00
Clemens
ad5bebeda0 mitmproxy.contentviews added 2016-07-28 17:10:06 +02:00
dufferzafar
1cffa5f46b Use replace while decoding 2016-07-28 07:48:10 -07:00
dufferzafar
56d04b5740 Set upper bound on jsbeautifier package to 1.7 2016-07-28 07:41:54 -07:00
Maximilian Hils
f54b302a59 fix cert verification tests, remove leftovers 2016-07-27 22:44:06 -07:00
Maximilian Hils
8b325fd65a improve invalid certificate ux 2016-07-27 21:01:28 -07:00
Maximilian Hils
83102b853f minor fixes 2016-07-27 19:38:36 -07:00
Sachin Kelkar
17fdb841f0 verify upstream certificates by default (#1111)
squashed and merged by @mhils
2016-07-27 17:57:38 -07:00
Aldo Cortesi
3636ed7d41 Merge pull request #1446 from cortesi/state
console: add replace_view_state, fix statusbar issues
2016-07-28 11:18:20 +12:00
Aldo Cortesi
d6e4ef4ced console: add replace_view_state, fix statusbar issues
Fixes #1394
2016-07-28 11:01:32 +12:00
Aldo Cortesi
75ab006ca9 Merge pull request #1442 from cortesi/scripts
mitmdump: send script .done when terminating after flow read
2016-07-28 10:22:30 +12:00
Maximilian Hils
3aad011988 Merge pull request #1406 from gzzhanghao/fix36
[web] Update view with sortedUpdate
2016-07-27 14:55:08 -07:00
Aldo Cortesi
297cf5d565 mitmdump: send script .done when terminating after flow read
Fixes #1439
2016-07-28 09:35:25 +12:00
Clemens Brunner
41383b866e add favicon to mitmweb (#1440) 2016-07-27 11:20:36 -07:00
Clemens
3e6c284757 add contentviews to client 2016-07-27 17:27:01 +02:00
dufferzafar
583827ad3f Use strutils.native before sending data to jsbeautifier 2016-07-27 04:34:51 -07:00
dufferzafar
821413349e Re-order imports etc. 2016-07-27 04:34:51 -07:00
dufferzafar
21e6ecb47d Remove jsbeautifier files 2016-07-27 04:34:51 -07:00
dufferzafar
4ce2420545 Make contentview requirements mandatory 2016-07-27 04:34:51 -07:00
dufferzafar
303b6df447 Use jsbeautifier from pip 2016-07-27 04:33:16 -07:00
Clemens
2c3ddb0ecc add parameter to content requests 2016-07-27 10:21:06 +02:00
Clemens
d8a78d9f52 add contentviews to settings 2016-07-27 09:45:46 +02:00
Jason
2b9e5dcd1b [web] change test files 2016-07-27 00:39:01 +08:00
Maximilian Hils
d97fe767dc update dependencies (#1435) 2016-07-25 21:52:34 -07:00
Maximilian Hils
2c11cbeedb restrict accepted lxml versions to fix builds 2016-07-25 19:40:07 -07:00
Maximilian Hils
705d042629 fix #1432 2016-07-25 19:37:47 -07:00
Aldo Cortesi
38b43cc9f9 Merge pull request #1428 from dufferzafar/replay
Consolidate replay under R
2016-07-26 13:53:44 +12:00
Aldo Cortesi
db22e72103 Merge pull request #1427 from mhils/grideditor
Refactor GridEditor
2016-07-26 13:38:04 +12:00
Maximilian Hils
817b675c52 Merge branch 'flow_editing_v2' 2016-07-25 17:51:38 -07:00
Maximilian Hils
3ebb58f641 add up/download button to ContentTooLarge view 2016-07-25 17:50:59 -07:00
Maximilian Hils
03a596d1d9 simplify stop edit 2016-07-25 17:45:42 -07:00
Maximilian Hils
67bfc1df14 fix flow edit 2016-07-25 17:31:37 -07:00
Maximilian Hils
aee693a5c0 Merge remote-tracking branch 'jason/style' into flow_editing_v2 2016-07-25 17:13:00 -07:00
Maximilian Hils
e1587b2bc1 make empty buttons editable 2016-07-25 17:12:39 -07:00
Maximilian Hils
70dbd1b32d web: refactor ContentLoader 2016-07-25 17:03:50 -07:00
Maximilian Hils
79ebcb046e Merge remote-tracking branch 'origin/master' into flow_editing_v2 2016-07-25 15:16:16 -07:00
Maximilian Hils
3254595584 minor fixes 2016-07-25 15:12:20 -07:00
Maximilian Hils
ffe6593361 make sure to escape errors printed to the console 2016-07-25 14:37:19 -07:00
Jason
7b51f12813 [web] bug fix and add test 2016-07-26 02:09:54 +08:00
Clemens
68e437a740 rewrite getDiff 2016-07-25 17:33:36 +02:00
Clemens
1ea094e9dc remove auto change to raw mode on edit 2016-07-25 15:47:05 +02:00
Clemens
ca4541613c combine content with header updates 2016-07-25 14:34:00 +02:00
Clemens
61ef7ca91b added contentHash 2016-07-25 10:56:12 +02:00
Clemens
0aedea6e60 remove lastFileUpload field 2016-07-25 09:05:24 +02:00
Shadab Zafar
f164181f2e Consolidate replay under R 2016-07-25 10:19:34 +05:30
Maximilian Hils
2d985e964c py2: silence abc metaclass warnings 2016-07-24 21:17:41 -07:00
Maximilian Hils
480ae46b88 refactor grideditor for py3 compatibility 2016-07-24 21:17:41 -07:00
Maximilian Hils
56796aeda2 Merge pull request #1426 from mhils/query-encoding
Fix query/path_components encoding
2016-07-24 21:17:35 -07:00
Maximilian Hils
f9edffc58e silence test warnings 2016-07-24 20:13:18 -07:00
Maximilian Hils
013288f7ca add quote/unquote tests 2016-07-24 19:38:44 -07:00
Maximilian Hils
a682074e9e improve query/path_components getter/setter 2016-07-24 19:38:44 -07:00
Maximilian Hils
c1bd4dabc8 Merge pull request #1425 from dufferzafar/clear-hotfix
Fix clearing of flows
2016-07-24 18:39:44 -07:00
Shadab Zafar
b99da24529 Fix clearing of flows
Fixes #1424
2016-07-25 07:08:03 +05:30
Maximilian Hils
ec6934d339 console: fix options signal 2016-07-24 11:15:28 -07:00
Maximilian Hils
e9eee5a6da Merge pull request #1423 from dufferzafar/fix-search
Fix console search on Python 3
2016-07-24 09:53:18 -07:00
Shadab Zafar
71b6b84f29 Fix console search on Python 3 2016-07-24 22:21:04 +05:30
Maximilian Hils
c5f3bb83f6 fix keyboard navigation 2016-07-24 09:43:29 -07:00
Jason
0a4bb394da [web] style improvement 2016-07-24 18:34:06 +08:00
Jason
3a3305b9ac [web] fix: Flow update changes list order #36 2016-07-24 18:25:09 +08:00
Maximilian Hils
a3fa9e14ae Merge pull request #1421 from mhils/encoding-cache
Add Encoding Cache, Remove HTTP Message Content Cache
2016-07-23 23:33:38 -07:00
Maximilian Hils
e07f515a20 remove content caching in netlib.http.Message 2016-07-23 19:05:10 -07:00
Maximilian Hils
d6209fa03b add tests for single-element cache 2016-07-23 19:04:57 -07:00
Maximilian Hils
e920c101e5 add single-element cache for netlib.encoding 2016-07-23 18:49:01 -07:00
Maximilian Hils
4d042ec543 fix #1373, fix #1154 (#1420) 2016-07-23 18:48:54 -07:00
Maximilian Hils
a87d089561 Merge pull request #1380 from dufferzafar/marked-filter
Marked property and filter
2016-07-23 17:55:12 -07:00
Maximilian Hils
ea718df111 Merge pull request #1416 from mhils/issue-1396
fix #1396, fix #1205, fix #1374
2016-07-23 15:37:23 -07:00
Maximilian Hils
fb238ad63e make the linter happy 2016-07-23 14:35:04 -07:00
Maximilian Hils
b78fea3784 add remote debug example 2016-07-23 14:02:54 -07:00
Maximilian Hils
fa45722ed8 Merge pull request #1402 from mhils/console-fixes
minor fixes
2016-07-23 12:49:57 -07:00
Maximilian Hils
ca493ad7f3 fix #1396, fix #1205, fix #1374 2016-07-23 12:09:19 -07:00
Maximilian Hils
fcb906dc97 improve dumper addon text alignment (#1415) 2016-07-23 12:01:05 -07:00
Maximilian Hils
61de6fa1d6 fix test_view_urlencoded 2016-07-23 11:55:27 -07:00
Thomas Kriechbaumer
c58db1adf3 http2: fix kill (#1413) 2016-07-23 11:11:45 -07:00
Thomas Kriechbaumer
514ea1b701 http2: cleanup tests 2016-07-23 11:08:32 +02:00
Shadab Zafar
f7217b006b Remove save marked flows prompt 2016-07-23 13:19:59 +05:30
Shadab Zafar
d6deec60b0 Add marked attribute when converting flow to 0.18 2016-07-23 10:41:57 +05:30
Shadab Zafar
08000c940c Test marked property while serialization roundtrip 2016-07-23 10:41:57 +05:30
Shadab Zafar
32ef73e6b4 Remove [Marked Flows] status indicator 2016-07-23 10:41:57 +05:30
Shadab Zafar
484dbd8a7b Keep focus on same flow when disabling marked view 2016-07-23 10:41:57 +05:30
Shadab Zafar
426a62299c Focus nearest matching flow if current flow is unmarked 2016-07-23 10:41:57 +05:30
Shadab Zafar
6135ec1196 Move match function to Flow 2016-07-23 10:41:57 +05:30
Shadab Zafar
4a3e9c0563 Keep focus on same flow when enabling marked view
...if it is marked.
2016-07-23 10:41:57 +05:30
Shadab Zafar
40b50e9398 Remove flow marking from ConsoleState 2016-07-23 10:41:57 +05:30
Shadab Zafar
500b61a811 Use marked property in ConsoleState.clear 2016-07-23 10:41:57 +05:30
Shadab Zafar
653ed4e342 Use ~marked filter while toggling marked view 2016-07-23 10:41:57 +05:30
Shadab Zafar
cc98b9c32f Add a marked filter 2016-07-23 10:41:57 +05:30
Shadab Zafar
6c05a0c908 Update unmark all flows "U" 2016-07-23 10:41:57 +05:30
Shadab Zafar
d99d61e8ef Update save_marked_flows to use the new attribute 2016-07-23 10:41:57 +05:30
Shadab Zafar
6fe36a5b7f Fix display of mark status [m] 2016-07-23 10:41:57 +05:30
Shadab Zafar
911c7a4f1b Update toggling of marked attribute on pressing "m" 2016-07-23 10:41:57 +05:30
Shadab Zafar
541d9db27a Add marked attribute to flow 2016-07-23 10:41:57 +05:30
Maximilian Hils
88195ae2cf re-enable OSX builds on travis (#1411) 2016-07-22 21:46:56 -07:00
Aldo Cortesi
e85566e4ee Merge pull request #1412 from cortesi/updated
Addon iface: .configure(options) -> .configure(options, updated)
2016-07-23 16:08:27 +12:00
Aldo Cortesi
afda175e1c Addon iface: .configure(options) -> .configure(options, updated) 2016-07-23 15:43:55 +12:00
Aldo Cortesi
45d24696e0 Merge pull request #1410 from cortesi/addons
Keep maturing scripts and addons
2016-07-23 12:32:03 +12:00
Aldo Cortesi
dbafe9f87b scripts: refactor some examples that keep global state
We now have a better way to do this.
2016-07-23 12:24:09 +12:00
Aldo Cortesi
b5416895f5 script: convert test recorder to an addon class 2016-07-23 11:38:45 +12:00
Aldo Cortesi
9294d19f90 scripts: .start can now return an Addon instance 2016-07-23 11:29:13 +12:00
Aldo Cortesi
05caa0a03d script: tune auto reload
- Don't respond to directory changes
- Ignore hidden files

I've "solved" this as well as it can be done in modd, and getting good results
here just turns into a large pile of heuristics that don't work in all
circumstances. Also watchdog sucks.
2016-07-23 11:08:14 +12:00
Aldo Cortesi
51a8ba57f1 script: add a namespace adaptor to match Addons 2016-07-23 11:03:50 +12:00
Maximilian Hils
65c2f30218 fix mitmproxy 0.11 dumpfile - was 0.18 before 2016-07-22 10:36:26 -07:00
Clemens
f578bf5122 file upload updates contentview, editable contentloader, diffs on upload 2016-07-22 19:07:53 +02:00
Maximilian Hils
9b40e1072c minor fixes 2016-07-21 20:33:55 -07:00
Maximilian Hils
9f0889d541 Merge pull request #1399 from mhils/fix-cv-cache-invalidation
Fix content view cache invalidation
2016-07-21 20:10:06 -07:00
Maximilian Hils
6dcdc89857 Merge pull request #1400 from mhils/fix-copy-clipboard
py3: fix copy to clipboard
2016-07-21 20:09:42 -07:00
Maximilian Hils
798759d2b3 fix content view cache invalidation 2016-07-21 19:49:32 -07:00
Maximilian Hils
8a2c7bea8e py3: fix copy to clipboard 2016-07-21 19:44:20 -07:00
Maximilian Hils
daae51823d Merge pull request #1397 from mhils/console-fixes
Console fixes
2016-07-21 19:11:53 -07:00
Maximilian Hils
b28954ea5f minor fixes 2016-07-21 18:32:47 -07:00
Maximilian Hils
2ce7166a45 improve console ux for duplication/creation 2016-07-21 18:32:25 -07:00
Maximilian Hils
0911f4908b fix #1391 2016-07-21 18:31:12 -07:00
Maximilian Hils
f5841c705c fix #1392 2016-07-21 18:30:48 -07:00
Maximilian Hils
bb1400777b fix #1390 2016-07-21 18:30:09 -07:00
Maximilian Hils
873f48f6ab display python version in console help 2016-07-21 17:08:21 -07:00
Clemens
70ca10b423 moved editor to raw_view mode, add content_file_upload 2016-07-21 19:13:16 +02:00
Maximilian Hils
3d6f714b5d web: perf++ 2016-07-21 03:00:10 -07:00
Clemens
61f192434f moved editor to raw_view mode 2016-07-21 11:50:02 +02:00
Maximilian Hils
6ffeaaebed Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-07-21 01:16:35 -07:00
Maximilian Hils
8a3a21bba1 web: fix ValueEditor, clean up code 2016-07-21 01:14:55 -07:00
Maximilian Hils
427fffbcb8 web: fix flow content update 2016-07-21 00:43:31 -07:00
Aldo Cortesi
c090e02848 Merge pull request #1385 from mitmproxy/console
console: nopop, rheaders into Options
2016-07-21 17:06:38 +12:00
Aldo Cortesi
e15cf968c2 console: nopop, rheaders into Options 2016-07-21 15:51:12 +12:00
Aldo Cortesi
33ffbc28ed console: share one ActionBar instance
This fixes an issues where popping a view off the stack caused stale ActionBar
contents to be displayed.
2016-07-21 15:41:43 +12:00
Aldo Cortesi
6750ab899a Merge branch 'flow-export' of https://github.com/dufferzafar/mitmproxy into dufferzafar-flow-export 2016-07-21 13:53:41 +12:00
Aldo Cortesi
02acfb1242 Fix netlib.utils.is_valid_host
- Don't crash when passed an empty string. This translated into an actual core
crash, discovered while fuzzing with afl.
- Taking a slice of length one out of bytes returns an integer, so the check
for trailing period in this function never worked on Python3.
- Add unit tests.
2016-07-21 10:38:37 +12:00
Maximilian Hils
8b2a5cad2d Merge remote-tracking branch 'origin/flow_editing' 2016-07-20 14:35:20 -07:00
Shadab Zafar
2b58e153b9 Fix hotkey kerfuffle
`z` (instead of `C`) to "clear flow list or eventlog"
`C` to "export flow to clipboard"
`E` to "export flow to file"
2016-07-20 14:44:20 +05:30
Shadab Zafar
a933b82064 Make necessary changes in flowview 2016-07-20 14:41:21 +05:30
Shadab Zafar
3321e7bef3 Refactor exporters 2016-07-20 10:03:00 +05:30
Shadab Zafar
c84d0bd10b Add a url exporter 2016-07-20 10:03:00 +05:30
Shadab Zafar
0d478e71ee Ask for scope when called from flowlist 2016-07-20 10:03:00 +05:30
Shadab Zafar
e3670f9d9b Integrate ask_copy_part into exporters
This introduces some duplication but that'll be refactored later.
2016-07-20 10:03:00 +05:30
Shadab Zafar
8f4d49e22a Remove raw_request exporter
This functionality will be handled by headers+content
2016-07-20 10:03:00 +05:30
Shadab Zafar
3ae28f1c31 s/part/key 2016-07-20 10:03:00 +05:30
Shadab Zafar
e56df1b706 Don't send master and state parameters 2016-07-20 10:03:00 +05:30
Shadab Zafar
5377d5a61d Refactor 2016-07-20 10:03:00 +05:30
Shadab Zafar
4f04dd618c Common function for both file and clipboard 2016-07-20 10:03:00 +05:30
Shadab Zafar
5cf2228250 Export to file (p) or clipboard (P) 2016-07-20 10:03:00 +05:30
Shadab Zafar
6119f0f16a Exporters list 2016-07-20 10:03:00 +05:30
Maximilian Hils
b27db1fc81 minor fixes 2016-07-19 18:09:33 -07:00
Aldo Cortesi
1ff800598a Merge pull request #1383 from cortesi/options
mitmproxy.flow.options -> mitmproxy.options
2016-07-20 11:46:24 +12:00
Aldo Cortesi
8317772377 mitproxy.options -> mitmproxy.optmanager, mitmproxy.flow.options -> mitmproxy.options
It might be slightly  more felicitous to move optmanager into netlib at some
point, especially if we can also use it in pathod.

This also consolidates our constants in mitmproxy.options, removing some duplicates.
2016-07-20 11:28:53 +12:00
Aldo Cortesi
aa3b866e1d Merge pull request #1382 from cortesi/cleanup
[wip] ProxyConf-related refactoring
2016-07-20 09:28:18 +12:00
Clemens
281f20ef1e added flow_content update 2016-07-19 16:13:26 +02:00
Aldo Cortesi
6000136b01 Merge branch 'master' into cleanup 2016-07-19 23:35:42 +12:00
Clemens
698fb11132 Merge remote-tracking branch 'origin/master' into flow_editing 2016-07-19 12:32:36 +02:00
Maximilian Hils
18dd84b908 web: fix flow selection 2016-07-19 03:23:40 -07:00
Clemens
48728af43a moved flow editor state to redux 2016-07-19 12:23:20 +02:00
Maximilian Hils
518c28fff9 update web assets 2016-07-19 03:14:35 -07:00
Maximilian Hils
f356a84430 simplify web ui ducks 2016-07-19 03:13:39 -07:00
Maximilian Hils
4ea6e61ea8 fix web master options leftovers 2016-07-19 03:11:17 -07:00
Thomas Kriechbaumer
329909c514 update README about Python support 2016-07-19 10:43:57 +02:00
Aldo Cortesi
09fbebf42a Test suite: get_proxy_config -> get_options 2016-07-19 19:36:40 +12:00
Aldo Cortesi
29eecd5d66 Simplify common initilization in cmdline.py 2016-07-19 17:15:10 +12:00
Aldo Cortesi
ecd01ce7c6 Merge pull request #1379 from cortesi/proxyconfig
Unify ProxyConfig and Options
2016-07-19 16:59:23 +12:00
Aldo Cortesi
9c9d28d068 Remove proxy.config.process_proxy_options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
ef380917a8 ProxyConf: adapt mitmproxy console, ditch tcp|host filter attrs on flow.master 2016-07-19 16:25:09 +12:00
Aldo Cortesi
be081a24bc ProxyConf: auth_* into Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
5cfe783b6c ProxyConfig: http2, rawtcp, no_upstream_cert -> Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
fb6e9c44c8 ProxyConfig: ciphers_client and ciphers_server -> Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
26fa88a338 ProxyConfig: Refactor to move verification mode checks into configure 2016-07-19 16:25:09 +12:00
Aldo Cortesi
77bf092bcd ProxyConfig: tcp_hosts and ignore_hosts to Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
98bf544664 Regularize naming of upstream_trusted_ca* options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
0a3839375d ProxyConfig: various SSL options to Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
f81c53f9bb Fix ca directory creation 2016-07-19 16:25:09 +12:00
Aldo Cortesi
78e8159007 config.parse_server_spec shouldn't pass byts to tcp.Address 2016-07-19 16:25:09 +12:00
Aldo Cortesi
f9622074cc ProxyConfig: mode, upstream_server and upstream_auth to Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
bd733e1232 Handle command-line argument errors properly
At some point we stopped handling exceptions from get_common_options properly.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
d2268ddb1e ProxyConfig: --body-size-limit to Options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
f24f8ce971 ProxyConfig: --cert to options
Also incidentally improve handling of invalid certificate formats.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
856e1c2ba9 Move clientcers & cadir to Options
Also adds a .configure mechanism to ProxyConfig, and hooks it up to the change
event.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
b1b1a1b9cf ProxyConfig: cadir to options 2016-07-19 16:25:09 +12:00
Aldo Cortesi
6908dc4d90 ProxyConfig refactor
Step two of frog boiling: move listening address and port into options. This is
the hard bit, because it touches the test suite so deeply.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
9bc1514aef Unify proxy config and options
This is step 1 in a gradual "boiling frog" strategy. Decorate ProxyConfig
with an Options object.
2016-07-19 16:25:09 +12:00
Maximilian Hils
5034a6232c web: remove SELECT_RELATIVE 2016-07-18 21:23:50 -07:00
Maximilian Hils
859bb8c99f Merge remote-tracking branch 'jason/ui' 2016-07-18 20:59:17 -07:00
Maximilian Hils
00b0d47db6 Merge pull request #1365 from Kriechi/fix-1333
add Windows py3 builds
2016-07-18 20:48:46 -07:00
Aldo Cortesi
9869cb617e Merge pull request #1378 from cortesi/cleanups
Console-related cleanups
2016-07-18 11:29:18 +12:00
Aldo Cortesi
e9865800a8 Console options cleanup
Use setters, use togglers, move more things out of master
2016-07-18 10:31:34 +12:00
Aldo Cortesi
ff80c7b618 file -> open throughout console 2016-07-18 10:08:05 +12:00
Aldo Cortesi
f9e4249499 Add a toggller helper to Options, start using it in mitmproxy console 2016-07-18 10:03:10 +12:00
Thomas Kriechbaumer
7b57c2948e cleanup 2016-07-17 18:17:35 +02:00
Thomas Kriechbaumer
d9021f8505 http2: coverage++ 2016-07-17 18:07:02 +02:00
Aldo Cortesi
6c86d7bd4f Merge pull request #1372 from cortesi/setheaders
setheaders -> addon
2016-07-17 18:49:41 +12:00
Aldo Cortesi
216e38d437 setheaders -> addon 2016-07-17 18:41:14 +12:00
Aldo Cortesi
61d6345f22 Merge pull request #1371 from cortesi/cleancode
Remove old ReplaceHooks code
2016-07-17 17:25:06 +12:00
Aldo Cortesi
821b97c19c Remove old ReplaceHooks code 2016-07-17 16:25:42 +12:00
Aldo Cortesi
a26cc75aab Merge pull request #1370 from cortesi/filestreamer
Some work on stream-to-file
2016-07-17 16:20:41 +12:00
Aldo Cortesi
9bf1d300d8 Some work on stream-to-file
- stream -> filestreamer throughout
- move active_flows set into FileStreamer addon
2016-07-17 16:07:29 +12:00
Aldo Cortesi
fb45d59c02 Merge pull request #1367 from Kriechi/fix-1366
fix-1366
2016-07-17 15:06:58 +12:00
Aldo Cortesi
15c7528faf Merge pull request #1369 from cortesi/dumper
Extract console dump functionality into an addon
2016-07-17 14:35:54 +12:00
Aldo Cortesi
08b3af98c2 Merge branch 'master' into dumper 2016-07-17 12:53:14 +12:00
Aldo Cortesi
b5bbeb0ff3 dumper: correctly detect request replay
Fixes #1361
2016-07-17 11:11:22 +12:00
Aldo Cortesi
ca7ca8ec24 The "handled" flag on responses should not persist across calls 2016-07-17 11:06:29 +12:00
Aldo Cortesi
11bd911e45 Some mild refactoring of dumper.py 2016-07-17 11:00:36 +12:00
Aldo Cortesi
4bbab72cb2 Merge pull request #1368 from DrakeCaraker/patch-1
Update gamecenter.rst
2016-07-17 10:27:07 +12:00
Drake Caraker
2fde1d0b53 Update gamecenter.rst
Typo fix: changed plist score value from '0' to '55', aligning with the subsequent explanatory text.
2016-07-16 15:24:56 -07:00
Aldo Cortesi
b0b3b19ad6 Extract console dump functionality into an addon
This removes all the code that deals with printing flows to screen from dump.py
into a self-contained addon.

- This fixes a bug - by moving dumping into an
addon, we now dump flows AFTER addon transformation, so we can see the changes
made.
- We get dumping "for free" in other places by simply adding the addon. It's
now easy to add dumping to console to mitmweb for debugging and development.
The same goes for external projects that derive from master.
- We also get major benefits in clarity for a frankly hairy part of our
project. Mitmdump is much clearer, and all the hairyness is now isolated for
further refactoring.
2016-07-17 10:17:02 +12:00
Thomas Kriechbaumer
a32312cecc fix-1366 2016-07-16 18:31:37 +02:00
Thomas Kriechbaumer
da99258168 add Windows py3 builds
fixes #1333
2016-07-16 12:08:36 +02:00
Maximilian Hils
f0c15aa09c @mhils can't merge 2016-07-16 00:36:26 -07:00
Maximilian Hils
afc3f6d854 Merge remote-tracking branch 'duffer/tcpflow-filter' 2016-07-16 00:19:01 -07:00
Maximilian Hils
b27d59095d Merge pull request #1306 from mitmproxy/message-body-encoding
Improve Message Body Encoding
2016-07-16 00:13:58 -07:00
Aldo Cortesi
903807292b Merge pull request #1363 from cortesi/replace
replacehooks -> addon
2016-07-16 18:57:41 +12:00
Maximilian Hils
e6e39ce80f preserve content-type parameter order 2016-07-15 23:46:12 -07:00
Aldo Cortesi
1a1f7e6fd9 replacehooks -> addon
Also fixes a bug in header replacements in netlib that resulted in a mutable
multidict.
2016-07-16 18:37:30 +12:00
Maximilian Hils
3602fd7a36 Merge remote-tracking branch 'origin/master' into message-body-encoding 2016-07-15 23:17:57 -07:00
Maximilian Hils
a3c7c84d49 improve message content semantics 2016-07-15 22:50:33 -07:00
Shadab Zafar
fea4435dac Allow DummyFlow to match ~e, ~src and ~dst 2016-07-16 10:15:38 +05:30
Shadab Zafar
5082dc6cbd Sort filt items alphabetically 2016-07-16 10:15:38 +05:30
Shadab Zafar
1d2ccb9170 Add DummyFlow and its Tests 2016-07-16 10:15:38 +05:30
Shadab Zafar
8c49f0e784 Add tests for TCPFlow.match 2016-07-16 10:15:38 +05:30
Shadab Zafar
6a2668d865 Add ~http and ~tcp filters 2016-07-16 10:15:38 +05:30
Shadab Zafar
262a420553 Use ~bq / ~bs for messages sent from client / server 2016-07-16 10:15:38 +05:30
Shadab Zafar
5f7d61f864 Replace http decorator with one that handles different flowtypes 2016-07-16 10:15:38 +05:30
Shadab Zafar
a7bb0f5d02 Add TCPFlow.match 2016-07-16 10:15:38 +05:30
Shadab Zafar
767457fda9 Add tests for HTTPFlow only filters 2016-07-16 10:15:38 +05:30
Shadab Zafar
ffcdd02e96 Add decorator for HTTPFlow filters 2016-07-16 10:15:38 +05:30
Shadab Zafar
317355a9af Add test for operators (& | !) 2016-07-16 10:15:38 +05:30
Shadab Zafar
4e29993c1f Add test for addresses (~src, ~dst) 2016-07-16 10:15:38 +05:30
Shadab Zafar
124b87b851 Add test for body (~b) 2016-07-16 10:15:38 +05:30
Shadab Zafar
88671c3aac Add test for error (~e) 2016-07-16 10:15:38 +05:30
Aldo Cortesi
17305643bc console: don't let messages overwrite prompts
This renders mitmproxy unresponsive and is bad UX as well.
2016-07-16 11:48:16 +12:00
Aldo Cortesi
50c76ac4ff Merge pull request #1362 from cortesi/errors
Some work on errors and logs
2016-07-16 11:46:01 +12:00
Aldo Cortesi
50f1495f29 Make mitmdump return an error exit status if errors occurred during run 2016-07-16 10:59:47 +12:00
Aldo Cortesi
33d03d916a Flash a status bar message if an error log event occurs 2016-07-16 10:39:49 +12:00
Aldo Cortesi
49b65d2ea4 Add a helper to translate a log level to a tier
This is in utils for now - we'll find a better home down the track.
2016-07-16 10:33:50 +12:00
Aldo Cortesi
91e9016ce5 Trigger "start" when scripts are reloaded. 2016-07-16 10:21:00 +12:00
Aldo Cortesi
5f23d4f5ca add_event -> add_log throughout project
"Event" is terribly over-loaded in the project, and "log" is straight-forward
and self-explanatory.
2016-07-16 10:19:06 +12:00
Aldo Cortesi
5a60f32c55 Fix log level handling
We have 4: error, warn, info and debug.
2016-07-16 09:23:52 +12:00
Aldo Cortesi
532ae7dc4a Add addons after initialisation in mitmproxy console
The main effect of this is that we now properly capture errors on startup that
were ignored before.
2016-07-16 09:22:56 +12:00
Clemens
87797d7ac0 added new btn, changed to codemirror 2016-07-15 14:41:30 +02:00
Aldo Cortesi
c4fb489a96 Zap unused test scripts 2016-07-15 22:37:52 +12:00
Maximilian Hils
60d2e14cb9 fix #1358 2016-07-15 00:07:32 -07:00
Aldo Cortesi
64e16f5112 Merge pull request #1356 from cortesi/script
Scripts to addon
2016-07-15 16:48:01 +12:00
Aldo Cortesi
c7d0850d8f Script cleanups
- Preserve script order on config change
- Prohibit script duplicates (i.e. identical script + args)
- Various cleanups and tweaks
2016-07-15 16:35:24 +12:00
Aldo Cortesi
917d51bd22 Fix HAR extractor
Thanks to @mhils
2016-07-15 15:01:35 +12:00
Aldo Cortesi
92a5076bd0 Adjust concurrent tests for start method 2016-07-15 15:00:37 +12:00
Aldo Cortesi
4ba7ce50c6 Add .start for addons and scripts
Also improve error messages, fix various unit tests
2016-07-15 14:52:34 +12:00
Aldo Cortesi
fcc1416ffd Fix windows parse_args test 2016-07-15 10:33:51 +12:00
Clemens
5f3782dd5f change way to edit 2016-07-14 23:01:34 +02:00
Aldo Cortesi
8fee5db675 Always use PollingObserver 2016-07-14 21:33:53 +12:00
Aldo Cortesi
9f1c46e7d6 Merge branch 'master' into script 2016-07-14 20:26:34 +12:00
Aldo Cortesi
e051928f26 Add missing mitmweb option 2016-07-14 20:24:56 +12:00
Aldo Cortesi
698af945a4 Adjust for new options scheme 2016-07-14 19:58:12 +12:00
Aldo Cortesi
a4127fb6d5 Add a tick event for addons and scripts, and use it for race-free reload 2016-07-14 19:54:15 +12:00
Aldo Cortesi
5b2d1c044a Tighten the tick loop
In the past, we consumed from the event queue until we were idle for a certain
amount of time (0.1s). This would cause hangs in interactive tools when there
was a stream of events, hurting responsiveness. We now wait for a maximum of
0.1s before triggering the tick loop, will be able to reduce this further down
the track.
2016-07-14 19:54:15 +12:00
Aldo Cortesi
deffed2196 Script cleanup: editing in console, Python3 compatibility fixes 2016-07-14 19:54:15 +12:00
Aldo Cortesi
b94f5fd361 Convert examples and example tests for new-style scripts
Remove the test that just loads all the example scripts for now - it's a very
low-value test, and we need to think of something better.
2016-07-14 19:54:15 +12:00
Aldo Cortesi
a6821aad8e Zap old scripts infrastructure, fix concurrency tests 2016-07-14 19:54:15 +12:00
Aldo Cortesi
a3a22fba33 First-order integration of scripts addon 2016-07-14 19:54:15 +12:00
Shadab Zafar
1266255842 Re-add deletion of stickycookies (#1355)
This was originally added in #1324 (fixing issue #1096)
but got lost during "the big refactor" (#1352)
2016-07-14 00:37:27 -07:00
Aldo Cortesi
c852c3c88d Merge pull request #1354 from mhils/explicit-options
Make options explicit
2016-07-14 18:17:34 +12:00
Maximilian Hils
f84a23f11d minor fixes 2016-07-13 22:01:16 -07:00
Maximilian Hils
ec6fbe9eb6 make options explicit 2016-07-13 21:45:25 -07:00
Aldo Cortesi
b8a23eeaa3 Merge pull request #1353 from cortesi/stream
Streaming to file -> addon
2016-07-14 14:09:59 +12:00
Aldo Cortesi
b2c4f301cb Stream to file -> addon
This commit also clarifies a confusion about the "outfile" attribute and its
use in testing in the mitmdump master.
2016-07-14 13:52:09 +12:00
Aldo Cortesi
941919190b Merge pull request #1352 from cortesi/stickycookie
StickyCookies to addon
2016-07-14 13:14:04 +12:00
Aldo Cortesi
703c05066e Fix indeterminacy in sticky cookie tests
How has this not bitten us before?
2016-07-14 12:59:00 +12:00
Aldo Cortesi
cf3b3d206a Zap unused imports 2016-07-14 12:45:00 +12:00
Aldo Cortesi
120465a142 Ditch StickyCookie module 2016-07-14 12:17:28 +12:00
Aldo Cortesi
00509d86a8 StickyCookies to addon 2016-07-14 12:13:14 +12:00
Aldo Cortesi
c0cd01b6e3 Merge pull request #1351 from cortesi/anticache
AntiCache to addon
2016-07-14 12:09:21 +12:00
Aldo Cortesi
b5a69e2398 Merge remote-tracking branch 'upstream/master' into anticache 2016-07-14 11:38:23 +12:00
Aldo Cortesi
b56de79d6c Merge pull request #1350 from cortesi/addons-cleanup
Addons cleanup
2016-07-14 11:36:53 +12:00
Aldo Cortesi
143bf0dfa9 AntiCache to addon 2016-07-14 11:24:06 +12:00
Aldo Cortesi
6e7b86cd82 Disable OSX tests on Travis for now
We'll re-enable as soon as this is sorted out:

https://github.com/travis-ci/travis-ci/issues/6303
2016-07-14 11:12:37 +12:00
Aldo Cortesi
97b2e6d958 Add a .setter helper to Options
This returns a function that sets a named attribute, and is handy for
event-driven code like mitmproxy console.
2016-07-14 11:11:41 +12:00
Aldo Cortesi
711196592d Merge pull request #1349 from cortesi/addons
Addons: StickyAuth
2016-07-14 11:10:53 +12:00
Aldo Cortesi
c52d567b43 Handle OptionsError for command-line args. 2016-07-14 10:19:16 +12:00
Aldo Cortesi
a8a083a10d Move StickyAuth into addon
This is the first addon that handles an OptionsError, so this commit also demos
how this works in console. Handling of command-line erorrs is on its way.
2016-07-14 10:08:41 +12:00
Aldo Cortesi
696789b8ec func.__name__ works in both 2.7 and 3.5
Thanks to @resam and @dwfreed for pointing this out
2016-07-14 09:33:26 +12:00
Clemens
45349b3597 chaged editor style 2016-07-13 20:53:05 +02:00
Clemens
baac6c4693 gzip issue 2016-07-13 20:44:35 +02:00
Clemens
121079934e make file out ouf string to combine flow content updates via editor and fileupload 2016-07-13 20:18:04 +02:00
Clemens
f84098554a added code editor and file upload 2016-07-13 18:16:31 +02:00
Aldo Cortesi
07c3f90c5b Merge pull request #1348 from cortesi/addons
Addons
2016-07-14 00:42:12 +12:00
Aldo Cortesi
9ab1db513f Satisfy our ruthless linting overlords 2016-07-13 23:50:25 +12:00
Aldo Cortesi
255e1eb00b Add the addons mechanism
Demonstrate how it works and interacts with Options by adding our first new
builtin: anticomp.
2016-07-13 23:45:49 +12:00
Aldo Cortesi
1f72532cae Merge branch 'options' into addons 2016-07-13 23:27:06 +12:00
Aldo Cortesi
7f8fd3cdff Basic outline of addons
Add addons.py, integrate with our event mechanism, and change the Master API so
options is the first init argument.
2016-07-13 23:26:04 +12:00
Aldo Cortesi
efc0b9fe7f Merge pull request #1347 from cortesi/options
Options
2016-07-13 22:57:31 +12:00
Aldo Cortesi
077850bd10 Raise AttributeError from Options.__getattr__ 2016-07-13 20:05:17 +12:00
Aldo Cortesi
c9a0fe6a0e Show how options integrates with console
This is not functional at the moment, because all mutable options are still on
master.
2016-07-13 19:15:38 +12:00
Aldo Cortesi
a20f8e9620 More powerful Options scheme
This prepares us for the addon configuration mechanism and gives us a more
flexible way to handle options changes. This changeset should spell the end of
the current anti-pattern in our codebase where we duplicate data out of options
onto the master when mutability is needed. From now on, Options can be the one
source of thruth.

- Change notifications
- Rollback on error
2016-07-13 18:45:50 +12:00
Clemens Brunner
2624911d75 fixed bug (#1342)
fix minor mitmweb issues
2016-07-12 14:52:33 -07:00
Thomas Kriechbaumer
3579c6dd43 http2: fix race-condition in tests 2016-07-12 19:55:28 +02:00
Thomas Kriechbaumer
9267b2b501 Merge pull request #1345 from strohu/patch-2
Make sudo pfctl error check Python 3 compatible
2016-07-12 19:31:42 +02:00
strohu
6a9407d7cc Make sudo pfctl error check Python 3 compatible
In Python 3, subprocess.check_output() returns a sequence of bytes. This change ensures that it will be converted to a string, so the substring test for the sudo error message does not raise a TypeError. This fixes the code in Python 3 while remaining compatible with Python 2.
2016-07-12 15:47:01 +01:00
Thomas Kriechbaumer
4fd71d7bfd Merge pull request #1344 from strohu/patch-1
Fix is_ascii check when determining next layer
2016-07-12 15:54:00 +02:00
strohu
6217614204 Fix is_ascii check when determining next layer 2016-07-12 13:18:58 +01:00
Clemens
544b1e3238 modify flow content 2016-07-11 19:49:58 +02:00
Thomas Kriechbaumer
427ba88618 Merge pull request #1338 from Kriechi/http2-tests
Improve HTTP/2 test coverage
2016-07-10 20:40:46 +02:00
Thomas Kriechbaumer
7c09255298 http2: more coverage 2016-07-10 20:07:43 +02:00
Thomas Kriechbaumer
b611997619 http2: simplify test class 2016-07-10 18:53:00 +02:00
Thomas Kriechbaumer
e89defe9ad update dependency and loosen restrictions on good citizens 2016-07-10 13:38:49 +02:00
Thomas Kriechbaumer
81c450ddc8 Merge pull request #1335 from mitmproxy/travis
move OSX Travis job to py3 for snapshots
2016-07-10 13:17:42 +02:00
Thomas Kriechbaumer
c90de8b9a4 fix sysinfo for py3 2016-07-10 13:16:23 +02:00
Thomas Kriechbaumer
ff63fadf0b move OSX Travis job to py3 for snapshots 2016-07-10 12:48:48 +02:00
Thomas Kriechbaumer
6762c6f5a2 Merge pull request #1336 from dufferzafar/rtool-hotfix
rtool hotfix
2016-07-10 12:24:10 +02:00
Shadab Zafar
8135b356d6 Decode commit value in rtool 2016-07-10 15:50:13 +05:30
Thomas Kriechbaumer
22c0db3b19 revert travis osx changes 2016-07-09 22:31:12 +02:00
Maximilian Hils
dc6266e08e Merge pull request #1324 from dufferzafar/sticky-cookies
Delete stickycookies when told by the server
2016-07-09 13:20:45 -07:00
Shadab Zafar
7eade1ef7c Remove redundant tests 2016-07-10 01:08:02 +05:30
Shadab Zafar
39f5108400 Test cookies.is_expired separately 2016-07-10 01:06:50 +05:30
Shadab Zafar
c92992f03b Move cookie expiry detection to separate function 2016-07-09 22:20:25 +05:30
Shadab Zafar
6a746deff5 Add tests for deletion of stickycookies 2016-07-09 22:20:25 +05:30
Shadab Zafar
608435cabf Delete stickycookies when told by the server
Fixes #1096
2016-07-09 22:20:25 +05:30
Thomas Kriechbaumer
7efd63f94c add whitespace to improve url parsing 2016-07-09 12:17:43 +02:00
Thomas Kriechbaumer
3e2d41d507 fix pip install on osx travis 2016-07-09 11:55:52 +02:00
Thomas Kriechbaumer
3a3d9f65e6 upgrade pip on osx travis 2016-07-09 11:50:30 +02:00
Thomas Kriechbaumer
3fe5b47cf9 try to fix weird install behaviour 2016-07-09 11:44:18 +02:00
Thomas Kriechbaumer
8cfa5ad306 update osx travis 2016-07-09 11:29:25 +02:00
Thomas Kriechbaumer
aa1615eafd cleanup tox 2016-07-09 11:20:10 +02:00
Thomas Kriechbaumer
1b0a89abd2 Merge pull request #1334 from mhils/cleanup
Remove unused files
2016-07-09 11:18:34 +02:00
Maximilian Hils
718fa5bbcd remove unused files 2016-07-09 01:39:37 -07:00
Maximilian Hils
636cbfd163 Update README.rst 2016-07-09 01:33:56 -07:00
Maximilian Hils
6f0a733d62 Add Python 3.5 markers to setup.py 2016-07-09 01:29:12 -07:00
Maximilian Hils
e16a632b95 remove pathod doc leftovers 2016-07-09 01:26:06 -07:00
Thomas Kriechbaumer
695c7368e6 Merge pull request #1299 from dufferzafar/py3-dump
Python 3 - test_dump
2016-07-09 10:17:24 +02:00
Maximilian Hils
3d40fae6d7 travis: move osx test to the top
OSX is the slow one, so it should start straight away.
2016-07-09 01:05:04 -07:00
Shadab Zafar
83a1cc5a9a Make escape_control_characters handle strings on Py2 2016-07-09 13:28:20 +05:30
Shadab Zafar
bd58230178 Remove py35 section from tox.ini 2016-07-09 12:51:43 +05:30
Shadab Zafar
0a21d27004 strutils.hexdump returns native_strings 2016-07-09 12:43:21 +05:30
Shadab Zafar
c7cbbf5f0d Set verbosity & flow_detail to 0 2016-07-09 12:32:41 +05:30
Shadab Zafar
147f61fa62 py3++ 2016-07-09 11:14:12 +05:30
Shadab Zafar
b4469d2579 py3++: test_dump 2016-07-09 11:14:12 +05:30
Maximilian Hils
15c10d49f6 Merge pull request #1327 from mitmproxy/remove-script-context
Remove script context
2016-07-08 20:11:12 -07:00
Maximilian Hils
5d2b7c52f9 move script context to mitmproxy.ctx 2016-07-08 19:57:57 -07:00
Maximilian Hils
f7639e077a py3++ 2016-07-08 15:58:12 -07:00
Maximilian Hils
0a1431ed2c fix #1314 2016-07-08 15:50:11 -07:00
Maximilian Hils
035f989890 Merge pull request #1330 from jpkrause/master
Added flow converters for versions 0.11 and 0.12
2016-07-08 15:29:37 -07:00
jpkrause
05ab9c1b37 Updated coding style and modified flow format compat test to use v0.11 and v0.10 dump files 2016-07-08 15:03:36 -07:00
jpkrause
c9482c6255 Added flow converters for versions 0.11 and 0.12 2016-07-08 12:46:28 -07:00
Jason
92026d26ea [web] update build 2016-07-08 22:01:09 +08:00
Jason
666017125a [web] add tests for main view and ui 2016-07-08 21:59:34 +08:00
Thomas Kriechbaumer
819e737f0d Merge pull request #1328 from Kriechi/fix-1326
http2: fix self-depended streams
2016-07-08 11:31:07 +02:00
Thomas Kriechbaumer
df43a962d7 simplify tox test exclusion 2016-07-08 10:54:21 +02:00
Thomas Kriechbaumer
6da166d762 http2: fix self-depended streams 2016-07-08 10:37:56 +02:00
Maximilian Hils
7c67faa8da remove script contexts 2016-07-07 23:50:55 -07:00
Maximilian Hils
c048ae1d5b remove context from all scripts 2016-07-07 20:14:52 -07:00
Maximilian Hils
7a5b21556b fix tests 2016-07-07 19:34:57 -07:00
Maximilian Hils
00dce24015 tests++ 2016-07-07 18:02:59 -07:00
Maximilian Hils
76473d44e0 py3++ 2016-07-07 17:50:26 -07:00
Maximilian Hils
f62e976e1e py3++ 2016-07-07 17:29:22 -07:00
Thomas Kriechbaumer
acca8e5253 reorder travis jobs 2016-07-07 21:14:29 +02:00
Thomas Kriechbaumer
7baeac4d67 Merge pull request #1325 from Kriechi/dufferzafar-py3-h2
HTTP/2: Python 3-compatibility
2016-07-07 21:11:55 +02:00
Thomas Kriechbaumer
d962bd4e83 py3++ 2016-07-07 20:25:48 +02:00
Shadab Zafar
c870d26bc7 py3++: test_protocol_http2 2016-07-07 16:39:25 +02:00
Maximilian Hils
a212ce1f63 py3++ 2016-07-07 02:30:25 -07:00
Maximilian Hils
c57c203037 Merge pull request #1323 from mhils/test-examples
Exclude harparser script on Python 3
2016-07-07 01:31:06 -07:00
Maximilian Hils
f259b9478f disable harparser on py3 2016-07-07 01:21:15 -07:00
Thomas Kriechbaumer
64ac2c73fe Merge pull request #1318 from mhils/tnetstring3-unicode-type
[tests actually pass] Add unicode to tnetstring3
2016-07-07 09:48:22 +02:00
Maximilian Hils
605a4fd2fd Merge pull request #1322 from linrock/json-api
Detect JSON API media type as a json content view
2016-07-06 21:26:38 -07:00
Linmiao Xu
275cf7a6c2 Detect JSON API media type as a json content view
IANA assignment here:
https://www.iana.org/assignments/media-types/application/vnd.api+json

More about JSON API:
https://github.com/json-api/json-api
2016-07-06 21:10:35 -07:00
Maximilian Hils
64a867973d sni is now str, not bytes 2016-07-06 21:03:17 -07:00
Maximilian Hils
8287ce7e6d fix tests 2016-07-06 19:55:48 -07:00
Maximilian Hils
2c37ebfc72 fix dump file cross compat between python versions 2016-07-06 19:55:48 -07:00
Maximilian Hils
d406bee988 tnetstring3: adapt to unicode support 2016-07-06 19:55:48 -07:00
Maximilian Hils
48ee3a553e add tnetstring unicode type 2016-07-06 19:55:48 -07:00
Maximilian Hils
684b4b5130 tnetstring: keys are str on py3. migrate flow.io_compat 2016-07-06 19:55:48 -07:00
Maximilian Hils
e6e839d56d add python3 tnetstring implementation 2016-07-06 19:55:25 -07:00
Maximilian Hils
9c873d63f4 py3++, multidict fixes
This commit improves Python 3 compatibility and fixes two multidict
issues:

 1. Headers.items(multi=True) now decodes fields
 2. MultiDict.clear(item) has been removed, as Python's
    MutableMapping already defines .clear() with different
    semantics. This is confusing for everyone who expects a
    dict-like object. `.pop("attr", None)` is not fantastic,
    but it's the Python way to do it.
2016-07-06 19:53:29 -07:00
Maximilian Hils
55fae7cea9 Merge pull request #1319 from mitmproxy/fix-py27-encoding-issues
Fix pathod log encoding
2016-07-06 17:35:34 -07:00
Maximilian Hils
444f0a4c39 py3++ 2016-07-06 17:31:08 -07:00
Maximilian Hils
8b564bc934 fix pathod log encoding 2016-07-06 16:47:32 -07:00
Maximilian Hils
811b72cd30 blacklist pysftp 0.2.9
https://bitbucket.org/dundeemt/pysftp/issues/97/pysftp-029-breaks-builds
2016-07-06 13:01:24 -07:00
Maximilian Hils
38fd1d3ad7 fix issue introduced in 72f3b2b 2016-07-06 12:14:48 -07:00
Maximilian Hils
72f3b2bb17 minor code improvement 2016-07-05 19:32:25 -07:00
Maximilian Hils
c9b7f34265 Merge branch 'dont-cache-tox' 2016-07-05 18:36:25 -07:00
Maximilian Hils
e84f5fcc72 Merge pull request #1315 from mitmproxy/better-unicode-handling
remove clean_bin, clarify unicode handling
2016-07-05 16:02:37 -07:00
Maximilian Hils
882b8b5d80 don't cache tox on CI 2016-07-05 15:58:52 -07:00
Maximilian Hils
09d6782722 Merge pull request #1316 from mhils/faster-lint
tox: dont make sdist when linting
2016-07-05 15:40:10 -07:00
Maximilian Hils
00a35aa895 Merge pull request #1297 from dufferzafar/py3-flow-export
Python 3 - test_flow_export
2016-07-05 15:17:18 -07:00
Maximilian Hils
d51cf543bb remove clean_bin, clarify unicode handling 2016-07-05 15:11:32 -07:00
Maximilian Hils
45a634783a tox: dont make sdist when linting 2016-07-05 15:03:40 -07:00
Thomas Kriechbaumer
317a5178ea Merge pull request #1244 from Kriechi/http2-tests
http2: tests++
2016-07-05 22:33:39 +02:00
Thomas Kriechbaumer
5fecb8c843 http2: test fatal connection termination 2016-07-05 22:15:57 +02:00
Thomas Kriechbaumer
8d2042ea8a http2: test throttling at MAX_CONCURRENT_STREAMS 2016-07-05 22:15:57 +02:00
Thomas Kriechbaumer
05de3b759f http2: remove forbidden headers
E.g.: send_error_reponse sets a connection header
2016-07-05 22:15:57 +02:00
Thomas Kriechbaumer
ba9851db02 always recreate tox envs 2016-07-05 21:13:24 +02:00
Thomas Kriechbaumer
50fdb01553 prevent early priority changes 2016-07-05 21:02:19 +02:00
Thomas Kriechbaumer
1adcd6ad6b Merge pull request #1245 from Kriechi/http2-priority-information
http2: handle priority information better
2016-07-05 20:56:01 +02:00
Thomas Kriechbaumer
64880e7ebd handle related events from h2 2016-07-05 20:14:28 +02:00
Thomas Kriechbaumer
47db346959 improve end_stream handling
To replicate requests as close as possible frame-by-frame.

This fixes an issue with broken HTTP/2 implemenation by Akamai and
Twitter, which raise an error if we send an empty DataFrame only to
indicate END_STREAM.
2016-07-05 20:14:28 +02:00
Thomas Kriechbaumer
aa1b203182 http2: implement direct handling of priority 2016-07-05 20:14:28 +02:00
Thomas Kriechbaumer
69e20b34de bump h2 dependency 2016-07-05 20:14:28 +02:00
Jason
09ab2528f5 [web] bug fixs 2016-07-05 13:57:32 -04:00
Jason
7b543dd95c [web] bug fix 2016-07-05 13:43:37 -04:00
Jason
db991e2bcc [web] set display large 2016-07-05 22:49:41 +08:00
Jason
af2319aa64 [web] listen to window.onKeyDown 2016-07-05 22:28:00 +08:00
Jason
9bfde2a3ae [web] change ducks/ui 2016-07-05 11:12:07 +08:00
Maximilian Hils
ca9de786fd minor fix 2016-07-04 15:07:01 -07:00
Maximilian Hils
a6b3551934 raise ValueError if content-encoding is invalid 2016-07-04 13:58:09 -07:00
Thomas Kriechbaumer
23e295b37e py3: fix bytes vs. str 2016-07-03 23:22:04 +02:00
Shadab Zafar
45aa2174e2 http2: Remove TestReadRequestConnect test 2016-07-03 21:14:01 +05:30
Shadab Zafar
d361177753 h2: move header parsing to netlib 2016-07-03 18:03:34 +05:30
Shadab Zafar
f623b3d99b py3++: test_flow_export 2016-07-02 21:15:20 +05:30
Shadab Zafar
17b727321f Replace map + lambda with list comprehensions 2016-07-02 21:15:20 +05:30
Shadab Zafar
5b5a3ffa8e netlib: condition on PY2 rather than on PY3
Let's just hope PY4 doesn't break this!
2016-07-02 21:15:20 +05:30
Thomas Kriechbaumer
f70fd1b4b6 Merge pull request #1308 from dufferzafar/lint-hotfix
fix lint issues
2016-07-02 15:49:37 +02:00
Shadab Zafar
393c1d74af fix lint issues 2016-07-02 18:56:22 +05:30
Maximilian Hils
2f8a1fd2cb tests++ 2016-07-02 03:03:42 -07:00
Maximilian Hils
d9f797e7e6 make the linter happy 2016-07-02 02:11:00 -07:00
Maximilian Hils
dbf7cb1a44 update examples: no decoded() anymore 🎉 2016-07-02 02:01:46 -07:00
Maximilian Hils
6032c4f235 message.content -> .raw_content, implement .text
This PR improves our handling of HTTP message body encodings:

- The unaltered message body is now accessible as `.raw_content`
- The "content-encoding"-decoded content (i.e. gzip removed) content
  is not `.content`, as this is what we want in 99% of the cases.
- `.text` now provides the "content-encoding"-decoded and then
  "content-type charset"-decoded message body.
- The decoded values for `.content` and `.text` are cached,
  so that repeated access and `x.text = x.text` is cheap.
- The `decoded()` decorator is now deprecated, as we can now just use
  `.content`. Similarly `HTTPMessage.get_decoded_content()` is
  deprecated.
2016-07-02 01:51:47 -07:00
Maximilian Hils
2c09e0416b minor fixes 2016-07-01 17:49:18 -07:00
Maximilian Hils
fa72462798 fix tcp message handling 2016-07-01 17:17:16 -07:00
Maximilian Hils
536c7acd13 py3++ 2016-07-01 14:10:48 -07:00
Shadab Zafar
e0ed7699ca Handle case when scheme is None 2016-07-01 10:23:04 -07:00
Shadab Zafar
268e42e55e py3++: test/mitmproxy/test_server 2016-07-01 10:23:04 -07:00
Jason
8f73dc79c0 [web] ui ducks for content view 2016-07-01 23:44:48 +08:00
Maximilian Hils
98dc9d3d7e Merge pull request #1302 from mhils/update-dependencies
Update Dependencies
2016-06-29 03:30:49 -07:00
Maximilian Hils
8366c87c57 update to latest typing release 2016-06-29 03:03:23 -07:00
Maximilian Hils
b5a39f7d6a bump depdencies 2016-06-29 02:08:16 -07:00
Maximilian Hils
025efc030a Merge pull request #1301 from mitmproxy/simplify-tox
Simplify tox
2016-06-29 02:04:38 -07:00
Maximilian Hils
ac860c6fc0 improve docs, fix #1290 2016-06-29 00:38:11 -07:00
Maximilian Hils
b27c6ee181 appveyor: build snapshots on master 2016-06-29 00:06:04 -07:00
Maximilian Hils
6181bf978d remove superfluous statements in tox.ini 2016-06-29 00:05:03 -07:00
Maximilian Hils
01104b4761 collect coverage on appveyor 2016-06-28 23:55:29 -07:00
Maximilian Hils
f7d4319c5a minor fixes 2016-06-28 23:48:19 -07:00
Maximilian Hils
7cae0c268f do not run tests in parallel
this makes ci very unreliable, see
https://travis-ci.org/mitmproxy/mitmproxy/jobs/140994186
I don't know of a way to fix the test collection bug.
2016-06-28 23:18:55 -07:00
Maximilian Hils
b7430c0775 Merge pull request #1296 from gzzhanghao/test
[web] add tests for ducks/utils
2016-06-28 23:16:18 -07:00
Maximilian Hils
a57ea27bd4 watchdog: always use PollingObserver 2016-06-28 22:09:12 -07:00
Maximilian Hils
4f7d108722 compile docs on python 3.5 2016-06-28 22:06:08 -07:00
Maximilian Hils
e012116c3b powershell magic 2016-06-28 22:00:50 -07:00
Maximilian Hils
e6ea365f19 resilence Cryptography_locking_cb 2016-06-28 21:18:17 -07:00
Maximilian Hils
a4fde737b1 fix appveyor 2016-06-28 21:18:01 -07:00
Maximilian Hils
f69972d13d simplify tox setup 2016-06-28 19:44:25 -07:00
Maximilian Hils
3b53d3e393 fix mysterious tox issue 2016-06-28 19:26:08 -07:00
Thomas Kriechbaumer
042bcf7cf8 fix path in appveyor 2016-06-28 20:59:53 +02:00
Thomas Kriechbaumer
3079ea7e29 update tox env on CI 2016-06-28 10:20:51 +02:00
Thomas Kriechbaumer
e0bf3c671a fix appveyor snapshot upload 2016-06-28 10:17:50 +02:00
Maximilian Hils
9099529d17 Merge pull request #1294 from mitmproxy/appveyor-py3
update appveyor with tox
2016-06-28 00:40:31 -07:00
Thomas Kriechbaumer
566736c799 update appveyor with tox 2016-06-27 23:14:32 +02:00
Jason
37c2b47c26 [web] add tests for utils 2016-06-27 18:42:20 +08:00
Maximilian Hils
28531a4dd7 fix lxml installation on py27 2016-06-26 22:25:13 -07:00
Maximilian Hils
e7bdee56ef rtool: build py3 wheels an binaries 2016-06-26 22:13:42 -07:00
Maximilian Hils
588dad1bc7 minor docs fix 2016-06-26 14:42:12 -07:00
Maximilian Hils
ed9a72553d fix mitmproxy/mitmweb#25 2016-06-26 02:17:07 -07:00
Maximilian Hils
370e6caedc [web] (mostly) remove jQuery 2016-06-26 02:05:41 -07:00
Maximilian Hils
3eb2d04aac minor fixes 2016-06-26 01:45:45 -07:00
Maximilian Hils
1c240d919a [web] sorter -> sort 2016-06-25 19:58:11 -07:00
Jason
db415a26bc [web] log only in dev 2016-06-25 10:50:15 +08:00
Jason
a782571244 [web] build with envify 2016-06-25 10:43:30 +08:00
Jason
59dc5e4687 [web] update build 2016-06-25 10:09:21 +08:00
Jason
aecc267eb9 [web] fix imports 2016-06-25 10:06:38 +08:00
Jason
64fda2c735 [web] fix update filter 2016-06-25 10:03:51 +08:00
Jason
e400e9f513 [web] ErrorView 2016-06-25 09:52:49 +08:00
Jason
2b7923b4f4 [web] fix actions 2016-06-25 02:18:52 +08:00
Jason
8da623c603 [web] fix selectFlows 2016-06-25 00:53:56 +08:00
Jason
571c817f21 [web] add msgQueue 2016-06-25 00:36:39 +08:00
Jason
5a1677c387 Merge branch 'master' of github.com:mitmproxy/mitmproxy into list
Conflicts:
	mitmproxy/web/static/app.js
	web/src/js/app.jsx
	web/src/js/connection.js
	web/src/js/ducks/websocket.js
2016-06-24 21:04:39 +08:00
Maximilian Hils
21c3480429 Merge remote-tracking branch 'jason/websocket' 2016-06-23 23:38:19 -07:00
Maximilian Hils
ed05d3f858 Merge pull request #1285 from westurner/patch-1
DOC: install.rst: Installation on Fedora, Ubuntu
2016-06-23 15:44:29 -07:00
Jason
f392b8e34c [web] bug fix 2016-06-24 01:20:42 +08:00
Jason
c40ff0277b [web] fix bugs 2016-06-24 01:01:34 +08:00
Jason
e11d6600be [web] fix eventLog flow 2016-06-24 00:16:59 +08:00
Jason
1df67dbe9d [web] reduce eventlog view 2016-06-24 00:15:37 +08:00
Jason
7746deedc2 [web] code format 2016-06-24 00:13:05 +08:00
Jason
b2ffa06e32 [web] fix view data structure 2016-06-24 00:10:13 +08:00
Jason
7bc479bb3a [web] fix flows data flow 2016-06-24 00:03:32 +08:00
Jason
bd4cf8fef2 [web] ws methods 2016-06-23 23:56:24 +08:00
Jason
84683e7abb [web] check item existence before update 2016-06-23 23:48:17 +08:00
Jason
f50dc62249 [web] fix eventLog ducks 2016-06-23 23:44:53 +08:00
Jason
5adb7a54fd [web] separate views and list 2016-06-23 23:20:41 +08:00
Thomas Kriechbaumer
5d0de16f57 http2: improve error handling in tests 2016-06-22 22:09:57 +02:00
Maximilian Hils
aaf0bba496 Merge pull request #1291 from BSalita/master
Show how to upgrade pip.
2016-06-22 12:29:34 -07:00
Maximilian Hils
b3502b92c8 Merge pull request #1282 from dufferzafar/py3
Python 3 - mitmproxy.{protocol.http1, proxy, platform.pf}
2016-06-22 12:25:18 -07:00
Jason
397554b7c7 [web] update build 2016-06-23 01:30:34 +08:00
Jason
749d710665 [web] fix data connection 2016-06-23 01:30:28 +08:00
Jason
3c4e81aeff [web] fix utils/list 2016-06-23 01:23:16 +08:00
Jason
2358d79ac5 Merge branch 'master' of github.com:mitmproxy/mitmproxy into list 2016-06-23 01:15:46 +08:00
Jason
72fdca49ec [web] connect new ducks actions 2016-06-23 01:15:14 +08:00
Jason
bcea39657a [web] fix ducks/flows 2016-06-23 01:06:45 +08:00
Jason
7671224b4c [web] remove ducks/utils/view 2016-06-23 01:02:29 +08:00
Jason
2a9a6f6151 [web] flows.makeFun 2016-06-23 01:01:39 +08:00
Jason
60ea300990 [web] FlowActions -> flows ducks 2016-06-23 00:58:45 +08:00
Jason
c0904e9aed [web] refactoring ducks/flows 2016-06-23 00:49:26 +08:00
Jason
a42512a1cc [web] finish utils/list 2016-06-23 00:17:35 +08:00
BSalita
a77e850b6f Show how to upgrade pip.
Windows install failed due to out of date pip. Show how to upgrade to latest pip.
2016-06-22 14:49:41 +02:00
Shadab Zafar
d655d8f1f3 py3++: mitmproxy.platform.pf 2016-06-22 13:38:00 +05:30
Shadab Zafar
c0ba47094d py3++: mitmproxy.protocol.http1 2016-06-22 13:37:41 +05:30
Shadab Zafar
119021a9c3 py3++: mitmproxy.proxy 2016-06-22 13:37:16 +05:30
Maximilian Hils
66a2b0d615 Merge pull request #1286 from gzzhanghao/settings
[web] Fix settings ducks
2016-06-21 21:04:42 -07:00
Jason
57af1d00dd [web] set connected to false when DISCONNECTED 2016-06-22 11:29:21 +08:00
Jason
26aed8f56f [web] updateSettings -> handleWsMsg 2016-06-22 11:24:22 +08:00
Jason
42f433e395 [web] use a dummy action to init list 2016-06-22 11:16:08 +08:00
Jason
1fc11974a7 [web] update eventlog 2016-06-22 11:12:58 +08:00
Wes Turner
514d75cedd DOC: install.rst: Installation on Fedora, Ubuntu 2016-06-21 19:14:13 -05:00
Thomas Kriechbaumer
7523f41f75 Merge pull request #1283 from dufferzafar/tnetstring3
tnetstring3
2016-06-21 20:41:25 +02:00
Shadab Zafar
0adbf21a7f py3++ 2016-06-21 23:55:31 +05:30
Shadab Zafar
0a53550955 mitmproxy.tnetstring -> mitmproxy.contrib.tnetstring 2016-06-21 23:53:59 +05:30
Shadab Zafar
10f4a36a5a Imported tests for tnetstring
Copied from
a808f6b5ba/tests/test_format.py

Then ran pep8 etc.
2016-06-21 23:47:36 +05:30
Shadab Zafar
b5d280cab1 Py3: tnetstring
Copied the initial code from
[tnetstring3](https://raw.githubusercontent.com/carlopires/tnetstring3/master/tnetstring/__init__.py)

Then made some changes, like using the isdigit function, removing
superfluous ord() etc. to make all our tests pass.
2016-06-21 23:37:28 +05:30
Jason
9a7415a58d [web] store ws object in symbol property 2016-06-22 00:51:45 +08:00
Jason
0cab9ef1fa Merge remote-tracking branch 'origin/master' into websocket
Conflicts:
	mitmproxy/web/static/app.js
	web/src/js/components/ProxyApp.jsx
2016-06-22 00:49:21 +08:00
Aldo Cortesi
4576dbf8aa Minor wording improvements for the README 2016-06-21 20:52:27 +12:00
Aldo Cortesi
35413b0c3d Merge pull request #1274 from Kriechi/discourse-readme
add Discourse to README
2016-06-21 20:49:16 +12:00
Thomas Kriechbaumer
56af469b5a add Discourse to README 2016-06-21 10:03:32 +02:00
Maximilian Hils
65955ee45f add better description 2016-06-20 21:01:24 -07:00
Clemens
37475217bf added tests for ui 2016-06-20 21:00:27 -07:00
Maximilian Hils
44abb4caea Merge pull request #1276 from dufferzafar/console-pathedit
mitmproxy.console tests - PathEdit
2016-06-20 20:36:31 -07:00
Maximilian Hils
7ef0e37c74 Merge pull request #1273 from Kriechi/fix-default-arg
fix default arg
2016-06-20 14:52:16 -07:00
Maximilian Hils
b1715b4092 Merge pull request #1278 from mitmproxy/add_accept_revert_buttons_to_menu_flow
added accept and revert to flowmenu
2016-06-20 14:50:54 -07:00
Shadab Zafar
5b95803be0 py3++ 2016-06-20 21:57:18 +02:00
Shadab Zafar
efeade134a py3++ 2016-06-20 21:39:39 +02:00
Clemens
79834676cb added accept and revert to flowmenu 2016-06-20 10:20:41 +02:00
Maximilian Hils
165deb08fd Merge remote-tracking branch 'jason/settings' 2016-06-19 18:27:12 -07:00
Shadab Zafar
6aeba9777a Add dummy directory to completion 2016-06-20 01:24:27 +05:30
Shadab Zafar
ba13fda10d Add tests for PathEdit 2016-06-20 00:50:41 +05:30
Thomas Kriechbaumer
c4c9527fa0 Merge pull request #1275 from Kriechi/more-py3
py3++
2016-06-19 16:50:54 +02:00
Thomas Kriechbaumer
6ad0e3e66e fix default arg 2016-06-19 12:05:10 +02:00
Thomas Kriechbaumer
7bde38dc4a py3++ 2016-06-19 12:00:37 +02:00
Maximilian Hils
5c0161886a Merge pull request #1272 from dwfreed/patch-1
mitmproxy/models: missed comma in __all__
2016-06-18 12:20:19 -07:00
Jason
d01e49c6d5 [web] replace SetttingsActions.update with settings.updateSettings 2016-06-19 02:53:15 +08:00
Doug Freed
1f915b7f24 mitmproxy/models: missed comma in __all__
Spotted by Landscape (thanks @Kriechi for pointing out the site).  Add a
comma to the last item too, to prevent this from happening in the future
and reduce messing up blame later.
2016-06-18 14:50:06 -04:00
Jason
9cb5b0af9d Merge branch 'master' of github.com:mitmproxy/mitmproxy into websocket
Conflicts:
	mitmproxy/web/static/app.js
	web/src/js/components/ProxyApp.jsx
	web/src/js/connection.js
2016-06-18 14:18:24 +08:00
Jason
6c0511b06f [web] add app ducks 2016-06-18 14:11:47 +08:00
Maximilian Hils
23b976a999 Merge pull request #1270 from mitmproxy/settings
[web] Settings Ducks 2
2016-06-17 22:11:16 -07:00
Maximilian Hils
f203936fbf add setInterceptPattern action creator 2016-06-17 21:06:17 -07:00
Maximilian Hils
6a41ea9171 add fetchApi.put shortcut 2016-06-17 21:05:30 -07:00
Maximilian Hils
ce53799c62 simplify settings reducer 2016-06-17 21:03:19 -07:00
Jason
965b27b529 [web] simplify settings 2016-06-17 22:12:32 +08:00
Jason
c82d27b2a2 Merge branch 'master' into settings
Conflicts:
	mitmproxy/web/static/app.css
	mitmproxy/web/static/app.js
	web/src/js/components/ProxyApp.jsx
2016-06-17 21:58:24 +08:00
Jason
e4addd60f1 Merge branch 'master' into websocket
Conflicts:
	mitmproxy/web/static/app.css
	mitmproxy/web/static/app.js
	web/src/js/components/ProxyApp.jsx
2016-06-17 21:54:31 +08:00
Thomas Kriechbaumer
9c6199db9b Merge pull request #1269 from Kriechi/pathod-netlib-http2
move custom HTTP/2 stack from netlib to pathod
2016-06-17 15:21:57 +02:00
Thomas Kriechbaumer
eb3ed87100 move custom HTTP/2 stack from netlib to pathod 2016-06-17 15:06:01 +02:00
Maximilian Hils
fcf5dc8728 Merge pull request #1267 from gzzhanghao/components
[web] Working on components
2016-06-17 01:53:02 -07:00
Maximilian Hils
78785df16b pathoc: use idna encoding for hostnames 2016-06-16 17:09:52 -07:00
Shadab Zafar
2a0e850615 pathod tests: do not string_escape specs 2016-06-16 17:08:21 -07:00
Shadab Zafar
6782b4ec00 Py3: Store certificate with a byte key
Had to debug this for hours!
2016-06-16 17:08:06 -07:00
Shadab Zafar
ea5576238f Py3: Use BytesIO in a pathoc test 2016-06-16 17:08:06 -07:00
Shadab Zafar
aa3d3290ee Py3: Send bytes to get_cert 2016-06-16 17:08:06 -07:00
Shadab Zafar
cd5ef042bb Py3: pathoc should send bytes over wire 2016-06-16 17:08:06 -07:00
Shadab Zafar
500bf18023 Enable Travis for the entire pathod directory :) 2016-06-16 17:08:06 -07:00
Shadab Zafar
f399a5cd29 Py3: Fix tests by using byte literals 2016-06-16 17:08:06 -07:00
Jason
034287edcf [web] clean up 2016-06-17 07:57:06 +08:00
Maximilian Hils
4836f3f12b Merge pull request #1263 from Kriechi/readme
Update README with information about tox & flake8.
2016-06-16 16:28:18 -07:00
Jason
16a28eca25 [web] websocket 2016-06-17 07:26:29 +08:00
Jason
7a78970d10 [web] common 2016-06-17 07:07:38 +08:00
Jason
4ce7a9ba77 [web] editor config for line endings 2016-06-17 06:26:46 +08:00
Jason
6ad2f13341 [web] fix settings ducks 2016-06-17 06:01:29 +08:00
Jason
cedac98b70 [web] promot reduce 2016-06-17 05:08:05 +08:00
Jason
7fb0836bfe [web] remove store 2016-06-17 05:08:05 +08:00
Jason
b88937f1e0 [web] eliminate SettingsStore 2016-06-17 05:08:05 +08:00
Jason
99b2b8633d [web] settings store 2016-06-17 05:08:05 +08:00
Jason
f5c597a9e3 [web] Editor & Prompt 2016-06-17 04:38:35 +08:00
Jason
e5bf1e930a [web] FlowView and ContentView 2016-06-17 04:37:57 +08:00
Thomas Kriechbaumer
daa31c0fe0 hide codecov.yml 2016-06-16 18:13:03 +02:00
Maximilian Hils
1fc2db85fa web: fix tests 2016-06-16 03:06:08 -07:00
Thomas Kriechbaumer
1575fd3c9e update README with tox and flake8 info 2016-06-16 10:12:22 +02:00
Maximilian Hils
848e7c6c50 web: use implicit bindActionCreators 2016-06-15 14:32:03 -07:00
Maximilian Hils
c7a891b652 Merge branch 'add_flow_to_options' 2016-06-15 13:40:03 -07:00
Maximilian Hils
94e2929b3f minor fixes 2016-06-15 13:39:56 -07:00
Shadab Zafar
7de5d7b298 Enable Travis for test/pathod/test_pathoc 2016-06-15 09:49:39 +02:00
Shadab Zafar
52fa195204 Unexpected spaces around = 2016-06-15 09:49:39 +02:00
Shadab Zafar
03ce09ca99 Py3: Split on byte newlines in pathod.log 2016-06-15 09:49:39 +02:00
Shadab Zafar
22a94f06e6 Py3: Find Content-Length header by bytes 2016-06-15 09:49:38 +02:00
Shadab Zafar
f83433e674 Py3: pathoc 2016-06-15 09:49:38 +02:00
Shadab Zafar
fa40531a80 Py3: pathod 2016-06-15 09:49:38 +02:00
Shadab Zafar
d9b940c21e Py3: websockets 2016-06-15 09:49:38 +02:00
Shadab Zafar
0f1aa2b78e Py3: fix http2 bytes issue 2016-06-15 09:49:38 +02:00
Clemens
48e372bf98 rename view -> ui, make code more readable 2016-06-15 08:54:55 +02:00
Clemens
00b4abfe83 add previous state to dispatch function 2016-06-15 00:19:33 +02:00
Clemens
003096b4cc code review 2016-06-14 22:17:34 +02:00
Maximilian Hils
26fe7dc87d Merge pull request #1257 from tdickers/master
Make har_extractor.py output HAR 1.2 spec-compliant
2016-06-14 10:03:13 -07:00
Tai Dickerson
c2d0910e59 Make har_extractor.py output HAR 1.2 spec-compliant
HAR files were failing to load in harviewer (http://www.softwareishard.com/har/viewer/) due to:
- ISO 8601 dates for startedDateTime missing timezone (http://www.softwareishard.com/blog/har-12-spec/#pages)
-- Used UTC but could add detection of default system timezone if desired
- pages object missing pageTimings (http://www.softwareishard.com/blog/har-12-spec/#pageTimings)
-- Used {} because all child fields are optional
2016-06-14 12:47:10 -04:00
Clemens
bf75e14573 added flowMenu 2016-06-14 11:20:48 +02:00
Aldo Cortesi
a63817f2b8 Merge pull request #1253 from mhils/fix-debug
Fix Debug Mode on Windows
2016-06-14 17:12:02 +12:00
Aldo Cortesi
04394ebd50 Merge pull request #1251 from cortesi/netlibrace
Roll connect handlers and thread leak detection out in more of the netlib test suite
2016-06-14 17:11:41 +12:00
Aldo Cortesi
93276d45be Merge branch 'master' into netlibrace 2016-06-14 16:29:15 +12:00
Aldo Cortesi
4c292b0197 Fix Python3 tests 2016-06-14 16:13:50 +12:00
Aldo Cortesi
d8ae2f1562 Merge pull request #1254 from mitmproxy/scriptargs
Inline Scripts: use sys.argv instead of args argument.
2016-06-14 15:25:01 +12:00
Aldo Cortesi
c2b5a13e3f Don't fail when start() is not defined 2016-06-14 14:39:07 +12:00
Aldo Cortesi
59aff68e7a Merge branch 'netlibrace' of github.com:cortesi/mitmproxy into netlibrace 2016-06-14 14:35:12 +12:00
Aldo Cortesi
50a20fefee Satisfy lint 2016-06-14 14:34:30 +12:00
Aldo Cortesi
9e63350a96 Use handlers in http2 test suite 2016-06-14 14:32:18 +12:00
Aldo Cortesi
e6fd98bb72 Start rolling out leak detection in netlib 2016-06-14 14:32:18 +12:00
Maximilian Hils
63c6660895 update examples, tests, docs 2016-06-13 18:17:09 -07:00
Maximilian Hils
804efe9d38 fix contextmanager, remove args argument to start() 2016-06-13 18:08:57 -07:00
Maximilian Hils
3c9a70b761 fix debug mode on Windows 2016-06-13 18:06:44 -07:00
Aldo Cortesi
e7b61995ad A tiny wrapper to make script invocations nicer 2016-06-14 12:34:22 +12:00
Aldo Cortesi
3c5b0491e6 Use handlers in http2 test suite 2016-06-14 12:09:13 +12:00
Aldo Cortesi
d7d532d6a6 Merge remote-tracking branch 'upstream/master' into netlibrace 2016-06-14 11:20:29 +12:00
Thomas Kriechbaumer
ccf4723505 Merge pull request #1242 from Kriechi/fix-1240
fix #1240
2016-06-12 14:17:30 +02:00
Thomas Kriechbaumer
a5aa16e03b fix #1240 2016-06-12 11:51:49 +02:00
Aldo Cortesi
a9c74bcb55 Start rolling out leak detection in netlib 2016-06-12 12:15:00 +12:00
Aldo Cortesi
e0d6434b27 Merge pull request #1247 from cortesi/appveyor
Be stricter about handling connetcts in the pathoc test suite
2016-06-12 11:35:20 +12:00
Aldo Cortesi
e58a2bf095 Merge branch 'master' into appveyor 2016-06-12 11:27:16 +12:00
Aldo Cortesi
dc545ca0f6 Make the tcp connection closer cancellable
And use this to make pathoc error handling more sophisticated
2016-06-12 11:17:05 +12:00
Aldo Cortesi
1d44030963 Merge pull request #1246 from cortesi/version
Fold mitmproxy.version and pathod.version into netlib.version
2016-06-12 10:40:10 +12:00
Aldo Cortesi
9bea616441 Be stricter about handling connetcts in the pathoc test suite
Attempt to clear a niggling Appveyor exception buggering up our CI.
2016-06-12 10:39:19 +12:00
Aldo Cortesi
728d5caa22 Fold mitmproxy.version and pathod.version into netlib.version 2016-06-12 10:29:12 +12:00
Thomas Kriechbaumer
c801f81373 Merge pull request #1243 from cortesi/debug2
debug: On SIGUSR2, we dump tracebacks for all threads to screen
2016-06-11 14:22:48 +02:00
Aldo Cortesi
e9f8eb1f6b Satisfy lint 2016-06-11 23:13:41 +12:00
Aldo Cortesi
7b86560ded debug: On SIGUSR2, we dump tracebacks for all threads to screen 2016-06-11 23:07:42 +12:00
Aldo Cortesi
8489c01ac8 Merge pull request #1241 from cortesi/debug
Debug
2016-06-11 22:22:02 +12:00
Aldo Cortesi
53b2fd545b Zap stray semicolon 2016-06-11 21:26:38 +12:00
Aldo Cortesi
5566a1f0e6 debug: num_fds is posix-only 2016-06-11 21:25:34 +12:00
Aldo Cortesi
0848d1085e debug: add OpenSSL 2016-06-11 21:06:41 +12:00
Aldo Cortesi
3f240b1875 debug: verison -> version
@resam blew our sponsorship - t-mobile is up next
2016-06-11 21:04:13 +12:00
Aldo Cortesi
09edbd9492 Improve debugging of thread and other leaks
- Add basethread.BaseThread that all threads outside of test suites should use
- Add a signal handler to mitmproxy, mitmdump and mitmweb that dumps resource
information to screen when SIGUSR1 is received.
- Improve thread naming throughout to make thread dumps understandable
2016-06-11 19:52:24 +12:00
Aldo Cortesi
5b9f07c81c debug.sysinfo: tests and coverage 2016-06-11 17:56:17 +12:00
Aldo Cortesi
e367b88195 Add a --sysinfo flag to all daemons
This dumps all the platform information and mitmproxy version data we'd
normally need to troubleshoot an issue.
2016-06-11 16:40:21 +12:00
Aldo Cortesi
4831e3e0bc Merge pull request #1238 from cortesi/toxfiddle
Distinguish between CI and interactive versions of tox
2016-06-11 16:24:12 +12:00
Aldo Cortesi
227d762cac Merge branch 'master' into toxfiddle 2016-06-11 16:08:14 +12:00
Aldo Cortesi
250b47487a tox: Pull Py3 test list out into an environment variable
Suggestion from @resam
2016-06-11 09:34:40 +12:00
Maximilian Hils
0b241a1da7 Merge remote-tracking branch 'jason/master' 2016-06-10 12:03:56 -07:00
Aldo Cortesi
3f7dc296c8 We're not using tox-travis any more - ditch it. 2016-06-10 20:05:18 +12:00
Aldo Cortesi
6da3ef48e0 Remove explicit versions in tox CI environments
Tox matches the environment prefix against its std environs, so we don't need
to be explicit with versions here.
2016-06-10 19:38:55 +12:00
Aldo Cortesi
bac3e87538 Distinguish between CI and interactive versions of tox
- This patch changes tox so that local invocation runs the tests
with paralellism, coverage disabled, and without attempting to report coverage
upstream.

- You can now run specific tests for the py27 environment:

    tox -e py27 ./path/to/my/test

We can't do this for py35 just yet, because of our junk filter, and the fact
that we specify which tests to run directly in the conf file. Once these are
cleaned up, we can extend.
2016-06-10 16:03:54 +12:00
Aldo Cortesi
11fb217191 Fix a crash when pathoc connections fail
Use the new handler to tidy this up.
2016-06-10 11:14:23 +12:00
Aldo Cortesi
120b6c0b59 Merge remote-tracking branch 'upstream/master' into pathodlog 2016-06-10 10:49:45 +12:00
Aldo Cortesi
2cf79b7912 Remove timestamps from pathoc output
Pathoc is an interactive tool, no need for a long leading timestamp. More
generally, make timestamps optional in the logging mechanism so we can
configure this with command-line flags or something down the track.
2016-06-10 10:47:28 +12:00
Jason
c33df55919 [web] update build 2016-06-09 20:39:51 +08:00
Jason
81a0c45c89 [web] header.js -> Header.js 2016-06-09 20:35:03 +08:00
Jason
6c95635cb8 [web] eventlog.js -> EventLog.jsx 2016-06-09 18:40:59 +08:00
Jason
1baefcdc99 [web] footer.js -> Footer.jsx 2016-06-09 18:13:18 +08:00
Jason
e24bf8d73f [web] fix shortcut for header fields 2016-06-09 18:03:40 +08:00
Jason
f306cfa8b6 [web] separate flowtable to multiple files 2016-06-09 17:52:30 +08:00
Maximilian Hils
52754f40c2 Merge pull request #1233 from gzzhanghao/master
[web] ProxyApp and MainView with ES6
2016-06-09 00:53:33 -07:00
Jason
6407765285 [web] update build 2016-06-09 14:22:23 +08:00
Jason
8e538c7630 [web] fix updateLocation 2016-06-09 14:20:14 +08:00
Jason
851bb4bf68 [web] rewrite ProxyApp and MainView with es6 2016-06-09 13:35:41 +08:00
Maximilian Hils
7707d096d2 fix default websocket state 2016-06-08 19:41:34 -07:00
Aldo Cortesi
9b0e31d312 Merge pull request #1232 from cortesi/odict
Remove odict
2016-06-09 13:59:26 +12:00
Aldo Cortesi
c421c41307 Remove odict
- Adds default implementations for _kconv and _reduce_values to MultiDict.
Without these, operations fail in really, really non-obvious ways.
- Replace the remaining few instances of ODict

Fixes #1159
2016-06-09 13:28:43 +12:00
Maximilian Hils
90cb84b536 Merge pull request #1220 from mitmproxy/add_sorting_with_redux
Add sorting with redux
2016-06-08 13:37:09 -07:00
Thomas Kriechbaumer
68f07911e0 properly fail on test failures 2016-06-08 19:46:13 +02:00
Maximilian Hils
f3f8dce5a0 Merge pull request #1230 from redfast00/master
fix after cleanup of netlib.utils in mitmproxy.console.statusbar
2016-06-08 10:15:55 -07:00
Thomas Kriechbaumer
696fe209e0 Merge pull request #1223 from dufferzafar/pathod-lang-http2
Python 3 - pathod.language.http2
2016-06-08 13:09:40 +02:00
redfast00
16d32b2ce5 fix after cleanup of netlib.utils in mitmproxy.console.statusbar 2016-06-08 13:07:19 +02:00
Shadab Zafar
7d62121b85 Py3: encode() the spec before appending to path 2016-06-08 16:29:21 +05:30
Shadab Zafar
70216673a1 Py3: Find content-length header by bytes 2016-06-08 16:28:39 +05:30
Shadab Zafar
e187358e97 Py3: Pass bytes to http Request and Response 2016-06-08 16:17:00 +05:30
Shadab Zafar
2ff5c789df Enable Travis for test_language_http2 2016-06-08 16:17:00 +05:30
Shadab Zafar
b3b4156c2f Py3: Fix test_language_http2 tests by using byte literals 2016-06-08 16:15:54 +05:30
Shadab Zafar
6b03df2633 Py3: Use global next() instead of iterator method 2016-06-08 16:15:54 +05:30
Shadab Zafar
0280af9522 Py3: Use BytesIO instead of StringIO 2016-06-08 16:15:54 +05:30
Shadab Zafar
4f97216501 Py3: Properly encode() access to user_agents 2016-06-08 16:15:54 +05:30
Clemens
ad84d650de sorting add pr review changes 2016-06-08 10:29:33 +02:00
Aldo Cortesi
e93fe9d4fa Merge pull request #1228 from cortesi/controller2
Controller refactoring
2016-06-08 14:09:59 +12:00
Aldo Cortesi
a5cb241c7c If a message has been acked, all other processors are skipped
This applies the constraint, but does to clumsily. When we've unified modules
and processors it will be much nicer. We also make some exceptions for the
master processors that we may want to re-evaluate down the track.
2016-06-08 12:58:58 +12:00
Aldo Cortesi
b3bf754e53 Simplify script concurrency helpers
We now have take() to prevent double-replies.
2016-06-08 11:21:38 +12:00
Aldo Cortesi
a388ddfd78 A new interface for reply
Reply is now explicit - it's no longer a callable itself. Instead, we have:

    reply.kill()            - kill the flow
    reply.ack()             - ack, but don't send anything
    reply.send(message)     - send a response

This is part of an incremental move to detach reply from our flow objects,
and unify the script and handler interfaces.
2016-06-08 10:44:20 +12:00
Aldo Cortesi
982077ec31 Add reply.ack and reply.kill 2016-06-08 10:14:34 +12:00
Aldo Cortesi
db11fe0087 Merge branch 'master' into beautiful-json 2016-06-08 09:19:25 +12:00
Aldo Cortesi
eb680e7764 Merge pull request #1226 from Kriechi/travis-tox
use tox in Travis
2016-06-08 09:06:47 +12:00
Thomas Kriechbaumer
14ac916bce use tox in Travis 2016-06-07 19:59:49 +02:00
Clemens
dbbda03020 sorting done, ready to review 2016-06-07 11:22:52 +02:00
Clemens
fa3ad2382b sorting done, ready to review 2016-06-07 11:07:25 +02:00
Clemens
1aac283e23 moved redux state injection closer to child 2016-06-07 11:07:25 +02:00
Clemens
ff2129773f start with sort, continue tomorrow 2016-06-07 11:07:25 +02:00
Clemens
ac2d8549e5 moved sort state to redux, missing apply sort 2016-06-07 11:07:25 +02:00
Maximilian Hils
c98c83190b tests++ 2016-06-07 01:03:08 -07:00
Maximilian Hils
637a3be937 disable codecov comments 2016-06-07 01:00:23 -07:00
Maximilian Hils
c6180a7b26 don't declare codecov as dev dependency 2016-06-07 00:48:32 -07:00
Maximilian Hils
5ea363afad use codecov pypi package 2016-06-07 00:45:43 -07:00
Maximilian Hils
e7ba89a327 Update README.rst 2016-06-07 00:32:29 -07:00
Shadab Zafar
d254fe791a Py3: Fix a test_language_writer test by using a byte literal 2016-06-07 00:01:41 -07:00
Maximilian Hils
4f3ace1a62 Merge branch 'port-pathod-language-writer' 2016-06-07 00:00:20 -07:00
Maximilian Hils
e115859bbd Merge pull request #1216 from dufferzafar/pathod-lang-ws
Python 3 - pathod.language.websocket
2016-06-06 23:57:50 -07:00
Maximilian Hils
1904afe3f0 add codecov too appveyor 2016-06-06 23:41:41 -07:00
Maximilian Hils
009a4d2add s/coveralls/codecov/ 2016-06-06 23:38:21 -07:00
Shadab Zafar
d2281e0ab3 Enable Travis for test/pathod/test_language_websocket 2016-06-07 11:40:17 +05:30
Maximilian Hils
ba466dbb35 simplify pretty_json, improve test coverage 2016-06-06 23:08:58 -07:00
Maximilian Hils
71b6e369f8 change content views: escape in raw mode, show utf8 in json 2016-06-06 22:42:11 -07:00
Aldo Cortesi
1ffc273c94 Utils cleanups
- Move more stuff that belongs in netlib.human
- Move some stuff to near the only use
- Zap mitmproxy.utils.timestamp(). I see the rationale, but we used it
interchangeably with time.time() throughout the project. Since time.time()
dominates in the codebase and timestamp() is such low utility, away it goes.
2016-06-07 17:12:52 +12:00
Maximilian Hils
b180bfcf35 fix docs 2016-06-06 19:30:45 -07:00
Maximilian Hils
7f0c8ab40e travis: stricter doc checks 2016-06-06 19:10:19 -07:00
Maximilian Hils
83f8522981 docs: remove option directive
inserting " .. option::" tags create ugly markup, so we just ditch this
entirely and continue using refs.
2016-06-06 19:10:19 -07:00
Maximilian Hils
9a1cc16643 fix MultiView docs 2016-06-06 19:10:19 -07:00
Maximilian Hils
38d2e6432c minor fixes 2016-06-06 19:10:19 -07:00
Aldo Cortesi
9b7de5c98f docs: adjust theme override inclusion
https://github.com/rtfd/readthedocs.org/issues/2116
2016-06-07 13:54:40 +12:00
Aldo Cortesi
75ebd638eb Merge remote-tracking branch 'upstream/master' 2016-06-07 12:56:51 +12:00
Aldo Cortesi
e037fe05ff Migrate pathod docs to Sphinx
All the content of the pathod docs are moved into Sphinx. The interactive
format has not translated well to static docs, and there's still a lot of
rewriting, format fixing, structuring, etc to be done.
2016-06-07 12:55:32 +12:00
Maximilian Hils
80292c0ac3 fix all pathod tests on Windows 🎉 2016-06-06 16:03:45 -07:00
Maximilian Hils
3bf36854e7 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-06-06 15:59:48 -07:00
Maximilian Hils
f2f5beb75d Merge branch 'pathod-lang-http' 2016-06-06 15:59:24 -07:00
Maximilian Hils
54ee8ff4d4 web: accept all falsey sortFns in sortedIndexOf 2016-06-06 15:47:31 -07:00
Maximilian Hils
7cb7d9ad32 netlib: always disconnect when using context manager 2016-06-06 15:10:03 -07:00
Maximilian Hils
2ee5e8ef0e fix NestedMessage encoding 2016-06-06 13:39:38 -07:00
Maximilian Hils
6447c8ae22 fix .freeze(), improve tests 2016-06-06 13:31:44 -07:00
Maximilian Hils
c973fd881f update pyparsing 2016-06-06 13:29:39 -07:00
Shadab Zafar
afa2ad81df Py3: encode() status code responses 2016-06-06 11:52:45 -07:00
Shadab Zafar
b03a98f9fc Py3: Exception doesn't have to be bytes 2016-06-06 11:52:45 -07:00
Shadab Zafar
f48073af56 Py3: Fix status_code and other tests by using byte literals 2016-06-06 11:52:45 -07:00
Shadab Zafar
5a2932adc1 Py3: Fix corresponding base.Integer test in test_language_base 2016-06-06 11:52:45 -07:00
Shadab Zafar
daba944151 Py3: Store base.Integer value as bytes 2016-06-06 11:52:45 -07:00
Shadab Zafar
40056e1cd7 Py3: Fix useragent tests 2016-06-06 11:52:45 -07:00
Shadab Zafar
78b2fa3a13 Py3: UASTRINGS should be indexed by and return bytes 2016-06-06 11:52:45 -07:00
Shadab Zafar
da38ce2e6e Py3: decode() input before creating new Header token 2016-06-06 11:52:45 -07:00
Shadab Zafar
f5a6b295f7 Py3: Fix websocket tests 2016-06-06 11:52:45 -07:00
Shadab Zafar
b86ef9fd04 Py3: Use BytesIO in tutils.render 2016-06-06 11:52:45 -07:00
Shadab Zafar
c4ac19be9f Py3: Use bytes_to_escaped_str for escaping message 2016-06-06 11:52:45 -07:00
Shadab Zafar
4813f9c69e Py3: More byte literals 2016-06-06 11:52:45 -07:00
Shadab Zafar
f6523a128c Enable Travis for test/pathod/test_language_http 2016-06-06 11:52:45 -07:00
Shadab Zafar
bafce6cfe9 Py3: Use byte string literals 2016-06-06 11:51:36 -07:00
Shadab Zafar
9a19540f8b Py3: Use BytesIO instead of StringIO for tests 2016-06-06 11:51:36 -07:00
Shadab Zafar
12dd6f6707 Py3: Use global next() instead of iterator method 2016-06-06 11:51:36 -07:00
Shadab Zafar
07a0d6dcc2 Py3: Return bytes from _Component class 2016-06-06 11:51:36 -07:00
Shadab Zafar
ced6fb4cf9 Py3: Fix tests by using byte literals 2016-06-06 11:48:58 -07:00
Shadab Zafar
efb0f7133c Py3: Use global next() instead of iterator method 2016-06-06 11:48:54 -07:00
Maximilian Hils
437866ebf9 Reenable pathod.language.writer tests
This reverts commit 1e1b4fd88d.
2016-06-06 11:42:25 -07:00
Maximilian Hils
1e1b4fd88d fix travis tests on master 2016-06-06 11:41:51 -07:00
Maximilian Hils
1214085f67 fix pathod test on Windows 2016-06-06 11:37:49 -07:00
Aldo Cortesi
210c376901 Fix sequencing in Pathoc websocket termination test 2016-06-06 18:17:22 +12:00
Aldo Cortesi
21c7218ee3 Close when Pathoc.connect raises an exception 2016-06-06 16:52:51 +12:00
Aldo Cortesi
9458eaece7 Make more of the pathod test suite use synchronisation 2016-06-06 16:05:44 +12:00
Aldo Cortesi
e9fb35b817 Fix lint 2016-06-06 15:02:16 +12:00
Maximilian Hils
d878122cf9 web: fix list update propagation 2016-06-05 18:43:17 -07:00
Maximilian Hils
b6ebde3b1d Merge branch 'such-redux' 2016-06-05 18:23:46 -07:00
Maximilian Hils
e6ef149a03 web: modernize flow table columns 2016-06-05 18:23:06 -07:00
Maximilian Hils
efed5ab967 web: update react 2016-06-05 18:20:51 -07:00
Maximilian Hils
445a89e842 web: fix list reducer 2016-06-05 18:20:15 -07:00
Aldo Cortesi
2b19a33738 Merge pull request #1212 from mitmproxy/such-redux
web: completely move flow state to redux
2016-06-06 08:58:50 +12:00
Aldo Cortesi
08344ee38b Merge pull request #1215 from redfast00/master
Now keeps header capitalization
2016-06-06 08:45:35 +12:00
Aldo Cortesi
c31b9c461d Merge pull request #1211 from cortesi/pathod
WIP: Radical webectomy of pathod
2016-06-06 08:40:20 +12:00
redfast00
25505733bc fix multidict unittests 2016-06-05 21:20:37 +02:00
Shadab Zafar
435bfeca0b Use BytesIO instead of StringIO 2016-06-06 00:36:15 +05:30
redfast00
a724fd606a Now keeps header capitalization 2016-06-05 20:47:10 +02:00
Shadab Zafar
cff54edf6b Py3: Use functools.total_ordering for better rich comparison 2016-06-06 00:07:44 +05:30
Shadab Zafar
bda30efb35 Py3: Use rich comparison methods (__eq__, __lt__) instead of __cmp__ 2016-06-06 00:07:44 +05:30
Shadab Zafar
7b6da98719 Py3: Use byte literals for comparison 2016-06-06 00:07:44 +05:30
Shadab Zafar
be306c8439 Py3: Use global next() function instead of iterator method 2016-06-06 00:07:44 +05:30
Thomas Kriechbaumer
ef462a05d7 Merge pull request #1213 from felixonmars/patch-1
Allow cryptography 1.4
2016-06-05 12:34:46 +02:00
Thomas Kriechbaumer
65fe397f3c Merge pull request #1206 from Kriechi/improve-http2
improve http2
2016-06-05 10:10:28 +02:00
Felix Yan
ef363270b8 Allow cryptography 1.4
All tests passed and it works correctly here.
2016-06-05 00:04:24 -05:00
Maximilian Hils
d53a2de0ba web: completely move flow state to redux 2016-06-04 18:53:41 -07:00
Aldo Cortesi
a31c183a0f Ditch pathod static assets 2016-06-05 13:28:57 +12:00
Aldo Cortesi
375d7c9741 Remove last vestiges of noapi and noweb from pathod
Also hide HTTP2 freeze bug by making explain configurable in the tests
2016-06-05 13:24:46 +12:00
Aldo Cortesi
48da24ae7e First-order removal of pathod API and app 2016-06-05 13:04:13 +12:00
Aldo Cortesi
c0c45c051a Fix test that may fail due to binary header data
This is just inherently not a determinisitc test. We don't use the log HTTP
interface any more, so it can just go. A more radical "solution" is inbound
shortly.

Fixes #1207
2016-06-05 11:47:52 +12:00
Thomas Kriechbaumer
2355c29c0e Merge pull request #1209 from dufferzafar/pathod-lang-base
Python 3 - pathod.language.base
2016-06-04 15:57:22 +02:00
Shadab Zafar
f45765a236 Add test_language_base to tox.ini 2016-06-04 19:07:28 +05:30
Shadab Zafar
1de379be95 Enable Travis for test/pathod/test_language_base 2016-06-04 18:32:37 +05:30
Shadab Zafar
2dec2db756 Py3: Return path unescaped
[skip appveyor]
2016-06-04 18:31:31 +05:30
Shadab Zafar
6ffe8b376e Py3: Write bytes to file 2016-06-04 18:28:50 +05:30
Shadab Zafar
0d4437a404 Fix function name typo 2016-06-04 18:28:03 +05:30
Shadab Zafar
1c82231129 Use encode to detect if string is valid ASCII 2016-06-04 12:49:11 +02:00
Thomas Kriechbaumer
cfb5efc96f travis++ 2016-06-04 12:35:33 +02:00
Thomas Kriechbaumer
cc6b84dfc4 travis++ 2016-06-04 12:30:35 +02:00
Thomas Kriechbaumer
36c7fef134 add missing pathod files to travis 2016-06-04 12:27:46 +02:00
Thomas Kriechbaumer
c29bbbc29a Merge pull request #1208 from dufferzafar/pathod-lang-writer
Python 3 - pathod.language.writer
2016-06-04 12:01:19 +02:00
Shadab Zafar
bd7b275d44 Py3: Convert all data to bytes in pathod.language.writer test 2016-06-04 15:23:09 +05:30
Shadab Zafar
614a3d7a54 Py3: Use global next() instead of iterator method 2016-06-04 15:23:09 +05:30
Shadab Zafar
ae553ef472 Fix Docstring: "inject" can be an action too 2016-06-04 15:23:09 +05:30
Thomas Kriechbaumer
42930407ae improve travis 2016-06-04 11:25:47 +02:00
Thomas Kriechbaumer
1c4e1e049c http2: remove custom PUSH_PROMISE header 2016-06-04 11:20:10 +02:00
Thomas Kriechbaumer
ac70eaed66 http2: improve GoAway handling 2016-06-04 11:20:10 +02:00
Thomas Kriechbaumer
7f4ac6f27b http2: respect MAX_CONCURRENT_STREAMS by hold-off 2016-06-04 11:20:10 +02:00
Maximilian Hils
e880f532ad web interleave old store and redux flow state 2016-06-04 00:58:13 -07:00
Maximilian Hils
c0d08be7a6 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-06-04 00:41:35 -07:00
Maximilian Hils
b02d66491c web: implement update and remove for list and view 2016-06-04 00:37:10 -07:00
Aldo Cortesi
d5532319c1 Basic ConsoleMaster tests, based on mastertester 2016-06-04 19:07:27 +12:00
Aldo Cortesi
af63a3e064 console/__init__.py -> console/master.py 2016-06-04 16:06:44 +12:00
Aldo Cortesi
12a4f9ecf9 Very basic test truss for web.app 2016-06-04 15:30:28 +12:00
Aldo Cortesi
f7f9cab5dc Rebase on master 2016-06-04 14:37:07 +12:00
Maximilian Hils
1b1ea98f08 web: add flows to redux state 2016-06-03 18:53:30 -07:00
Maximilian Hils
1b327f34c3 web: add redux list views 2016-06-03 18:38:25 -07:00
Maximilian Hils
ff9cc8b283 web: remove old event log store 2016-06-03 18:38:25 -07:00
Maximilian Hils
d6fcd7e06d web: implement redux store fetching 2016-06-03 18:38:25 -07:00
Thomas Kriechbaumer
46d9cdd70a fix style 2016-06-03 18:57:46 +02:00
Maximilian Hils
e31aa39fc2 Merge branch 'redux-ducks' 2016-06-02 23:45:36 -07:00
Maximilian Hils
65fde7f554 Merge pull request #1190 from mitmproxy/file_menu_save_open
File menu save open
2016-06-02 23:42:35 -07:00
Maximilian Hils
5321f15def web: fix eventlog height registration 2016-06-02 23:41:32 -07:00
Maximilian Hils
7afac747a8 web: reduxify event log store 2016-06-02 23:40:30 -07:00
Maximilian Hils
7c63aa3708 web: reduxify WebSocket 2016-06-02 21:12:59 -07:00
Aldo Cortesi
1ab64da682 Merge pull request #1167 from xntrik/mark_filter
implement a toggle for viewing marked flows only in console
2016-06-03 15:05:18 +12:00
Aldo Cortesi
08e4cd2a40 Merge remote-tracking branch 'upstream/master' 2016-06-03 14:55:35 +12:00
Aldo Cortesi
25671b91bd Fix flow handling for mitmdump
Fixes #1188
2016-06-03 14:53:51 +12:00
Maximilian Hils
6a91ab166f remove reducers directory 2016-06-02 19:29:03 -07:00
Maximilian Hils
a2d13714a6 Merge pull request #1202 from Lukasa/track-down-crypto-problems
Better debugging output.
2016-06-02 19:12:05 -07:00
Aldo Cortesi
7191906ba8 Merge pull request #1192 from cortesi/testsuite
WIP: Solidify pathod test suite
2016-06-03 14:08:48 +12:00
Aldo Cortesi
28aa6f0564 Bush-leage revert: re-enable brew OpenSSL update 2016-06-03 13:58:03 +12:00
Aldo Cortesi
6943d7e397 More explicit name for the tcp.Server handler counter 2016-06-03 13:57:12 +12:00
Cory Benfield
010e3bb39d Quiet mode is a lie! 2016-06-02 18:56:32 -07:00
Cory Benfield
179b6e3525 Better debugging output. 2016-06-02 18:42:15 -07:00
Maximilian Hils
734ec94554 slightly improve readme wording 2016-06-02 18:25:56 -07:00
Aldo Cortesi
0d4a930397 Try not updating OpenSSL for now 2016-06-03 12:46:48 +12:00
Maximilian Hils
698d38b28e web: 🐣 2016-06-02 17:46:18 -07:00
Aldo Cortesi
e584ef0c56 Make dev.sh noisy to troubleshoot OpenSSL travis issue 2016-06-03 12:37:20 +12:00
Aldo Cortesi
e60860e65d Make tcp.Client.connect return a context manager that closes the connection 2016-06-03 12:06:36 +12:00
Aldo Cortesi
36383a6146 Pathod websocket service threads should not be immortal 2016-06-03 11:58:05 +12:00
Aldo Cortesi
c5076f5e01 Implement a service connection handler counter, use it in Pathod test suite
Lots of failures, but that's a good thing.
2016-06-03 11:47:07 +12:00
Aldo Cortesi
c6d15904f3 Merge remote-tracking branch 'upstream/master' into testsuite 2016-06-03 10:19:22 +12:00
Thomas Kriechbaumer
b9ad7be5ac Merge pull request #1199 from dufferzafar/pathod-generator-hotfix
Handle the slice object case in TransformGenerator.__getitem__
2016-06-02 22:45:55 +02:00
Shadab Zafar
8e60a9bca9 Handle the slice object case in TransformGenerator.__getitem__ 2016-06-03 02:00:58 +05:30
Clemens
5e7fa349a9 final review done, nothing to change -> ready to merge 2016-06-02 21:01:22 +02:00
Maximilian Hils
9c6da08d00 fix dumpfile upload 2016-06-02 11:41:26 -07:00
Thomas Kriechbaumer
66ec1940ac Merge pull request #1198 from s4chin/add-install-instructions
Add installation section to README
2016-06-02 20:06:24 +02:00
Sachin Kelkar
2ca066b7d6 Update README 2016-06-02 23:27:26 +05:30
Maximilian Hils
73e494770f web: add fetchApi convenience method 2016-06-02 10:34:16 -07:00
Clemens
89fc438e32 change some pr issuses 2016-06-02 10:31:24 -07:00
Clemens
a219d33430 basic file up and download working 2016-06-02 10:30:53 -07:00
Clemens
cf544318ae basic file up and download working 2016-06-02 10:30:43 -07:00
Clemens
dfc033ab5f added basic file up_download functionality (not finish yet) 2016-06-02 10:30:43 -07:00
Clemens
3e6a74f4ee added ui 2016-06-02 10:29:55 -07:00
Maximilian Hils
d84610a41d web: use object spread operator
While the spread operator is not part of ES6, React also uses it for JSX.
It makes sense for us to keep it in other parts of the codebase as well.
2016-06-02 10:24:33 -07:00
Maximilian Hils
5e385405ca please flake8 2016-06-02 09:54:19 -07:00
Maximilian Hils
29c52d98dc Merge remote-tracking branch 'duffer/pathod-lang-generators' 2016-06-02 09:53:22 -07:00
Maximilian Hils
7a388560d7 use object spread operator
While the spread operator is not part of ES6, React also uses it for JSX.
It makes sense for us to keep it in other parts of the codebase as well.
2016-06-02 09:51:39 -07:00
Shadab Zafar
75ce2498e8 Simplify rand_byte by creating a special case for Python 2 2016-06-02 13:34:18 +05:30
Aldo Cortesi
5fd52970fd Satisfy linting gods 2016-06-02 19:55:52 +12:00
Aldo Cortesi
69de78515d Make last_log actually return last log 2016-06-02 19:45:18 +12:00
Aldo Cortesi
c9dd574f48 Silence requests warnings
Once we convert the rest of the suite to pathoc, this can go.
2016-06-02 19:40:39 +12:00
Aldo Cortesi
d8c52964c7 Reimplement test retrievals on pathoc and ditch requests
Requests uses urllib3, which has a connection pool that's not easy to disable
(https://github.com/shazow/urllib3/issues/383).
2016-06-02 19:36:02 +12:00
Shadab Zafar
c4da7e026c Enable Travis for test_language_generators 2016-06-02 13:03:18 +05:30
Shadab Zafar
ec5d931ee3 Remove redundant __getslice__ from TransformGenerator 2016-06-02 13:02:17 +05:30
Shadab Zafar
b510616c69 Py3: Return bytes from FileGenerator
and use __getitem__ instead of __getslice__
2016-06-02 13:00:44 +05:30
Shadab Zafar
a04d7fd166 Py3: Return bytes from RandomGenerator
and use __getitem__ rather than __getslice__
2016-06-02 13:00:02 +05:30
Maximilian Hils
9e3591e3c2 add basic redux architecture, convert eventlog to redux 2016-06-02 00:04:10 -07:00
Aldo Cortesi
a7522d9308 pathod.test shouldn't use the API at all 2016-06-02 18:27:51 +12:00
Aldo Cortesi
254614e9f7 Since we have locks over the logs, use direct access rather than API requests to get to them 2016-06-02 18:10:36 +12:00
Maximilian Hils
9a76e31f2f add redux as dependency 2016-06-01 22:56:51 -07:00
Aldo Cortesi
40156ce123 Bump error timeout 2016-06-02 17:55:11 +12:00
Aldo Cortesi
5e12384486 Remove debug print 2016-06-02 17:54:34 +12:00
Aldo Cortesi
92decf96dd Add expect_log to the pathod test truss, and use it for last_log 2016-06-02 17:46:37 +12:00
Aldo Cortesi
007a03664c Move the admonision to use Discourse in the issue template to the bottom
Github integrations get the raw issue text, which means that the context we see
in-channel is mostly the admonition. I think it's visible enough at the bottom
to catch most users who would have paid attention to it if it were at the top.
2016-06-02 17:11:23 +12:00
Aldo Cortesi
14d6e1d2e3 Formatting of README
This is really a pretext to get Travis to rebuild, because it's stuck on the
wrong commit for the branch.
2016-06-02 16:43:46 +12:00
Aldo Cortesi
29bcdc8250 Fix lock over pathod locks
There were basically a nop before... o_O
2016-06-02 16:08:17 +12:00
Aldo Cortesi
ffca395e48 Honesty in testing
- Don't skip tests that fail
- Don't omit console from coverage

I'm working on the pathod races, and can't seem to reproduce the failures
locally.

Also, let's not kid ourselves about the console coverage - it should be
tracked. To improve it, we should measure it. Regressions in coverage of the
module should be flagged by CI.
2016-06-02 14:44:06 +12:00
Aldo Cortesi
07f7905f91 Merge pull request #1191 from cortesi/utils
Utils reorganisation
2016-06-02 13:14:56 +12:00
Aldo Cortesi
09da1febbd Shift a bunch more string-related functions to strutils 2016-06-02 13:04:19 +12:00
Aldo Cortesi
31012d782f Consolidate some functions to strutils.bytes_to_escaped_str 2016-06-02 12:53:12 +12:00
Aldo Cortesi
3d9dbd6a49 xrepr is used exactly once. move to pathoc.py. 2016-06-02 12:37:24 +12:00
Aldo Cortesi
cccdc98426 Utils reorganisation: add netlib.strutils
Extract a number of string and format-related functions to netlib.strutils.
2016-06-02 12:31:41 +12:00
Aldo Cortesi
eaa3b308f7 Fix non-deterministic test failures in export
We had various places in the code where we relied on incidental order of dict
keys. Add a helper to multidict, and fix.
2016-06-02 11:37:18 +12:00
Aldo Cortesi
92cdca50c7 Make Travis behave 2016-06-01 17:45:03 +12:00
Aldo Cortesi
08c82804e6 Ditch IRC Travis notifications, try to fix Slack Travis notifications 2016-06-01 17:26:55 +12:00
Aldo Cortesi
3206a48ceb Remove downloads for now
Fixes #1185
2016-06-01 17:07:15 +12:00
Aldo Cortesi
1a08048a8d Un-break mitmproxy console 2016-06-01 16:51:17 +12:00
Aldo Cortesi
92b24c6653 Merge pull request #1183 from mitmproxy/module-imports
use module-level imports only
2016-06-01 16:26:55 +12:00
Aldo Cortesi
137ee28bd6 Fix test suite 2016-06-01 15:10:54 +12:00
Aldo Cortesi
d60fdebc47 Fix lint harder 2016-06-01 14:50:06 +12:00
Aldo Cortesi
efbdd8d266 Merge branch 'module-imports' of github.com:mitmproxy/mitmproxy into module-imports 2016-06-01 14:43:24 +12:00
Aldo Cortesi
afcfa783ea Satisfy lint 2016-06-01 14:43:08 +12:00
Maximilian Hils
1ca45b1e64 fix imports 2016-05-31 19:35:10 -07:00
Maximilian Hils
3aa8d42b05 fix PIL import 2016-05-31 19:25:47 -07:00
Maximilian Hils
0a2e7a97cd use module-level imports only 2016-05-31 19:06:57 -07:00
Maximilian Hils
1dd078beb2 Merge pull request #1182 from cortesi/netlibimports
Reorganise netlib imports according to Google Style Guide
2016-05-31 17:33:57 -07:00
Aldo Cortesi
44fdcb4b82 Reorganise netlib imports according to Google Style Guide 2016-06-01 11:12:10 +12:00
Aldo Cortesi
ebeda5e8d2 It's text markup language, Jim, but not as we know it 2016-06-01 10:17:10 +12:00
Aldo Cortesi
be64445364 Merge remote-tracking branch 'upstream/master' 2016-06-01 09:58:15 +12:00
Aldo Cortesi
a061e45877 Merge branch 'master' of github.com:cortesi/mitmproxy 2016-06-01 09:58:01 +12:00
Aldo Cortesi
0670354203 Style guides in README 2016-06-01 09:55:43 +12:00
Maximilian Hils
898602ad21 Merge pull request #1180 from dufferzafar/pathod-base
Python 3 - pathod.language.base
2016-05-31 14:46:28 -07:00
Maximilian Hils
30fff1fb32 be more strict about module namespaces 2016-05-31 14:05:57 -07:00
Aldo Cortesi
a7abf8b731 Merge pull request #1179 from cortesi/reorg
Start reorganising */utils.py
2016-05-31 21:03:42 +12:00
Aldo Cortesi
4da125b6a0 Fix tests harder 2016-05-31 20:51:06 +12:00
Aldo Cortesi
42e91fcfe1 http2.frame -> http2.framereader 2016-05-31 20:32:28 +12:00
Aldo Cortesi
5a75ea3fc6 Fix test failures 2016-05-31 20:19:54 +12:00
Aldo Cortesi
40a030f215 Satisfy flake8 2016-05-31 19:58:28 +12:00
Aldo Cortesi
f62efed304 Unify and make symmetric pretty_size and parse_size 2016-05-31 19:45:48 +12:00
Aldo Cortesi
b2f63458fc Move human-friendly format functions to netlib.human, remove redundant implementations 2016-05-31 19:32:08 +12:00
Aldo Cortesi
ec34cae618 utils.multipartdecode -> http.multipart.decode
also

utils.parse_content_type -> http.headers.parse_content_type
2016-05-31 19:07:55 +12:00
Aldo Cortesi
15b2374ef9 netlib.utils.get_header_tokens -> netlib.http1.read.get_header_tokens
Placing this next to its only use.
2016-05-31 18:54:42 +12:00
Aldo Cortesi
da074bff01 isascii is unused 2016-05-31 18:51:40 +12:00
Aldo Cortesi
6dda2b2ee5 Module is part of the name - url.decode, not url.urldecode
A pattern we need to use far more often in the codebase
2016-05-31 18:46:19 +12:00
Aldo Cortesi
4e6c9c4e93 Extract url functions from netlib.utils and move to netlib.http.url 2016-05-31 18:42:56 +12:00
Aldo Cortesi
08fbe6f111 Start cleaning up netlib.utils
- Remove http2 functions, move to http2.frame
- Remove Serializable, move to netlib.basetypes
2016-05-31 17:16:31 +12:00
Aldo Cortesi
2f526393d2 Merge pull request #1178 from cortesi/pseudohdrs
Improve handling of HTTP2 pseudo-headers
2016-05-31 16:34:28 +12:00
Aldo Cortesi
4de4223b2d Extend pseudo-header treatment to :status on responses 2016-05-31 15:12:20 +12:00
Aldo Cortesi
9ea68ebd28 Improve handling of pseudo-headers
- The canonical source for :method, :scheme and :path are the .method, .scheme
and .path attributes on the request object.
- These pseudo-headers are stripped after reading the request, and re-inserted
just before sending.
- The :authority header remains, and should be handled analagously to the Host
header in HTTP1 with respect to display and user interaction.
2016-05-31 14:36:17 +12:00
Aldo Cortesi
d98582664d Make tox run all tests for 2.7 2016-05-31 10:25:24 +12:00
Aldo Cortesi
bc6509ab6d Fix test import error 2016-05-31 10:25:02 +12:00
Aldo Cortesi
3e8345ee93 Merge branch 'flow-module-2' of https://github.com/mhils/mitmproxy into mhils-flow-module-2 2016-05-31 09:45:37 +12:00
Shadab Zafar
25e30f42be Py3: Use byte literals for comparison 2016-05-31 01:13:50 +05:30
Shadab Zafar
42f16d5d40 Py3: Use six.string_types instead of basestring 2016-05-31 00:49:44 +05:30
Shadab Zafar
769e20f2a9 Py3: Use range from six.moves 2016-05-31 00:41:44 +05:30
Maximilian Hils
e3d7224e5d tell flake8 that type-annotation imports are okay 2016-05-30 02:53:58 -07:00
Maximilian Hils
89f07603ca split mitmproxy.flow into mitmproxy.flow.* 2016-05-30 01:40:09 -07:00
Thomas Kriechbaumer
4f0657bc22 activate flake8 for good! 2016-05-30 09:44:40 +02:00
Clemens Brunner
6652e3a369 start of developing server side for options (#1155)
* added UI for options menu

* update UI for options menu

* update UI for options v2

* update UI for options v2

* added new btn class

* little changes

* little changes

* merge

* deleted branch

* change menu button class

* added option route + added very incomplete handler class

* moved options to settings

* added toggleinputbutton

* changed options menu

* added option for stream large bodies, but no working

* added option for stream large bodies, but no working
2016-05-29 23:34:30 -07:00
Aldo Cortesi
e8290a0eb4 Satisfy flake8 2016-05-30 12:41:44 +12:00
Aldo Cortesi
6ecc6da486 Merge branch 'tox' of https://github.com/Kriechi/mitmproxy into Kriechi-tox 2016-05-30 12:20:46 +12:00
Thomas Kriechbaumer
be9438b01c fix 2016-05-29 22:58:56 +02:00
Thomas Kriechbaumer
8cd0c9c330 fix windows paths 2016-05-29 22:47:51 +02:00
Thomas Kriechbaumer
669976d579 add tox 2016-05-29 22:39:06 +02:00
Thomas Kriechbaumer
fb0b591242 fix har test 2016-05-29 22:30:15 +02:00
Thomas Kriechbaumer
e723c2d6ad fix bytes vs. str 2016-05-29 22:17:45 +02:00
Thomas Kriechbaumer
03167d5e71 fix headers order 2016-05-29 22:07:22 +02:00
Maximilian Hils
2e633af5aa handle_* -> * leftovers 2016-05-29 13:01:45 -07:00
Thomas Kriechbaumer
748cbaa074 cleanup 2016-05-29 20:09:53 +02:00
Thomas Kriechbaumer
d76e5ad1ee raise a more verbose error 2016-05-29 19:28:59 +02:00
Thomas Kriechbaumer
a0e4bba7aa more style cleanup 2016-05-29 15:13:08 +02:00
Thomas Kriechbaumer
01fcaa64c3 fix #1162 2016-05-29 13:58:14 +02:00
Thomas Kriechbaumer
e2447406cc more style cleanup 2016-05-29 13:43:20 +02:00
Thomas Kriechbaumer
5c45ca7f9a fix travis with flake8 2016-05-29 12:17:46 +02:00
Thomas Kriechbaumer
287eff804d install flake8 2016-05-29 12:03:29 +02:00
Thomas Kriechbaumer
8eeab37a07 more style cleanup
Use this to check:
flake8 --count mitmproxy netlib pathod examples test
2016-05-29 11:55:12 +02:00
Thomas Kriechbaumer
0c2c017727 change comment indentation 2016-05-29 11:04:55 +02:00
Thomas Kriechbaumer
c707479bcd Merge pull request #1173 from mitmproxy/format-examples
Format examples
2016-05-29 11:03:54 +02:00
Thomas Kriechbaumer
979c7fc319 Merge pull request #1174 from Kriechi/flake8
make sure we do not introduce more style offenses
2016-05-29 11:03:30 +02:00
Maximilian Hils
4544e0f337 fix docs typo 2016-05-29 02:00:30 -07:00
Aldo Cortesi
27fff86cf7 Update method names in /examples/flowbasic
Please enter the commit message for your changes. Lines starting
2016-05-29 20:51:30 +12:00
Thomas Kriechbaumer
93a7d5b186 make sure we do not introduce more style offenses 2016-05-29 10:51:21 +02:00
Maximilian Hils
17382b963e format examples 2016-05-29 01:23:39 -07:00
Aldo Cortesi
6c8ad6d894 controller.ControlError -> exceptions.ControlException 2016-05-29 20:22:30 +12:00
Aldo Cortesi
8638000cfa Add some comments to controller wrapper. 2016-05-29 20:17:35 +12:00
Aldo Cortesi
f3bee6f245 Merge pull request #1172 from cortesi/solidcore
First steps to solidifying the core
2016-05-29 20:03:40 +12:00
Maximilian Hils
85aa5da6e3 fix tests 2016-05-28 19:31:43 -07:00
Maximilian Hils
b70663f434 minor improvements 2016-05-28 19:10:49 -07:00
Aldo Cortesi
0176f50e4f Adapt examples 2016-05-29 12:54:52 +12:00
Aldo Cortesi
0a875421c5 handle_* -> *
Now that we have the controller.handler decorator, the _handler prefix
stutters.
2016-05-29 12:49:01 +12:00
Aldo Cortesi
8bb9285678 Explicitly list all events 2016-05-29 12:15:52 +12:00
Aldo Cortesi
9a32402a39 Merge branch 'solidcore' of github.com:cortesi/mitmproxy into solidcore 2016-05-29 12:02:16 +12:00
Aldo Cortesi
e4f043f69c Flatten ServerMaster into Master 2016-05-29 12:01:46 +12:00
Aldo Cortesi
ed415877d4 Merge branch 'master' into solidcore 2016-05-29 11:14:46 +12:00
Thomas Kriechbaumer
7971dce223 mitmproxy: fix most flake8 offenses 2016-05-28 22:45:15 +02:00
Thomas Kriechbaumer
e4045dc7f8 pathod: fix most flake8 offenses 2016-05-28 22:44:28 +02:00
Thomas Kriechbaumer
e5038c9ab7 netlib: fix most flake8 offenses 2016-05-28 22:17:02 +02:00
Thomas Kriechbaumer
e1cc91900f ignore sslkeylogfile.log 2016-05-28 22:16:35 +02:00
Thomas Kriechbaumer
caee1adeb6 cleanup imports with flake8 2016-05-28 14:43:32 +02:00
Aldo Cortesi
4632cb5dbd Merge branch 'master' into solidcore 2016-05-28 20:59:51 +12:00
Maximilian Hils
fa7964988f fix Python 2 tests 2016-05-28 00:17:57 -07:00
Shadab Zafar
877f5c54ef Enable Travis for test_log 2016-05-28 00:17:57 -07:00
Shadab Zafar
b71ef054b5 Py3: Use cStringIO from six.moves 2016-05-28 00:17:57 -07:00
Aldo Cortesi
0042653498 Be stricter about the handler call signature
Uses this to catch an error in mitmweb
2016-05-28 13:21:07 +12:00
Aldo Cortesi
735bbe52e1 Merge branch 'master' into solidcore 2016-05-28 13:09:35 +12:00
Aldo Cortesi
3a9e03ea1e Fix crash in mitmproxy when viewing responses 2016-05-28 13:04:34 +12:00
Aldo Cortesi
804e04ef43 Zap stray debugging call 2016-05-28 12:47:26 +12:00
Aldo Cortesi
c6caafe365 Merge branch 'solidcore' of github.com:cortesi/mitmproxy into solidcore 2016-05-28 12:43:38 +12:00
Aldo Cortesi
f4813d5649 Make @controller.handler inheritance-friendly
Use this to adapt mitmweb and mitproxy console
2016-05-28 12:38:07 +12:00
Aldo Cortesi
f29f6210bb Mandate that all handlers must be wrapped, make tests pass
mitmproxy, mitmdump and mitmweb masters still to be done
2016-05-28 11:00:00 +12:00
Aldo Cortesi
7c4843857b Sketch out a more solid core
- Decorator for handler methods
- Stricter checking for double-acks and non-acks
2016-05-28 11:00:00 +12:00
Maximilian Hils
abf3cae54e Merge pull request #1169 from gzzhanghao/contentview
[web] Eliminate Router mixin and RawMixin
2016-05-27 11:43:01 -07:00
Jason
9e869f0aa1 Merge remote-tracking branch 'origin/master' into contentview 2016-05-28 01:11:04 +08:00
Jason
fb639c2e11 [web] add default value for text views 2016-05-28 01:10:09 +08:00
Jason
6529a3aa3e [web] eliminate RawMixin 2016-05-28 00:43:33 +08:00
Maximilian Hils
22ecd022a8 Merge pull request #1119 from dufferzafar/pathod-port
Python 3 - pathod.utils
2016-05-26 12:09:39 -07:00
Shadab Zafar
92317bc81d Enable travis Py3 testing for test_utils 2016-05-26 23:39:16 +05:30
Shadab Zafar
bc6cd13356 Go Python 3 by default with the bytes conversion 2016-05-26 23:07:37 +05:30
Shadab Zafar
4ec56808dd remove str() 2016-05-26 23:07:37 +05:30
Shadab Zafar
1bbb178b6a Remove inner_repr, fixup escape_unprintables 2016-05-26 23:07:37 +05:30
Shadab Zafar
1699592f09 Use escaped_str functions for TokValueLiteral 2016-05-26 23:07:37 +05:30
Shadab Zafar
daaa672d39 Remove Py3 specific check 2016-05-26 23:07:37 +05:30
Shadab Zafar
5c62fabc84 Use BytesIO in pathod app 2016-05-26 23:07:37 +05:30
Shadab Zafar
22e4bc1938 Py3: Handle bytes case in inner_repr 2016-05-26 23:07:37 +05:30
Shadab Zafar
e5cebb81fb Removed wrong import 2016-05-26 23:07:37 +05:30
Shadab Zafar
88e42bab6d Py3: inner_repr and escape_unprintables 2016-05-26 23:07:37 +05:30
Shadab Zafar
f3932b27da Py3: Import and Other misc. stuff 2016-05-26 23:07:37 +05:30
Maximilian Hils
d149c447fe fix py3 tests 2016-05-25 20:31:32 -07:00
Maximilian Hils
d3477e27fa bytes_to_escaped_str: always escape single quotes 2016-05-25 20:11:34 -07:00
Maximilian Hils
7a8da48a30 escaped_str_to_bytes: support unicode on python 2 2016-05-25 19:16:02 -07:00
Aldo Cortesi
08f2a0524e Mandate that all handlers must be wrapped, make tests pass
mitmproxy, mitmdump and mitmweb masters still to be done
2016-05-26 13:14:57 +12:00
Aldo Cortesi
23efee9813 Sketch out a more solid core
- Decorator for handler methods
- Stricter checking for double-acks and non-acks
2016-05-26 12:31:29 +12:00
Aldo Cortesi
f7e77d543b Refactor dev.sh
- Parameterise the Python version. All of these now work:
    ./dev.sh            # Use default Python version
    ./dev.sh 2.7        # Explicitly use 2.7 in venv2.7
    ./dev.sh 3.5        # Explicitly use 3.5 in venv3.5

This should also work for Travis, which has a weird setup where Pytho3 can be
3.4.
2016-05-26 09:35:21 +12:00
Aldo Cortesi
bcfce32bfa Merge pull request #1168 from Kriechi/venv-py3
add a py3 venv in dev environment
2016-05-26 08:46:02 +12:00
Thomas Kriechbaumer
b0c90cc64f add a py3 venv in dev environment
This allows us to run e.g. tests in a different python version:
$ venv3/bin/py.test test/netlib/test_tcp.py
2016-05-25 20:42:42 +02:00
Maximilian Hils
e44947e8c2 Update issue_template.md 2016-05-24 16:18:10 -07:00
Jason
6bf74955b9 [web] use props.location instead of context.location 2016-05-24 23:16:30 +08:00
Jason
61453aa847 [web] eliminate Router mixin 2016-05-24 23:08:21 +08:00
Christian Frichot
dbc3e72723 implement a toggle for viewing marked flows only in console 2016-05-24 07:14:05 -07:00
Thomas Kriechbaumer
ebaad91484 Merge pull request #1127 from mitmproxy/tcp-flows
mitmdump: Add Basic Support for TCP Flows
2016-05-23 20:54:14 +02:00
Maximilian Hils
354b8f84df minor fixes (#1165) 2016-05-23 11:47:16 -07:00
Maximilian Hils
c160a47e51 warn users if rfile == outfile, refs #1117 2016-05-21 15:25:57 -07:00
Thomas Kriechbaumer
e6c2e012a5 fix weight value serialization 2016-05-21 21:45:36 +02:00
Maximilian Hils
ed4c99b33a Merge pull request #1164 from Kriechi/improve-http2
Improve http2
2016-05-21 11:49:53 -07:00
Thomas Kriechbaumer
85a3a92a8a kill streams if connection gets terminated 2016-05-21 20:24:21 +02:00
Thomas Kriechbaumer
6965c93be6 implement transparent Priority updates 2016-05-21 20:17:59 +02:00
Thomas Kriechbaumer
f7ce8e219e fix typo 2016-05-21 18:35:29 +02:00
Thomas Kriechbaumer
0cb2e656cd immediately send push to client 2016-05-21 17:42:47 +02:00
Maximilian Hils
dcad3f72af Merge branch 'issue-1099' 2016-05-20 20:02:56 -07:00
Aldo Cortesi
97f3077082 Merge branch 'mhils-multidict' 2016-05-21 15:01:19 +12:00
Aldo Cortesi
43d7965532 Clean un-needed imports 2016-05-21 15:00:52 +12:00
Aldo Cortesi
14fb2eeb1e Merge pull request #1109 from mitmproxy/faster-tls
Speed up TLS handshake if SNI is present
2016-05-21 12:15:30 +12:00
Aldo Cortesi
123e3b130c We don't need 3 slightly different implementations of Data 2016-05-21 11:53:14 +12:00
Aldo Cortesi
a5c4cd0340 A clearer implementation of MultiDictView
This makes MultiDictView work with a simple getter/setter pair, rather than
using attributes with implicit leading underscores. Also move MultiDictView
into multidict.py and adds some simple unit tests.
2016-05-21 11:37:36 +12:00
Aldo Cortesi
96d8ec1ee3 Merge branch 'multidict' of https://github.com/mhils/mitmproxy into mhils-multidict 2016-05-21 10:15:37 +12:00
Maximilian Hils
84144ca0c6 tests: silence flaky pathod test 2016-05-20 14:05:04 -07:00
Maximilian Hils
eb914924ab fix #1099 2016-05-20 13:59:42 -07:00
Maximilian Hils
a3946d2a2d tests++ 2016-05-20 13:27:26 -07:00
Maximilian Hils
b538138ead tests++ 2016-05-20 11:04:27 -07:00
Maximilian Hils
560fc756aa fix Header docs 2016-05-20 09:37:13 -07:00
Maximilian Hils
f96697646c add FlowMaster.active_flows 2016-05-19 22:09:00 -07:00
Maximilian Hils
d38989fe7e tests: finish connections properly 2016-05-19 22:07:56 -07:00
Maximilian Hils
d3c30d9005 fix tests, don't double-add error'd flows 2016-05-19 22:07:56 -07:00
Maximilian Hils
acd51befbb minor fixes, adjust tests 2016-05-19 22:07:56 -07:00
Maximilian Hils
43c5205424 mimtdump: add basic support for tcp flows 2016-05-19 22:07:56 -07:00
Maximilian Hils
395b11d288 minor improvements 2016-05-19 22:07:30 -07:00
Maximilian Hils
f3bedc103a Update issue_template.md 2016-05-19 19:57:25 -07:00
Thomas Kriechbaumer
79cb17ef03 Merge pull request #1152 from mhils/cleanup-odict
clean up odict
2016-05-19 16:47:51 +02:00
Maximilian Hils
a7b9e3033d tests: properly skip pathod tests 2016-05-18 22:51:27 -07:00
Maximilian Hils
f4c3c01266 display response reason in ui 2016-05-18 22:51:13 -07:00
Maximilian Hils
56b9ec0974 docs++ 2016-05-18 22:50:45 -07:00
Maximilian Hils
6f8db2d7eb improve MultiDict, add ImmutableMultiDict, adjust response.cookies 2016-05-18 22:50:19 -07:00
Maximilian Hils
8e39b7bf38 test flow export with duplicate query string 2016-05-18 19:28:23 -07:00
Maximilian Hils
d1fc694952 clean up odict 2016-05-18 19:01:49 -07:00
Maximilian Hils
44ac64aa72 add MultiDict
This commit introduces MultiDict, a multi-dictionary similar to
ODict, but with improved semantics (as in the Headers class).
MultiDict fixes a few issues that were present in the Request/Response
API. In particular, `request.cookies["foo"] = "bar"` has previously been a
no-op, as the cookies property returned a mutable _copy_ of the cookies.
2016-05-18 18:46:42 -07:00
Maximilian Hils
4c3fb8f509 tests: xfail -> skip 2016-05-18 18:42:35 -07:00
Thomas Kriechbaumer
09b90fce9e remove debug print 2016-05-17 22:45:09 -07:00
Thomas Kriechbaumer
eeccb2faa0 http2: cleanup 2016-05-17 22:44:38 -07:00
Maximilian Hils
9a280119d2 Merge pull request #1126 from Kriechi/safeguard
Safeguard
2016-05-17 22:03:32 -07:00
Thomas Kriechbaumer
43ab9f7bd0 http2: properly handle connection errors 2016-05-17 21:26:06 -07:00
Thomas Kriechbaumer
e61014d203 http2: add connection-lost test 2016-05-17 21:25:10 -07:00
Aldo Cortesi
d27fd55657 Fix broken test_flow_export tests
- Make the tests safe for concurrency
- Fix a test that only passed due to prior modification of global state

This also fixes the project generally for parallel test execution.
2016-05-18 12:34:45 +12:00
Aldo Cortesi
00cc836470 Clean up flow export tests
- Externalise test data
- Define a less finicky comparator for Python code
2016-05-18 12:16:50 +12:00
Yoginski
b155dfd771 Updated the docstring (#1150) 2016-05-17 11:15:18 -07:00
Thomas Kriechbaumer
55a17b2ed3 fix encoding error on *too* random bytes
This should fix things like:

def __init__(self, val):
    self.val = val.decode("string_escape")
ValueError: Trailing \ in string
pathod/language/base.py:108: ValueError

test/pathod/test_language_websocket.py:83: in fr
    return netlib.websockets.Frame.from_bytes(tutils.render(wf, settings))
test/pathod/tutils.py:123: in render
    r = r.resolve(settings)
pathod/language/websockets.py:179: in resolve
    Key(base.TokValueLiteral(os.urandom(4)))
2016-05-15 10:41:54 -07:00
Thomas Kriechbaumer
2887480bcb fix naming which caused overwriting of functions 2016-05-15 10:39:39 -07:00
Thomas Kriechbaumer
f4a13d6f9f http2: improve header tests (#1143) (#1144) 2016-05-14 10:14:42 -07:00
Kostya Esmukov
7fdc0a94db Fixed HTTP2 headers being folded. (#1143) (#1144) 2016-05-14 04:59:21 -07:00
Clemens Brunner
902cd255d4 added UI for options menu (#1130)
* added UI for options menu

* update UI for options menu

* update UI for options v2

* update UI for options v2

* added new btn class

* little changes

* little changes

* merge

* deleted branch

* change menu button class
2016-05-14 05:40:11 -06:00
Jonathan Jones
551fafd451 showing url for terminals that support clickable links when starting mitmweb (#1141) 2016-05-14 05:39:17 -06:00
Thomas Kriechbaumer
f969c70015 bump python-hyper dependencies (#1139) 2016-05-12 13:01:54 -06:00
Maximilian Hils
f1c922c652 Sanitize Print (#1135)
* sanitize strings with shell control characters

* netlib: add utilities to safe-print bytes

* escaped str: add TODO for multi-byte chars
2016-05-12 11:03:57 -06:00
Thomas Kriechbaumer
518cc78454 Merge pull request #1137 from Kriechi/h2-header-encoding
disable http2 header encoding, use bytes everywhere
2016-05-11 23:19:12 -05:00
Thomas Kriechbaumer
7a813936c6 disable http2 header encoding, use bytes everywhere 2016-05-11 16:47:58 -05:00
Jason Pepas
b174fd5e1f Adding example which turns every reponse into an HTTP 500. (#1136)
* Adding example which turns every reponse into an HTTP 500.

* Prefer b"" over None for response.content.
2016-05-11 15:26:17 -06:00
Thomas Kriechbaumer
bbf7b6f690 Merge pull request #1134 from mhils/fix-versions
Fix `version.NAME`
2016-05-11 13:27:58 -05:00
Maximilian Hils
acab4fea5a fix version.NAME 2016-05-11 13:02:19 -06:00
Thomas Kriechbaumer
bef72c1b02 Merge pull request #1121 from Kriechi/fix-cookies
improve cookie parsing
2016-05-11 12:30:44 -05:00
Thomas Kriechbaumer
e2ee48a0ee replace SimpleCookie with our own parser lib 2016-05-11 12:20:21 -05:00
Maximilian Hils
67a37e6d1f improve script loading 2016-05-11 11:15:36 -06:00
Thomas Kriechbaumer
e34b2d7e65 Merge pull request #1132 from mhils/improve-script-loading
Improve script loading
2016-05-11 11:58:44 -05:00
Maximilian Hils
4c8e334642 actually fix tests 2016-05-10 12:19:26 -06:00
Maximilian Hils
bb4f9611f5 Revert "fix tests"
This reverts commit f315dc1eb9.
2016-05-10 12:18:05 -06:00
Maximilian Hils
f315dc1eb9 fix tests 2016-05-10 12:17:25 -06:00
Thomas Kriechbaumer
08002282e8 improve cookie parsing
allows '/' to be within a cookie name
removes deprecated cookie getter/setter
fixes #1118
2016-05-10 11:13:12 -05:00
Thomas Kriechbaumer
595a01de4e Merge pull request #1086 from Kriechi/h2-improv
cleanup h2
2016-05-10 11:09:11 -05:00
Thomas Kriechbaumer
73a5d479bb cleanup h2 layer 2016-05-10 10:57:25 -05:00
Maximilian Hils
9d47d3b1ec fix #1120 2016-05-09 12:15:20 -06:00
Maximilian Hils
01f52ee56a fix mitmdump shutdown 2016-05-08 16:54:30 -06:00
Maximilian Hils
3c644274e9 mitmdump: make sure to always call done() in inline scripts 2016-05-08 16:49:36 -06:00
Maximilian Hils
9ac9df82c4 actually fix #1115 2016-05-06 12:48:44 -07:00
Maximilian Hils
99178c57db issue-1115 2016-05-06 12:39:00 -07:00
Maximilian Hils
ff53e7a6eb scripts: allow package imports 2016-05-03 19:54:16 -07:00
Maximilian Hils
7e633d8a8a fix ClientHello.__repr__ 2016-05-02 19:05:14 -07:00
Maximilian Hils
a91d8d9d26 improve server tls handshake behaviour 2016-05-02 18:53:08 -07:00
Maximilian Hils
67537ee614 simplify ClientHello handling 2016-05-02 18:18:20 -07:00
Maximilian Hils
626f7e1017 improve tls handling, separate set_server and set_server_tls 2016-05-02 18:18:20 -07:00
Maximilian Hils
7f894c131b speed up TLS handshake if SNI is present 2016-05-02 18:18:20 -07:00
Maximilian Hils
714ba16111 disable py.test timeout by default, this breaks interactive debuggers 2016-05-02 16:51:49 -07:00
Maximilian Hils
b5e5917f7f web: update dependencies 2016-05-02 14:33:43 -07:00
Thomas Kriechbaumer
ea983f775c Merge pull request #1107 from javabrett/dev-dot-sh
README.rst should refer to ./dev.sh not ./dev
2016-05-01 14:32:41 +02:00
Brett Randall
69adcce566 README.rst should refer to ./dev.sh not ./dev 2016-05-01 22:26:44 +10:00
Maximilian Hils
d84fc645a7 docs: minor fixes 2016-04-30 15:25:02 -07:00
Thomas Kriechbaumer
f456591db0 Merge pull request #1102 from mitmproxy/stateobject-list
Add support for stateobject lists
2016-04-30 12:05:57 +02:00
Steven Noble
96512dd848 Include correct documentation URL in error message 2016-04-30 00:45:07 -07:00
Maximilian Hils
74cfd7a4e2 stateobject: support lists 2016-04-29 20:59:26 -07:00
Maximilian Hils
cb1119f3ee fix bugs introduced in 317b4be 2016-04-29 20:58:51 -07:00
Maximilian Hils
30bafea41a tcp protocol: stop on server shutdown 2016-04-29 20:33:07 -07:00
Maximilian Hils
317b4becca mitmdump: don't fail for other flowtypes 2016-04-29 20:18:32 -07:00
Maximilian Hils
60bbc250d4 mitmdump: fix shutdown after reading flow file 2016-04-29 20:17:18 -07:00
Maximilian Hils
4c331e2d01 fix bug introduced in 909d5ec 2016-04-29 12:36:07 -07:00
Maximilian Hils
54c4859a95 remove netlib version check 2016-04-29 12:00:38 -07:00
Maximilian Hils
909d5ec87e FlowReadError -> FlowReadException 2016-04-29 11:17:49 -07:00
Maximilian Hils
c7a85d1b9e fix #1089 2016-04-28 17:51:53 -07:00
Maximilian Hils
613a05b5b7 Update certinstall.rst 2016-04-28 15:22:23 -07:00
Zohar Lorberbaum
acaca765e4 Generate better function names for root url. (#1100) 2016-04-28 15:09:42 -07:00
Steven Van Acker
66267ad276 support for setting/sending multiple cookies (#1091)
* support for setting/sending multiple cookies

* py.test for multiple cookie support
2016-04-22 11:16:05 -07:00
Maximilian Hils
3876a1f38c release: always build tags 2016-04-21 22:52:30 -07:00
Maximilian Hils
5b12720962 silence flaky pathod test 2016-04-21 18:29:16 -07:00
Maximilian Hils
9f92855c99 update reverse proxy documentation, fix #1092 2016-04-21 17:56:18 -07:00
Maximilian Hils
ecf4adf30b dependency update 2016-04-21 17:25:00 -07:00
Maximilian Hils
028f5c4929 downgrade pyparsing to fix #1087 and #1090 2016-04-21 17:11:28 -07:00
Maximilian Hils
49d1bcc8a2 fix CONNECT display in upstream mode 2016-04-20 15:27:39 -07:00
Maximilian Hils
c17ccead6d mitmdump: allow stdin as infile 2016-04-18 16:04:37 -07:00
Maximilian Hils
02ba76ea09 fix proxy authorization bug, refs #988 2016-04-17 15:44:37 -07:00
Maximilian Hils
423c076c61 cleanup mitmproxy.controller, raise Kill in Channel (#1085) 2016-04-14 12:03:29 -07:00
Maximilian Hils
bc60c26c7b py3++ 2016-04-13 22:34:28 -07:00
Maximilian Hils
03c011cf4b Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-04-13 20:37:22 -07:00
Maximilian Hils
1ab51a1d3d fix #1082 2016-04-13 20:32:05 -07:00
Maximilian Hils
a3f8a7c72c minor improvements 2016-04-13 20:30:34 -07:00
Israel Blancas
9678240783 gulp-minify-css is deprecated. Adding gulp-clean-css 2016-04-11 16:38:30 -07:00
Maximilian Hils
228197185e Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-04-11 14:14:27 -07:00
Maximilian Hils
70e35b7017 peer_address -> ip_address 2016-04-11 14:14:18 -07:00
Maximilian Hils
14e9b0a0ac docs: better data structure docs 2016-04-11 14:13:48 -07:00
Felix Yan
5dc7b11229 Add installation instructions for Arch Linux (#1079) 2016-04-11 11:47:48 -07:00
Maximilian Hils
7208a7543f docs: fix logo 2016-04-10 00:07:51 -07:00
Maximilian Hils
4a62da6bac update README 2016-04-09 20:14:42 -07:00
Maximilian Hils
c22b14fae7 bump version 2016-04-09 20:01:24 -07:00
Maximilian Hils
deb7844004 update CHANGELOG 2016-04-09 17:43:47 -07:00
Maximilian Hils
dcdee7dc46 server replay: keep --kill active 2016-04-09 16:47:05 -07:00
Maximilian Hils
4d16bb8cb6 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-04-09 14:35:37 -07:00
Maximilian Hils
5c333ee3ba fix client playback logic 2016-04-09 14:35:30 -07:00
Anthony Zhang
4306304827 Fix being unable to export binary data in requests (#1069) 2016-04-09 14:21:14 -07:00
Maximilian Hils
5c8e7a090e fix server replay shutdown 2016-04-09 14:20:08 -07:00
Maximilian Hils
d6a5291f36 add sphinx_rtd_theme as a dependency 2016-04-03 08:36:02 -07:00
Maximilian Hils
0259f47997 Merge branch 'better-replace' 2016-04-03 08:17:30 -07:00
Maximilian Hils
84f650aabf update dependencies 2016-04-03 08:16:10 -07:00
Thomas Kriechbaumer
b39560aaae Merge pull request #1076 from mitmproxy/issue-1061
Fix #1061
2016-04-03 10:19:44 +02:00
Thomas Kriechbaumer
f5fe93bf13 Merge pull request #1074 from mitmproxy/move-response-refresh
move HTTPResponse.refresh into netlib
2016-04-03 10:16:39 +02:00
Thomas Kriechbaumer
16fdbb4f2f Merge pull request #1073 from mitmproxy/first-line-format
form_(in|out) -> first_line_format
2016-04-03 10:16:06 +02:00
Thomas Kriechbaumer
94342891ee Merge pull request #1072 from mitmproxy/remove-response-msg
response.msg -> response.reason
2016-04-03 10:14:06 +02:00
Maximilian Hils
35a6d6e7f6 response.msg -> response.reason 2016-04-02 22:54:46 +02:00
Maximilian Hils
4e2acc4d9d move HTTPResponse.refresh into netlib 2016-04-02 22:49:05 +02:00
Maximilian Hils
a267934d99 minor simplifications 2016-04-02 22:00:14 +02:00
Maximilian Hils
e6fa2688c9 form_(in|out) -> first_line_format 2016-04-02 21:57:35 +02:00
Maximilian Hils
050431fdd6 improve timing display 2016-04-02 21:33:51 +02:00
Maximilian Hils
610842cda5 fix FlowMaster.create_request, add test 2016-04-02 21:15:55 +02:00
Maximilian Hils
d6e58bd16c fix #1052 2016-04-02 21:07:55 +02:00
Maximilian Hils
3a1486183c fix #1061 2016-04-02 21:03:36 +02:00
Maximilian Hils
4bdf7e035e fix #1067 2016-04-02 20:20:28 +02:00
Maximilian Hils
76b930ff70 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-04-02 14:39:14 +02:00
Maximilian Hils
806aa0f41c improve .replace() and move it into netlib 2016-04-02 14:38:33 +02:00
Maximilian Hils
4ee8808b44 add Serializeable.copy 2016-04-02 13:50:53 +02:00
Maximilian Hils
06c6d88359 Merge pull request #1066 from fimad/master
Fix XSS vulnerability in HTTP errors
2016-03-31 19:36:01 +02:00
Will Coster
55bffe1782 Fix XSS vulnerability in HTTP errors
The make_error_response method does not properly escape characters
that end up in the response body. Since the error code can contain
user supplied values this leads to a potential XSS vulnerability.

Example:

    echo '<script>alert(1)</script>' | nc localhost 8888
2016-03-31 10:22:29 -07:00
Maximilian Hils
f1c5721c8c travis: checkout full repo for builds 2016-03-31 18:35:14 +02:00
Maximilian Hils
c788e18e03 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-03-31 18:07:58 +02:00
Maximilian Hils
5552b5e782 snapshots: fix build tag 2016-03-31 18:07:47 +02:00
Maximilian Hils
de0f2cbcd3 Merge pull request #1050 from zlorb/master
Flow export to locust.io load test tool [http://locust.io]
2016-03-29 18:28:09 +02:00
Zohar Lorberbaum
8016b6ab55 Merge remote-tracking branch 'mitmproxy/master'
# Conflicts:
#	test/mitmproxy/test_flow_export.py
2016-03-28 20:08:55 -07:00
Zohar Lorberbaum
cd2ef2fe13 merge 2016-03-28 10:17:58 -07:00
Zohar Lorberbaum
37483e228f Merge remote-tracking branch 'mitmproxy/master'
Merge with master
2016-03-28 10:06:02 -07:00
Zohar Lorberbaum
6d16f44ab7 Merge with master 2016-03-28 10:03:26 -07:00
Zohar Lorberbaum
e56198ae7c cleaner target url 2016-03-28 09:51:06 -07:00
Zohar Lorberbaum
ef3d24e8c8 locust_task re-use locust_code. 2016-03-27 21:42:52 -07:00
Thomas Kriechbaumer
dfcfa6263c add safeguard 2016-03-27 13:15:57 +02:00
Thomas Kriechbaumer
04cb099b15 improve flow export tests 2016-03-27 13:04:19 +02:00
Thomas Kriechbaumer
ec68d8b8e4 s/nocover/no cover/g
according to coveralls docs
2016-03-27 12:02:41 +02:00
Thomas Kriechbaumer
ab7e80085a increase test timeout 2016-03-27 11:59:27 +02:00
Thomas Kriechbaumer
ddea3434a2 Merge pull request #1055 from MatthewShao/issue#963
Simplify '.content' by removing CONTENT_MISSING
2016-03-27 11:14:28 +02:00
Matthew Shao
6e4af64050 minor fix about if-else statement 2016-03-27 09:16:40 +08:00
Matthew Shao
66bd27e6f9 update comments 2016-03-26 17:49:22 +08:00
Matthew Shao
53e15f778d update document for the removal of CONTENT_MISSING 2016-03-26 16:17:55 +08:00
Matthew Shao
08ff00f36d replace CONTENT_MISSING with None. 2016-03-26 16:00:51 +08:00
Matthew Shao
2f285a6015 Setting CONTENT_MISSING to None 2016-03-26 11:26:42 +08:00
Zohar Lorberbaum
9f77c80a32 pep8 2016-03-25 17:29:42 -07:00
Zohar Lorberbaum
5b07e8b3af Add UI shortcuts. 2016-03-24 20:29:53 -07:00
Zohar Lorberbaum
a44062effb Flow export to locust.io load test tool. 2016-03-23 01:49:18 -07:00
Maximilian Hils
2d6eb28fd0 py3++ 2016-03-20 23:39:57 +01:00
Maximilian Hils
403ac82a7d netlib: request.path can be None 2016-03-20 23:22:50 +01:00
Maximilian Hils
e739517070 py3++ 2016-03-20 23:14:22 +01:00
Maximilian Hils
726536689b py3++ 2016-03-20 22:58:35 +01:00
Maximilian Hils
2ce023a991 py3++ 2016-03-20 22:50:03 +01:00
Thomas Kriechbaumer
d8e8dfc1c6 Merge pull request #1047 from mitmproxy/no-coverage-by-default
py.test: disable coverage collection by default
2016-03-20 20:40:15 +01:00
Maximilian Hils
6f902ffbb3 py3++: iteritems 2016-03-20 19:56:22 +01:00
Maximilian Hils
88d365cfe6 py3++: cStringIO 2016-03-20 19:40:03 +01:00
Maximilian Hils
43671e723f py.test: disable coverage collection by default 2016-03-20 19:39:02 +01:00
Maximilian Hils
61a657fe56 Merge pull request #1045 from mitmproxy/py3-scripts
Port mitmproxy.script to Python 3
2016-03-20 11:31:56 +01:00
Thomas Kriechbaumer
d99194fccc Merge pull request #1043 from mitmproxy/better-scripts
Better scripts
2016-03-19 20:33:14 +01:00
Maximilian Hils
b0a16dee20 fix script exception display 2016-03-19 20:27:03 +01:00
Maximilian Hils
4b955da94e fix pyOpenSSL version 2016-03-19 20:09:00 +01:00
Maximilian Hils
7b4fcc8577 update pyOpenSSL 2016-03-19 20:02:30 +01:00
Maximilian Hils
c52c59f858 port mitmproxy.scripts to py3 2016-03-19 19:53:27 +01:00
Maximilian Hils
4be9074b49 fix tests on OSX 2016-03-19 19:19:36 +01:00
Maximilian Hils
fb0b17ee93 simplify tests for @concurrent 2016-03-19 03:04:55 +01:00
Maximilian Hils
7e49b8c186 add tests for mitmproxy.script.reloader 2016-03-19 03:04:55 +01:00
Maximilian Hils
898f5d10b9 improve mitmproxy.scripts semantics, clean up tests 2016-03-19 03:04:55 +01:00
Maximilian Hils
36fb8a32f4 restrict cryptography version for pyopenssl compat 2016-03-19 03:04:08 +01:00
Maximilian Hils
b90579fe45 fix dependency versions 2016-03-18 14:59:49 +01:00
Maximilian Hils
afb24d8c4c Merge remote-tracking branch 'origin/requires-io-master' 2016-03-18 14:57:16 +01:00
Maximilian Hils
f5a6ebf584 remove code duplication 2016-03-18 14:54:42 +01:00
requires.io
c8ddd87837 [requires.io] dependency update 2016-03-18 14:52:59 +01:00
Thomas Kriechbaumer
4cd170d36c Merge pull request #1040 from felixonmars/patch-1
Allow lxml 3.6
2016-03-18 09:29:58 +01:00
Felix Yan
b751598da9 Allow lxml 3.6
All tests passed here, and it works fine.
2016-03-18 12:23:47 +08:00
Maximilian Hils
983b0dd4f6 Merge pull request #1014 from ikoz/master
New option: Add server certs to client chain
2016-03-17 02:28:00 +01:00
ikoz
b4e7aaf2f6 Make the add-server-certs-to-client-chain and verify-upstream-cert options mutually exclusive whily processing the proxy options. Do the same for the add-server-certs-to-client-chain and no-upstream-cert options. 2016-03-16 22:57:57 +00:00
ikoz
8ed491201a Revert "Create mutually exclusive group for add-server-certs-to-client-chain and verify-upstream-cert command line options. These are not meaningful together."
This reverts commit 02e378486b.
2016-03-16 22:45:27 +00:00
ikoz
9cc55f211f Rename 'server' to 'upstream' in identifiers related to the AddServerCertsToClientChain feature 2016-03-16 19:20:18 +00:00
ikoz
02e378486b Create mutually exclusive group for add-server-certs-to-client-chain and verify-upstream-cert command line options. These are not meaningful together. 2016-03-16 19:15:44 +00:00
ikoz
d26c7f4ca5 Move more init things inside AddServerCertsToClientChainMixin 2016-03-16 18:43:51 +00:00
ikoz
efc3e942d5 Restructuring of the AddServerCertsToClientChain test so that it uses a Mixin - also removed some extra printf statements 2016-03-16 17:43:48 +00:00
Maximilian Hils
f118d9abb1 Merge pull request #1032 from cle1000/patch-2
Update modify_response_body.py
2016-03-16 16:45:42 +01:00
Maximilian Hils
2a20fc59b2 Merge pull request #1030 from xhy940801/socks
Add 'UsernamePasswordAuth' 'UsernamePasswordAuthResponse' to SOCKS
2016-03-16 12:16:52 +01:00
Thomas Kriechbaumer
0ab9e60168 Merge pull request #1019 from lilydjwg/master
add resolved IP address in "Details" tab
2016-03-15 23:28:08 +01:00
ikoz
776e625413 Add tests for add-server-certs-to-client-chain feature 2016-03-15 14:58:38 +00:00
ikoz
9b970b0303 fix for sslinfo cert chain printing bug - now all certs get printed 2016-03-15 14:40:54 +00:00
cle1000
0a478e4e39 Update modify_response_body.py
fix typo
2016-03-15 15:36:10 +01:00
lilydjwg
eecadadce3 use "peer_address" instead of "sock_address" 2016-03-15 21:32:06 +08:00
yonder
ba933dff2c Add 'UsernamePasswordAuth' 'UsernamePasswordAuthResponse' to SOCKS 2016-03-15 14:33:20 +08:00
lilydjwg
20ec502032 fix tests for "sock_address" 2016-03-14 22:17:12 +08:00
Maximilian Hils
4604c25c60 fix #1025, refs #983 2016-03-12 23:55:56 +01:00
Maximilian Hils
d3a55cd3f0 Merge pull request #1027 from gzzhanghao/vscroll
[web] fix virtual scroll range
2016-03-12 19:00:16 +01:00
Maximilian Hils
e0f1f13c14 minor pyinstaller fixes 2016-03-12 18:55:25 +01:00
Jason
ae61025d5d [web] fix virtual scroll range 2016-03-12 23:06:21 +08:00
Thomas Kriechbaumer
2d31c5c786 Merge pull request #1011 from MatthewShao/master
Fix #1005
2016-03-11 17:33:04 +01:00
Maximilian Hils
1bfc27c3f6 Merge pull request #1008 from dufferzafar/test-examples
Some tests for examples
2016-03-11 16:44:55 +01:00
Maximilian Hils
c1c3fe3c88 Merge pull request #1023 from adityadivekar03/issue981
Add mitmproxy icon for binaries
2016-03-11 16:43:19 +01:00
Aditya
891d7a87b8 Add icon for binaries 2016-03-11 20:30:17 +05:30
Shadab Zafar
5a1c3c4ad8 Update contentview test 2016-03-11 18:40:51 +05:30
Shadab Zafar
35204ecb1c Move har_extractor tests to the examples file 2016-03-11 17:57:57 +05:30
Shadab Zafar
7c5791e51a Use the contextmanager in all tests 2016-03-11 17:57:57 +05:30
Shadab Zafar
af9442a9ba Add contextmanager to load an example 2016-03-11 17:57:57 +05:30
Shadab Zafar
b95cc63b87 Add tests for redirect_requests example 2016-03-11 17:57:57 +05:30
Shadab Zafar
2cd5392657 Add test for iframe_injector example 2016-03-11 17:57:57 +05:30
Shadab Zafar
ba1cf18f42 Add tests for custom_contentviews example 2016-03-11 17:57:57 +05:30
Shadab Zafar
5eca2223d5 Add tests for modify_response_body example 2016-03-11 17:57:57 +05:30
Shadab Zafar
c378fe2199 Remove missing import 2016-03-11 17:57:57 +05:30
Shadab Zafar
9ef1522b5f Update modify_querystring example & add test for it 2016-03-11 17:57:57 +05:30
Shadab Zafar
96df077d54 Add tests for add_header example 2016-03-11 17:57:57 +05:30
Shadab Zafar
a2274f52e4 Add tests for modify_form example 2016-03-11 17:57:57 +05:30
Shadab Zafar
106b296871 Update modify_form example to not use deprecated functions 2016-03-11 17:57:57 +05:30
Thomas Kriechbaumer
e74e212a7a Merge pull request #1022 from dufferzafar/fix-1018
Fix missing cookie import
2016-03-11 13:19:58 +01:00
Shadab Zafar
90587cf998 Fix missing cookie import 2016-03-11 17:36:04 +05:30
Matthew Shao
426f84d930 Add update_focus method in console/__init__.py. 2016-03-11 08:44:51 +08:00
Maximilian Hils
448d28e2cb Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-03-10 21:17:24 +01:00
Maximilian Hils
167bd77683 fix content view example inline script 2016-03-10 21:17:05 +01:00
Maximilian Hils
4a6edd92e6 Merge pull request #1004 from gzzhanghao/vscroll
[web] VirtualScroll and AutoScroll helper
2016-03-10 15:13:24 +01:00
Jason
1c0496e051 [web] VirtualScroll and AutoScroll helper 2016-03-10 21:40:07 +08:00
依云
e9bff5ac56 add resolved IP address in "Details" tab 2016-03-10 21:23:31 +08:00
Maximilian Hils
b413a052f9 Merge pull request #1012 from gzzhanghao/router
[web] eliminate common.Router.getParams
2016-03-09 18:54:34 +01:00
Maximilian Hils
454cca43f0 Merge pull request #1015 from gzzhanghao/props
[web] dont mutate props
2016-03-09 18:53:05 +01:00
Maximilian Hils
aa2bf90b11 Merge pull request #1013 from gzzhanghao/style
[web] Fix label margin in footer
2016-03-09 18:39:51 +01:00
Jason
84f180847d [web] dont mutate props 2016-03-09 13:30:55 +08:00
Maximilian Hils
7fa95aabbb Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-03-08 20:34:37 +01:00
Maximilian Hils
47fa843795 add icon for binaries
This differs from the favicon as that the .ico file stores
the logo in multiple resolutions.
2016-03-08 20:33:48 +01:00
ikoz
0169271bf9 New option: Add server certs to client chain
If enabled, append all server certificates to the certificate chain
served to the client, as extras. Can be used to bypass certain
certificate pinning impementations.
2016-03-08 18:13:36 +00:00
Jason
4522b2b62f [web] fix footer label margin 2016-03-09 00:39:51 +08:00
Jason
df8b21c08f [web] eliminate common.Router.getParams 2016-03-09 00:28:44 +08:00
Matthew Shao
6eb584f766 Fix #1005 2016-03-08 19:42:38 +08:00
Maximilian Hils
ea3742c393 Merge pull request #1009 from gzzhanghao/settings
[web] eliminate SettingsState
2016-03-07 17:58:27 +01:00
Jason
ca9a493a1c [web] uniform code style for Footer component 2016-03-08 00:57:01 +08:00
Jason
0545326dc0 [web] eliminate SettingsState 2016-03-07 18:47:08 +08:00
Maximilian Hils
34d19cf12e Merge pull request #994 from gzzhanghao/common
[web] remove common.ChildFocus
2016-03-05 13:20:43 +01:00
Thomas Kriechbaumer
f59770e949 Merge pull request #969 from dufferzafar/pretty-export
Indent JSON body while exporting it as code
2016-03-04 19:57:22 +01:00
Thomas Kriechbaumer
428da2c4b1 Merge pull request #989 from dufferzafar/har-extractor
Improve HAR Extractor Script
2016-03-04 19:55:52 +01:00
Thomas Kriechbaumer
d7e9dda85c Merge pull request #988 from xhy940801/master
Add upstream proxy authentication
2016-03-04 19:47:31 +01:00
yonder
0e27dfd9c1 Improve test case 2016-03-04 11:12:03 -05:00
Shadab Zafar
d17cd5c6ec Use custom Context object 2016-03-04 03:13:40 +05:30
Shadab Zafar
6a4f1ae7c7 Test har_extractor.response 2016-03-04 03:10:29 +05:30
Shadab Zafar
7108d72705 Fix pprint import 2016-03-04 03:02:49 +05:30
Shadab Zafar
1c80599379 Use default empty page_list 2016-03-04 03:02:33 +05:30
Shadab Zafar
c982f579dd Add basic test for har_extractor 2016-03-04 02:32:01 +05:30
Shadab Zafar
48f1c9afc2 Add a test for json request 2016-03-04 01:06:09 +05:30
Shadab Zafar
9540ede112 Use separators param in json.dumps() to avoid trailing whitespace 2016-03-04 01:05:35 +05:30
Shadab Zafar
01a99f2b25 Handle the case of correct json content-type but malformed body 2016-03-04 01:01:16 +05:30
Shadab Zafar
ec61cfddfd Use json instead of contentviews 2016-03-03 06:44:19 +05:30
yonder
b8ae666c78 Add test for upstream-auth 2016-03-02 12:19:33 -05:00
Maximilian Hils
b48d1fa5b8 Merge pull request #993 from gzzhanghao/tests
[web] Fix eslint warnings about tests
2016-03-02 17:50:59 +01:00
Jason
70cde8ccaa [web] Fix eslint warnings about tests 2016-03-02 23:04:13 +08:00
Jason
1d002182e3 [web] remove common.ChildFocus 2016-03-02 22:37:32 +08:00
Maximilian Hils
fab9dad940 Merge pull request #992 from gzzhanghao/gulp
[web] gulp: log errors from buildScript/bundle
2016-03-02 15:23:50 +01:00
Jason
035f482a44 [web] gulp: log errors from buildScript/bundle 2016-03-02 22:14:28 +08:00
Maximilian Hils
a1c76814e7 Merge pull request #991 from gzzhanghao/flowtable
[web] fix FlowTable.scrollIntoView
2016-03-02 15:11:51 +01:00
Jason
70af4fae46 [web] StoreView.index -> indexOf 2016-03-02 21:55:36 +08:00
Maximilian Hils
8089752cb2 Merge pull request #990 from gzzhanghao/index
[web] fix StoreView.index
2016-03-02 09:54:47 +01:00
Jason
eb19077913 [web] fix StoreView.index 2016-03-02 15:59:56 +08:00
Shadab Zafar
1f41719bbc Remove some duplication and make more pythonic har_extractor 2016-03-02 11:39:48 +05:30
Shadab Zafar
27faea2355 Fixup HAR Extractor 2016-03-01 20:20:18 +05:30
Shadab Zafar
1548185a17 Use requests' json parameter 2016-03-01 18:45:05 +05:30
Shadab Zafar
ac25206420 Indent JSON body while exporting it as code
Fixes #968
2016-03-01 17:39:32 +05:30
yonder
0077e0f8d9 Add upstream proxy authentication 2016-03-01 17:40:32 +08:00
Maximilian Hils
3de89ab16c web: use es6 modules 2016-02-29 02:57:35 +01:00
Maximilian Hils
9192427d7b web: fix router 2016-02-29 02:16:38 +01:00
Maximilian Hils
cbb068edaa fix up web stuff 2016-02-28 22:35:08 +01:00
Maximilian Hils
ade5078ebd suppress pathoc test timeouts on windows 2016-02-27 14:36:17 +01:00
Maximilian Hils
0faae87acc fix snapshot upload 2016-02-27 14:26:54 +01:00
Maximilian Hils
c68ab3e60c Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-27 02:17:10 +01:00
Maximilian Hils
b8b37fdad6 add simplified connection constructor 2016-02-27 02:17:01 +01:00
Maximilian Hils
679c97ec3e fix #966 2016-02-27 02:13:26 +01:00
Maximilian Hils
5950587f27 Merge pull request #978 from Kriechi/dev-ci
use dev-scripts on CI
2016-02-26 22:06:18 +01:00
Thomas Kriechbaumer
168647f7e4 use dev-scripts on CI 2016-02-25 18:01:59 +01:00
Thomas Kriechbaumer
7e55a21287 fix #977 2016-02-24 08:29:24 +01:00
Thomas Kriechbaumer
02ec4c8207 fix h2 imports
fixes #975
2016-02-23 22:10:15 +01:00
Thomas Kriechbaumer
1b7b968526 Merge branch 'ParthGanatra-pip-upgrade' 2016-02-23 19:59:59 +01:00
Parth Ganatra
ed5260290f Update dev.sh 2016-02-23 19:59:30 +01:00
Maximilian Hils
bfbcbfd737 fix coverage collection 2016-02-23 18:07:12 +01:00
Aldo Cortesi
dca9139fb2 Merge pull request #967 from dufferzafar/766
Fix minor issues with har_extractor
2016-02-22 10:09:28 +13:00
Aldo Cortesi
08f44b9fad Doc tweaks
This patch does the following:

- Fixes all warnings in the doc tree
- Adds a modd + devd conf file that renders HTML and treats doc warnings as
errors. This lets you send warning output to your desktop notifier, and gives
livereload similar to the livehtml entry in the Makefile.
- Some small tweaks

Sphinx currently has a bug that causes unknown options to generate a warning:

https://github.com/sphinx-doc/sphinx/issues/2229

This is fixed in stable, but not yet released. You can update Sphinx to the
latest stable like so:

pip install --upgrade https://github.com/sphinx-doc/sphinx/archive/stable.zip
2016-02-21 11:47:17 +13:00
Aldo Cortesi
cf3182a6d4 Merge branch 'master' of github.com:mitmproxy/mitmproxy 2016-02-21 10:53:16 +13:00
Maximilian Hils
cf57020038 fix proxy reconnect 2016-02-20 22:08:49 +01:00
Thomas Kriechbaumer
985213a6bc fix tests 2016-02-20 18:55:43 +01:00
Shadab Zafar
6bb27c162f har_extractor: Replace deprecated stuff with recommended ones 2016-02-20 21:01:59 +05:30
Shadab Zafar
be9329dfd4 har_extractor: Use items() instead of iteritems() 2016-02-20 21:01:27 +05:30
Aldo Cortesi
5441683037 First-order conversion of rtool to flat directory structure 2016-02-19 16:43:26 +13:00
Maximilian Hils
e8611acb76 fix #951 2016-02-19 00:46:57 +01:00
Maximilian Hils
614e2ebf29 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-19 00:30:51 +01:00
Maximilian Hils
2bec6a35e2 fix #956 2016-02-19 00:30:37 +01:00
Aldo Cortesi
a635e04fbf console: slightly less hacky hack show http2 warning after first tick 2016-02-19 12:16:55 +13:00
Aldo Cortesi
3d477c72d3 Merge pull request #960 from Kriechi/enable-h2
enable HTTP/2 by default if available
2016-02-19 11:56:50 +13:00
Thomas Kriechbaumer
7d2c7efa57 enable HTTP/2 by default if available 2016-02-18 23:53:53 +01:00
Maximilian Hils
ecb26c3c82 Merge remote-tracking branch 'duffer/pretty-host' 2016-02-18 23:17:02 +01:00
Maximilian Hils
7c6bf7abb3 Merge pull request #964 from mitmproxy/flat-structure
Flat structure
2016-02-18 23:10:47 +01:00
Shadab Zafar
d6ab9901d1 Fixup more tests 2016-02-18 21:58:32 +05:30
Shadab Zafar
9dc1224282 Incorporate comments made during review 2016-02-18 20:12:45 +05:30
Maximilian Hils
61cde30ef8 fix .landscape.yml 2016-02-18 13:28:49 +01:00
Maximilian Hils
20352f3453 fix test paths, move coverage config into setup.py 2016-02-18 13:24:17 +01:00
Maximilian Hils
d33d3663ec combine projects 2016-02-18 13:03:40 +01:00
Maximilian Hils
294774d6f0 move pathod/.sources to root 2016-02-18 12:29:49 +01:00
Maximilian Hils
18b619e164 move mitmproxy/web to root 2016-02-18 12:29:35 +01:00
Thomas Kriechbaumer
be02dd105b Merge pull request #962 from mitmproxy/simpler-issue-template
Simplify Issue Template
2016-02-18 11:55:53 +01:00
Maximilian Hils
3cbacf4e0b remove nonmeaningful contributing section from the readme 2016-02-18 11:42:55 +01:00
Maximilian Hils
6bb39e2eb0 simplify issue template 2016-02-18 11:30:16 +01:00
Maximilian Hils
bf024cd153 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-18 11:27:40 +01:00
Maximilian Hils
f42af90612 move bin into release, update rtool 2016-02-18 11:25:29 +01:00
Shadab Zafar
175109e44e Use host header values only when the ports match 2016-02-18 07:01:52 +05:30
Aldo Cortesi
31ab3a231e Merge pull request #959 from thiagoarrais/doc-fix
Fix misleading documentation for clipboard command
2016-02-18 10:42:07 +13:00
Aldo Cortesi
57f3915f76 Merge branch 'Kriechi-h2' 2016-02-18 10:41:08 +13:00
Aldo Cortesi
b6e5e50c24 Make fuzzing run again 2016-02-18 10:40:16 +13:00
Thiago Arrais
3343882737 Fix help
'P' can also be used on the request screen!
2016-02-17 18:34:21 -03:00
Aldo Cortesi
46abde94a4 Merge branch 'h2' of https://github.com/Kriechi/mitmproxy into Kriechi-h2 2016-02-18 10:22:33 +13:00
Aldo Cortesi
c914ad754a Merge pull request #958 from Kriechi/issue-template
add issue template
2016-02-18 10:18:38 +13:00
Aldo Cortesi
36e070ee25 Pull bin to the top, move pathod examples to examples dir 2016-02-18 10:15:59 +13:00
Aldo Cortesi
2e7b29ce20 Merge remote-tracking branch 'origin/unify' 2016-02-18 10:10:31 +13:00
Aldo Cortesi
14f6bcd86e Adjust release for new repo structure 2016-02-18 09:48:37 +13:00
Aldo Cortesi
92597f82ea Docs and examples to top level 2016-02-18 09:27:08 +13:00
Thomas Kriechbaumer
09abd7eb9a add issue template 2016-02-17 21:10:48 +01:00
Aldo Cortesi
49464de1cb Merge branch 'master' of ssh.github.com:mitmproxy/mitmproxy 2016-02-18 09:05:54 +13:00
Aldo Cortesi
10047a025f One CHANGELOG at the top of the repo 2016-02-18 09:05:24 +13:00
Aldo Cortesi
10eed53d0a Merge pull request #952 from fimad/master
Add a content view for query parameters
2016-02-18 08:57:42 +13:00
Thomas Kriechbaumer
262b4bc482 upgrade h2, remove reset-stream hotfix 2016-02-17 15:34:31 +01:00
Shadab Zafar
6f96da08c9 Handle port numbers in host header
from: https://github.com/mitmproxy/netlib/pull/121
2016-02-17 08:48:59 +05:30
Will Coster
595d2a2fa0 Add a content view for query parameters
The query content view uses format_dict to display a table of query
parameters and is made the default content view for requests with
query parameters and no request body.

To facilitate this the query parameter dictionary of HTTPRequests is
added to the metadata content view parameter under the "query" key.

Additionally, the logic for handling "no content" messages is moved
from contentviews.get_content_view to ViewAuto. This is necessary as
it allows the query content view to be displayed when there is no
request body.
2016-02-16 18:50:10 -08:00
Maximilian Hils
b7701eb8c1 add combined MANIFEST.in and CHANGELOG 2016-02-17 00:02:18 +01:00
Aldo Cortesi
887ecf8896 Merge pull request #950 from Kriechi/rename
Rename lib folders
2016-02-17 10:35:41 +13:00
Thomas Kriechbaumer
b87797ea25 remove test/ from py.test commands 2016-02-16 22:15:10 +01:00
Thomas Kriechbaumer
e2ca4ea923 fix minor things 2016-02-16 22:01:50 +01:00
Thomas Kriechbaumer
6c9aeaab9e move py.test options to ini-file 2016-02-16 21:53:16 +01:00
Thomas Kriechbaumer
6b585023fd move tservers helper 2016-02-16 21:53:16 +01:00
Thomas Kriechbaumer
8242f2cc9d rename ProxTest -> ProxyTest 2016-02-16 21:15:50 +01:00
Thomas Kriechbaumer
1785f70a19 fix all libpathod->pathod references 2016-02-16 21:11:19 +01:00
Thomas Kriechbaumer
d95a1f9819 fix all libmproxy->mitmproxy references 2016-02-16 20:56:33 +01:00
Thomas Kriechbaumer
f1a0a3b228 rename mitmproxy source directory 2016-02-16 20:37:59 +01:00
Thomas Kriechbaumer
dedca54099 rename pathod source directory 2016-02-16 20:37:53 +01:00
Aldo Cortesi
ef8e95956d Merge pull request #949 from fimad/master
Fix failing unit tests caused by a69d223b
2016-02-16 17:55:23 +13:00
Will Coster
0fc348d211 Fix failing unit tests caused by a69d223b 2016-02-15 20:36:21 -08:00
Maximilian Hils
5101843683 fix wheel creation, re-add MANIFEST.in 2016-02-16 04:28:10 +01:00
Maximilian Hils
c31df4fa25 travis: remove sdist builds 2016-02-16 02:04:58 +01:00
Maximilian Hils
2d569527f2 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-16 02:02:40 +01:00
Maximilian Hils
bc7db1be2d temporarily silence flaky tests 2016-02-16 02:02:32 +01:00
Maximilian Hils
718e298dba Merge pull request #948 from fimad/master
Preserve host header when modifying request path
2016-02-16 01:27:16 +01:00
Will Coster
a69d223b33 Preserve host header when modifying request path
Currently the path_components and query setters of the Request object
use the url setter under the hood. The url setter updates all parts of
the URL including the host. If the host header and the host in the
request URL are different (as is common when making HTTPS requests)
then the host header will be updated to the value in the URL as a
result of modifying the path.

This change fixes this problem by modifying the query and
path_components setters to not use the url setter and instead directly
update the path field.
2016-02-15 16:21:20 -08:00
Maximilian Hils
4583fa7922 remove MANIFEST.in, move Dockerfile to root 2016-02-16 00:57:42 +01:00
Maximilian Hils
ec4f7ab050 update mitmproxy changelog 2016-02-16 00:45:43 +01:00
Maximilian Hils
df92228b93 rtool: remove support for source distributions 2016-02-16 00:39:07 +01:00
Maximilian Hils
615e4ec163 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-16 00:22:41 +01:00
Maximilian Hils
10f9b6faa7 fix release tool, refs #947 2016-02-16 00:22:38 +01:00
Aldo Cortesi
d17ae31452 Satisfy pip constraints, set +x on executables 2016-02-16 12:04:25 +13:00
Maximilian Hils
f864266ccc update shield.io badges 2016-02-15 23:05:30 +01:00
Maximilian Hils
87d9afcf2e Merge pull request #937 from mhils/single-repo
Combine mitmproxy, pathod and netlib in a single repo.
2016-02-15 23:00:11 +01:00
Maximilian Hils
3d9a5157e7 use own shields instance, update pathod readme 2016-02-15 21:13:06 +01:00
Maximilian Hils
a78c6f1cb0 update README.rst, minor fixes 2016-02-15 19:43:55 +01:00
Maximilian Hils
fc9fa87827 fix ALPN checks 2016-02-15 18:43:06 +01:00
Maximilian Hils
b7af845523 fix appveyor, re-introduce requirements.txt 2016-02-15 18:12:12 +01:00
Maximilian Hils
a1190c3696 adjust travis 2016-02-15 17:06:32 +01:00
Maximilian Hils
b211bef9a1 fix tests 2016-02-15 16:34:38 +01:00
Maximilian Hils
d7158f975e move tests into shared folder 2016-02-15 16:34:22 +01:00
Maximilian Hils
5fe473fb43 dev -> dev.sh 2016-02-15 16:03:42 +01:00
Maximilian Hils
95cef3c0e9 merge metadata files 2016-02-15 15:43:59 +01:00
Maximilian Hils
dd2c500294 add release 2016-02-15 14:58:53 +01:00
Maximilian Hils
175ce43a30 add pathod 2016-02-15 14:58:49 +01:00
Maximilian Hils
43c3e164ec add netlib 2016-02-15 14:58:48 +01:00
Maximilian Hils
33fa49277a move mitmproxy 2016-02-15 14:58:46 +01:00
Maximilian Hils
36f34f7019 convert old flows to 0.17 2016-02-14 18:34:11 +01:00
Maximilian Hils
925c206249 make sure that we don't have build race conditions 2016-02-14 17:41:54 +01:00
Maximilian Hils
c07e4be678 Merge branch 'master' of https://github.com/mitmproxy/release 2016-02-14 17:28:32 +01:00
Maximilian Hils
cf8588f125 fix minor bugs 2016-02-14 17:28:25 +01:00
Maximilian Hils
e8598f5f7a bump version 2016-02-14 17:25:30 +01:00
Maximilian Hils
aafa69a738 bump version 2016-02-14 17:25:30 +01:00
Maximilian Hils
5cf0aea62f bump version 2016-02-14 17:25:30 +01:00
Maximilian Hils
38e9176a45 update dependencies 2016-02-14 17:04:47 +01:00
Maximilian Hils
e6285468b4 fix plain http proxying 2016-02-14 16:59:21 +01:00
Maximilian Hils
ced78ba107 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-14 16:37:20 +01:00
Maximilian Hils
885e619a7e mitmweb: fix _strip_content 2016-02-14 16:37:09 +01:00
Maximilian Hils
ea0ba6d143 Merge pull request #935 from mitmproxy/coding-style
Improve Coding Style
2016-02-14 15:10:09 +01:00
Thomas Kriechbaumer
4767474d4b remove noop code 2016-02-14 14:58:36 +01:00
Thomas Kriechbaumer
6746cf5f54 autoflake 2016-02-14 14:45:27 +01:00
Thomas Kriechbaumer
efcfc62b73 autopep8 2016-02-14 14:43:48 +01:00
Thomas Kriechbaumer
5e65b933b2 improve landscape config 2016-02-14 14:36:44 +01:00
Thomas Kriechbaumer
c394ee31fb Merge pull request #933 from mitmproxy/http2-log
Print HTTP2 frames to debug log
2016-02-14 14:33:02 +01:00
Maximilian Hils
7c17c6ddbe print http2 frames to debug log 2016-02-14 14:18:31 +01:00
Maximilian Hils
5968983b4c make travis less noisy 2016-02-14 12:53:46 +01:00
Maximilian Hils
fb6cbbb7ac don't print while displaying a progress bar 2016-02-14 01:44:54 +01:00
Maximilian Hils
a54fc2785f Merge pull request #932 from fimad/master
Do not send Proxy-Agent in CONNECT responses, fix #783
2016-02-14 01:27:51 +01:00
Will Coster
d60257e767 Do not send Proxy-Agent in CONNECT responses
Sending any headers at all in response to a CONNECT request breaks
proxying Android emulators on all non-80 ports.

Issue: #783
2016-02-13 16:16:12 -08:00
Maximilian Hils
bd68b4f678 Merge pull request #929 from ganguera/ganguera/basic_auth
Added Basic Auth support for MITMWeb interface
2016-02-12 23:35:16 +01:00
Guillem Anguera
195ea8e15a Send password_manager as a general application setting instead of per handler 2016-02-12 23:30:42 +01:00
Maximilian Hils
b902f957dd more verbose sftp output 2016-02-12 22:18:30 +01:00
Maximilian Hils
16433ccb0c automatically delete old snapshots 2016-02-12 21:57:48 +01:00
Maximilian Hils
1f4d031a60 improve snapshot upload 2016-02-12 21:42:02 +01:00
Maximilian Hils
cb3c7b9072 Merge pull request #931 from mortonfox/patch-1
Update virtualenv links
2016-02-12 07:34:58 +01:00
Morton Fox
be4a1711da Update virtualenv links 2016-02-12 00:11:01 -05:00
Maximilian Hils
c75951d1cb use public key crypto for snapshot upload 2016-02-11 19:34:29 +01:00
Maximilian Hils
9879f2645b Merge branch 'master' of https://github.com/mitmproxy/release 2016-02-11 18:52:53 +01:00
Maximilian Hils
d3a9a6ba95 add snapshot upload to rtool 2016-02-11 18:51:47 +01:00
Maximilian Hils
8d8ae74102 workaround for RTD issue rtfd/readthedocs.org#152 2016-02-11 00:38:49 +01:00
Guillem Anguera
5306523446 Added Basic Auth support for MITMWeb interface 2016-02-11 00:14:38 +01:00
Maximilian Hils
b0dc44428e fix #823 2016-02-10 19:42:41 +01:00
Maximilian Hils
5283074cba relax dependencies for enum34, fix #924 2016-02-10 17:05:43 +01:00
Maximilian Hils
678bf6b793 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-10 17:04:37 +01:00
Maximilian Hils
d1a617be85 fix #925 2016-02-10 17:03:40 +01:00
Maximilian Hils
324184a25a Merge pull request #916 from dufferzafar/export-code
Export any flow request as Python code
2016-02-10 16:05:03 +01:00
Shadab Zafar
33c514e2a7 Use textwrap.dedent in flow_export.python_code too 2016-02-10 14:13:32 +05:30
Shadab Zafar
5f044d03b7 Use classes to test a command, move code to separate methods under
classes
2016-02-09 21:58:29 +05:30
Shadab Zafar
0576f579ed Use textwrap.dedent to improve readability of tests 2016-02-09 21:52:22 +05:30
Shadab Zafar
1c2f8a608e Rename test_export_flow.py to test_flow_export.py 2016-02-09 21:26:05 +05:30
Thomas Kriechbaumer
1af231fe01 change ci notifications 2016-02-08 20:26:17 +01:00
Thomas Kriechbaumer
c5e5e499e4 change ci notifications 2016-02-08 20:25:38 +01:00
Thomas Kriechbaumer
d5aa4f017d fix syntax 2016-02-08 20:06:33 +01:00
Thomas Kriechbaumer
bee1201918 fix #920
This might be implemented by hyper-h2 in the future.
2016-02-08 19:41:11 +01:00
Shadab Zafar
ae8fb0a3d3 Fix content length header issues
Caused by:
d253ebc142
2016-02-08 23:31:56 +05:30
Shadab Zafar
56892f885b Tests for flow_export.raw_request 2016-02-08 23:31:30 +05:30
Shadab Zafar
ddeb3731a8 Tests for flow_export.python_code 2016-02-08 23:31:01 +05:30
Shadab Zafar
61a4743b62 Test exact return value of flow_export.curl_command 2016-02-08 21:56:20 +05:30
Shadab Zafar
abc1552800 Add some basic tests for flow_exports 2016-02-08 21:28:10 +05:30
Shadab Zafar
3374be9f4b Move exporters to a separate file 2016-02-08 20:18:25 +05:30
Maximilian Hils
3c0685546f Merge branch 'master' of https://github.com/mitmproxy/pathod 2016-02-08 15:10:31 +01:00
Maximilian Hils
14186d98d6 bump version 2016-02-08 15:10:20 +01:00
Maximilian Hils
12b0a72db8 fix http version string 2016-02-08 15:10:16 +01:00
Maximilian Hils
1dcb8b14ac bump version 2016-02-08 15:09:29 +01:00
Maximilian Hils
ead9b0ab8c fix http version string 2016-02-08 15:09:25 +01:00
Thomas Kriechbaumer
ec087a1960 Merge pull request #921 from mitmproxy/model-cleanup
Model Cleanup
2016-02-08 11:41:30 +01:00
Thomas Kriechbaumer
4ee1ad88fc Merge pull request #120 from mitmproxy/model-cleanup
Model Cleanup
2016-02-08 09:52:29 +01:00
Maximilian Hils
655b521749 fix docstrings 2016-02-08 04:33:10 +01:00
Maximilian Hils
173ff0b235 fix py3 compat 2016-02-08 04:28:49 +01:00
Maximilian Hils
bdb763d9cf make stateobject simpler and stricter 2016-02-08 04:19:25 +01:00
Maximilian Hils
fe0ed63c4a add Serializable ABC 2016-02-08 04:16:58 +01:00
Maximilian Hils
4873547de3 minor fixes 2016-02-08 02:10:48 +01:00
Maximilian Hils
e9934cc008 simplify state management 2016-02-08 02:10:10 +01:00
Maximilian Hils
cd744592f6 remove duplicate code 2016-02-08 01:11:52 +01:00
Maximilian Hils
2654cd87af fix #876 2016-02-08 01:06:18 +01:00
Maximilian Hils
b0477fd8c9 http2: indicate http version in the ui 2016-02-08 00:45:35 +01:00
Maximilian Hils
370a0f91c1 http2: fix http_version 2016-02-08 00:45:19 +01:00
Maximilian Hils
c8d2876f23 raise error if --http2 is specified, but the OpenSSL version doesn't support it 2016-02-08 00:44:38 +01:00
Maximilian Hils
218e66cb32 removed unused parameter 2016-02-08 00:43:20 +01:00
Maximilian Hils
8f8796f9d9 expose OpenSSL's HAS_ALPN 2016-02-08 00:40:55 +01:00
Maximilian Hils
e2a084e7f7 Merge pull request #37 from mitmproxy/requires-io-master
[requires.io] dependency update on master branch
2016-02-07 21:57:41 +01:00
requires.io
04a5b4e540 [requires.io] dependency update 2016-02-07 21:20:31 +01:00
Maximilian Hils
9e2670e7fa Merge pull request #2 from mitmproxy/requires-io-master
[requires.io] dependency update on master branch
2016-02-06 18:25:35 +01:00
requires.io
9f48d5fb63 [requires.io] dependency update 2016-02-06 18:25:01 +01:00
Maximilian Hils
5f079e56ec update dependencies 2016-02-06 01:23:55 +01:00
Maximilian Hils
4a6db7671f update dependencies 2016-02-06 01:22:27 +01:00
Maximilian Hils
992842ddaf update dependencies 2016-02-06 00:29:06 +01:00
Maximilian Hils
5ce2d8c26d do not include 'test' as package 2016-02-06 00:27:10 +01:00
Maximilian Hils
12d9594e85 minor fixes 2016-02-06 00:26:51 +01:00
Maximilian Hils
cbee3bdfa6 minor fixes 2016-02-06 00:25:50 +01:00
Maximilian Hils
1755fd3368 Merge branch 'master' of https://github.com/mitmproxy/pathod 2016-02-05 23:45:00 +01:00
Maximilian Hils
2b88d7db00 update dependencies 2016-02-05 23:42:37 +01:00
Maximilian Hils
4bad98cfce use setup.y environment markers 2016-02-05 23:39:48 +01:00
Maximilian Hils
066aeb1b19 update dependencies 2016-02-05 23:29:13 +01:00
Thomas Kriechbaumer
b69f48f1f3 Merge pull request #917 from mitmproxy/not-so-modern-setuptools
remove compatible version specifiers
2016-02-05 23:19:17 +01:00
Maximilian Hils
db719f1673 remove compatible version specifiers 2016-02-05 22:59:24 +01:00
Shadab Zafar
545014dcb6 Export any flow as Python code, not just GET
The generic code idea was taken from Postman's code export:
https://www.getpostman.com/
2016-02-06 00:41:57 +05:30
Shadab Zafar
9efda4d138 Refactor copy_as_python_code
Make it easier to support other HTTP request types
2016-02-06 00:41:01 +05:30
Maximilian Hils
9554ce9ab4 re-enable wheels 2016-02-04 23:03:13 +01:00
Maximilian Hils
dffc7e7450 Merge pull request #914 from mitmproxy/modern-setuptools
Modern setuptools
2016-02-04 23:00:51 +01:00
Maximilian Hils
d77f11d3ba make sure that we don't get bitten by upstream 2016-02-04 19:03:35 +01:00
Maximilian Hils
110a5147ad always install urwid 2016-02-04 18:46:57 +01:00
Maximilian Hils
b077edbc92 setup.py: no range operators for env markers 2016-02-04 18:44:40 +01:00
Maximilian Hils
a4a8b38dc8 simplify setup.py 2016-02-04 18:37:58 +01:00
Maximilian Hils
375dbe0703 always add common name as subjectAltName 2016-02-04 18:16:23 +01:00
Thomas Kriechbaumer
023026e032 Merge pull request #883 from mitmproxy/hyper-h2
HTTP/2: Implementation using hyper-h2
2016-02-04 10:51:18 +01:00
Maximilian Hils
98f54d21b6 travis: cache wheels on osx, allow pypy failures 2016-02-04 09:52:29 +01:00
Maximilian Hils
69df00c19f remove debug output 2016-02-04 09:52:29 +01:00
Maximilian Hils
07c36542f0 fix travis caching 2016-02-04 09:52:29 +01:00
Maximilian Hils
547dd4163e fix import 2016-02-04 09:52:29 +01:00
Maximilian Hils
9759207c8d check for channel error location 2016-02-04 09:52:29 +01:00
Thomas Kriechbaumer
cf8c063773 fix http2 race condition 2016-02-04 09:52:29 +01:00
Thomas Kriechbaumer
ca5cc34d0b cleanup 2016-02-04 09:52:29 +01:00
Maximilian Hils
68bcc82b8e do not send RST if there is not upstream stream openend yet 2016-02-04 09:52:28 +01:00
Maximilian Hils
6bc1755750 add comment that explains OrderedDict use 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
74e62903c1 fix exception classes 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
738094e167 improve test reliability 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
b007ff3f9b fix locking issues 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
af6c257131 fix flow == None errors 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
ab3543ba4d use test timeouts 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
d8ae7c3e29 fix tests and use netlib utils 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
f2097b47ce fix race condition during state loading
PyPy and Python2.7 might process the state attributes in different order.
2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
6d3b3994e2 code formatting 2016-02-04 09:52:28 +01:00
Thomas Kriechbaumer
64978968f2 fix authority handling 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
44f83b5947 add more tests, improve coverage 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
bd1d9e28e4 test stream resets in push promise 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
cd2b4ea058 bump h2 dependency and use latest API 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
276817e40e refactor http2 tests 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
187691e65b remove print 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
41f4197a0d test PushPromise support 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
97c2530f90 allow pypy on travis 2016-02-04 09:52:27 +01:00
Thomas Kriechbaumer
ef7b4f56af update CI integration 2016-02-04 09:52:25 +01:00
Thomas Kriechbaumer
8d14dd33d0 try to show weird test output 2016-02-04 09:52:04 +01:00
Thomas Kriechbaumer
735c79a2ed increase coverage 2016-02-04 09:52:04 +01:00
Maximilian Hils
4e9579e93e try to fix travis 2016-02-04 09:52:04 +01:00
Thomas Kriechbaumer
47cf27c011 silence 3rd party module loggers 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
bfc7d3967c exclude tests if no alpn support present 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
4501c8a0a1 add http2 full-stack test 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
f49c1cd1c5 improve http2 header parsing 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
a99ef584ad reuse frame reading snippet 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
4de9cbb61e rename test file 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
2964a607ad fix import in tests 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
936422cd73 split files into http, http1, and http2 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
a05a961e7f cleanup lock usage 2016-02-04 09:52:03 +01:00
Thomas Kriechbaumer
94977e0e3d remove manual settings acknowledge 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
26b7ff9525 implemented push promise 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
83a4439485 fix flow control on closed streams 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
3f5e798743 fix errors in http body parsing 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
4468fc7c2d fix private API and RstStream issues 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
db38e5a1cc update hyper-h2 exception handling 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
24641d8561 cleanup code 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
2cd71091ad remove form_out todo 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
c44a8949f7 use proper exception classes 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
de1b637a47 --wip-- 2016-02-04 09:52:02 +01:00
Thomas Kriechbaumer
947f79eb6c improved zombie detection 2016-02-04 09:52:01 +01:00
Thomas Kriechbaumer
3f44eff143 --wip-- 2016-02-04 09:52:01 +01:00
Thomas Kriechbaumer
986e30fb19 add todo note 2016-02-04 09:52:01 +01:00
Thomas Kriechbaumer
9e61974288 improve flow control 2016-02-04 09:52:01 +01:00
Thomas Kriechbaumer
b44c3ac6e0 propagate GoAway to the other side 2016-02-04 09:52:01 +01:00
Thomas Kriechbaumer
e9eed5e4c2 --wip-- 2016-02-04 09:52:01 +01:00
Maximilian Hils
ae4a1dd6de Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2016-02-02 21:49:03 +01:00
Maximilian Hils
cc68e6bcb2 add appveyor slack integration 2016-02-02 21:48:48 +01:00
Thomas Kriechbaumer
3bf2a3fb99 move travis-slack notification to different channel 2016-02-02 19:28:20 +01:00
Maximilian Hils
8c4d8b3785 fix #861, fix #888 2016-02-02 18:18:04 +01:00
Maximilian Hils
0336a53aa8 Merge branch 'master' of https://github.com/mitmproxy/netlib 2016-02-02 18:16:05 +01:00
Maximilian Hils
a188ae5ac5 allow creation of certs without CN 2016-02-02 18:15:55 +01:00
Maximilian Hils
5b18a355aa Merge pull request #909 from chrishamant/master
fix crash with viewing unpacked date objects
2016-02-02 18:12:02 +01:00
Chris Hamant
329710e6fb fix crash with viewing unpacked date objects 2016-02-02 11:48:42 -05:00
Thomas Kriechbaumer
e222858f01 bump dependency and remove deprecated fields 2016-02-02 17:39:49 +01:00
Maximilian Hils
83bd7b2603 turn script reloader off by default outside mitmdump/mitmproxy 2016-02-02 14:33:36 +01:00
Maximilian Hils
aaf82cae7d tests: use relative imports 2016-02-02 13:25:31 +01:00
Maximilian Hils
bceeb4a291 raise an ScriptException when running unloaded scripts 2016-02-02 12:27:01 +01:00
Maximilian Hils
f39e50c4db silence third-party modules 2016-02-02 12:26:28 +01:00
Thomas Kriechbaumer
81b32cf426 Merge pull request #116 from Kriechi/hyperframe
migrate to hyperframe
2016-02-01 20:28:14 +01:00
Thomas Kriechbaumer
1e20340126 Merge pull request #118 from mitmproxy/py3-peek
Fix Reader.peek() on Python 3
2016-02-01 20:25:28 +01:00
Maximilian Hils
417384d6f2 Merge pull request #906 from anantk17/master
Added feature to intercept flows from within inline scripts
2016-02-01 20:24:06 +01:00
Maximilian Hils
931b5459e9 remove code duplication 2016-02-01 20:19:34 +01:00
Maximilian Hils
a3af0ce71d tests++ 2016-02-01 20:10:18 +01:00
Maximilian Hils
bda49dd178 fix #113, make Reader.peek() work on Python 3 2016-02-01 19:38:14 +01:00
Maximilian Hils
7c83a709ea add test for Reader.peek() 2016-02-01 19:24:30 +01:00
Thomas Kriechbaumer
e98c729bb9 test on python3 2016-01-31 20:19:32 +01:00
Thomas Kriechbaumer
280b491ab2 migrate to hyperframe 2016-01-31 20:03:25 +01:00
Anant
34875585c0 added comments 2016-01-31 04:02:11 +05:30
Maximilian Hils
11218e0c98 fix #903 2016-01-30 22:44:08 +01:00
Thomas Kriechbaumer
d253ebc142 fix test request and response headers 2016-01-30 22:03:24 +01:00
Thomas Kriechbaumer
283c74a0ea allow pypy again on travis 2016-01-30 13:38:28 +01:00
Thomas Kriechbaumer
2145ded375 fix pypy on travis 2016-01-30 13:35:49 +01:00
Thomas Kriechbaumer
8c37538314 code formatting: fix whitespace issues 2016-01-27 10:36:28 +01:00
Thomas Kriechbaumer
c2bb29f669 cleanup imports 2016-01-27 10:36:28 +01:00
Maximilian Hils
299c7fa34c Merge pull request #884 from dufferzafar/export
Export/Copy flow as...
2016-01-26 21:12:08 +01:00
Maximilian Hils
ce132dc180 Merge pull request #893 from dweinstein/sni-ignore
Add ignore based on TLS ClientHello SNI
2016-01-26 21:07:12 +01:00
David Weinstein
4be8d148b1 Add SNI ignore docs and have code match it 2016-01-26 13:09:22 -05:00
David Weinstein
8f8c2efccd Include raw client hello in exception 2016-01-26 12:38:00 -05:00
David Weinstein
7d69c3480b remove TODO 2016-01-26 11:59:32 -05:00
David Weinstein
a2ebcfe879 Simplify check_ignore in _next_layer 2016-01-26 11:44:32 -05:00
David Weinstein
17a32d921c Log exceptions parsing TlsClientHello in TlsLayer 2016-01-26 11:40:11 -05:00
David Weinstein
11b289d3c7 remove client_tls property from TlsLayer 2016-01-26 11:28:19 -05:00
David Weinstein
21ddd5e503 Move SNI ignore check into _next_layer 2016-01-26 11:12:46 -05:00
David Weinstein
0a43cc8844 add TlsClientHello repr 2016-01-26 09:33:03 -05:00
Maximilian Hils
798bd413e8 Merge pull request #898 from lilydjwg/master
[console] always show connection info in Details tab
2016-01-26 11:31:37 +01:00
依云
ca0f310211 [console] always show connection info in Details tab
Connections become false values when it's finished. Check if it's
None when trying to show address info.

Fixes #886.
2016-01-26 18:14:19 +08:00
David Weinstein
56ef7d238b Don't store client_tls state in root context 2016-01-25 17:49:31 -05:00
Shadab Zafar
8fa16ce895 Remove restrictions based on request content 2016-01-25 22:31:22 +05:30
Thomas Kriechbaumer
dc7d41e7a5 Merge pull request #115 from Kriechi/move-tservers
move tservers to netlib module
2016-01-25 15:22:36 +01:00
Anant
0a6e3c88ef Added feature to intercept flows from within inline scripts 2016-01-25 19:00:33 +05:30
Thomas Kriechbaumer
1b487539b1 move tservers to netlib module 2016-01-25 09:20:44 +01:00
David Weinstein
ce0a500885 Add ignore based on TLS ClientHello SNI
- also add some documentation about ignoring based on SNI
2016-01-23 21:46:04 -05:00
Maximilian Hils
a60810cc2c Merge pull request #891 from ganguera/master
Added CLI argument to enable "follow flow list" mode
2016-01-22 23:03:47 +01:00
Guillem Anguera
b030ff090a Added CLI argument to enable "follow flow list" mode 2016-01-22 22:11:03 +01:00
Maximilian Hils
4024721c7b Merge pull request #879 from snemes/master
Fixed a problem with the bind address not being used as the source address on outgoing TCP packets
2016-01-18 16:07:02 +01:00
Sandor Nemes
cb3107fd0e Merge branch 'master' of https://github.com/snemes/mitmproxy 2016-01-18 15:53:34 +01:00
Sandor Nemes
61bd318622 remove unnecessary source_address from proxy modes 2016-01-18 15:52:03 +01:00
Sandor Nemes
b892957b90 Merge branch 'master' into master 2016-01-18 13:35:27 +01:00
Maximilian Hils
7eb9bf818c Merge pull request #881 from MatthewShao/Fix#846
Fix #846
2016-01-18 12:21:21 +01:00
Matthew Shao
8aeed2032d Update reloader.py 2016-01-18 19:12:43 +08:00
Sandor Nemes
918a457f5a Minor aesthetic fixes. 2016-01-18 09:55:46 +01:00
Matthew Shao
98cee0e147 Update reloader.py 2016-01-18 10:15:09 +08:00
MatthewShao
7f2b17d0ef Use RegexMatchingEventHandler() instead. 2016-01-18 09:57:58 +08:00
Sandor Nemes
192f033967 Merge branch 'master' into master 2016-01-17 21:24:47 +01:00
Maximilian Hils
0ca0469d6e Merge pull request #110 from snemes/master
Added getter/setter for TCPClient source_address
2016-01-17 20:09:33 +01:00
Maximilian Hils
0f54f2990c Merge pull request #872 from bazzinotti/inline-tcp
Add "tcp_message" Inline Script Hook
2016-01-17 19:54:59 +01:00
Maximilian Hils
17fd8f5a24 Merge pull request #36 from felixonmars/fix/typo
Fix a typo: aways -> always
2016-01-14 15:41:03 +01:00
Felix Yan
d065161c8e Fix a typo: aways -> always 2016-01-14 22:03:26 +08:00
Thomas Kriechbaumer
add33f8733 Merge pull request #887 from felixonmars/pillow-31
Allow Pillow 3.1
2016-01-14 09:42:25 +01:00
Felix Yan
cbf9418072 Allow Pillow 3.1
Tested with Pillow 3.1.0, all tests passed and the functionality is working correctly here.
2016-01-14 14:59:51 +08:00
Matthew Shao
5b442a8947 Use PollingObserver() only on OS X. 2016-01-14 09:30:06 +08:00
Maximilian Hils
0882457b17 Merge pull request #882 from tinius/sslstrip
added sslstrip to inline script examples
2016-01-13 15:46:31 +01:00
Sandor Nemes
2753af0ec7 Merge branch 'master' into master 2016-01-13 15:05:57 +01:00
Sandor Nemes
d12e256749 Merge branch 'master' into master 2016-01-13 15:05:29 +01:00
Shadab Zafar
152e395fa4 Copy as raw request
Issue #807

I am not entirely sure what needs to be returned in this case.
2016-01-13 19:21:13 +05:30
Thomas Kriechbaumer
e1e2f7464e Merge pull request #112 from mitmproxy/update-cryptography
upgrade cryptography dependency for new wheels
2016-01-13 13:10:23 +01:00
Shadab Zafar
34ec2d1370 Export/Copy request as python code
Press E followed by p to copy code to clipboard.

The code uses the python requests module.

Only GET methods are currently supported, but can easily be extended
to POST etc.
2016-01-13 16:40:05 +05:30
Shadab Zafar
1079e00641 Use signals.status_message for empty content 2016-01-13 16:36:44 +05:30
Thomas Kriechbaumer
9e2d050bb3 upgrade cryptography dependency for new wheels 2016-01-13 12:05:38 +01:00
Shadab Zafar
0bb13c61d6 Refactor copy_as_curl_command 2016-01-13 16:17:01 +05:30
Marcelo Glezer
9facd190c6 refactored export as curl to be 'E' to export and 'c' to as curl command 2016-01-13 15:29:44 +05:30
Marcelo Glezer
b2e3d2ce70 headers enumartion was failing in copy as curl and protocol was None when copy to clipboard was called. first wip fix 2016-01-13 15:29:44 +05:30
Marcelo Glezer
fa007a7707 fixed TypeError: ask_save_overwrite() takes exactly 2 arguments (xxxxx given) 2016-01-13 15:28:32 +05:30
Ryan Welton
6a235a1b11 Was needlessly passing un-used parameters + clean up misspelling 2016-01-13 15:28:32 +05:30
Ryan Welton
b424c1d43f Switch to single quotes 2016-01-13 15:28:32 +05:30
Ryan Welton
dde0ff50a5 Add copy as curl command 2016-01-13 15:28:32 +05:30
Niko Kommenda
55e89865ff no longer strips Accept-Encoding as mitmproxy can handle compression 2016-01-12 22:25:42 +00:00
Niko Kommenda
25705af76d added sslstrip to inline script examples 2016-01-12 16:41:41 +00:00
Matthew Shao
181c2973e6 PollingObserver() fixed on Linux and OS X. 2016-01-12 22:24:18 +08:00
MatthewShao
201fdea6e5 Change Observer() to PollingObserver(). 2016-01-12 21:36:59 +08:00
Matthew Shao
89679bc386 Fix observer in same dir situation. 2016-01-12 20:50:33 +08:00
MatthewShao
e72663be08 Fix script reloader on OS X. 2016-01-12 11:45:03 +08:00
Sandor Nemes
b8e8c4d682 Simplified setting the source_address in the TCPClient constructor 2016-01-11 08:10:36 +01:00
Michael J. Bazzinotti
e766838a1a Add Inline Script Hooks to TCP mode 2016-01-10 13:05:01 -05:00
Maximilian Hils
46428412d6 Merge pull request #111 from felixonmars/master
Allow cryptography 1.2.*
2016-01-10 18:20:41 +01:00
Felix Yan
739806bfe2 Allow cryptography 1.2.* 2016-01-11 00:37:43 +08:00
Thomas Kriechbaumer
aea3837d4a remove code duplication 2016-01-10 11:57:39 +01:00
Chris Czub
493302d180 Support writing to outfile from mitmweb 2016-01-10 11:57:37 +01:00
Sandor Nemes
fe77dd35c6 Fixed a problem with the bind address not being used as the source address on outgoing TCP packets 2016-01-08 18:55:13 +01:00
Sandor Nemes
4bb9f3d35b Added getter/setter for TCPClient source_address 2016-01-08 18:04:47 +01:00
Maximilian Hils
f07008b8a6 Merge pull request #878 from warting/patch-1
Update redirect_requests.py
2016-01-08 17:33:03 +01:00
Stefan Wärting
27b801ebe2 Update redirect_requests.py
replace http version with "HTTP/1.1"
2016-01-08 16:02:27 +01:00
Maximilian Hils
11215e46ec fix #659 2016-01-02 15:12:36 +01:00
Michael J. Bazzinotti
f8d8a80bd0 clientcert tests: fix whitespace 2015-12-29 18:14:11 +01:00
Maximilian Hils
7b093b46b6 Merge pull request #870 from bazzinotti/master
[docs/libmproxy/test] Support single client-side cert file
2015-12-29 17:51:11 +01:00
Michael J. Bazzinotti
09168e1274 client-cert: Simplify and cleanup
simplify the error message when cert path does not exist.
During tests, reset the clientcerts proxy config setting to None
Remove now-unused clientcerts code from class ProxTestBase
2015-12-29 11:48:02 -05:00
Michael J. Bazzinotti
80690b7906 [docs/libmproxy/test] Support single client-side cert file as argument to
--client-certs
2015-12-28 15:20:45 -05:00
Maximilian Hils
d1e6b5366c bump version 2015-12-25 16:00:50 +01:00
Maximilian Hils
c10b614f70 update ssl_match_hostname dependency, refs #868 2015-12-25 15:56:26 +01:00
Maximilian Hils
6391b05ef1 Merge pull request #857 from jwilk/spelling
docs: fix typos
2015-12-12 11:43:56 +01:00
Jakub Wilk
c8f9f4c17e docs: fix typos 2015-12-12 11:18:56 +01:00
Maximilian Hils
c6d849f7f5 Merge pull request #855 from jvillacorta/master
Add default ciphers to avoid issue with iOS9 App Transport Security
2015-12-11 17:13:32 +01:00
Jorge Villacorta
ba53c7c9a2 Add default ciphers to avoid issue with iOS9 App Transport Security 2015-12-11 11:09:02 -05:00
Maximilian Hils
f446dc4b83 Merge pull request #853 from dweinstein/warnings-to-stderr
TLS verification warnings write to stderr
2015-12-10 17:49:24 +01:00
David Weinstein
78fc092b94 TLS verification warnings write to stderr 2015-12-10 11:43:58 -05:00
Aldo Cortesi
3b38fd86d2 Merge commit '5db6275' 2015-12-04 11:20:18 +13:00
Aldo Cortesi
5db6275c63 Changelog 2015-12-04 11:19:24 +13:00
Maximilian Hils
37903f69a0 setup.py: document that we don't want to use '~=' 2015-12-03 19:58:35 +01:00
Maximilian Hils
5f159da488 fix tests 2015-12-03 18:45:37 +01:00
Maximilian Hils
47b2beb48b use latest netlib version for snapshots 2015-12-03 18:42:02 +01:00
Maximilian Hils
5272979774 remove docs directory from sdist 2015-12-03 18:19:44 +01:00
Maximilian Hils
71834421bb bump version 2015-12-03 18:13:24 +01:00
Maximilian Hils
e6bf033cbd bump version 2015-12-03 18:13:24 +01:00
Maximilian Hils
77eca7c305 bump version 2015-12-03 18:13:24 +01:00
Maximilian Hils
d6c0157f7d fully disable wheels 2015-12-03 18:03:59 +01:00
Maximilian Hils
946bc05187 use version specifiers compatible with old setuptools releases 2015-12-03 17:57:29 +01:00
Maximilian Hils
4718f36379 use version specifiers compatible with old setuptools releases 2015-12-03 17:56:57 +01:00
Maximilian Hils
ed132ba4e5 use version specifiers compatible with old setuptools releases 2015-12-03 17:56:41 +01:00
Maximilian Hils
79da0f7c93 clean up, don't build wheels 2015-12-03 17:55:42 +01:00
Maximilian Hils
46ae8b0e30 Revert "make setup.py wheel-ready"
This reverts commit 51bd98d5b1.
2015-12-03 17:28:52 +01:00
Maximilian Hils
51bd98d5b1 make setup.py wheel-ready 2015-12-03 16:25:49 +01:00
Maximilian Hils
8ef0624b51 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2015-12-03 14:45:44 +01:00
Maximilian Hils
1619af1486 flow format compat: 0.14 -> 0.15 2015-12-03 14:45:26 +01:00
Maximilian Hils
b362e9a013 test flow conversion 2015-12-03 14:43:56 +01:00
Maximilian Hils
f772fdeb33 update spec files 2015-12-03 14:32:45 +01:00
Maximilian Hils
7c14725e54 add 'v' in release tag 2015-12-03 14:28:32 +01:00
Maximilian Hils
da50120502 appveyor: deploy binaries to snapshot server 2015-12-03 13:16:36 +01:00
Maximilian Hils
9c89bfbccc appveyor: build binaries 2015-12-03 12:56:41 +01:00
Maximilian Hils
d1ce1aa993 fix #839 2015-12-02 21:19:41 +01:00
Maximilian Hils
7274edce05 travis: retry snapshot upload 2015-12-02 21:03:45 +01:00
Maximilian Hils
85b553724c add tnetstring inspection tool 2015-12-02 19:59:02 +01:00
Maximilian Hils
3963a2191b add import capability for old flows, fix #840 2015-12-02 19:50:08 +01:00
Maximilian Hils
a0a7be9ab1 make pyinstaller version configurable 2015-11-29 22:11:14 +01:00
Maximilian Hils
b5d5e56fdb remove docs from sdist
This has been broken anyway.
2015-11-29 19:07:27 +01:00
Maximilian Hils
9f224f7dbd add 3.5 compat classifiers 2015-11-29 19:06:54 +01:00
Maximilian Hils
d3570747e8 also build wheels 2015-11-29 19:05:58 +01:00
Maximilian Hils
7cb57e206f README: mkd -> rst
pypi only renders reStructuredText.
2015-11-29 19:04:19 +01:00
Maximilian Hils
ea3639209b travis: don't install virtualenv manually 2015-11-29 15:26:24 +01:00
Maximilian Hils
459ab0434f add virtualenv dependency 2015-11-29 15:25:12 +01:00
Maximilian Hils
f9c000ea6e travis: fix osx binary build condition 2015-11-29 15:23:44 +01:00
Maximilian Hils
4c9fc2e3e9 travis: build binaries on osx 2015-11-29 15:11:08 +01:00
Maximilian Hils
8cd9f41929 tabs -> spaces 2015-11-29 14:54:44 +01:00
Maximilian Hils
0188d5b1c7 better binary archive names 2015-11-29 14:50:44 +01:00
Maximilian Hils
45c199a807 fix tarfile creation 2015-11-29 03:38:23 +01:00
Maximilian Hils
f02da6448d disable concurrency tests on appveyor 2015-11-29 03:13:08 +01:00
Maximilian Hils
bb62f5f3f5 lessen test race conditions 2015-11-29 02:59:25 +01:00
Maximilian Hils
0b06b02c92 add new pyinstaller spec files 2015-11-29 02:48:39 +01:00
Maximilian Hils
decdb75fba update rtool 2015-11-29 02:46:08 +01:00
Maximilian Hils
43ed82062f fix #847 2015-11-27 21:21:04 +01:00
Maximilian Hils
178324a0ee remove unicode_literals 2015-11-27 20:26:02 +01:00
Maximilian Hils
6b92497d4f remove unnecessary race conditions in tests 2015-11-27 01:11:06 +01:00
Maximilian Hils
abd8881491 add memoryleak debug script 2015-11-26 23:26:01 +01:00
Maximilian Hils
a88004f1ce fix #831 2015-11-26 23:20:31 +01:00
Maximilian Hils
6a239526e5 http: catch all exceptions 2015-11-26 23:19:43 +01:00
Maximilian Hils
a9f64c22f8 simplify Client/ServerConnection.__repr__ 2015-11-26 23:15:21 +01:00
Maximilian Hils
89013eb7af establish tls with client even if server connection fails 2015-11-26 23:13:06 +01:00
Maximilian Hils
3eea7f1216 script reloader: minor fixes 2015-11-26 14:59:54 +01:00
Maximilian Hils
63355421ed travis: add OSX tests 2015-11-26 14:59:43 +01:00
Maximilian Hils
5d332e7218 fix #842 2015-11-26 14:58:08 +01:00
Maximilian Hils
354f84c4c8 skip timing tests on appveyor 2015-11-24 19:07:04 +01:00
Maximilian Hils
d2f69da235 disable script reloader
This currently throws some errors on OSX.
2015-11-24 18:54:16 +01:00
Maximilian Hils
a561e3bd3d Merge branch 'travis-contentviews' 2015-11-20 12:25:15 +01:00
Maximilian Hils
40b1819293 Merge pull request #836 from MatthewShao/fix#835
Fix #835 , can display unicode character correctly
2015-11-18 13:57:33 +01:00
Maximilian Hils
4d17ddba38 Merge pull request #105 from bltb/master
Allow empty HTTP header value.
2015-11-17 11:19:33 +01:00
Benjamin Lee
52c02bc930 Add test for empty header field value. 2015-11-17 06:51:22 +11:00
Benjamin Lee
cf1889e157 WIP. Add breaking test. 2015-11-17 06:46:48 +11:00
Benjamin Lee
c1385c9a17 Fix to ignore empty header value.
According to Augmented BNF in the following RFCs

http://tools.ietf.org/html/rfc5234#section-3.6

http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.1

        field-value    = *( field-content | LWS )

http://tools.ietf.org/html/rfc7230#section-3.2

        field-value    = *( field-content / obs-fold )

... the HTTP message header `field-value` is allowed to be empty.
2015-11-17 04:51:20 +11:00
Matthew Shao
b7bea03c68 fix #835 , can display unicode character correctly 2015-11-16 20:47:58 +08:00
Maximilian Hils
0df7e27c3b Merge pull request #103 from scone/master
Utils port to 3.4 keeping py2 compatibility
2015-11-14 22:15:24 -08:00
Maximilian Hils
57cd9022d9 fix appveyor race conditions in tests 2015-11-14 22:14:18 +01:00
Maximilian Hils
d6bd1cb4a6 fix HTTPS Proxy-Authentication, refs #824 2015-11-14 21:55:02 +01:00
Sam Cleveland
ce02874e2a Fixing test_wsgi to remove py.test warnings
Renamed TestApp class to ExampleApp to prevent py.test from trying to
collect it as a test.
2015-11-14 13:42:43 -06:00
Maximilian Hils
0d98b9dcc5 finalize script reloading 🎉 2015-11-14 05:57:02 +01:00
Maximilian Hils
4499ab61c0 structure libmproxy.script 2015-11-14 04:21:38 +01:00
Maximilian Hils
247f27d821 minor stylistic fixes 2015-11-14 03:46:34 +01:00
Maximilian Hils
dce469d4c1 Merge pull request #833 from zbuc/contentview_scripts
Contentview scripts
2015-11-13 18:41:05 -08:00
Maximilian Hils
3cd709d982 Merge pull request #821 from zbuc/protobuf_contentview_test_fix
Fix failing protobuf contentview test
2015-11-13 18:35:10 -08:00
Chris Czub
e72a9a62a1 Feedback from PR #832 2015-11-13 16:55:27 -05:00
Chris Czub
d3feaa3bc6 Add custom content view plugin support for mitmproxy/mitmdump 2015-11-13 15:09:05 -05:00
Chris Czub
d7239d665e Add new contentviews' content type mappings 2015-11-13 15:08:52 -05:00
Chris Czub
82a90511bc Add "add" ContentView method & test 2015-11-13 15:07:56 -05:00
Maximilian Hils
b97988baee be more conservative about dependency versions 2015-11-13 20:02:07 +01:00
Maximilian Hils
5916260849 be more conservative about dependency versions 2015-11-13 20:00:54 +01:00
Maximilian Hils
f62d564cfb be more conservative about dependency versions
We had various examples in the past where new releases break mitmproxy completely. Just as of today, the lxml guys pushed a new release to pypi, but did not include wheels - you cannot install mitmproxy on Windows without a compiler installed now.
2015-11-13 19:57:02 +01:00
Matthew Shao
cd0b9e01be Decouple libmproxy.script from libmproxy.flow 2015-11-13 21:08:39 +08:00
Sam Cleveland
2bd7bcb371 Porting to Python 3.4
Updated wsgi to support Python 3.4 byte strings.
Updated test_wsgi to remove py.test warning for TestApp having an
__init__ constructor.

samc$ sudo py.test netlib/test/test_wsgi.py -r w
= test session starts =
platform darwin -- Python 3.4.1, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /Users/samc/src/python/netlib, inifile:
collected 6 items

netlib/test/test_wsgi.py ......

= 6 passed in 0.20 seconds =
2015-11-11 20:27:10 -06:00
Sam Cleveland
6689a342ae Porting to Python 3.4
Fixed byte string formatting for hexdump.

= test session starts =
platform darwin -- Python 3.4.1, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /Users/samc/src/python/netlib, inifile:
collected 11 items

netlib/test/test_utils.py ...........

= 11 passed in 0.23 seconds =
2015-11-11 19:53:51 -06:00
Sam Cleveland
2d48f12332 Revert "Porting netlib to python3.4"
This reverts commit 8237183485.
2015-11-11 19:41:42 -06:00
Sam Cleveland
8237183485 Porting netlib to python3.4
Updated utils.py using 2to3-3.4
Updated hexdump to use .format() with .encode() to support python 3.4
Python 3.5 supports .format() on bytes objects, but 3.4 is the current
default on Ubuntu.

samc$ py.test netlib/test/test_utils.py
= test session starts =
platform darwin -- Python 3.4.1, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /Users/samc/src/python/netlib, inifile:
collected 11 items

netlib/test/test_utils.py ...........

= 11 passed in 0.19 seconds =
2015-11-11 11:32:02 -06:00
Matthew Shao
2522ba69fa Move the observer initalization to the constructor of Script
class.Should work with both mitmproxy and mitmdump now.
Change the names in PEP8 style.
2015-11-11 20:59:12 +08:00
Matthew Shao
3f6521f912 Use watchdog to reload scripts automatically. 2015-11-11 09:03:05 +08:00
Maximilian Hils
3739e1fe82 fix scripteditor bug 2015-11-10 04:48:30 +01:00
Maximilian Hils
59d3e9d954 docs++ 2015-11-07 20:43:10 +01:00
Maximilian Hils
9298325ca5 Merge pull request #822 from ddworken/master
Added information on cert pinning (Fixes #689)
2015-11-07 11:30:28 -08:00
Maximilian Hils
c302bec198 travis: test optional content views as well 2015-11-07 20:17:46 +01:00
David Dworken
96465075f4 Added information on cert pinning (Fixes #689) 2015-11-06 21:23:10 -05:00
Aldo Cortesi
6a7899fdbb Bump version for next release cycle 2015-11-07 09:30:59 +13:00
Aldo Cortesi
9cab9ee5d6 Bump version for next release cycle 2015-11-07 09:30:49 +13:00
Aldo Cortesi
58aeb2b843 Bump version for next release cycle 2015-11-07 09:30:38 +13:00
Chris Czub
b0648ee8a6 Fix failing protobuf contentview test 2015-11-06 11:18:48 -05:00
Aldo Cortesi
41e91dae00 Add CONTRIBUTORS 2015-11-06 14:08:38 +13:00
Aldo Cortesi
9beae933ba Bump version, update CONTRIBUTORS, CHANGELOG 2015-11-06 13:52:08 +13:00
Aldo Cortesi
fc75613fa8 Bump version, add CONTRIBUTORS 2015-11-06 13:51:40 +13:00
Aldo Cortesi
3e2eb3fef1 Bump version 2015-11-06 13:51:15 +13:00
Aldo Cortesi
2eb9beebfa Adjust pyinstaller spec paths 2015-11-06 11:44:52 +13:00
Aldo Cortesi
f16f2b9ce3 Adjust pyinstaller spec paths 2015-11-06 11:44:37 +13:00
Aldo Cortesi
6135e16482 Catch and ignore thread errors on exit
Keyboard interrupts bugger up Queues in some way, which causes a traceback on
exit in many of our tools. The issue seems easiest to reproduce with binary
builds on OSX.
2015-11-06 11:35:54 +13:00
Maximilian Hils
de5df2e4d4 Merge pull request #819 from tekii/hotfix-broken-copy
fix copy to clipboard command when copying content
2015-11-05 04:17:08 +01:00
Marcelo Glezer
6b6b0a9416 fix copy to clipboard command when copying content 2015-11-05 00:09:22 -03:00
Maximilian Hils
810c2f2414 Merge remote-tracking branch 'origin/hostname-validation' 2015-11-04 21:33:32 +01:00
Maximilian Hils
fb463f50ed Merge pull request #809 from zbuc/pfctl_errhandling
Better error handling/reporting for pfctl failures on OS X
2015-11-04 21:32:12 +01:00
Chris Czub
9398d5896b PR 809 make code more pythonic 2015-11-04 15:04:18 -05:00
Maximilian Hils
9d12425d5e Set default cert expiry to <39 months
This sould fix mitmproxy/mitmproxy#815
2015-11-04 11:28:02 +01:00
Maximilian Hils
c62abd67d2 docs: fix broken graphic 2015-11-02 13:04:35 +01:00
Maximilian Hils
96db5edc5c docs: improve mode flowchart 2015-11-02 11:50:08 +01:00
Maximilian Hils
51a3378290 improve reverse proxy docs 2015-11-02 10:47:14 +01:00
Maximilian Hils
07b60acb7f try to fix appveyor race conditions in tests 2015-11-01 18:44:50 +01:00
Maximilian Hils
1bf34e6f45 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2015-11-01 18:39:55 +01:00
Maximilian Hils
978eb17d66 fix #811 2015-11-01 18:37:20 +01:00
Maximilian Hils
9d36f8e43f minor fixes 2015-11-01 18:20:00 +01:00
Maximilian Hils
5af9df326a fix certificate verification
This commit fixes netlib's optional (turned off by default)
certificate verification, which previously did not validate the
cert's host name. As it turns out, verifying the connection's host
name on an intercepting proxy is not really straightforward - if
we receive a connection in transparent mode without SNI, we have no
clue which hosts the client intends to connect to. There are two
basic approaches to solve this problem:

 1. Exactly mirror the host names presented by the server in the
    spoofed certificate presented to the client.
 2. Require the client to send the TLS Server Name Indication
    extension. While this does not work with older clients,
    we can validate the hostname on the proxy.

Approach 1 is problematic in mitmproxy's use case, as we may want
to deliberately divert connections without the client's knowledge.
As a consequence, we opt for approach 2. While mitmproxy does now
require a SNI value to be sent by the client if certificate
verification is turned on, we retain our ability to present
certificates to the client which are accepted with a maximum
likelihood.
2015-11-01 18:15:30 +01:00
Maximilian Hils
b4eb4eab92 adjust test certificate generation 2015-11-01 17:48:34 +01:00
Maximilian Hils
5e90459569 Merge pull request #810 from gecko655/ctrl_fb
Use ctrl+f and ctrl+b to scroll a page
2015-10-31 18:00:14 +01:00
gecko655
6aa7454f92 Use ctrl+f and ctrl+b to scroll a page 2015-10-30 12:48:38 +09:00
Chris Czub
88451ef245 Declare & define insufficient_priv 2015-10-29 16:01:24 -04:00
Chris Czub
70c28f5d34 Better error handling/reporting for pfctl failures on OS X 2015-10-29 15:56:43 -04:00
Maximilian Hils
65c08ec899 Merge pull request #791 from tunz/master
Prevent flowview from creating duplicated windows
2015-10-28 13:10:38 +01:00
Maximilian Hils
8e9cd77b55 Merge pull request #805 from Badg/patch-1
Update ubuntu installation to includ libjpeg
2015-10-23 03:25:23 +02:00
Nick Badger
4537d561c6 Ubuntu install missing libjpeg8-dev, zlib1g-dev
As per https://pillow.readthedocs.org/en/3.0.0/installation.html#linux-installation, to avoid missing install dependencies.
2015-10-22 18:11:06 -07:00
Nick Badger
a6fee43384 Update ubuntu installation to includ libjpeg
Otherwise install fails with error "--enable-jpeg requested but jpeg not found"
2015-10-22 17:38:55 -07:00
Maximilian Hils
ed56eadd28 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2015-10-22 02:38:14 +02:00
Maximilian Hils
726b70ccdc fix #800 2015-10-22 02:38:00 +02:00
Maximilian Hils
267837f441 add test certificate generator 2015-10-16 18:12:36 +02:00
Maximilian Hils
4d772d7ce0 Merge pull request #801 from ben-lerner/doc_fix
doc typo fix
2015-10-14 09:37:24 +02:00
Ben Lerner
22191d63ab doc typo fix 2015-10-13 21:09:56 -04:00
Maximilian Hils
7d8191ee37 update web builds, use watchify 2015-10-08 12:43:55 +02:00
Maximilian Hils
442f079e0b Merge pull request #797 from colinbendell/colinbendell-patch-1
server_conn.address might not yet be established
2015-10-08 12:37:43 +02:00
Choongwoo Han
9c0efdf2ec Refresh flowview instead of reopen the same flowview 2015-10-08 11:31:33 +09:00
Colin Bendell
a85e4bc75c default should not be None
Fixed default value when self.address has not been set
2015-10-07 21:46:08 -04:00
Colin Bendell
77aeac11a9 Check if server connection hasn't yet been initiated
This fixes #761 when NoneType error is thrown when non-TLS requests initiate a client request but the server connection hasn't yet been initiated.
2015-10-07 20:30:31 -04:00
Maximilian Hils
09e36fae4e Merge pull request #792 from tunz/patch-1
Correct a wrong link in CONTRIBUTING.md
2015-10-04 10:36:52 +02:00
Choongwoo Han
3ffc3404b0 Update CONTRIBUTING.md
Wrong link
2015-10-04 14:49:41 +09:00
Choongwoo Han
45494d1c79 Prevent flowview from creating duplicated windows 2015-10-04 14:21:51 +09:00
Maximilian Hils
ce38a05a20 Merge remote-tracking branch 'origin/master' 2015-10-03 23:59:13 +02:00
Maximilian Hils
26631621ee fix #786 2015-10-03 14:48:51 +02:00
Maximilian Hils
d67f4fa3cc Merge pull request #788 from sethp-jive/patch-1
Allow reading scripts from an anonymous pipe
2015-10-01 00:59:25 +02:00
sethp-jive
fd8c921a2f Allow reading scripts from an anonymous pipe
Bash (and many other shells) provide a nifty feature in "anonymous pipe" or "anonymous fifo" whereby the output of a subshell may be treated as a simple file by the parent shell: http://unix.stackexchange.com/a/156088

Unfortunately, libmproxy complains because that "file" is not a regular file, as os.path.isfile checks, e.g. giving the error "Not a file: /dev/fd/11". This patch is intended to provide for the following use-case:

```
mitmdump -s <(echo "def response(context, flow):\n  flow.response.headers['newheader'] = [`hostname`]")
```

where `hostname` may be replaced with a more complicated lookup.
2015-09-30 15:55:43 -07:00
Maximilian Hils
c6811bd0e8 fix #773 2015-09-28 14:55:13 +02:00
Maximilian Hils
0f9a72580a fix coverage collection 2015-09-28 14:16:06 +02:00
Maximilian Hils
86ef19b450 fix tests 2015-09-28 14:04:41 +02:00
Maximilian Hils
2e1f7ecd55 fix tests 2015-09-28 14:04:25 +02:00
Maximilian Hils
c11ab3676d Merge branch 'http-models' 2015-09-28 13:54:53 +02:00
Maximilian Hils
67229fbdf7 Merge branch 'http-models' 2015-09-28 13:53:59 +02:00
Maximilian Hils
5261bcdf4b properly adjust tests for 87566da3ba 2015-09-28 11:46:18 +02:00
Maximilian Hils
87566da3ba fix mitmproxy/mitmproxy#784 2015-09-28 11:18:00 +02:00
Maximilian Hils
6661770d4e handle Expect: 100-continue header, fix #770 2015-09-28 10:59:10 +02:00
Maximilian Hils
6075957a97 move tests to netlib 2015-09-27 00:50:14 +02:00
Maximilian Hils
23d13e4c12 test response model, push coverage to 100% branch cov 2015-09-27 00:49:41 +02:00
Maximilian Hils
466888b01a improve request tests, coverage++ 2015-09-26 20:07:11 +02:00
Maximilian Hils
1b6ea5caf3 adjust to netlib response changes + docs 2015-09-26 17:41:14 +02:00
Maximilian Hils
fa722e0290 adjust to netlib changes 2015-09-26 17:40:22 +02:00
Maximilian Hils
49ea8fc0eb refactor response model 2015-09-26 17:39:50 +02:00
Maximilian Hils
b13acd7956 adjust to netlib request changes + docs 2015-09-26 01:23:59 +02:00
Maximilian Hils
a163dba582 adjust to netlib request model changes 2015-09-26 00:40:01 +02:00
Maximilian Hils
106f7046d3 refactor request model 2015-09-26 00:39:04 +02:00
Maximilian Hils
45f2ea33b2 minor fixes 2015-09-25 18:24:18 +02:00
Maximilian Hils
c7b8322500 also accept bytes as arguments 2015-09-22 01:56:09 +02:00
Maximilian Hils
f937522773 Headers: return str on all Python versions 2015-09-22 01:48:35 +02:00
Maximilian Hils
a978c6b9ce fix tests 2015-09-21 23:39:22 +02:00
Maximilian Hils
2536e1d3e7 appveyor: use py.test 2015-09-21 23:05:12 +02:00
Maximilian Hils
2f670bac99 fix tests, use pytest
We currently test with unparallelized builds,
because there are apparently some race conditions
in the test suite, which I can't trigger locally
but happen on travis.

Squashed commit of the following:

commit 7dceb6dd3a1bdbc39688258bc4dff6eee685a33b
Author: Maximilian Hils <git@maximilianhils.com>
Date:   Mon Sep 21 23:00:24 2015 +0200

    disable parallelized tests

commit fc0c3f12ee9259162e83026851362925d93b69f2
Author: Maximilian Hils <git@maximilianhils.com>
Date:   Mon Sep 21 22:49:19 2015 +0200

    fix tests

commit baba3ca5ef49bdbd7aad14f1bf0626738fa3d21c
Author: Maximilian Hils <git@maximilianhils.com>
Date:   Mon Sep 21 22:28:20 2015 +0200

    fix tests, use py.test
2015-09-21 23:03:45 +02:00
Maximilian Hils
9fbeac50ce revert websocket changes from 73586b1b
The DEFAULT construct is very weird,
but with None we apparently break pathod
in some difficult-to-debug ways.
Revisit once we do more here.
2015-09-21 22:49:39 +02:00
Thomas Kriechbaumer
21579f0add Merge pull request #98 from Kriechi/master
backport changes
2015-09-21 18:51:44 +02:00
Thomas Kriechbaumer
e9fe45f3f4 backport changes 2015-09-21 18:45:49 +02:00
Maximilian Hils
2da4aaf1ed adjust to netlib changes 2015-09-21 18:39:37 +02:00
Maximilian Hils
1ff8f294b4 minor encoding fixes 2015-09-21 18:34:43 +02:00
Maximilian Hils
bba5ec7144 experimental: run tests using py.tests 2015-09-21 18:31:30 +02:00
Maximilian Hils
88375ad64a fix minor bugs, add py.test compatibility 2015-09-21 02:26:47 +02:00
Maximilian Hils
9dea36e439 remove nose references 2015-09-21 01:22:05 +02:00
Maximilian Hils
151942d7ae update appveyor 2015-09-21 01:13:59 +02:00
Maximilian Hils
f0ff68023d remove nose as a dependency 2015-09-21 01:11:42 +02:00
Maximilian Hils
eaf66550b0 always use py.test 2015-09-21 01:08:19 +02:00
Maximilian Hils
f2e3e6af6d test on pypy3 2015-09-21 00:45:52 +02:00
Maximilian Hils
73586b1be9 python 3++ 2015-09-21 00:44:17 +02:00
Maximilian Hils
daebd1bd27 python3++ 2015-09-20 20:35:45 +02:00
Maximilian Hils
292a0aa9e6 make tests compatible with py.test 2015-09-20 19:56:57 +02:00
Maximilian Hils
0ad5cbc6bf python3++ 2015-09-20 19:56:45 +02:00
Maximilian Hils
693cdfc6d7 python3++ 2015-09-20 19:40:09 +02:00
Maximilian Hils
3f1ca556d1 python3++ 2015-09-20 18:12:55 +02:00
Maximilian Hils
91cdd78201 improve http error messages 2015-09-19 11:59:40 +02:00
Maximilian Hils
6d27901b6f fix replay functionality 2015-09-19 11:59:05 +02:00
Maximilian Hils
42bbd3c928 don't cache changed messages, fix #777 2015-09-19 11:50:02 +02:00
Maximilian Hils
fde2420e37 fix #778 2015-09-19 11:18:57 +02:00
Maximilian Hils
2d4a5fb116 experimental: don't interfere with headers, fix #93 2015-09-18 18:07:38 +02:00
Maximilian Hils
551d9f11e5 experimental: don't interfere with headers 2015-09-18 18:05:50 +02:00
Maximilian Hils
d1904c2f52 python3++ 2015-09-18 15:38:31 +02:00
Maximilian Hils
7b6b157547 properly handle SNI IPs
fixes mitmproxy/mitmproxy#772
We must use the ipaddress package here, because that's what cryptography
uses. If we opt for something else, we have nasty namespace conflicts.
2015-09-18 15:35:02 +02:00
Maximilian Hils
66d21fa4ba trigger inline script hooks for artifical responses, fix #775 2015-09-18 13:51:05 +02:00
Maximilian Hils
5df5ee15f2 remove old server replay workaround, fix #774 2015-09-18 13:27:05 +02:00
Maximilian Hils
f2c87cff8a fix py3 tests 2015-09-17 17:32:59 +02:00
Maximilian Hils
266b80238d fix tests 2015-09-17 17:29:55 +02:00
Maximilian Hils
d798ed955d python3++ 2015-09-17 16:31:50 +02:00
Maximilian Hils
6661ad3143 code -> status_code, httpversion -> http_version 2015-09-17 15:25:28 +02:00
Maximilian Hils
906360f63f code -> status_code, httpversion -> http_version 2015-09-17 15:16:33 +02:00
Maximilian Hils
8d71059d77 clean up http message models 2015-09-17 15:16:12 +02:00
Maximilian Hils
12984f149c move body assembly to netlib 2015-09-17 02:40:08 +02:00
Maximilian Hils
a07e43df8b http1: add assemble_body function 2015-09-17 02:39:42 +02:00
Maximilian Hils
8fa01f41a6 minor fixes 2015-09-17 02:39:07 +02:00
Maximilian Hils
dad9f06cb9 organize exceptions, improve content-length handling 2015-09-17 02:14:14 +02:00
Maximilian Hils
f61109db84 use new netlib exceptions 2015-09-17 02:13:42 +02:00
Maximilian Hils
14a5f405fd use new netlib exceptions 2015-09-17 02:13:28 +02:00
Maximilian Hils
8fbed971ae Merge pull request #768 from mitmproxy/netlib-http1-refactor
Adjust to netlib changes
2015-09-16 20:24:48 +02:00
Maximilian Hils
a7291a7e78 Merge pull request #34 from mitmproxy/netlib-http1-refactor
Adjust to netlib changes
2015-09-16 20:22:19 +02:00
Maximilian Hils
e1659f3fcf Merge pull request #92 from mitmproxy/python3
Python3 & HTTP1 Refactor
2015-09-16 20:19:52 +02:00
Maximilian Hils
1a6e41c200 minor fixes 2015-09-16 20:12:53 +02:00
Maximilian Hils
0af0608978 adjust to netlib changes 2015-09-16 18:45:22 +02:00
Maximilian Hils
9f26d68f47 adjust to netlib changes 2015-09-16 18:44:34 +02:00
Maximilian Hils
265f31e878 adjust http1-related code 2015-09-16 18:43:24 +02:00
Maximilian Hils
ee6969c1fa s/below/above/ 2015-09-16 13:40:50 +02:00
Maximilian Hils
f5900d1a7b simplify test script 2015-09-16 04:09:05 +02:00
Maximilian Hils
1f3844da89 make pypi happy 2015-09-16 04:08:29 +02:00
Maximilian Hils
774d5b42a2 improve readme 2015-09-16 03:59:22 +02:00
Maximilian Hils
457025df9a Merge pull request #751 from mitmproxy/readthedocs
Move Docs to readthedocs
2015-09-16 02:53:01 +02:00
Maximilian Hils
9b882d2450 test parts on python 3.5 2015-09-16 00:09:43 +02:00
Maximilian Hils
a077d8877d finish netlib.http.http1 refactor 2015-09-16 00:04:23 +02:00
Maximilian Hils
11e7f476bd wip 2015-09-15 19:12:15 +02:00
Maximilian Hils
436a9ea839 minor fixes 2015-09-14 23:58:06 +02:00
Maximilian Hils
2f9c566e48 remove pathod as dependency 2015-09-13 14:33:45 +02:00
Maximilian Hils
32b487109f Merge pull request #765 from mitmproxy/such-colors-very-wow
Improve Content Views
2015-09-12 17:57:21 +02:00
Maximilian Hils
4106e19612 relax test suite time tests 2015-09-12 17:50:24 +02:00
Maximilian Hils
5fe12a467f fix tests 2015-09-12 17:40:30 +02:00
Maximilian Hils
eb2264e91a improve display of non-ascii contents
fixes #283
2015-09-12 17:10:38 +02:00
Maximilian Hils
997fcde8ce make clean_bin unicode-aware 2015-09-12 17:03:09 +02:00
Maximilian Hils
049d253a83 simplify contentview api 2015-09-12 13:49:16 +02:00
Maximilian Hils
9c31669211 mitmdump: colorize output, add content views 2015-09-11 19:03:50 +02:00
Maximilian Hils
b7b46bac46 content view: fix fallback 2015-09-11 16:40:58 +02:00
Maximilian Hils
02d80631dc Merge pull request #764 from mitmproxy/contentviews
Extract Content Views from Console
2015-09-11 15:31:25 +02:00
Maximilian Hils
47602dc1a5 clean up tests 2015-09-11 13:41:16 +02:00
Maximilian Hils
960f62f363 fix bugs 2015-09-11 13:37:52 +02:00
Maximilian Hils
625a719eb1 completely remove console from contentviews 2015-09-11 12:26:52 +02:00
Maximilian Hils
7c186a4edb Merge branch 'master' into contentviews 2015-09-11 12:13:39 +02:00
Maximilian Hils
dd414e4852 better error messages, remove error cause 2015-09-11 02:17:04 +02:00
Maximilian Hils
40ce06e780 tls layer: fix early peek 2015-09-11 01:47:13 +02:00
Maximilian Hils
ffdf143be4 better exception handling 2015-09-11 01:39:33 +02:00
Maximilian Hils
c159c8ca13 fix chunked encoding 2015-09-11 01:18:17 +02:00
Maximilian Hils
a38142d595 don't yield empty chunks 2015-09-11 01:17:39 +02:00
Maximilian Hils
30f0ee40c5 nicer error messages 2015-09-11 00:49:37 +02:00
Maximilian Hils
d1bc966e5b polish for release: introduce http2 and rawtcp as command line switches 2015-09-11 00:00:00 +02:00
Maximilian Hils
33c0d36530 fix exception re-raise 2015-09-10 18:36:50 +02:00
Maximilian Hils
35a99d2faf start reraising exceptions properly 2015-09-10 16:24:22 +02:00
Maximilian Hils
92c763f469 fix mitmproxy/mitmproxy#759 2015-09-10 12:32:38 +02:00
Maximilian Hils
ebba79b655 raw tcp mode: use ssl_read_select 2015-09-10 11:33:03 +02:00
Maximilian Hils
a5f7752cf1 add ssl_read_select 2015-09-10 11:30:41 +02:00
Maximilian Hils
3b6140dfff fix send_response if content is missing 2015-09-10 10:32:08 +02:00
Maximilian Hils
c573d8c292 inline scripts: provide __file__ 2015-09-10 10:31:01 +02:00
Maximilian Hils
cf2b2e0cc7 simplify streaming http layer 2015-09-10 10:20:11 +02:00
Maximilian Hils
61f4319491 http protocol: use new tls attribute 2015-09-09 18:49:32 +02:00
Maximilian Hils
e63ef3a520 add inline script for conditional tls passthrough
fix #646
2015-09-08 21:35:15 +02:00
Maximilian Hils
32b3c32138 add tcp.Address.__hash__ 2015-09-08 21:31:27 +02:00
Maximilian Hils
c3f73552b8 docs: add travis integration 2015-09-08 16:07:27 +02:00
Maximilian Hils
4b8e162a8b Merge branch 'master' into readthedocs 2015-09-08 15:36:37 +02:00
Maximilian Hils
c3ba98b681 docs: update documentedlist, add filter table headers 2015-09-08 15:36:24 +02:00
Maximilian Hils
fc86bbd03e let Headers inherit from object
fixes mitmproxy/mitmproxy#753
2015-09-08 15:16:25 +02:00
Maximilian Hils
8dfa15c2d4 whitelist next_layer for @concurrent 2015-09-07 16:05:16 +02:00
Maximilian Hils
d002371d30 expose next_layer to inline scripts 2015-09-07 13:52:58 +02:00
Maximilian Hils
c4286b15dc docs: minor fixes 2015-09-07 10:52:18 +02:00
Maximilian Hils
31ee4607c8 remove old docs 2015-09-07 10:30:40 +02:00
Maximilian Hils
b4013659a8 docs 🎉 2015-09-06 03:20:58 +02:00
Maximilian Hils
eb2334c6cb Merge branch 'master' into readthedocs 2015-09-06 01:37:19 +02:00
Maximilian Hils
853cd81075 docs++ 2015-09-06 01:37:15 +02:00
Maximilian Hils
23e8260a99 finish tools section 2015-09-05 23:50:37 +02:00
Maximilian Hils
a8d931089c fix tests 2015-09-05 20:53:44 +02:00
Maximilian Hils
5125c669cc adjust to new netlib Headers class 2015-09-05 20:45:58 +02:00
Maximilian Hils
1165e35e1b docs++ 2015-09-05 20:15:35 +02:00
Maximilian Hils
50bf92ccce Merge branch 'master' of https://github.com/mitmproxy/netlib 2015-09-05 18:16:41 +02:00
Maximilian Hils
b889e9e1a2 adjust to new netlib headers 2015-09-05 18:16:08 +02:00
Maximilian Hils
66ee1f465f headers: adjust everything 2015-09-05 18:15:47 +02:00
Maximilian Hils
3718e59308 finalize Headers, add tests 2015-09-05 15:27:48 +02:00
Maximilian Hils
1fb28594ed doc: headers class 2015-09-05 13:27:11 +02:00
Maximilian Hils
5f97701958 add new headers class 2015-09-05 13:26:36 +02:00
Maximilian Hils
b62498e125 remove urwid from contentviews 2015-09-04 17:33:21 +02:00
Maximilian Hils
018c693dee remove urwid from contentviews (wip) 2015-09-04 17:07:14 +02:00
Maximilian Hils
74b3b842fe rewrite basic docs for readthedocs 2015-09-04 16:17:55 +02:00
Maximilian Hils
00561d280c speed up filters 2015-09-04 02:11:09 +02:00
Maximilian Hils
e88c7e4c58 Merge branch 'master' into readthedocs 2015-09-04 00:47:04 +02:00
Maximilian Hils
ee8e5947df Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2015-09-04 00:46:51 +02:00
Maximilian Hils
a18db90ea3 update example inline scripts 2015-09-04 00:46:42 +02:00
Maximilian Hils
2d1c382f38 docs, docs, docs! 2015-09-04 00:45:47 +02:00
Thomas Kriechbaumer
3ebe5a5147 http2: do net let Settings frames escape 2015-09-03 21:24:07 +02:00
Thomas Kriechbaumer
53abf5f4d7 http2: handle Ping in protocol 2015-09-03 21:24:07 +02:00
Thomas Kriechbaumer
47ab7f04ea http2: Ping frames are handled in netlib 2015-09-03 21:23:19 +02:00
Maximilian Hils
29698aa83c add dev docs 2015-09-03 19:46:58 +02:00
Maximilian Hils
14457f29b3 docs++ 2015-09-03 18:55:38 +02:00
Maximilian Hils
99126f62ed remove depth attribute from set_server 2015-09-03 18:25:36 +02:00
Maximilian Hils
8da683a638 Merge branch 'master' of https://github.com/mitmproxy/mitmproxy 2015-09-03 17:01:37 +02:00
Maximilian Hils
f4272de5ec remove ServerConnectionMixin.reconnect 2015-09-03 17:01:25 +02:00
Thomas Kriechbaumer
3a229f60e3 http2: fix ping response 2015-09-03 14:26:36 +02:00
Thomas Kriechbaumer
1f6d05f89f http2: server can send WindowUpdate frames as well 2015-09-03 14:09:59 +02:00
Thomas Kriechbaumer
bc93600a66 http2: add GoAway support for client 2015-09-03 13:55:13 +02:00
Thomas Kriechbaumer
b4d6f2e12b http2: fix PingFrame again 2015-09-03 13:55:13 +02:00
Thomas Kriechbaumer
29ae2bbf91 http2: fix multiple stream per connection
fixes #746
2015-09-03 13:54:58 +02:00
Thomas Kriechbaumer
bde4bdd1d2 http2: fix unhandled frames 2015-09-03 13:40:35 +02:00
Maximilian Hils
a0f3803233 Merge pull request #748 from Kriechi/tls-ciphers
pass-through ciphers from client to server
2015-09-03 12:57:56 +02:00
Maximilian Hils
7a1e2789a8 Merge pull request #749 from Kriechi/ignore-priority-frames
ignore http2 priority frames
2015-09-03 12:54:54 +02:00
Thomas Kriechbaumer
37e6b3c401 http2: improve unexpected frame handling and shutdown 2015-09-03 11:09:59 +02:00
Maximilian Hils
cc2a6a3919 fix circular imports 2015-09-02 20:56:19 +02:00
Thomas Kriechbaumer
c79af62763 ignore http2 priority frames 2015-09-02 20:50:50 +02:00
Thomas Kriechbaumer
0047ac4cdc pass-through ciphers from client to server 2015-09-02 20:46:14 +02:00
Chris Czub
b4e0be9052 PR #700
Start moving the contentview up a level
Started shifting the contentview class up to libmproxy
2015-09-02 20:30:58 +02:00
Maximilian Hils
c14fbc7794 Merge pull request #741 from mitmproxy/proxy-refactor-cb
Proxy Refactor
2015-09-02 01:16:48 +02:00
Maximilian Hils
f1c8b47b1e better tls error messages, fix #672 2015-09-01 19:24:36 +02:00
Maximilian Hils
a10acda80b update .env 2015-09-01 18:58:51 +02:00
Maximilian Hils
97d2247524 update .env 2015-09-01 18:58:18 +02:00
Maximilian Hils
2f0d650729 Merge branch 'master' into proxy-refactor-cb 2015-09-01 02:39:59 +02:00
Maximilian Hils
6719aa5986 Merge branch 'proxy-refactor-cb' of https://github.com/mitmproxy/mitmproxy into proxy-refactor-cb 2015-09-01 02:39:57 +02:00
Maximilian Hils
e8de7595c2 .env: fix windows compatibility 2015-09-01 02:37:03 +02:00
Maximilian Hils
b5f1c38e78 minor docs improvements 2015-09-01 02:35:05 +02:00
Maximilian Hils
de10b3f7ec Merge pull request #744 from Kriechi/proxy-refactor-cb
do not log WindowUpdateFrame frames
2015-08-31 23:20:30 +02:00
Thomas Kriechbaumer
c4d6b35726 do not log WindowUpdateFrame frames 2015-08-31 22:22:10 +02:00
Maximilian Hils
481cc6ea84 we don't support socks auth, refs #738 2015-08-31 17:29:14 +02:00
Maximilian Hils
b04e6e56ab update inline script hooks 2015-08-31 17:05:52 +02:00
Maximilian Hils
41e6e538df fix layer initialization 2015-08-31 13:49:47 +02:00
Maximilian Hils
7450bef615 fix dns_spoofing example, avoid connecting to itself 2015-08-31 13:43:30 +02:00
Maximilian Hils
1e9aef5b1e fix upstream proxy server change, update example 2015-08-31 00:14:42 +02:00
Maximilian Hils
63ad4a4f51 coverage++ 2015-08-30 15:59:50 +02:00
Maximilian Hils
a86ec56012 move files around 2015-08-30 15:27:29 +02:00
Maximilian Hils
421b241ff0 remove http2http references 2015-08-30 13:40:23 +02:00
Maximilian Hils
3873e08339 remove old code 2015-08-30 03:42:11 +02:00
Maximilian Hils
08655cb956 Merge remote-tracking branch 'origin/master' into proxy-refactor-cb 2015-08-30 03:24:05 +02:00
Maximilian Hils
21e7f420d2 minor fixes 2015-08-30 03:23:57 +02:00
Maximilian Hils
1dd09a5509 always insert tls layer for inline script upgrades 2015-08-30 02:27:38 +02:00
Maximilian Hils
dd7f50d64b restructure code, remove cruft 2015-08-30 01:21:58 +02:00
Maximilian Hils
100ea27c30 simplify raw tcp protocol 2015-08-29 23:08:16 +02:00
Maximilian Hils
c07b9ee301 update .travis.yml 2015-08-29 20:58:08 +02:00
Maximilian Hils
29b355c469 update .travis.yml 2015-08-29 20:57:51 +02:00
Maximilian Hils
2d0d240abc Merge branch 'master' of https://github.com/mitmproxy/netlib 2015-08-29 20:56:19 +02:00
Maximilian Hils
4a8fd79e33 don't yield prefix and suffix 2015-08-29 20:54:54 +02:00
Maximilian Hils
a7058e2a3c fix bugs, fix tests 2015-08-29 20:53:25 +02:00
Maximilian Hils
63844df343 fix streaming 2015-08-29 14:28:11 +02:00
Maximilian Hils
2dfba2105b move sslversion mapping to netlib 2015-08-29 12:34:01 +02:00
Maximilian Hils
08b630f83a better sslversion handling 2015-08-29 12:30:54 +02:00
Maximilian Hils
1265945f55 move sslversion mapping to netlib 2015-08-29 12:30:35 +02:00
Maximilian Hils
982d8000c4 wip 2015-08-28 17:35:48 +02:00
Maximilian Hils
dd317aa5d2 fix alpn 2015-08-28 17:35:22 +02:00
Maximilian Hils
1cc48345e1 clean up config/cmdline, fix bugs, remove cruft 2015-08-28 01:51:13 +02:00
Maximilian Hils
a86491eeed Revert "unify SSL version/method handling"
This reverts commit 14e49f4fc7.
2015-08-27 18:37:16 +02:00
Maximilian Hils
5b17496c7e start fixing proxy config 2015-08-27 18:31:15 +02:00
Maximilian Hils
83decd6771 fix inline script redirects 2015-08-27 17:35:53 +02:00
Maximilian Hils
515c024448 handle tls server errors more gracefully 2015-08-27 15:59:56 +02:00
Maximilian Hils
ecfde4247f re-add http1 replay 2015-08-27 15:48:41 +02:00
Maximilian Hils
0f97899fbd re-add --ignore and --tcp 2015-08-27 15:26:21 +02:00
Maximilian Hils
9389c186ba improve travis 2015-08-27 02:57:09 +02:00
Maximilian Hils
23e2d2136c Merge pull request #735 from ender672/disable-mouse-option
console: add command line flag to disable mouse interaction
2015-08-27 01:25:42 +02:00
Maximilian Hils
f6dadc2b0d no more sni double-connects! 2015-08-27 00:07:44 +02:00
Maximilian Hils
9c6b3eb58a clean up clienthello parsing 2015-08-26 22:00:50 +02:00
Thomas Kriechbaumer
daf512ce93 http2: fix tests 2015-08-26 21:04:13 +02:00
Thomas Kriechbaumer
3e3b59aa71 http2: fix priority stream dependency check 2015-08-26 20:58:00 +02:00
Maximilian Hils
2cfc1b1b40 fix non-alpn clients 2015-08-26 20:48:59 +02:00
Maximilian Hils
778644d4b8 http2: fix bugs, chrome works 🎉 2015-08-26 15:12:04 +02:00
Maximilian Hils
605af2d3d4 Merge branch 'proxy-refactor-cb' of https://github.com/mitmproxy/mitmproxy into proxy-refactor-cb 2015-08-26 14:03:58 +02:00
Maximilian Hils
aebe342025 improve alpn handling 2015-08-26 14:03:51 +02:00
Maximilian Hils
85b3899126 Merge pull request #739 from Kriechi/proxy-refactor-cb
fix return value and empty requests
2015-08-26 13:49:42 +02:00
Thomas Kriechbaumer
158906444f fix return value and empty requests 2015-08-26 13:48:39 +02:00
Maximilian Hils
1093d185ec manually read tls clienthello 2015-08-26 06:38:03 +02:00
Maximilian Hils
3fa65c48dd manually read tls clienthello [wip] 2015-08-26 05:39:00 +02:00
Maximilian Hils
b19eb2126b update slackin url 2015-08-25 23:40:09 +02:00
Maximilian Hils
de0ced73f8 fix error messages 2015-08-25 18:33:55 +02:00
Maximilian Hils
8ce0de8bed minor fixes 2015-08-25 18:24:17 +02:00
Maximilian Hils
56a4bc381e request -> request_method 2015-08-24 18:17:04 +02:00
Maximilian Hils
21858995ae request -> request_method 2015-08-24 18:16:34 +02:00
Maximilian Hils
622665952c minor stylistic fixes 2015-08-24 16:52:32 +02:00
Maximilian Hils
f1f34e7713 fix bugs, fix tests 2015-08-24 16:52:03 +02:00
Thomas Kriechbaumer
05d26545e4 adapt netlib changes 2015-08-21 10:26:28 +02:00
Thomas Kriechbaumer
cd9701050f read_response depends on request for stream_id 2015-08-21 10:04:57 +02:00
Thomas Kriechbaumer
6fc2ff9469 http2: fix tests 2015-08-21 09:18:14 +02:00
Thomas Kriechbaumer
00ed982ea0 cleanup 2015-08-20 20:44:58 +02:00
Thomas Kriechbaumer
53f2582313 http2: fix unhandled settings frame 2015-08-20 20:36:51 +02:00
Thomas Kriechbaumer
55cfd259dc http2: simplify protocol-related code 2015-08-20 20:31:01 +02:00
Thomas Kriechbaumer
5746472426 fix typo 2015-08-20 19:53:17 +02:00
Thomas Kriechbaumer
16f697f68a http2: disable features we do not support yet 2015-08-20 10:27:06 +02:00
Thomas Kriechbaumer
94b7beae2a http2: implement basic flow control updates 2015-08-20 10:27:06 +02:00
Thomas Kriechbaumer
eb34305518 http2: fix frame length field 2015-08-20 10:27:06 +02:00
Thomas Kriechbaumer
e20d4e5c02 http2: add callback to handle unexpected frames 2015-08-20 10:27:06 +02:00
Thomas Kriechbaumer
1025c15242 fix typo 2015-08-20 10:27:06 +02:00
Timothy Elliott
fb4af4eb78 console: add command line flag to disable mouse interaction
Adds the --no-mouse command line option to disable the mouse.

Fixes #685
2015-08-19 13:07:39 -07:00
Thomas Kriechbaumer
4339b8e7fa http2: use callback for handle unexpected frames 2015-08-19 21:09:48 +02:00
Maximilian Hils
721bd1c136 Merge pull request #734 from Kriechi/proxy-refactor-cb
move read methods to lower HTTP layer
2015-08-19 18:15:49 +02:00
Thomas Kriechbaumer
f2ace5493b move read methods to lower HTTP layer 2015-08-19 18:09:45 +02:00
Maximilian Hils
eda88428da Merge pull request #733 from Kriechi/proxy-refactor-cb
Proxy refactor cb
2015-08-19 16:44:28 +02:00
Thomas Kriechbaumer
97bfd1d856 move send method to lower layers 2015-08-19 16:36:37 +02:00
Thomas Kriechbaumer
c9fa8491cc improve next_layer detection 2015-08-19 16:32:02 +02:00
Maximilian Hils
9920de1e15 tcp._Connection: clean up code, fix inheritance 2015-08-19 16:06:33 +02:00
Maximilian Hils
6810fba54e add ssl peek polyfill 2015-08-19 16:05:42 +02:00
Maximilian Hils
b8db81969d make dev installation instructions copy-pasteable 2015-08-19 15:11:32 +02:00
Maximilian Hils
7730d2e0c0 fix virtualenv activation 2015-08-19 15:10:15 +02:00
Maximilian Hils
98583ce870 fix docs typo
refs mitmproxy/mitmproxy.org#7
2015-08-19 14:08:32 +02:00
Thomas Kriechbaumer
26052767a2 Merge pull request #732 from FreeArtMan/master
Fixing issue #710. Prety printing in read_dumpfile
2015-08-19 11:45:27 +02:00
FreeArtMan
4d9bf45e82 Fixing issue #710. Prety printing in read_dumpfile 2015-08-19 09:59:13 +01:00
Thomas Kriechbaumer
9bae97eb17 http2: fix connection preface and wrappers 2015-08-19 09:43:43 +02:00
Thomas Kriechbaumer
57c56d8917 Merge pull request #86 from Kriechi/http2-wip
http2: fix TODOs
2015-08-18 22:19:30 +02:00
Thomas Kriechbaumer
9686a77dcb http2: implement request target 2015-08-18 22:17:00 +02:00
Thomas Kriechbaumer
cd419300a9 temporarily disable pypy with new openssl on travis 2015-08-18 21:24:40 +02:00
Thomas Kriechbaumer
07a1356e2f http2: add support for too large header frames 2015-08-18 21:22:42 +02:00
Thomas Kriechbaumer
0d384ac2a9 http2: add support for too large data frames 2015-08-18 21:22:42 +02:00
Thomas Kriechbaumer
12efa61e3a fix request-target tests 2015-08-18 21:22:27 +02:00
Thomas Kriechbaumer
c903efcf5b temporarily disable pypy with new openssl on travis 2015-08-18 21:17:20 +02:00
Thomas Kriechbaumer
af6fefb5b4 temporarily disable pypy on travis 2015-08-18 21:14:37 +02:00
Thomas Kriechbaumer
67e6e5c7d8 temporarily disable pypy on travis 2015-08-18 21:13:46 +02:00
Maximilian Hils
231656859f TCPClient: more sophisticated address handling 2015-08-18 21:08:42 +02:00
Maximilian Hils
62416daa4a add Reader.peek() 2015-08-18 21:08:01 +02:00
Maximilian Hils
c92dc1b868 re-add form_out 2015-08-18 21:07:38 +02:00
Maximilian Hils
ab1549e0ef yield -> callbacks 2015-08-18 15:59:44 +02:00
Maximilian Hils
96de7ad562 various fixes 2015-08-18 14:15:08 +02:00
Maximilian Hils
99129ab5a1 Merge remote-tracking branch 'Kriechi/proxy-refactor' into proxy-refactor
Conflicts:
	libmproxy/protocol2/http.py
2015-08-17 19:20:28 +02:00
Aldo Cortesi
9286f5b5b4 Small tweaks to read_dumpfile example. 2015-08-17 11:29:24 +12:00
Aldo Cortesi
3d30667125 Bump netlib version - 0.13.1 is already out 2015-08-17 10:21:30 +12:00
Maximilian Hils
a2b8504889 improve protocol handling 2015-08-16 23:25:02 +02:00
Thomas Kriechbaumer
38c456bb62 implement Http1 and Http2 protocols as layers 2015-08-16 15:19:11 +02:00
Maximilian Hils
c04fa1b233 minor fixes 2015-08-16 12:52:34 +02:00
Maximilian Hils
61afac8637 Merge remote-tracking branch 'Kriechi/proxy-refactor' into proxy-refactor
Conflicts:
	libmproxy/protocol2/http_proxy.py
	libmproxy/protocol2/tls.py
	libmproxy/proxy/connection.py
2015-08-16 12:47:13 +02:00
Maximilian Hils
4c31ffd90f minor fixes 2015-08-16 12:43:15 +02:00
Aldo Cortesi
7da47bd720 Merge branch 'master' of ssh.github.com:mitmproxy/netlib 2015-08-16 21:47:42 +12:00
Aldo Cortesi
99e89a1efc Remove stray prints from test suite 2015-08-16 21:47:26 +12:00
Aldo Cortesi
bf773f822c OSX tarfiles, remove obsolete osx-binaries 2015-08-16 21:45:45 +12:00
Aldo Cortesi
c428578c83 First pass PyInstaller specs for OSX binaries 2015-08-16 21:44:54 +12:00
Thomas Kriechbaumer
85cede47aa allow direct ALPN callback method 2015-08-16 11:41:34 +02:00
Aldo Cortesi
19a17933cc Disable mitmweb OSX binary generation for now 2015-08-16 21:40:41 +12:00
Thomas Kriechbaumer
1e40d34e94 add ALPN to proxy connections 2015-08-16 11:36:31 +02:00
Aldo Cortesi
a13fe94b7c Cleanup, restructuring, extract version in project config 2015-08-16 20:42:52 +12:00
Aldo Cortesi
10b377bb10 README -> README.mkd 2015-08-16 20:11:17 +12:00
Aldo Cortesi
11c626cf84 OSX binary builds in Python script 2015-08-16 20:09:33 +12:00
Aldo Cortesi
be498bc1a3 Adapt mitmdump and mitmweb for certifi and release process 2015-08-16 19:55:55 +12:00
Aldo Cortesi
b1908e6639 Updates
build -> rtool to avoid clashing with standard pyinstaller dirs
checklist updates
script adaptations
2015-08-16 17:25:38 +12:00
Aldo Cortesi
2973a79c59 Adapt mitmproxy.spec for new cryptography, certifi and new release structure 2015-08-16 17:24:40 +12:00
Aldo Cortesi
5b957ac658 constants -> CONSTANTS 2015-08-16 12:57:24 +12:00
Aldo Cortesi
c3fffe152e Build script, extension of contributors command, .gitignore 2015-08-16 12:51:52 +12:00
Aldo Cortesi
20d89cd34f Initial checkin 2015-08-16 12:39:06 +12:00
Aldo Cortesi
7e4020213c Remove release tools 2015-08-16 12:31:51 +12:00
Maximilian Hils
a175572447 Merge remote-tracking branch 'Kriechi/proxy-refactor' into proxy-refactor 2015-08-15 20:22:45 +02:00
Maximilian Hils
2a15479cdb fix bugs, make https work 2015-08-15 20:20:46 +02:00
Thomas Kriechbaumer
b7e6e1c9b2 add HTTP/1.1 ALPN version string 2015-08-15 17:49:59 +02:00
Thomas Kriechbaumer
a9dd82c986 add ALPN to proxy connections 2015-08-15 17:49:40 +02:00
Maximilian Hils
0dd243c5e4 various fixes 2015-08-15 16:26:12 +02:00
Maximilian Hils
747699b126 more work on http protocol 2015-08-14 16:49:52 +02:00
Maximilian Hils
808218f4bc more work on http layer 2015-08-14 10:41:11 +02:00
Maximilian Hils
aef3b626a7 wip commit 2015-08-11 20:32:14 +02:00
Maximilian Hils
026330a3b0 cleaner Exceptions, ssl -> tls, upstream proxy mode 2015-08-11 20:32:13 +02:00
Maximilian Hils
314e0f5839 add reverseproxy mode, fix bugs 2015-08-11 20:32:12 +02:00
Maximilian Hils
aac0ab23eb simplify layer code, add yield_from_callback decorator 2015-08-11 20:32:12 +02:00
Maximilian Hils
c46e3f90bb apply fixes from proxy-refactor-cb branch 2015-08-11 20:32:11 +02:00
Maximilian Hils
531ca4a356 minor fixes 2015-08-11 20:32:10 +02:00
Maximilian Hils
e815915b22 add auto layer, multiple other fixes 2015-08-11 20:32:10 +02:00
Maximilian Hils
c1d016823c move files around 2015-08-11 20:32:09 +02:00
Maximilian Hils
be995ddbd6 add ssl layer 2015-08-11 20:32:09 +02:00
Maximilian Hils
863113f989 first initial proof-of-concept 2015-08-11 20:32:08 +02:00
Maximilian Hils
a9fcef868b Merge pull request #720 from Kriechi/cleanup
move code to netlib
2015-08-11 11:59:37 +02:00
Maximilian Hils
f3a6113391 Merge pull request #85 from Kriechi/http2-wip
add move tests and code from mitmproxy
2015-08-11 10:57:32 +02:00
Thomas Kriechbaumer
891fa50e55 move code to netlib 2015-08-10 21:04:17 +02:00
Thomas Kriechbaumer
6a30ad2ad2 fix minor style offences 2015-08-10 20:50:05 +02:00
Thomas Kriechbaumer
ff27d65f08 cleanup whitespace 2015-08-10 20:44:36 +02:00
Thomas Kriechbaumer
476badf45c cleanup imports 2015-08-10 20:36:47 +02:00
Thomas Kriechbaumer
690b8b4f4e add move tests and code from mitmproxy 2015-08-10 20:34:27 +02:00
Maximilian Hils
a10c31c698 dev script: fix Linux+vagrant+virtualenv 2015-08-07 14:51:27 +02:00
Maximilian Hils
85f977aacd dev script: fix Windows+vagrant+virtualenv 2015-08-07 14:45:48 +02:00
Maximilian Hils
69ce4c3f14 remove evil unicode_literals 2015-08-06 10:49:41 +02:00
Maximilian Hils
adf2877020 fix #705 2015-08-03 18:07:30 +02:00
Maximilian Hils
c2832ef72b fix mitmproxy/mitmproxy#705 2015-08-03 18:06:31 +02:00
Thomas Kriechbaumer
6a678d86e1 fix mitmproxy tests 2015-08-02 11:27:01 +02:00
Thomas Kriechbaumer
6cce2f14d7 fix tests 2015-08-02 11:26:33 +02:00
Thomas Kriechbaumer
ff1e7e6409 fix imports for encoding 2015-08-01 14:53:34 +02:00
Thomas Kriechbaumer
fa568c2d3b move encoding tests from mitmproxy to netlib 2015-08-01 14:53:20 +02:00
Thomas Kriechbaumer
1c12e7c2b8 move encoding tests from mitmproxy to netlib 2015-08-01 14:53:13 +02:00
Thomas Kriechbaumer
0be84fd6b9 fix tutils imports 2015-08-01 14:49:15 +02:00
Thomas Kriechbaumer
b732a1cb3d reimplement streaming for HTTP/1 2015-08-01 14:37:33 +02:00
Thomas Kriechbaumer
54866c0faa revert hard-coded HTTP/2 protocol changes 2015-08-01 14:37:33 +02:00
Thomas Kriechbaumer
db02553e2a move code from mitmproxy to netlib 2015-08-01 14:37:32 +02:00
Thomas Kriechbaumer
8a05151170 revert ALPN-related changes to fix master
In the future this should be added again to support HTTP/2.
2015-08-01 14:37:32 +02:00
Thomas Kriechbaumer
a837230320 move code from mitmproxy to netlib 2015-08-01 12:40:40 +02:00
Aldo Cortesi
c31b6c3c36 Merge pull request #698 from Kriechi/http2-wip
[WIP] Protocol Refactoring for HTTP/2
2015-08-01 11:38:33 +12:00
Aldo Cortesi
7432ad6af7 Merge pull request #32 from Kriechi/http2-wip
[WIP] Protocol Refactoring for HTTP/2
2015-08-01 11:38:12 +12:00
Aldo Cortesi
199f2a44fe Merge pull request #84 from Kriechi/http2-wip
[WIP] Protocol Refactoring for HTTP/2
2015-08-01 11:38:02 +12:00
Thomas Kriechbaumer
4f38c6b90e attach application protocol to connection 2015-07-30 19:53:29 +02:00
Thomas Kriechbaumer
31dbd2fc75 use netlib http semantics 2015-07-30 19:42:48 +02:00
Thomas Kriechbaumer
7b10817670 http2: improve protocol 2015-07-30 19:40:00 +02:00
Thomas Kriechbaumer
a5d9e1f44d move code to netlib and implement protocols 2015-07-30 13:53:17 +02:00
Thomas Kriechbaumer
89f22f7359 refactor connection & protocol handling 2015-07-30 13:53:17 +02:00
Maximilian Hils
cdc84f52d2 Merge pull request #699 from onlywade/bugfix/docs_update_shortcut_keys
Update docs to reflect current shortcut keys for features which have …
2015-07-30 10:47:12 +02:00
Wade Catron
3346daa65a Update docs to reflect current shortcut keys for features which have been moved into the options menu. 2015-07-29 16:18:49 -07:00
Thomas Kriechbaumer
c7fcc2cca5 add on-the-wire representation methods 2015-07-29 11:27:43 +02:00
Thomas Kriechbaumer
827fe824d9 move code from mitmproxy to netlib 2015-07-27 11:48:38 +02:00
Maximilian Hils
d2ae6b630e Merge pull request #548 from macmantrl/no_serverconn
Prevent unnecessary upstream server connects
2015-07-26 11:58:21 +02:00
Aldo Cortesi
ee163ed5b0 Bump version for dev 2015-07-26 17:46:49 +12:00
Aldo Cortesi
675e70c7eb Changelog for v0.13 2015-07-26 14:21:18 +12:00
Thomas Kriechbaumer
e9bbcfadc1 fix module imports 2015-07-25 20:00:34 +02:00
Maximilian Hils
fb48217224 improve pyopenssl version check 2015-07-25 13:30:25 +02:00
Thomas Kriechbaumer
07c9d46fab remove debug output in tests 2015-07-24 18:01:55 +02:00
Thomas Kriechbaumer
d301f55bb7 supress output during tests 2015-07-24 17:58:35 +02:00
Maximilian Hils
0892649d31 Merge pull request #675 from Kriechi/protocol-refactor
HTTP protocol refactoring
2015-07-24 17:52:44 +02:00
Maximilian Hils
f8b4d66687 Merge pull request #31 from Kriechi/protocol-refactor
HTTP protocol refactoring
2015-07-24 17:43:41 +02:00
Thomas Kriechbaumer
96c9c4459f fix duplicated header reading 2015-07-24 17:39:55 +02:00
Maximilian Hils
b57c1386a1 Merge pull request #81 from Kriechi/protocol-refactor
HTTP protocol refactoring
2015-07-24 16:50:56 +02:00
Maximilian Hils
1b26161382 add distinct error for cert verification issues 2015-07-24 16:47:28 +02:00
Maximilian Hils
e0d1e8caf6 fix tests 2015-07-24 03:09:08 +02:00
Maximilian Hils
7bf8088d80 improve inline scripts, fix #683, fix #684 2015-07-24 02:57:56 +02:00
Thomas Kriechbaumer
dc42e33505 fix bugs 2015-07-22 16:13:21 +02:00
Thomas Kriechbaumer
657973eca3 fix bugs 2015-07-22 16:13:06 +02:00
Maximilian Hils
9b3fe80697 minor style improvements 2015-07-22 16:00:32 +02:00
Thomas Kriechbaumer
faf17d3d60 http2: make proper use of odict 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
ecc7ffe928 reduce public interface
use private indicator pattern “_methodname”
2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
83f013fca1 introduce EmptyRequest class 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
d62dbee0f6 rename content -> body 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
37a0cb858c introduce ConnectRequest class 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
4617ab8a3a add Request class and unify read_request interface 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
808b294865 refactor HTTP/1 as protocol 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
230c16122b change HTTP2 interface to match HTTP1 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
bab6cbff1e extract authentication methods from protocol 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
f50deb7b76 move bits around 2015-07-22 15:30:51 +02:00
Thomas Kriechbaumer
bd5ee21284 refactor websockets into protocol 2015-07-22 15:30:50 +02:00
Thomas Kriechbaumer
6dcfc35011 introduce http_semantics module
used for generic HTTP representation
everything should apply for HTTP/1 and HTTP/2
2015-07-22 15:30:50 +02:00
Thomas Kriechbaumer
6101d11d6c http2: remove odict workaround 2015-07-22 15:30:34 +02:00
Thomas Kriechbaumer
3cf6bd5fb6 remove debug prints 2015-07-22 15:30:34 +02:00
Thomas Kriechbaumer
1a9c1a8c2d remove code duplication 2015-07-22 15:30:34 +02:00
Thomas Kriechbaumer
11ac387df2 rename content -> body 2015-07-22 15:30:34 +02:00
Thomas Kriechbaumer
6d5a3da929 use new HTTP/1 protocol 2015-07-22 15:30:34 +02:00
Thomas Kriechbaumer
caaac5cd5a inline log method 2015-07-22 15:30:33 +02:00
Thomas Kriechbaumer
032f8b2985 use common interface for HTTP/1 and HTTP/2 2015-07-22 15:30:33 +02:00
Thomas Kriechbaumer
2b0465dbb9 use new netlib module names 2015-07-22 15:30:33 +02:00
Thomas Kriechbaumer
a2bf19125a refactor protocol-related pathod methods 2015-07-22 15:30:33 +02:00
Thomas Kriechbaumer
c1e84cb322 use websockets protocol 2015-07-22 15:30:33 +02:00
Thomas Kriechbaumer
78ae3e4a00 use netlib.http_semantics for generic data 2015-07-22 15:30:33 +02:00
Thomas Kriechbaumer
cedc0407de refactor to use netlib.http protocols 2015-07-22 15:30:12 +02:00
Thomas Kriechbaumer
bb265d0c40 use new netlib module names 2015-07-22 15:30:11 +02:00
Thomas Kriechbaumer
df1b0df39f use netlib.http_semantics for generic data 2015-07-22 15:30:11 +02:00
Maximilian Hils
c3c3d28bb1 update build script 2015-07-22 13:49:18 +02:00
Maximilian Hils
e316a9cdb4 bump version 2015-07-22 13:39:48 +02:00
Maximilian Hils
1f3f076ded Merge pull request #83 from kyle-m/master
Fixing upstream certificate validation bugs
2015-07-22 12:48:48 +02:00
Kyle Morton
c17af4162b Added a fix for pre-1.0 OpenSSL which wasn't correctly erring on failed certificate validation 2015-07-21 19:15:11 -07:00
Kyle Morton
155bdeb123 Fixing default CA which ought to be read as a pemfile and not a directory 2015-07-21 18:09:42 -07:00
Maximilian Hils
fe03a656a9 make build script amazing 2015-07-22 02:43:45 +02:00
Maximilian Hils
d2d2edc140 make build script executable on *nix 2015-07-22 00:44:24 +02:00
Maximilian Hils
170568ded0 fix text selection hint 2015-07-22 00:41:02 +02:00
Maximilian Hils
9a1bee31d6 bump version 2015-07-22 00:21:48 +02:00
Maximilian Hils
9fdc412fa0 bump version 2015-07-22 00:17:05 +02:00
Maximilian Hils
cacf767b5c bump version 2015-07-22 00:16:38 +02:00
Maximilian Hils
ec02eda0b4 preliminary release script 2015-07-21 19:03:25 +02:00
Maximilian Hils
7fcbbb86cc streamline build process 2015-07-21 17:51:59 +02:00
Maximilian Hils
1e023bf12c Merge pull request #82 from mua/master
Fixed version error formatting issue
2015-07-21 12:22:11 +02:00
M. Utku Altinkaya
397b3bba5e Fixed version error formatting issue 2015-07-21 13:17:46 +03:00
Maximilian Hils
a08172f6cc fix slack badge 2015-07-17 20:49:58 +02:00
Maximilian Hils
1abd2647b4 Add Slack to README. 2015-07-15 04:20:04 +02:00
Maximilian Hils
822bd10465 Merge pull request #677 from isra17/json_error
Use `ensure_ascii` in wep.app#broadcast
2015-07-14 00:53:32 +02:00
Maximilian Hils
3dcc05ca97 Merge pull request #676 from isra17/master
Add source address filter
2015-07-14 00:42:48 +02:00
isra17
c33df9dd1c Use ensure_ascii in wep.app#broadcast
Otherwise, a non-unicode character in a flow cause mitmweb to crash.
2015-07-13 18:19:33 -04:00
isra17
471e196e08 Add ~src ~dst REGEX filters
This filter allow to match on the request source and destination address
in the form of `<IP>:<Port>`.

Also fixed the parsing grammar to add a `WordEnd` after each filter
name. That way, `~src` doesn't match `~s` instead and keep the behavior
consistent with `~hq` != `~h`.
2015-07-13 18:11:14 -04:00
Maximilian Hils
2af2e60f1f Merge pull request #673 from jlhonora/master
Match g/G shortcuts to less
2015-07-08 18:36:49 +02:00
jlhonora
1ebdda7902 Match g/G shortcuts to less, fix #631 2015-07-08 12:10:03 -03:00
Maximilian Hils
f8243086f6 improve dependency management in setup.py 2015-07-04 19:38:41 +02:00
Maximilian Hils
5a2b121f50 fix #648 2015-07-04 19:11:02 +02:00
Maximilian Hils
08476e988f clarify docs 2015-07-04 17:44:52 +02:00
Maximilian Hils
9960565359 fix #653 2015-07-04 15:46:45 +02:00
Terry Long
4c50c36345 Prevent unecessary upstream server connects
Selectively connect to upstream server based on no_upstream_cert
option. When no_upstream_cert is used during server replay, prevent
connecting to the upstream server unless absolutely necessary.
2015-07-03 07:55:37 -07:00
Maximilian Hils
4ef83d8c11 pathoc: add socks connect 2015-07-03 02:48:35 +02:00
Maximilian Hils
4c831992aa fix #593, fix #656, coverage++ 2015-07-03 02:47:12 +02:00
Maximilian Hils
9bffd9cf03 fix windows compatibility 2015-07-03 02:46:06 +02:00
Maximilian Hils
880c66fe48 socks: optionally fail early 2015-07-03 02:45:12 +02:00
Maximilian Hils
9aaf10120d socks: add assert_socks5 method 2015-07-03 02:01:30 +02:00
Aldo Cortesi
5ad6773e78 Merge pull request #661 from kyle-m/master
Enabling upstream server verification.
2015-06-30 10:51:46 +12:00
Maximilian Hils
9131b96b63 Merge pull request #80 from kyle-m/master
Fixing how certifi is made the default ca_path to simplify calling logic
2015-06-29 21:53:42 +02:00
Kyle Morton
f0ad1f334c Enabling upstream server verification. Added flags --verify_upstream_cert,
--upstream-trusted-cadir, and --upstream-trusted-ca.
2015-06-29 11:00:20 -07:00
Aldo Cortesi
4407508e0c Give some structure to the logging module 2015-06-28 12:16:02 +12:00
Aldo Cortesi
6b6317e1de Properly handle pause forever
Fixes #21
2015-06-27 10:46:12 +12:00
Aldo Cortesi
e3c869e4c9 Merge branch 'master' of ssh.github.com:mitmproxy/pathod 2015-06-27 10:35:32 +12:00
Aldo Cortesi
61679acf56 Preserve traceback for errors in log wrapper 2015-06-27 10:34:56 +12:00
Kyle Morton
0a2b25187f Fixing how certifi is made the default ca_path to simplify calling logic. 2015-06-26 14:57:00 -07:00
Maximilian Hils
31b0d77507 synchronize metadata files across projects 2015-06-26 23:44:00 +02:00
Maximilian Hils
aebad44d55 synchronize metadata files across projects 2015-06-26 23:43:19 +02:00
Maximilian Hils
8ca103cba5 synchronize metadata files across projects 2015-06-26 23:43:08 +02:00
Maximilian Hils
c8f6bf66fb Merge branch 'appveyor2' 2015-06-26 23:24:31 +02:00
Maximilian Hils
79cb4ea994 Merge branch 'appveyor' 2015-06-26 23:24:03 +02:00
Aldo Cortesi
5f277408cf Merge pull request #654 from mitmproxy/remove_certforward
Remove Certforward Feature
2015-06-27 09:22:41 +12:00
Aldo Cortesi
3d6dc0879b Merge pull request #79 from mitmproxy/remove_certffi
Remove certffi
2015-06-27 09:22:33 +12:00
Maximilian Hils
7990503eaf docs: fix certinstall image max-width 2015-06-26 23:04:15 +02:00
Maximilian Hils
492d3de2ea Merge branch 'master' into appveyor 2015-06-26 19:23:36 +02:00
Maximilian Hils
26ea1a065e fix file type 2015-06-26 19:23:12 +02:00
Maximilian Hils
74c50d24eb fix tests on windows 2015-06-26 19:21:35 +02:00
Maximilian Hils
5b02d5417a appveyor: minor fixes 2015-06-26 18:36:28 +02:00
Maximilian Hils
643accd5f8 add appveyor 2015-06-26 18:33:31 +02:00
Maximilian Hils
93e515c02f appveyor: use explicit python version 2015-06-26 18:24:33 +02:00
Maximilian Hils
2fb3d6caed add appveyor 2015-06-26 18:10:04 +02:00
Maximilian Hils
b369962cbe remove certforward feature
The certforward feature was implemented to support #gotofail,
which only works on unpatched iOS devices. Given that many apps don't
support iOS 7 anymore, jailbreak+ssl killswitch is usually the better option.
By removing certforward, we can make netlib a pure python module again,
which significantly simplifies distribution.
2015-06-26 13:27:40 +02:00
Maximilian Hils
2723a0e573 remove certffi 2015-06-26 13:26:35 +02:00
Thomas Kriechbaumer
427e6d23ef apply js-beautify changes selectivly 2015-06-26 11:48:22 +02:00
Aldo Cortesi
b3b4a63b05 Add a .jsbeautifyrc to prevent war 2015-06-26 21:24:21 +12:00
Thomas Kriechbaumer
49707dd97f http2: implement embedded response 2015-06-26 10:48:42 +02:00
Thomas Kriechbaumer
7d7ae446a2 http2: fix framedump argument usage 2015-06-26 10:48:42 +02:00
Thomas Kriechbaumer
01f0982968 prettify html docs 2015-06-26 10:48:42 +02:00
Thomas Kriechbaumer
5c0f0c2c22 http2: update docs 2015-06-26 10:48:15 +02:00
Thomas Kriechbaumer
46255e6e9c http2: implement more language features 2015-06-25 14:59:22 +02:00
Thomas Kriechbaumer
09d76e1758 remove unused imports 2015-06-25 14:53:48 +02:00
Aldo Cortesi
41925b01f7 Fix printing of SSL version error
Fixes #73
2015-06-25 10:37:01 +12:00
Aldo Cortesi
94a7770a94 Output warning info to log fp using logging methods 2015-06-25 10:33:35 +12:00
Aldo Cortesi
876252eba8 Remove stray print & massage whitespace a bit 2015-06-25 10:27:22 +12:00
Aldo Cortesi
becc790d83 Merge pull request #645 from elitest/hardfailvenv
Add a check to see if virtualenv is installed.
2015-06-24 15:10:41 +12:00
Jim Shaver
080e453425 Merge branch 'master' into hardfailvenv
Conflicts:
	dev
2015-06-23 21:48:05 -05:00
Jim Shaver
db5c0b210b merged with upstream changes in dev 2015-06-23 20:50:51 -05:00
Jim Shaver
854dc004ee revert change, already done on master. 2015-06-23 20:47:36 -05:00
Jim Shaver
951fe2f7ed Add a check to see if virtualenv is installed. 2015-06-23 20:17:57 -05:00
Aldo Cortesi
db6576ca6f Merge pull request #76 from kyle-m/master
Provide debugging information when upstream server certificate fails validation
2015-06-24 09:27:08 +12:00
Kyle Morton
4766bce63d Adding test data to support post OpenSSL v1.0 cert hashing 2015-06-23 10:46:42 -07:00
Aldo Cortesi
074d8d7c74 Merge pull request #640 from Kriechi/ssl-version-handling
unify SSL version/method handling
2015-06-23 22:20:10 +12:00
Aldo Cortesi
0e15b94368 Merge pull request #29 from Kriechi/ssl-version-handling
unify SSL version/method handling
2015-06-23 22:19:42 +12:00
Aldo Cortesi
80dd703a2a Merge branch 'Kriechi-ssl-version-handling' 2015-06-23 22:18:10 +12:00
Aldo Cortesi
239f4758af Remove dependence on pathod in test suite. 2015-06-23 22:16:03 +12:00
Thomas Kriechbaumer
14e49f4fc7 unify SSL version/method handling 2015-06-23 12:05:34 +02:00
Aldo Cortesi
ed06cdcdc9 Merge branch 'ssl-version-handling' of https://github.com/Kriechi/netlib into Kriechi-ssl-version-handling 2015-06-23 22:04:09 +12:00
Aldo Cortesi
2c928181e8 Merge branch 'master' of ssh.github.com:mitmproxy/mitmproxy 2015-06-23 14:01:50 +12:00
Aldo Cortesi
237e05c823 Travis to Slack 2015-06-23 14:01:31 +12:00
Aldo Cortesi
ed8a80e65a Travis to Slack 2015-06-23 13:55:25 +12:00
Aldo Cortesi
5588e57ca4 Moar Travis. 2015-06-23 13:51:08 +12:00
Aldo Cortesi
85b46cd888 Refine travis.
And, lest some meticulous code reader (I'm looking at you, Thomas) notices the
extra colon:

https://github.com/travis-ci/travis-ci/issues/2894
2015-06-23 13:28:40 +12:00
Aldo Cortesi
45c2ac2cf7 Travis notifications for Slack. 2015-06-23 13:16:52 +12:00
Kyle Morton
d1452424be Cleaning up upstream server verification. Adding storage of cerificate
verification errors on TCPClient object to enable warnings in downstream
projects.
2015-06-22 17:31:13 -07:00
Kyle Morton
7afe44ba4e Updating TCPServer to allow tests (and potentially other use cases) to serve
certificate chains instead of only single certificates.
2015-06-22 16:48:09 -07:00
Aldo Cortesi
e2069d52a8 Merge pull request #638 from iroiro123/http-transparent
HTTP Transparent Proxy
2015-06-23 09:40:25 +12:00
Thomas Kriechbaumer
58118d607e unify SSL version/method handling 2015-06-22 20:39:34 +02:00
Thomas Kriechbaumer
5d63afdc6d unify SSL version/method handling 2015-06-22 20:39:05 +02:00
iroiro123
fbb23b5c9f changed error handling (ssl spoof mode) 2015-06-23 01:49:22 +09:00
iroiro123
5c7fa7a594 add unit tests for spoof mode 2015-06-23 00:57:33 +09:00
Aldo Cortesi
2aa1b98fbf netlib/test.py -> test/tservers.py 2015-06-22 14:52:23 +12:00
iroiro123
fd90367329 SSL Spoof mode 2015-06-21 00:51:56 +09:00
iroiro123
378aa78324 Spoof mode 2015-06-20 21:43:50 +09:00
Thomas Kriechbaumer
7a3623a14e fix pep8 whitespace 2015-06-18 18:15:22 +02:00
Maximilian Hils
159543dd2b Update README.mkd 2015-06-18 18:10:06 +02:00
Maximilian Hils
90aeda47ae Update README.mkd 2015-06-18 18:09:40 +02:00
Thomas Kriechbaumer
bfc889d29a fix prospector code smells 2015-06-18 18:05:09 +02:00
Thomas Kriechbaumer
f5c5deb2ae fix http user agents 2015-06-18 17:36:58 +02:00
Thomas Kriechbaumer
69e71097f7 mark unused variables and arguments 2015-06-18 17:14:38 +02:00
iroiro123
59ec291b6c HTTP Transparent Proxy 2015-06-18 23:53:27 +09:00
Maximilian Hils
ce0e2b12b4 Merge pull request #28 from Kriechi/fix-mitmproxy-error
fix failing mitmproxy tests
2015-06-18 15:02:08 +02:00
Thomas Kriechbaumer
40436ffb1f fix setup.py 2015-06-18 13:12:06 +02:00
Thomas Kriechbaumer
231cfcea38 fix failing mitmproxy tests 2015-06-18 12:53:36 +02:00
Maximilian Hils
3e282d764e Merge branch 'master' of github.com:mitmproxy/netlib 2015-06-18 11:37:04 +02:00
Maximilian Hils
014b76bff7 include wheel as dev dependency 2015-06-18 11:36:58 +02:00
Maximilian Hils
6a4dcaf356 remove implementation badge
line too short :-/
2015-06-18 11:33:43 +02:00
Thomas Kriechbaumer
65be004bb2 fix prospector code smells 2015-06-18 11:07:33 +02:00
Thomas Kriechbaumer
bd0cfef357 exclude tests on old OpenSSL without ALPN 2015-06-18 10:48:13 +02:00
Thomas Kriechbaumer
61cbe36e40 http2: rename test file 2015-06-18 10:38:26 +02:00
Thomas Kriechbaumer
e9fecbf830 add landscape/prospector config 2015-06-18 10:31:27 +02:00
Thomas Kriechbaumer
559c80214d add landscape.io badge 2015-06-18 10:29:53 +02:00
Thomas Kriechbaumer
c1b01428b9 remove old coding style script 2015-06-18 10:27:42 +02:00
Thomas Kriechbaumer
a9d6b38153 add landscape/prospector config 2015-06-18 10:26:49 +02:00
Aldo Cortesi
274d0333f8 Merge pull request #27 from Kriechi/http2-wip
HTTP/2: add initial support
2015-06-18 16:16:40 +12:00
Aldo Cortesi
4579c67150 Merge branch 'master' of https://github.com/kyle-m/netlib into kyle-m-master 2015-06-18 12:23:03 +12:00
Aldo Cortesi
6e301f37d0 Only set OP_NO_COMPRESSION by default if it exists in our version of OpenSSL
We'll need to start testing under both new and old versions of OpenSSL
somehow to catch these...
2015-06-18 12:18:22 +12:00
Aldo Cortesi
4152b14387 Merge pull request #71 from Kriechi/landscape
fix warnings and code smells
2015-06-18 12:07:20 +12:00
Aldo Cortesi
5bb7159edd Merge pull request #70 from Kriechi/http2-wip
HTTP/2: yet another PR
2015-06-18 12:07:02 +12:00
Thomas Kriechbaumer
a652e050b7 add landscape.io badge 2015-06-17 13:19:44 +02:00
Thomas Kriechbaumer
836b1eab97 fix warnings and code smells
use prospector to find them
2015-06-17 13:10:27 +02:00
Maximilian Hils
ff20e64537 add landscape configuration 2015-06-17 13:09:02 +02:00
Kyle Morton
c9c93af453 Adding certifi as default CA bundle. 2015-06-16 11:11:10 -07:00
Thomas Kriechbaumer
eb823a04a1 http2: improve :authority header 2015-06-16 15:00:29 +02:00
Thomas Kriechbaumer
abb37a3ef5 http2: improve test suite 2015-06-16 15:00:28 +02:00
Thomas Kriechbaumer
20c136e070 http2: return stream_id from request for response 2015-06-16 15:00:28 +02:00
Thomas Kriechbaumer
1c124421e3 http2: fix header_block_fragments and length 2015-06-16 15:00:28 +02:00
Thomas Kriechbaumer
d0a9d3cdda http2: only first headers frame as END_STREAM flag 2015-06-16 15:00:28 +02:00
Thomas Kriechbaumer
e3db241a2f http2: improve frame output 2015-06-16 15:00:28 +02:00
Thomas Kriechbaumer
79ff439930 add elliptic curve during TLS handshake 2015-06-16 15:00:28 +02:00
Thomas Kriechbaumer
12702b9a01 http2: improve frame output 2015-06-16 14:55:08 +02:00
Thomas Kriechbaumer
408b4ffef0 http2: implement Headers for request & response
improve test coverage
fix super ctor call
fix legacy httpversion
simpliy SSLInfo without ALPN
2015-06-16 14:53:41 +02:00
Thomas Kriechbaumer
ec68aa303e http2: implement error response 2015-06-16 11:33:10 +02:00
Maximilian Hils
1f0c55a942 add hacking section 2015-06-16 03:30:34 +02:00
Maximilian Hils
78cb5fe573 update classifiers 2015-06-16 03:18:52 +02:00
Maximilian Hils
2c2e355922 Update README.mkd 2015-06-16 03:06:30 +02:00
Maximilian Hils
36d7e3fcd6 Update README.mkd 2015-06-16 03:05:21 +02:00
Maximilian Hils
d8db9330a0 update badges 2015-06-16 02:52:07 +02:00
Maximilian Hils
9089226d66 explicitly state that we only support 2.7 2015-06-16 02:31:47 +02:00
Aldo Cortesi
bb206323ab Merge pull request #69 from kyle-m/master
Adding support for upstream certificate validation when using SSL/TLS…
2015-06-16 10:34:09 +12:00
Kyle Morton
fe764cde52 Adding support for upstream certificate validation when using SSL/TLS with an
instance of TCPClient.
2015-06-15 10:18:54 -07:00
Thomas Kriechbaumer
a0d8afd0fc http2: add request-response to pathod 2015-06-15 15:51:01 +02:00
Thomas Kriechbaumer
30fbf57e4b delay pathod parsing until needed
This allows us to use different languages based on runtime env.
2015-06-15 15:50:45 +02:00
Thomas Kriechbaumer
22811c45dd fix craft anchor
The go-button in the app was broken due to an invalid string representation of the regex. A plain string used as URL prefix simplifies this drastically.
2015-06-15 15:50:45 +02:00
Thomas Kriechbaumer
0bc8fa1d0d http2: add pathoc and language tests 2015-06-15 15:50:44 +02:00
Thomas Kriechbaumer
b7c8021407 http2: using http2 implies SSL 2015-06-15 15:50:44 +02:00
Thomas Kriechbaumer
18a4456397 refactor cmdline tests 2015-06-15 15:50:44 +02:00
Thomas Kriechbaumer
9ececa637d http2: add warning for missing ALPN support 2015-06-15 15:50:44 +02:00
Thomas Kriechbaumer
6be6595425 pathod: add ALPN support 2015-06-15 15:50:44 +02:00
Thomas Kriechbaumer
2c423eded1 fix pep8 config 2015-06-15 12:03:33 +02:00
Thomas Kriechbaumer
5fea5d7813 fix pep8 config 2015-06-15 12:01:42 +02:00
Thomas Kriechbaumer
08f988e9f6 improve meta code 2015-06-15 11:58:24 +02:00
Aldo Cortesi
4fbe406e2e Merge pull request #67 from Kriechi/http2-wip
HTTP/2: preparations for pathod
2015-06-15 11:02:44 +12:00
Thomas Kriechbaumer
0d137eac6f simplify ALPN 2015-06-14 19:50:35 +02:00
Thomas Kriechbaumer
8d71a5b4ab http2: add authority header 2015-06-14 19:43:32 +02:00
Thomas Kriechbaumer
9c6d237d02 add new TLS methods 2015-06-14 18:17:53 +02:00
Thomas Kriechbaumer
5fab755a05 add more tests 2015-06-12 15:27:29 +02:00
Thomas Kriechbaumer
a901bc3032 http2: add response creation 2015-06-12 14:45:51 +02:00
Thomas Kriechbaumer
8ea157775d http2: general improvements 2015-06-12 14:42:07 +02:00
Aldo Cortesi
7890450b0c Handle invalid IDNA encoding in hostnames
Fixes #622
2015-06-12 16:00:16 +12:00
Aldo Cortesi
fcc1558180 Fix typo in docs - thanks to Jim_Showalter@intuit.com 2015-06-12 14:15:26 +12:00
Aldo Cortesi
85e1ae7543 Merge pull request #624 from drahosj/master
Added flow marking functionality in the console
2015-06-12 13:53:07 +12:00
Jake Drahos
946030367f Added unmark all functionality
- 'U' to unmark all marked flows
2015-06-11 20:31:54 -05:00
Jake Drahos
2a6698bf5a Moved marking from flow to console
No longer taints the flow primitive
2015-06-11 20:27:33 -05:00
Jake Drahos
f2d7a6aa57 Merge remote-tracking branch 'origin/master'
Conflicts:
	libmproxy/console/flowlist.py
2015-06-11 16:34:53 -05:00
Jake Drahos
dd1e401e01 Changed mark symbol
Smaller symbol now, still just as easy to see while scrolling
2015-06-11 16:33:46 -05:00
Jake Drahos
486177edc7 Added functionality to write marked flows to file
w (write) -> m (marked)
2015-06-11 16:25:28 -05:00
Jake Drahos
d45d0ce22a Added functionality to write marked flows to file
w (write) -> m (marked)
2015-06-11 16:15:24 -05:00
Jake Drahos
122ee88021 Unmark duplicated flows
If a marked flow is duplicated, the duplicate will now be unmarked
2015-06-11 12:52:15 -05:00
Jake Drahos
13e71eba10 Changed symbols and colors
Added a better symbol for the mark, and changed the color to red. This helps it
stand out more easily.
2015-06-11 12:02:15 -05:00
Jake Drahos
a34eeb9a28 Fixed console rendering bug
Clearing all flows now works properly
2015-06-11 11:49:23 -05:00
Jake Drahos
e53a2426c1 Marked flows not deleted on clear all
Marked flows survive a clear all unless all current flows are marked.

Bug: They don't show up until another flow is added
2015-06-11 11:40:03 -05:00
Jake Drahos
8b998cfbea Implemented basic marking of flows
- Press m to toggle flow mark
- Flow mark is set in libmproxy/console/common.py. Currently set to "==="
2015-06-11 10:27:48 -05:00
Thomas Kriechbaumer
eeaed93a83 improve ALPN integration 2015-06-11 15:37:17 +02:00
Maximilian Hils
d389b9c59d fix #615 2015-06-08 19:01:32 +02:00
Maximilian Hils
083b404bba fix #618 2015-06-08 18:26:02 +02:00
Thomas Kriechbaumer
0595585974 fix coding style 2015-06-08 17:00:03 +02:00
Thomas Kriechbaumer
fdbb3b76cf http2: add warning if raw data looks like HTTP/1 2015-06-08 16:54:19 +02:00
Thomas Kriechbaumer
c59f045bd9 import travis config from netlib
this enables ALPN support with OpenSSL 1.0.2
2015-06-08 13:39:46 +02:00
Thomas Kriechbaumer
6cf7b10c45 disable coding style checker on Travis 2015-06-08 13:34:36 +02:00
Thomas Kriechbaumer
abbe88c8ce fix non-ALPN supported OpenSSL-related tests 2015-06-08 13:25:42 +02:00
Thomas Kriechbaumer
da0792f457 import travis config from netlib
this enables ALPN support with OpenSSL 1.0.2
2015-06-08 13:14:58 +02:00
Aldo Cortesi
6b9c2739c2 Merge pull request #66 from Kriechi/improve-alpn-support
improve ALPN support on travis
2015-06-08 23:08:43 +12:00
Aldo Cortesi
05efcf0a78 Merge pull request #25 from Kriechi/pathoc-http2
[WIP] pathoc: HTTP/2
2015-06-08 23:06:09 +12:00
Thomas Kriechbaumer
4666d1e7bb improve ALPN support on travis 2015-06-08 12:52:06 +02:00
Thomas Kriechbaumer
ff478b5290 ignore eggs directory 2015-06-08 12:41:48 +02:00
Thomas Kriechbaumer
359ef46905 fix coding style 2015-06-08 12:29:39 +02:00
Thomas Kriechbaumer
293e3c6896 http2: add request-response handling 2015-06-08 10:45:17 +02:00
Thomas Kriechbaumer
722b3ae9cd http2: setup ALPN 2015-06-08 10:29:50 +02:00
Thomas Kriechbaumer
16361439c4 http2: add command line arguments 2015-06-08 10:10:32 +02:00
Aldo Cortesi
7b4e50bb68 Bump timeouts to appease Travis. 2015-06-08 16:34:21 +12:00
Aldo Cortesi
332832278f 100% test coverage 2015-06-08 16:25:33 +12:00
Aldo Cortesi
97fdb9ef0c More timeout improvements 2015-06-08 15:57:29 +12:00
Aldo Cortesi
3ad73dfb5b Debug to diagnose Travis races 2015-06-08 15:40:58 +12:00
Aldo Cortesi
317db54666 Revamp timeout handling and test logging 2015-06-08 15:23:56 +12:00
Aldo Cortesi
af22814bc3 Revamp error logging somewhat 2015-06-08 14:01:04 +12:00
David Weinstein
9b70d4bd2a Merge pull request #613 from dweinstein/patch/docker-tweaks
match name of automated build base img
2015-06-07 21:43:26 -04:00
Aldo Cortesi
7dff8f0dca Convert parse_websocket_frame to a generator 2015-06-08 10:58:12 +12:00
David Weinstein
84b4ca6a65 match name of automated build base img 2015-06-07 11:06:47 -04:00
Aldo Cortesi
df962f8e7b Convert parse_pathod to generator 2015-06-07 16:11:32 +12:00
Aldo Cortesi
0da3e51e1c Make parse_pathoc a generator
This lets us do things like this:

get:/:ir,@1:x1000000000

It will also let us expand the language to include a "repeat forever" concept.
2015-06-07 13:18:33 +12:00
Aldo Cortesi
60ee1dd3aa Merge pull request #611 from dweinstein/feature/dockerfiles
initial add of docker mitmproxy
2015-06-07 10:12:49 +12:00
David Weinstein
3bd36b58e5 initial add of docker mitmproxy 2015-06-06 00:14:53 -04:00
Aldo Cortesi
9c48bfb2a5 http2: ditch the logging for now
The API is well designed: it looks like we can get all the information
we need to expose debugging in the caller of the API.
2015-06-06 12:30:53 +12:00
Aldo Cortesi
f2d784896d http2: resolve module structure and circular dependencies
- Move implementation out of __init__.py to protocol.py (an anti-pattern
because it makes the kind of structural refactoring we need hard)
- protocol imports frame, frame does not import protocol. To do this, we
shift the default settings to frame. If this feels wrong, we can move
them to a separate module (defaults.py?.).
2015-06-06 12:26:48 +12:00
Aldo Cortesi
fcaabeb455 Merge pull request #65 from Kriechi/h2-client
HTTP/2 protocol definition
2015-06-06 11:54:35 +12:00
Aldo Cortesi
bf7b76a997 Merge pull request #610 from tekii/fix-607
Fix 607
2015-06-06 11:10:33 +12:00
Thomas Kriechbaumer
e39d8aed6d http2: refactor hex to file adapter 2015-06-05 20:55:32 +02:00
Thomas Kriechbaumer
f2db8abbe8 use open instead of file 2015-06-05 20:52:11 +02:00
Thomas Kriechbaumer
6c1c6f5f0a http2: fix EchoHandler test helper 2015-06-05 20:49:03 +02:00
Marcelo Glezer
1befa9477c fix #607 fix message 2015-06-05 15:33:36 -03:00
Thomas Kriechbaumer
e7c84a1ce1 make travis run all tests 2015-06-05 20:22:21 +02:00
Thomas Kriechbaumer
49043131cc increase test coverage 2015-06-05 20:22:20 +02:00
Marcelo Glezer
17b34de28d fix #607 decode data before sending it to pyperclip 2015-06-05 15:19:57 -03:00
Thomas Kriechbaumer
fdc908cb98 http2: add protocol tests 2015-06-05 20:19:48 +02:00
Thomas Kriechbaumer
f003f87197 http2: rename module and refactor as strategy 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
623dd850e0 http2: add logging and error handling 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
40fa113116 http2: change header_block_fragment handling 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
5cecbdc168 http2: add basic protocol handling 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
e4c129026f http2: introduce state for connection objects 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
b84001e8f0 http2: explicitly mention all arguments in tests 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
436291764c http2: fix default settings 2015-06-05 13:33:37 +02:00
Thomas Kriechbaumer
9883509f89 simplify default ssl params for test servers 2015-06-05 13:33:37 +02:00
Aldo Cortesi
0269d0fb8b repr for websocket frames 2015-06-05 17:08:22 +12:00
Aldo Cortesi
7412ec83f5 Refactor pathoc message receive to use queues and generators
This gives us a nicer, thread-safe interface.
2015-06-05 16:03:17 +12:00
Aldo Cortesi
d23691f98c Improve websocket logging 2015-06-05 12:04:40 +12:00
Aldo Cortesi
2d9b9be1f4 Revert "tcp: clear_log to clear socket logs"
start_log also clears the log, which is good enough.

This reverts commit 4ca62e0d9b.
2015-06-05 11:50:29 +12:00
Aldo Cortesi
4ca62e0d9b tcp: clear_log to clear socket logs 2015-06-05 11:42:06 +12:00
Aldo Cortesi
0a7da6a9b1 Rudimentary support for reflected websocket frames. 2015-06-04 23:57:23 +12:00
Aldo Cortesi
9311d60596 Test output to try to figure out why Travis no longer loves us 2015-06-04 20:42:11 +12:00
Aldo Cortesi
07d5b90ebf Shore up test suite. 2015-06-04 20:36:50 +12:00
Aldo Cortesi
182b79ab9e Refactor to allow dropping to websockets on any anchor point 2015-06-04 20:23:05 +12:00
Aldo Cortesi
fb1b9113a1 Try to fix test suite race like a savage. 2015-06-04 19:55:01 +12:00
Aldo Cortesi
80d191ff7c Try to appease Travis 2015-06-04 19:45:22 +12:00
Aldo Cortesi
ae9f470d2b Craft anchor is now specified as a regex
Unifies this with anchor points.
2015-06-04 19:09:38 +12:00
Aldo Cortesi
c5992b8d23 Refactor Pathod HTTP handlers for clarity 2015-06-04 18:37:13 +12:00
Aldo Cortesi
5a33f31041 Clarify nomenclature, complete nested frame language spec. 2015-06-04 18:14:25 +12:00
Aldo Cortesi
9fda74c65a Clarify language API, stub out nested websocket frames 2015-06-04 17:18:06 +12:00
Aldo Cortesi
783e904b92 Merge pull request #603 from Kriechi/remove-contrib
replace contrib libraries with pypi dependencies
2015-06-04 13:30:18 +12:00
Aldo Cortesi
249bb4a2ac Bump version 2015-06-04 11:15:29 +12:00
Aldo Cortesi
5bee061849 Bump version 2015-06-04 11:15:07 +12:00
Aldo Cortesi
113c5c187f Bump version 2015-06-04 11:14:47 +12:00
Thomas Kriechbaumer
fbb2633dd3 replace contrib libraries with pypi dependencies 2015-06-02 10:00:34 +02:00
Maximilian Hils
c725325a78 Merge pull request #61 from Kriechi/distribute-cffi
distribute cffi correctly
2015-05-31 11:44:27 +02:00
Aldo Cortesi
6122f2da44 Change test API to allow multiple pathoc requests
Add simple unit test for websocket server
2015-05-31 18:38:11 +12:00
Aldo Cortesi
2ebe994375 logging: Re-raise exception after output 2015-05-31 18:12:39 +12:00
Aldo Cortesi
effd29b51a Refactor logging, fix conversion to websocket handler 2015-05-31 18:03:41 +12:00
Aldo Cortesi
af66661212 Add timestamps to logs by everywhere 2015-05-31 17:25:36 +12:00
Aldo Cortesi
35856ead07 websockets: nicer human readable 2015-05-31 17:24:44 +12:00
Aldo Cortesi
f7bd690e3a When we see an incomplete read with 0 bytes, it's a disconnect
Partially fixes mitmproxy/mitmproxy:#593
2015-05-31 17:18:55 +12:00
Aldo Cortesi
e7c255a3bb Refactor, fix a crashing bug by changing the way we specify SANs to pathod 2015-05-31 16:54:52 +12:00
Aldo Cortesi
73376e605a Save first byte timestamp for writers too. 2015-05-31 16:54:14 +12:00
Aldo Cortesi
88ab54fab0 Refactor pathod to allow switching protocol handlers 2015-05-31 14:12:51 +12:00
Aldo Cortesi
4ec181c140 Move version check to netlib, unit test it. 2015-05-31 13:12:01 +12:00
Thomas Kriechbaumer
b395049a85 distribute cffi correctly 2015-05-30 15:15:08 +02:00
Aldo Cortesi
2a1a0e1ab2 Prevent autoflake from changing our API 2015-05-30 17:51:48 +12:00
Aldo Cortesi
a09f3e06c3 Factor logger out of pathoc, use it in pathod as well. 2015-05-30 17:43:01 +12:00
Aldo Cortesi
4ed5043c67 Add coding style check, reformat. 2015-05-30 12:03:13 +12:00
Aldo Cortesi
f76bfabc5d Adjust pep8 parameters, reformat 2015-05-30 12:02:58 +12:00
Aldo Cortesi
5e4850d3b3 Merge pull request #62 from Kriechi/h2-client
H2 client
2015-05-30 12:01:19 +12:00
Aldo Cortesi
904760c6c2 Merge pull request #23 from Kriechi/fix-links
fix github links
2015-05-30 10:43:54 +12:00
Thomas Kriechbaumer
17db4486a8 fix typo 2015-05-29 20:15:37 +02:00
Thomas Kriechbaumer
64d6a11ce5 fix github links 2015-05-29 19:57:06 +02:00
Thomas Kriechbaumer
629fa8e552 make tests aware of ALPN & OpenSSL 1.0.2 dependency 2015-05-29 17:04:12 +02:00
Thomas Kriechbaumer
c32d8189fa cleanup imports 2015-05-29 17:00:38 +02:00
Thomas Kriechbaumer
e2de49596d add HTTP/2-capable client 2015-05-29 15:31:22 +02:00
Thomas Kriechbaumer
780836b182 add ALPN support to TCP abstraction 2015-05-29 15:31:22 +02:00
Thomas Kriechbaumer
d50b9be0d5 add generic frame parsing method 2015-05-29 15:31:22 +02:00
Thomas Kriechbaumer
4c469fdee1 add hpack to encode and decode headers 2015-05-29 15:31:22 +02:00
Thomas Kriechbaumer
754f929187 fix default argument
Python evaluates default args during method definition.
So you get the same dict each time you call this method.
Therefore the dict is the SAME actual object each time.
2015-05-29 11:42:46 +02:00
Thomas Kriechbaumer
5288aa3640 add human_readable() to each frame for debugging 2015-05-29 11:42:46 +02:00
Thomas Kriechbaumer
bdb62101bb test Address __str__ 2015-05-29 11:42:46 +02:00
Thomas Kriechbaumer
e805f2d066 improve travis coding style checks 2015-05-29 11:41:39 +02:00
Aldo Cortesi
1dda164d03 Satisfy autobots. 2015-05-28 12:18:56 +12:00
Aldo Cortesi
41af65a1c4 Merge branch 'Kriechi-cleanup' 2015-05-28 12:12:37 +12:00
Aldo Cortesi
5265b28957 Merge pull request #59 from Kriechi/update-tls-defaults
update TLS defaults: signature hash and DH params
2015-05-28 11:59:53 +12:00
Thomas Kriechbaumer
8037830696 add pep8 autoformat checks to travis 2015-05-27 13:13:04 +02:00
Thomas Kriechbaumer
161bc2cfaa cleanup code with autoflake
run the following command:
  $ autoflake -r -i --remove-all-unused-imports --remove-unused-variables .
2015-05-27 11:25:33 +02:00
Thomas Kriechbaumer
e3d390e036 cleanup code with autopep8
run the following command:
  $ autopep8 -i -r -a -a .
2015-05-27 11:19:11 +02:00
Thomas Kriechbaumer
041ca5c499 update TLS defaults: signature hash and DH params
* SHA1 is deprecated (use SHA256)
* increase RSA key to 2048 bits
* increase DH params to 4096 bits (LogJam attack)
2015-05-27 10:53:57 +02:00
Aldo Cortesi
f7b75ba8c2 Merge pull request #58 from Kriechi/update-openssl
Update openssl
2015-05-27 20:33:03 +12:00
Thomas Kriechbaumer
d6a68e1394 remove outdated workarounds 2015-05-27 10:23:43 +02:00
Thomas Kriechbaumer
1967a49cd9 bump pyOpenSSL and cryptography dependencies 2015-05-27 10:23:43 +02:00
Aldo Cortesi
3f25df0b12 Merge pull request #56 from Kriechi/http2-frames
implement basic HTTP/2 frame classes
2015-05-27 09:30:52 +12:00
Maximilian Hils
e8ee6d20fe fix typo 2015-05-26 19:08:55 +02:00
Thomas Kriechbaumer
4ce6f43616 implement basic HTTP/2 frame classes 2015-05-26 17:59:29 +02:00
Aldo Cortesi
baf0bac39a Post-release version bump. 2015-05-26 10:43:42 +12:00
Aldo Cortesi
ae749975e5 Post release version bump. 2015-05-26 10:43:28 +12:00
Aldo Cortesi
a43e3e29cf Remove server example for now. 2015-05-26 09:50:51 +12:00
Maximilian Hils
46fadfc823 improve displaying tcp addresses 2015-05-18 17:16:42 +02:00
Aldo Cortesi
dccd57f53b release prep: bump version, fix doc layout a bit 2015-05-18 10:46:19 +12:00
Aldo Cortesi
f40bf865b1 release prep: bump version 2015-05-18 10:46:00 +12:00
Aldo Cortesi
bcba55cc26 Strike times token on copy 2015-05-17 16:42:59 +12:00
Aldo Cortesi
abe1f09f2c HTTP and websocket requests now have an xN clause to repeat 2015-05-17 15:52:56 +12:00
Aldo Cortesi
d80fbc2410 websockets: raw body specification 2015-05-17 15:38:13 +12:00
Aldo Cortesi
bddf81edfc websockets: lINTEGER to specify payload length 2015-05-17 11:31:02 +12:00
Aldo Cortesi
cd2fb13b3e websockets: replace the "raw" with a simpler mechanism
You can now say "knone" to specifiy that no key should be generated
under any circumstances.
2015-05-17 11:04:53 +12:00
Aldo Cortesi
e4feba5433 Introduce and enfoce uniqueness constraints for language components 2015-05-17 10:43:30 +12:00
Aldo Cortesi
ace4454523 Zap outdated comment 2015-05-16 11:32:18 +12:00
Aldo Cortesi
2ee60783b6 websockets: client and server flavors, key and mask specification 2015-05-16 11:31:53 +12:00
Aldo Cortesi
d66dedc6e7 websockets: mask specification
- Add a FixedLengthValue
- Use it to implement a 4-byte mask specifier
- Adjust docs
2015-05-16 09:42:47 +12:00
Aldo Cortesi
2beae27541 websockets: fix actions on frames 2015-05-05 11:16:29 +12:00
Aldo Cortesi
1dc2fa0424 pathoc: cope with errors during websocket frame read. 2015-05-05 10:59:37 +12:00
Aldo Cortesi
dabb356c15 Zap a left-over test 2015-05-05 10:52:50 +12:00
Aldo Cortesi
f2bc58cdd2 Add tcp.Reader.safe_read, use it in socks and websockets
safe_read is guaranteed to raise or return a byte string of the
requested length. It's particularly useful for implementing binary
protocols.
2015-05-05 10:47:02 +12:00
Aldo Cortesi
589deb9fe1 websockets: specification of fin, mask, rsv1-3 bits. 2015-05-04 10:48:35 +12:00
Aldo Cortesi
179cc8dc1f Split up language docs, document websocket code specification. 2015-05-04 09:54:59 +12:00
Aldo Cortesi
4b2e00acb3 Docs 2015-05-04 08:34:53 +12:00
Aldo Cortesi
5b6d3a80bb websockets: code specification 2015-05-03 13:54:52 +12:00
Aldo Cortesi
67d2993339 Lower-case rather than upper-case to canonicalize names
Marginally less finicky
2015-05-03 12:59:21 +12:00
Aldo Cortesi
3f5ec4b737 PreValue -> Value 2015-05-03 12:54:25 +12:00
Aldo Cortesi
cc434ded89 Clarify token/component split through naming
Tokens are now Tok*
2015-05-03 12:53:28 +12:00
Aldo Cortesi
e35e6d90b9 Remove bundled pyparsing, install as external package
Adapt ValueLiteral parsing to suit
2015-05-03 10:11:51 +12:00
Aldo Cortesi
bf71a9a2a0 base.PathodSpec -> http.PathodResponse 2015-05-03 08:56:19 +12:00
Aldo Cortesi
a46e17459d Language: minor refactoring and whitespace 2015-05-03 08:51:57 +12:00
Aldo Cortesi
5d5f2bdd1f Split out language messages and actions 2015-05-03 08:02:13 +12:00
Aldo Cortesi
24437ba180 Revamp header components in language 2015-05-02 22:32:57 +12:00
Aldo Cortesi
fffee660e5 language: create and use Integer and PreValue generics 2015-05-02 21:42:09 +12:00
Aldo Cortesi
0ffd14372a Refactor language to move specific tokens into protocol module
This patch makes progress on language/http.py
2015-05-02 21:27:11 +12:00
Aldo Cortesi
2091d16387 test coverage: generators and websockets to 100% 2015-05-02 17:19:48 +12:00
Aldo Cortesi
a6dbb82936 tests: extract language.writer and language.websocket 2015-05-02 17:10:25 +12:00
Aldo Cortesi
88eabfd8ef language: extract http tests 2015-05-02 17:05:34 +12:00
Aldo Cortesi
5b48c69a6a Split language test suite: generators
Also remove some unused code
2015-05-02 16:53:48 +12:00
Aldo Cortesi
9109b3cc8c Massive refactoring to split up language implementation. 2015-05-02 16:17:00 +12:00
Aldo Cortesi
601cdf70c7 websockets: progressive masking. 2015-05-01 10:31:45 +12:00
Aldo Cortesi
08b2e2a6a9 websockets: more flexible masking interface. 2015-05-01 10:31:20 +12:00
Aldo Cortesi
7d9e38ffb1 websockets: A progressive masker. 2015-05-01 10:09:35 +12:00
Aldo Cortesi
3a3ea9d927 pathoc: cope better with disconnect conditions 2015-05-01 09:41:07 +12:00
Aldo Cortesi
b8f40860f5 pathoc: Integrate bytes read/written log into Log handler 2015-04-30 14:42:54 +12:00
Aldo Cortesi
fea3d8e421 Revamp pathoc log output with a context handler
This does two things - it gives us a central place to put log utilities,
and it lets us group together related log lines.
2015-04-30 13:59:10 +12:00
Aldo Cortesi
4dce7ee074 websockets: more compact and legible human_readable 2015-04-30 12:10:08 +12:00
Aldo Cortesi
8086022920 Add a tiny utility class for keeping bi-directional mappings.
Use it in websocket and socks.
2015-04-30 09:04:22 +12:00
Aldo Cortesi
b7a2fc8553 testing: http read_request corner case 2015-04-30 08:41:13 +12:00
Aldo Cortesi
f927701e74 Websocket frame read limit. 2015-04-30 08:03:26 +12:00
Aldo Cortesi
7e69fab331 Stub out websocket read loop and Frame language construct 2015-04-29 10:02:16 +12:00
Aldo Cortesi
18df329930 websockets: nicer frame construction
- Resolve unspecified values on instantiation
- Add a check for masking key length
- Smarter resolution for masking_key and mask values. Do the right thing unless told not to.
2015-04-24 15:42:31 +12:00
Aldo Cortesi
192fd1db7f websockets: include all header values in frame roundtrip 2015-04-24 15:31:14 +12:00
Aldo Cortesi
def93ea8ca websockets: remove validation
We don't really need this any more. The interface is much less error prone
because bit flags are no longer integers, we have a range check on opcode on
header instantiation, and we've deferred length code calculation and so forth
into the byte render methods.
2015-04-24 15:23:00 +12:00
Aldo Cortesi
f22bc0b4c7 websocket: interface refactoring
- Separate out FrameHeader. We need to deal with this separately in many circumstances.
- Simpler equality scheme.
- Bits are now specified by truthiness - we don't care about the integer value.
This means lots of validation is not needed any more.
2015-04-24 15:09:21 +12:00
Aldo Cortesi
3519871f34 websockets: refactor to avoid rundantly specifying payloads and payload lengths 2015-04-24 09:21:04 +12:00
Aldo Cortesi
bdd52fead3 websockets: extract frame header creation into a function 2015-04-24 08:47:09 +12:00
Aldo Cortesi
5405a4d458 Pull HTTP functionality out of language._Message in prep for frames 2015-04-24 07:35:17 +12:00
Aldo Cortesi
b0ab5297d1 Change the semantics of the craft anchor point specification
The anchor point is now defined as /p (rather than /p/), with the specification
for a request just to /p or /p/ being empty.
2015-04-23 17:35:22 +12:00
Aldo Cortesi
dacb350040 pathod: register websocket key from client handshake 2015-04-23 17:11:20 +12:00
Aldo Cortesi
2306a7ab6d Refactor logging, add some defaults to pathod argument help. 2015-04-23 08:43:57 +12:00
Aldo Cortesi
ce6147ec35 Use get_request_line from netlib.http 2015-04-23 08:24:26 +12:00
Aldo Cortesi
42a87a1d8b websockets: handshake checks only take headers 2015-04-23 08:23:51 +12:00
Aldo Cortesi
45d1e5cd0e Example websocket key for mock renders 2015-04-23 07:29:55 +12:00
Aldo Cortesi
61dc01af11 Resolve messages as part of policy check 2015-04-22 16:38:54 +12:00
Aldo Cortesi
5dee4210eb pathod: flag to set debugging for web interface dev 2015-04-22 15:58:25 +12:00
Aldo Cortesi
99cb0808ab websockets: server handshake scheme
Also refactor settings and resolution interfaces
2015-04-22 15:49:17 +12:00
Aldo Cortesi
65f04bf4d1 First-pass websocket client handshake 2015-04-22 09:31:22 +12:00
Aldo Cortesi
4fb49c8e55 websockets: (very) slightly nicer is_valid constraints 2015-04-21 23:49:27 +12:00
Aldo Cortesi
176e29fc09 websockets: constants, variable names, refactoring 2015-04-21 23:13:42 +12:00
Aldo Cortesi
1b509d5aea Whitespace, interface simplification
- safe_tobytes doesn't buy us much
- move masking key generation inline
2015-04-21 22:51:01 +12:00
Aldo Cortesi
3e0a71ea34 websockets: refactor to use http and header functions in http.py 2015-04-21 22:39:45 +12:00
Aldo Cortesi
e5f1264838 Whitespace, indentation, nounce -> nonce 2015-04-21 13:39:00 +12:00
Aldo Cortesi
7d83e388aa Whitespace, pep8, mixed indentation 2015-04-21 11:19:00 +12:00
Aldo Cortesi
dd7ea896f2 Return a named tuple from read_response 2015-04-21 11:11:16 +12:00
Aldo Cortesi
2c660d7633 Migrate requeset reading from mitmproxy to netlib 2015-04-21 11:05:12 +12:00
Aldo Cortesi
b66be24149 Fix call signature in pathoc. 2015-04-20 18:14:47 +12:00
Aldo Cortesi
0141629c08 Merge pull request #55 from Chandler/websockets
small websockets cleanup
2015-04-20 17:31:42 +12:00
Chandler Abraham
2c9079b518 whitespace 2015-04-19 22:22:15 -07:00
Chandler Abraham
fae964d315 remove subproject commit 2015-04-19 22:20:53 -07:00
Chandler Abraham
4ea1ccb638 fixing test coverage, adding to_file/from_file reader writes to match socks.py 2015-04-19 22:18:30 -07:00
Aldo Cortesi
33820d9aee Whitespace, interface refcactoring, sketch websockets language 2015-04-20 15:42:33 +12:00
Aldo Cortesi
74389ef04a Websockets: reorganise
- websockets.py to top-level
- implementations into test suite
2015-04-20 09:38:09 +12:00
Aldo Cortesi
be450cf9db Whitespace, small fixes. 2015-04-20 08:56:47 +12:00
Aldo Cortesi
3891fe5638 Refactor pathoc
We're getting ready for websockets. All the output specifiers are now on the
Pathoc object itself - we can't assume that all input and output happens in
response to a method call any more. This has the upside that we can unify the
request/print_request methods.
2015-04-19 18:04:27 +12:00
Aldo Cortesi
f8469a283b pathoc: Print SSL info only once per connection 2015-04-19 15:55:22 +12:00
Aldo Cortesi
43dadbc2fe Add SANs specification arguments to pathod 2015-04-19 10:51:03 +12:00
Aldo Cortesi
f332674ce1 100% unit tests
- Add SANs to pathod SSLConfig
- Fix tricky SSL establishment error test. Lets see if it's platform portable.
2015-04-19 10:43:16 +12:00
Aldo Cortesi
d8b79e9982 Scripts to reproducibly generate the test certificate 2015-04-19 10:12:15 +12:00
Aldo Cortesi
a5567094ac Document embedded response specification. 2015-04-18 17:04:24 +12:00
Aldo Cortesi
baf961cde0 Unit test++ for PathodSpec 2015-04-18 16:36:45 +12:00
Maximilian Hils
08ba987a84 Merge branch 'master' of github.com:mitmproxy/netlib 2015-04-17 16:29:25 +02:00
Maximilian Hils
0c2ad1edb1 fix socket_close on Windows, refs mitmproxy/mitmproxy#527 2015-04-17 16:29:09 +02:00
Aldo Cortesi
ef8e02edc3 Fix test that fails on Travis with a bodge
Circumvents a platform difference causing a test failure.
2015-04-17 18:02:03 +12:00
Aldo Cortesi
3061bdd0c2 Unit tests: cmdline.pathod 2015-04-17 18:00:46 +12:00
Aldo Cortesi
f8e95db6b0 housekeeping: ++tests, coverage annotations 2015-04-17 17:45:50 +12:00
Aldo Cortesi
fe8e27f27b Housekeeping: .env and fix unit tests 2015-04-17 15:27:50 +12:00
Aldo Cortesi
7defb5be86 websockets: more whitespace, WebSocketFrame -> Frame 2015-04-17 14:29:20 +12:00
Aldo Cortesi
488c25d812 websockets: whitespace, PEP8 2015-04-17 13:57:39 +12:00
Aldo Cortesi
3bbafa24bd Merge pull request #54 from Chandler/websockets
Netlib WebSockets take 1
2015-04-17 13:46:51 +12:00
Aldo Cortesi
c53d89fd7f Improve flexibility of http_cookies._format_pairs 2015-04-16 08:30:54 +12:00
Aldo Cortesi
0c85c72dc4 ODict improvements
- Setting values now tries to preserve the existing order, rather than
just appending to the end.
- __repr__ now returns  a repr of the tuple list. The old repr becomes a
.format() method. This is clearer, makes troubleshooting easier, and
doesn't assume all data in ODicts are header-like
2015-04-15 10:28:17 +12:00
Aldo Cortesi
aeebf31927 odict: don't convert values to strings when added 2015-04-14 16:20:02 +12:00
Aldo Cortesi
d739882bf2 Add an .extend method for ODicts 2015-04-14 13:50:57 +12:00
Aldo Cortesi
6db5e0a4a1 Remove old-style set-cookie cruft, unit tests to 100% 2015-04-14 10:13:03 +12:00
Aldo Cortesi
de9e741125 Firm up cookie parsing and formatting API
Make a tough call: we won't support old-style comma-separated set-cookie
headers. Real world testing has shown that the latest rfc (6265) is
often violated in ways that make the parsing problem indeterminate.
Since this is much more common than the old style deprecated set-cookie
variant, we focus on the most useful case.
2015-04-14 10:02:10 +12:00
Chandler Abraham
2d72a1b6b5 100% test coverage, though still need plenty more 2015-04-13 13:36:09 -07:00
Chandler Abraham
0ed2a29063 whitespace 2015-04-11 17:28:52 -07:00
Chandler Abraham
f131f9b855 handshake tests, serialization test 2015-04-11 17:26:59 -07:00
Aldo Cortesi
1a79ef8b6c Merge branch 'master' of https://github.com/mitmproxy/netlib 2015-04-12 11:32:27 +12:00
Aldo Cortesi
2630da7263 cookies: Cater for special values, fix some bugs found in real-world testing 2015-04-12 11:30:35 +12:00
Aldo Cortesi
73ce169e3d Initial outline of a cookie parsing and serialization module. 2015-04-12 10:26:09 +12:00
Chandler Abraham
0edc04814e small cleanups, working on tests 2015-04-11 11:35:15 -07:00
Chandler Abraham
e41e5cbfdd netlib websockets 2015-04-10 18:37:41 -07:00
Maximilian Hils
e58f76aec1 fix code smell 2015-04-09 02:09:33 +02:00
Maximilian Hils
7f7ccd3a18 100% test coverage 2015-04-09 00:57:37 +02:00
Maximilian Hils
6fbe3006af fail gracefully if we cannot start a new thread 2015-04-09 00:13:01 +02:00
Aldo Cortesi
09e995ab5c Improvements to pathoc repeat requests
- Pathoc will now keep trying if connections failed
- Add a -w option to specify a wait time between requests
2015-03-14 11:54:47 +11:00
Aldo Cortesi
2e64d44aab Merge branch 'master' of ssh.github.com:mitmproxy/pathod 2015-03-14 11:21:32 +11:00
Aldo Cortesi
7caf0e4dce Fix entry points for cmdline tools 2015-03-14 11:19:57 +11:00
Maximilian Hils
d5eff70b6e fix tests on Windows 2015-03-07 01:31:31 +01:00
Maximilian Hils
dbadc1b613 clean up cert handling, fix mitmproxy/mitmproxy#472 2015-03-07 01:22:02 +01:00
Maximilian Hils
24a3dd59fe try harder to fix race condition in tests 2015-02-27 22:34:36 +01:00
Maximilian Hils
d71f3b68fd make tests more robust, fix coveralls 2015-02-27 22:27:23 +01:00
Maximilian Hils
da1eb94ccd 100% test coverage 🎉 2015-02-27 22:02:52 +01:00
Maximilian Hils
63fb433690 fix #53 2015-02-27 20:40:17 +01:00
Maximilian Hils
738a7b34a2 Merge branch 'master' of github.com:mitmproxy/netlib 2015-02-27 17:00:19 +01:00
Maximilian Hils
224f737646 add option to log ssl keys
refs mitmproxy/mitmproxy#475
2015-02-27 16:59:29 +01:00
Maximilian Hils
2a2402dfff ...two years is not enough. 2015-02-17 00:10:10 +01:00
Aldo Cortesi
7e5bb74e72 5 years is enough... 2015-02-17 12:03:52 +13:00
Aldo Cortesi
c9de3e770b By popular demand, bump dummy cert expiry to 5 years
fixes #52
2015-02-17 11:59:07 +13:00
Maximilian Hils
b6af3fddf4 pypy support, faster travis builds 2015-02-07 01:43:25 +01:00
Aldo Cortesi
3c919631d4 Bump version 2014-12-28 22:46:19 +13:00
Maximilian Hils
438c1fbc7d TCPClient: Use TLS1.1+ where available, BaseHandler: disable SSLv2 2014-12-15 12:32:36 +01:00
Aldo Cortesi
7098c90a6d Bump version to 0.11.1 2014-11-15 12:45:06 +13:00
Aldo Cortesi
295c8340a3 Bump to 0.11.1 2014-11-15 12:44:26 +13:00
Aldo Cortesi
63d2403558 Merge branch 'master' of ssh.github.com:mitmproxy/pathod 2014-11-15 12:42:38 +13:00
Aldo Cortesi
1b41b9bb9b Use current version for download links
Fixes #19
2014-11-15 12:41:44 +13:00
Aldo Cortesi
c56e7a90d8 Fix tracebacks in connection finish 2014-11-15 12:31:13 +13:00
Maximilian Hils
8635e00175 Merge remote-tracking branch 'origin/master'
Conflicts:
	setup.py
2014-11-11 12:29:34 +01:00
Maximilian Hils
b917b61e6a be more explicit about requirements 2014-11-11 12:28:08 +01:00
Maximilian Hils
60584387ff be more explicit about requirements 2014-11-11 12:26:20 +01:00
Aldo Cortesi
396fb1943a Merge branch 'merge' 2014-11-11 14:02:56 +13:00
Aldo Cortesi
3b468849e6 Update pathod version number in requirements 2014-11-11 14:02:13 +13:00
Aldo Cortesi
27c7e9e934 Fix unit tests 2014-11-11 13:34:02 +13:00
Aldo Cortesi
1a9ba295ce Changelog, remove entry points in favor of scripts 2014-11-08 14:42:10 +13:00
Aldo Cortesi
0811a9ebde .flush can raise NetlibDisconnect. This fixes a traceback found in fuzzing. 2014-11-07 16:01:41 +13:00
Aldo Cortesi
9ce2f473f6 Simplify expected_http_body_size signature, fixing a traceback found in fuzzing 2014-11-07 15:59:00 +13:00
Aldo Cortesi
c1062db9fd Add a pip requirement to pathod to work around a pip/requests screwup 2014-11-05 09:58:07 +13:00
Aldo Cortesi
956149c126 --memo-limit - limit failed attempts to find new generated requests to N 2014-10-26 18:16:47 +13:00
Aldo Cortesi
ba468f12b8 Whitespace and legibility 2014-10-26 17:30:26 +13:00
Aldo Cortesi
bd1f7ebb5c Improve netability of grammars 2014-10-26 16:27:25 +13:00
Aldo Cortesi
974bd9d0f9 Resolve a quoting ambiguity in nested response specs 2014-10-26 12:56:28 +13:00
Aldo Cortesi
fc1fc80469 Allow nesting of pathod response specs in pathoc specs
This opens the door to really neat, repeatable, client-side driven
fuzzing, especially of proxies.
2014-10-26 10:50:32 +13:00
Aldo Cortesi
c00ae41486 Add a memoize argument to prevent playing the same pattern twice
Also remove addition of Date header, which makes this non-deterministic
2014-10-25 19:50:48 +13:00
Aldo Cortesi
fc4f9a1c7a pathoc -n 0 repeats forever 2014-10-25 17:58:59 +13:00
Aldo Cortesi
609d6eab30 Make grammar less ambiguous for multi-pattern files 2014-10-25 17:27:08 +13:00
Aldo Cortesi
ac4e9f8cb5 Rationalize pathoc arguments, add -r flag to randomly select a request from the provided specs 2014-10-25 16:43:01 +13:00
Aldo Cortesi
384abbfdd5 Nicer port specification for pathoc 2014-10-25 16:34:19 +13:00
Aldo Cortesi
6d8431ab3e Allow specification of multiple patterns from file and on command line 2014-10-25 16:20:23 +13:00
Aldo Cortesi
d4e6c25d45 Update pyparsing 2014-10-25 15:37:57 +13:00
Aldo Cortesi
00d0ee5ad5 Parse patterns eagerly on instantiation 2014-10-25 15:30:54 +13:00
Aldo Cortesi
d6ee532711 Whitespace and formatting 2014-10-25 14:24:05 +13:00
Aldo Cortesi
5aadf92767 Nicer way to specify patterns read for file - just use a path 2014-10-25 08:18:39 +13:00
Aldo Cortesi
3de68da3ad Add forgotten import. Oops. 2014-10-24 17:21:28 +13:00
Aldo Cortesi
c6c0509836 Strictly separate argument parsing from main loops 2014-10-24 17:19:55 +13:00
Aldo Cortesi
cd481fdd14 Refactor and whitespace 2014-10-24 17:12:54 +13:00
Aldo Cortesi
962a414327 Fix tests, re-add scripts 2014-10-24 14:01:34 +13:00
Maximilian Hils
74a5600190 fix tests 2014-10-23 15:31:42 +02:00
Maximilian Hils
ed5e685565 refactor tcp close, fix mitmproxy/mitmproxy#376 2014-10-22 17:54:20 +02:00
Maximilian Hils
29a4e91050 fix mitmproxy/mitmproxy#375 2014-10-17 18:48:30 +02:00
Maximilian Hils
e6a8730f98 fix tcp closing for ssled connections 2014-10-09 04:42:39 +02:00
Maximilian Hils
60e3e0b898 fix pathod 2014-10-09 03:35:39 +02:00
Maximilian Hils
987fa22e64 make socks reading more bulletproof 2014-10-09 01:46:08 +02:00
Maximilian Hils
9ef84ccc1c clean up code 2014-10-09 00:15:39 +02:00
Maximilian Hils
14c9ba1af6 adjust to netlib changes 2014-10-08 20:48:16 +02:00
Maximilian Hils
fdb6f5552d CertStore: add support for cert chains 2014-10-08 20:46:30 +02:00
Maximilian Hils
274688172d fix mitmproxy/mitmproxy#373 2014-10-08 18:40:46 +02:00
Maximilian Hils
48fb49ee44 distutils -> setuptools 2014-10-02 00:05:29 +02:00
Maximilian Hils
aee8acbec6 distutils -> setuptools 2014-10-01 23:22:53 +02:00
Maximilian Hils
0426eccfd8 fix tests 2014-09-28 03:55:16 +02:00
Maximilian Hils
e73a2dbab1 minor changes 2014-09-28 03:15:26 +02:00
Maximilian Hils
d4bd2101b5 increment version 2014-09-28 03:14:59 +02:00
Maximilian Hils
7dbce3d260 update gitignore 2014-09-28 03:14:51 +02:00
Aldo Cortesi
0e30796469 Short-form getstate 2014-09-17 14:04:26 +12:00
Aldo Cortesi
414a0a1602 Adjust for state object protocol changes in mitmproxy. 2014-09-17 11:47:07 +12:00
Aldo Cortesi
b21df0cf44 Merge branch 'master' of ssh.github.com:cortesi/netlib 2014-09-09 10:10:10 +12:00
Aldo Cortesi
63c1efd394 Remove avoidable imports from OpenSSL
Fixes #38
2014-09-09 10:08:56 +12:00
Maximilian Hils
dd2adc791d improve distribution 2014-09-08 18:58:07 +02:00
Maximilian Hils
f90ea89e69 more verbose errors 2014-09-08 18:38:05 +02:00
Aldo Cortesi
14d7beee13 Merge pull request #16 from mitmproxy/dist
improve distribution
2014-09-08 20:40:36 +12:00
Aldo Cortesi
07990fdcc2 Better MANIFEST.in 2014-09-08 18:59:25 +12:00
Aldo Cortesi
211b0dfe1f Merge pull request #18 from mitmproxy/mitm_issue_341
adapt pathod to netlib changes
2014-09-07 13:05:35 +12:00
Aldo Cortesi
5dcc7f78df Merge pull request #34 from bbaetz/master
Change the criticality of a number of X509 extentions, to match
2014-09-07 12:50:36 +12:00
Aldo Cortesi
754b627937 Merge pull request #48 from mitmproxy/mitmproxy_issue_341
Adjust netlib to mitmproxy changes
2014-09-07 12:47:49 +12:00
Aldo Cortesi
f4013dcd40 Add a FIXME note for discarded credentials 2014-09-07 12:47:17 +12:00
Aldo Cortesi
52f430c934 Merge pull request #37 from pritambaral/urlparse
More accurate host, port parsing
2014-09-07 12:46:01 +12:00
Aldo Cortesi
f98989b075 Merge branch 'master' into mitmproxy_issue_341
Conflicts:
	netlib/tcp.py
2014-09-07 12:39:59 +12:00
Aldo Cortesi
c198406b12 Silence insecure requets warnings in our test package 2014-09-07 11:38:44 +12:00
Aldo Cortesi
b688661ffb Merge branch 'func' 2014-09-07 11:25:28 +12:00
Aldo Cortesi
3b81d678c4 Use print function after future import 2014-09-07 11:24:41 +12:00
Maximilian Hils
6114f07f76 adapt pathod to netlib changes 2014-09-06 01:23:07 +02:00
Maximilian Hils
c2e74ef95c Merge branch 'master' into mitmproxy_issue_341 2014-09-04 21:21:03 +02:00
Maximilian Hils
d9a731b23a make inequality comparison work 2014-09-04 19:18:43 +02:00
Maximilian Hils
4bf7f3c0ff set source_address if not manually specified 2014-09-04 16:55:02 +02:00
Maximilian Hils
ec628bc37d fix tcp.Address inequality comparison 2014-09-04 01:10:44 +02:00
Maximilian Hils
3d489f3bb7 adapt netlib.wsgi to changes in mitmproxy/mitmproxy#341 2014-09-03 17:15:50 +02:00
Maximilian Hils
658a56a1ac use setuptools entrypoints rather than scripts 2014-08-31 02:09:04 +02:00
Maximilian Hils
8d647739c3 Merge branch 'master' into dist
Conflicts:
	requirements.txt
	setup.py
2014-08-31 01:31:14 +02:00
Maximilian Hils
e9a838ae53 fix tests to be compatible with the latest requests version 2014-08-31 01:28:51 +02:00
Maximilian Hils
198d3c88a3 try hardererer to fix travis 2014-08-30 18:16:16 +02:00
Maximilian Hils
49bbc5f941 try harderer to fix travis 2014-08-30 18:12:34 +02:00
Maximilian Hils
e75f3746bb try harder to fix travis 2014-08-30 18:07:13 +02:00
Maximilian Hils
2b9a604351 fix travis 2014-08-30 17:40:33 +02:00
Maximilian Hils
a87f075f32 requirements.txt: use dependencies specified in setup.py 2014-08-19 15:38:38 +02:00
Maximilian Hils
534c66644f only require the minor version of netlib to match 2014-08-19 15:29:37 +02:00
Maximilian Hils
ef0e501877 fix #46 2014-08-19 13:48:52 +02:00
Maximilian Hils
f93cd6a335 always use with statement to open files 2014-08-16 18:35:58 +02:00
Maximilian Hils
6d1b601ddf minor cleanups 2014-08-16 15:53:07 +02:00
Maximilian Hils
1c1167eda0 use passlib instead of md5crypt 2014-08-16 15:28:09 +02:00
Maximilian Hils
5d5471e429 Merge pull request #15 from mitmproxy/stream
adjust to netlib api changes
2014-07-31 22:07:41 +02:00
Maximilian Hils
1b8529649c Merge pull request #42 from mitmproxy/stream
Stream
2014-07-31 22:05:44 +02:00
Maximilian Hils
cd9b740176 Merge pull request #44 from kronick/master
Made attribute optional (as it is in pyOpenSSL)
2014-07-31 02:01:49 +02:00
kronick
197dae9183 Made attribute optional (as it is in pyOpenSSL)
See 0d7e8a1af2 -- It looks like this constant isn't set on some platforms (including Raspberry Pi's libssl)
2014-07-29 15:12:13 +02:00
Maximilian Hils
a0c8b20b7d adjust to netlib api changes 2014-07-21 14:08:09 +02:00
Maximilian Hils
254a686235 Merge branch 'master' into stream
Conflicts:
	netlib/http.py
2014-07-21 14:02:56 +02:00
Maximilian Hils
6bd5df79f8 refactor response length handling 2014-07-21 14:01:24 +02:00
Maximilian Hils
d382bb27bf certstore: add support for asterisk form to DNTree replacement 2014-07-19 00:02:31 +02:00
Maximilian Hils
cba927885e fix tests 2014-07-18 23:08:29 +02:00
Maximilian Hils
a7837846a2 temporarily replace DNTree with a simpler cert lookup mechanism, fix mitmproxy/mitmproxy#295 2014-07-18 22:55:25 +02:00
Brad Peabody
280d9b8625 added some additional functions for dealing with chunks - needed for mitmproxy streaming capability 2014-07-17 22:34:29 -07:00
Maximilian Hils
55c2133b69 add test case for mitmproxy/mitmproxy#295 2014-07-17 01:47:24 +02:00
Maximilian Hils
24ef9c61a3 improve docs 2014-07-14 17:38:49 +02:00
Maximilian Hils
c78b426c2a Merge pull request #40 from bradleypeabody/master
added option for read_response to only read the headers
2014-07-14 17:21:08 +02:00
Brad Peabody
273c25a705 added option for read_response to only read the headers, beginnings of implementing streamed result in mitmproxy 2014-07-12 22:42:06 -07:00
Maximilian Hils
4d5d8b6511 mark nsCertType non-critical, fix #39 2014-06-29 13:10:07 +02:00
Maximilian Hils
dfabe165d4 socks: 100% test coverage 2014-06-25 21:45:45 +02:00
Maximilian Hils
896e1a5524 fix overly restrictive tests 2014-06-25 21:31:10 +02:00
Maximilian Hils
e69133f98c remove ntop windows workaround 2014-06-25 21:16:47 +02:00
Maximilian Hils
6405595ae8 socks module: polish, add tests 2014-06-25 20:31:28 +02:00
Maximilian Hils
dc3d3e5f0a add inet_ntop/inet_pton functions 2014-06-25 20:31:10 +02:00
Maximilian Hils
217660f5db add socks module 2014-06-25 14:30:42 +02:00
Pritam Baral
dc071c4ea7 Ignore username:password part in url 2014-05-28 07:10:10 +05:30
Maximilian Hils
66ac56509f add support for ctx.load_verify_locations, refs mitmproxy/mitmproxy#174 2014-05-21 01:14:55 +02:00
Maximilian Hils
52c6ba8880 properly subclass Exception in HTTPError 2014-05-15 18:15:29 +02:00
Maximilian Hils
71834aeab1 make cert and key mandatory 2014-05-15 14:15:33 +02:00
Maximilian Hils
a8345af282 extract cert creation to be accessible in handle_sni callbacks 2014-05-15 13:51:59 +02:00
Maximilian Hils
92081eee04 Update certutils.py
refs mitmproxy/mitmproxy#200
2014-04-25 19:40:37 +02:00
Maximilian Hils
c2c952b3cc make error message example less abstract. 2014-03-31 12:44:20 +02:00
Maximilian Hils
10ef03d85a Merge pull request #35 from droope/patch-1
Change odict error message.
2014-03-31 12:40:40 +02:00
Pedro Worcel
bb10dfc505 Instead of removing the error, for consistency, leaving the error as-was
and replaced the message with something that may or may not be more
understandable :P
2014-03-31 20:19:23 +13:00
Pedro Worcel
e7c3e4c5ac Change error into awesome user-friendlyness
Hi there,

I was getting a very weird error "ODict valuelist should be lists", when attempting to add a header.

My code was as followed:

```
        msg.headers["API-Key"] = new_headers["API-Key"]                                                                                                                                                                              
 42         msg.headers["API-Sign"] = new_headers["API-Sign"]
```

In the end, that was because there could be multiple equal headers. In order to cater to that, it you guys might enjoy the patch I attach, for it converts strings automatically into lists of multiple headers.

I think it should work, but I haven't tested it :$

It'd allow me to have the above code, instead of this one below:

```
        msg.headers["API-Key"] = [new_headers["API-Key"]]                                                                                                                                                                               
 42         msg.headers["API-Sign"] = [new_headers["API-Sign"]]
```
2014-03-30 20:58:47 +13:00
Bradley Baetz
d8f54c7c03 Change the criticality of a number of X509 extentions, to match
the RFCs and real-world CAs/certs.

This improve compatability with older browsers/clients.
2014-03-20 11:12:11 +11:00
Maximilian Hils
a3107474f9 Merge pull request #31 from mitmproxy/fix_dhparam_gen
create dhparam file if it doesn't exist, fix mitmproxy/mitmproxy#235
2014-03-12 01:17:40 +01:00
Maximilian Hils
34e469eb55 create dhparam file if it doesn't exist, fix mitmproxy/mitmproxy#235 2014-03-11 20:23:27 +01:00
Maximilian Hils
4bd15a28b7 fix #28 2014-03-10 17:43:39 +01:00
Aldo Cortesi
f5cc63d653 Certificate flags 2014-03-10 17:29:27 +13:00
Aldo Cortesi
ca97aed4b8 Adjust timeout test to make race condition much less likely. 2014-03-10 17:19:46 +13:00
Aldo Cortesi
2a12aa3c47 Support Ephemeral Diffie-Hellman 2014-03-07 16:38:50 +13:00
Aldo Cortesi
9cc83ed9a8 Also dump SANs for pathoc -S 2014-03-07 15:21:34 +13:00
Aldo Cortesi
52b14aa1d1 CertStore: cope with certs that have no common name 2014-03-05 17:29:14 +13:00
Aldo Cortesi
e54bf1a804 Adjust for upstream cert store changes, improve cert handling significantly 2014-03-05 15:03:31 +13:00
Aldo Cortesi
86730a9a4c Handler convert_to_ssl now takes a key object, not a path. 2014-03-05 13:43:52 +13:00
Aldo Cortesi
0c3bc1cff2 Much more sophisticated certificate store
- Handle wildcard lookup
- Handle lookup of SANs
- Provide hooks for registering override certs and keys for specific
domains (including wildcard specifications)
2014-03-05 13:19:16 +13:00
Aldo Cortesi
7c82418e0b Beef up CertStore, add DH params. 2014-03-04 14:12:58 +13:00
Aldo Cortesi
d56f7fba80 We now require PyOpenSSL >= 0.14 2014-03-02 22:14:33 +13:00
Aldo Cortesi
944f213ebc Add connection cipher info to pathod server log 2014-03-02 22:10:49 +13:00
Aldo Cortesi
602e400ccc Use new get_current_cipher to show cipher in pathoc SSL output 2014-03-02 21:54:30 +13:00
Aldo Cortesi
cfaa3da25c Use PyOpenSSL's underlying ffi interface to get current cipher for connections. 2014-03-02 21:37:28 +13:00
Aldo Cortesi
53334e437c pathoc -S dumps information on the remote SSL certificate chain 2014-03-02 19:04:56 +13:00
Aldo Cortesi
1acaf1c880 Re-add state operations to ODict. 2014-03-02 16:54:21 +13:00
Aldo Cortesi
e381c03668 Cleanups, tests, and no-cover directives for code sections we can't test. 2014-03-02 16:47:10 +13:00
Aldo Cortesi
0177eb899a Support cert/key combo files in args. Improve argument names in SSLOptions 2014-03-02 15:56:36 +13:00
Aldo Cortesi
234d326080 Implement custom certs. 2014-03-02 15:13:56 +13:00
Aldo Cortesi
7788391903 Minor improvement to CertStore interface 2014-03-02 13:50:19 +13:00
Aldo Cortesi
091e539a02 Big improvements to SSL handling
- pathod now dynamically generates SSL certs, using the ~/.mitmproxy
cacert
- pathoc returns data on SSL peer certificates
- Pathod certificate CN can be specified on command line
- Support SSLv23
2014-03-02 13:45:35 +13:00
Aldo Cortesi
3443bae94e Cipher suite selection for client connections, improved error handling 2014-02-27 18:35:16 +13:00
Aldo Cortesi
a1d0da2b53 Expand SSL support
- Cipher suite selection for both pathoc and pathod
- SSL version specification for pathod
- Expose SSLv23 as an option, and use it by default
2014-02-27 18:33:48 +13:00
Aldo Cortesi
0e867adcf2 Merge branch 'master' of ssh.github.com:cortesi/netlib 2014-02-26 10:10:27 +13:00
Aldo Cortesi
49f29ce8ef Add an explicit license file.
Fixes #30
2014-02-26 10:09:36 +13:00
Maximilian Hils
c276b4294c allow super() on TCPServer, add thread names for better debugging 2014-02-15 23:16:28 +01:00
Maximilian Hils
a72ae4d85c Bump version
Do it now already so that mitmproxy will warn the user if netlib is not from master.
2014-02-11 12:09:58 +01:00
Maximilian Hils
0c04abb6e4 fix pathod main script 2014-02-08 22:42:27 +01:00
Maximilian Hils
505d396495 run tests against netlib master again. refs #12 2014-02-06 23:02:48 +01:00
Aldo Cortesi
0baa296613 Merge branch 'tcp_proxy' 2014-02-07 10:50:57 +13:00
Aldo Cortesi
3d52d16e8d Merge branch 'tcp_proxy' 2014-02-07 10:50:23 +13:00
Maximilian Hils
7fc544bc7f adjust netlib.wsgi to reflect changes in mitmproxys flow format 2014-02-05 21:34:14 +01:00
Maximilian Hils
0bbc40dc33 store used sni in TCPClient, add equality check for tcp.Address 2014-02-04 04:51:41 +01:00
Maximilian Hils
dc45b4bf19 move StateObject back into libmproxy 2014-01-31 01:06:53 +01:00
Maximilian Hils
ff9656be80 remove subclassing of tuple in tcp.Address, move StateObject into netlib 2014-01-30 20:07:30 +01:00
Maximilian Hils
b64e1ccf91 adjust for netlib.tcp.Address changes 2014-01-30 20:06:33 +01:00
Maximilian Hils
e18ac4b672 re-add server attribute to BaseHandler 2014-01-28 20:30:16 +01:00
Aldo Cortesi
1572d14cc3 Merge branch 'master' of ssh.github.com:mitmproxy/pathod 2014-01-29 08:19:25 +13:00
Maximilian Hils
b994fb5a27 adjust to signature changes in netlib.tcp 2014-01-28 19:28:20 +01:00
Maximilian Hils
1b566869de Merge branch 'master' into tcp_proxy 2014-01-28 17:44:55 +01:00
Maximilian Hils
763cb90b66 add tcp.Address to unify ipv4/ipv6 address handling 2014-01-28 17:26:35 +01:00
Aldo Cortesi
dc6d573d39 Adjust docs for inclusion of content-length header by default. 2014-01-28 15:31:30 +13:00
Maximilian Hils
ea894282f3 move test requirements out of main requirements.txt 2014-01-28 03:21:59 +01:00
Aldo Cortesi
404d4bbc69 Merge branch 'master' of ssh.github.com:cortesi/netlib 2014-01-28 15:14:01 +13:00
Aldo Cortesi
9c9e4a5295 travis irc notifications 2014-01-28 15:13:31 +13:00
Aldo Cortesi
7815b3fb41 travis: unbreak, and add irc notifications 2014-01-28 15:02:34 +13:00
Maximilian Hils
9759ec7c29 move test requirements out of main requirements.txt 2014-01-28 02:57:46 +01:00
Aldo Cortesi
732932e8bb Try even harderer to fix travis. 2014-01-28 14:42:39 +13:00
Aldo Cortesi
11f729a3a3 Try harder to un-break travis 2014-01-28 14:32:30 +13:00
Aldo Cortesi
5ba36622f0 travis: force install of pathod from git. 2014-01-28 14:22:01 +13:00
Aldo Cortesi
2aadea0b7c Fix homepage URL 2014-01-28 14:09:45 +13:00
Aldo Cortesi
26d6b189fc Pyflakes cleanup, adjust requirements.txt 2014-01-19 18:20:01 +13:00
Aldo Cortesi
8266699acd Silence pyflakes, adjust requirements.txt 2014-01-19 18:17:06 +13:00
Aldo Cortesi
25ed5537da Bump version. 2014-01-19 16:03:51 +13:00
Maximilian Hils
71c1017575 Merge branch 'master' into tcp_proxy 2014-01-18 22:55:51 +01:00
Maximilian Hils
0f22039bca add CONNECT request to list of request types that don't have a response body 2014-01-18 22:55:40 +01:00
Maximilian Hils
7e4f28e82a Merge branch 'master' into tcp_proxy 2014-01-09 18:06:22 +01:00
Maximilian Hils
f83508d4bf Merge branch 'master' into tcp_proxy 2014-01-09 18:06:12 +01:00
Maximilian Hils
d31b7daf6c change method signature 2014-01-09 18:04:04 +01:00
Maximilian Hils
53e9b37675 display build status from master branch 2014-01-09 17:39:30 +01:00
Maximilian Hils
85e0927820 display build status from master branch 2014-01-09 17:38:39 +01:00
Maximilian Hils
d0a6d2e254 fix tests, remove duplicate code 2014-01-09 05:33:21 +01:00
Maximilian Hils
b0b93d1c3e Merge remote-tracking branch 'origin/master' into tcp_proxy 2014-01-09 01:57:50 +01:00
Maximilian Hils
951f2d517f change parameter names to reflect changes 2014-01-09 01:57:37 +01:00
Aldo Cortesi
ac1a700fa1 Make certificate not-before time 48 hours.
Fixes #200
2014-01-08 14:46:55 +13:00
Aldo Cortesi
a9f8dcf755 Merge pull request #11 from mitmproxy/refactor_read_http_body
always return Content-Length: 0 if r is not set
2014-01-04 14:48:12 -08:00
Aldo Cortesi
1c6f714193 Merge pull request #26 from mitmproxy/refactor_read_http_body
refactor http.read_http_body
2014-01-04 14:37:34 -08:00
Aldo Cortesi
5717e7300c Make it possible to pass custom environment variables into wsgi apps. 2014-01-05 10:57:50 +13:00
Maximilian Hils
c7606ffdf9 list mock as requirement (via @droope) 2013-12-29 10:52:37 +01:00
Aldo Cortesi
467ef0c02a Merge branch 'master' of ssh.github.com:mitmproxy/pathod 2013-12-17 14:32:56 +13:00
Aldo Cortesi
8229c3884f Ability to specify SSL/TLS version 2013-12-17 14:32:41 +13:00
Maximilian Hils
e0d376381e fix windows compatibility 2013-12-16 04:47:29 +01:00
Maximilian Hils
210e0c891e Merge branch 'master' into refactor_read_http_body 2013-12-16 03:59:52 +01:00
Maximilian Hils
34f5f5a5c1 add travis CI file & requirements.txt 2013-12-16 03:58:46 +01:00
Maximilian Hils
cebec67e08 refactor read_http_body 2013-12-15 06:43:54 +01:00
Maximilian Hils
7049becdfe always return Content-Length: 0 if r is not set 2013-12-15 06:42:58 +01:00
Maximilian Hils
0187d92ec0 test tcpclient.source_address, increase coverage 2013-12-14 00:19:24 +01:00
Maximilian Hils
9ea4646262 use markdown for readme 2013-12-13 15:09:42 +01:00
Maximilian Hils
f2e8efdf15 merge smurfix/ipv6, add ipv6 support for TCPServer, add ipv6 test 2013-12-13 15:04:38 +01:00
Maximilian Hils
969595cca7 add requirements.txt, small changes 2013-12-13 06:24:08 +01:00
Maximilian Hils
22aae5fb66 add travis CI file 2013-12-13 06:15:32 +01:00
Matthias Urlichs
6f26cec83e tab fix 2013-12-12 07:11:13 +01:00
Matthias Urlichs
a7ac97eb82 support ipv6 2013-12-12 07:00:58 +01:00
Aldo Cortesi
d66fd5ba1b Bump version 2013-12-10 22:20:12 +13:00
Aldo Cortesi
4840c6b3bf Fix race condition in test suite. 2013-12-08 15:26:30 +13:00
Maximilian Hils
bae2b6ea36 fix AuthAction tests failures from last merge 2013-12-08 02:24:00 +01:00
Maximilian Hils
64139a1e7e merge origin/master 2013-12-08 01:39:50 +01:00
Maximilian Hils
390f2a46c9 make AuthAction generic 2013-12-08 01:37:45 +01:00
Aldo Cortesi
7213f86d49 Unit test auth actions. 2013-12-08 13:35:42 +13:00
Aldo Cortesi
d05c20d8fa Domain checks for persistent cert store is now irrelevant.
We no longer store these on disk, so we don't care about path
components.
2013-12-08 13:15:08 +13:00
Aldo Cortesi
75745cb0af Zap stray print in tests. 2013-12-08 13:04:27 +13:00
Aldo Cortesi
98a580cf69 Merge pull request #19 from rouli/ciphersuites
adding cipher list selection option to BaseHandler
2013-12-07 15:51:44 -08:00
Aldo Cortesi
af8f98d493 Merge pull request #22 from fictivekin/custom-o-cn
allow specification of o, cn, expiry
2013-12-07 15:42:54 -08:00
Aldo Cortesi
ed74b62856 Merge branch 'fix_invalid_tcp_close' 2013-12-08 10:15:43 +13:00
Aldo Cortesi
5aad09ab81 Fix client certificate request feature. 2013-12-08 10:15:19 +13:00
Aldo Cortesi
bed2aed9db Merge branch 'master' of ssh.github.com:cortesi/netlib 2013-11-21 13:09:11 +13:00
Maximilian Hils
e402e3b862 add custom argparse actions to seamlessly integrate ProxyAuth classes 2013-11-21 01:07:56 +01:00
Maximilian Hils
643602c066 Merge branch 'fix_windows_bugs' into fix_invalid_tcp_close 2013-11-19 05:03:10 +01:00
Maximilian Hils
5e4ccbd7ed attempt to fix #24 2013-11-19 04:11:24 +01:00
Aldo Cortesi
07e970346f Merge branch 'master' of ssh.github.com:cortesi/netlib 2013-10-18 08:17:39 +13:00
Maximilian Hils
d081b058e6 Merge pull request #23 from fictivekin/minor-cleanup
remove tempfile and shutil imports because they're not actually used
2013-10-07 14:12:39 -07:00
Sean Coates
642b3f002e remove tempfile and shutil imports because they're not actually used 2013-10-07 16:55:35 -04:00
Sean Coates
53b7c5abdd allow specification of o, cn, expiry 2013-10-07 16:48:30 -04:00
Maximilian Hils
447281b5b1 Merge pull request #21 from hackedd/patch-2
Don't create a certificate request when creating a dummy cert
2013-09-24 12:30:57 -07:00
Paul
98f765f693 Don't create a certificate request when creating a dummy cert 2013-09-24 21:18:41 +02:00
Aldo Cortesi
c4e6d7aea6 Merge branch 'master' of ssh.github.com:mitmproxy/pathod 2013-08-25 10:46:11 +12:00
Aldo Cortesi
d285508994 Fix download link. 2013-08-25 10:45:16 +12:00
Aldo Cortesi
a424eff309 Version bump and changelog. 2013-08-25 10:34:14 +12:00
Aldo Cortesi
8a261b2c01 Bump version. 2013-08-25 10:30:48 +12:00
Aldo Cortesi
7428f95474 Handle interrupted system call errors. 2013-08-25 10:22:09 +12:00
Israel Nir
d5b3e397e1 adding cipher list selection option to BaseHandler 2013-08-21 13:42:30 +03:00
Maximilian Hils
28a0030c1e compatibility fixes for windows 2013-08-19 19:41:20 +02:00
Maximilian Hils
42aede6181 ensure binary read on windows 2013-08-19 19:21:47 +02:00
Maximilian Hils
db2e7fde37 add PyCharm to gitignore 2013-08-19 19:21:32 +02:00
Maximilian Hils
c44f354fd0 fix windows bugs 2013-08-17 16:15:37 +02:00
Maximilian Hils
0fed8dc8eb update gitignore to not include PyCharms 2013-08-17 14:44:57 +02:00
Aldo Cortesi
19c55361c8 Adapt to new cert storage API. 2013-08-12 16:05:07 +12:00
Aldo Cortesi
62edceee09 Revamp dummy cert generation.
We no longer use on-disk storage - we just keep the certs in memory.
2013-08-12 16:03:29 +12:00
Aldo Cortesi
2da57ecff0 Correct order of precedence for SSL errors. 2013-08-11 11:47:07 +12:00
Aldo Cortesi
b9f06b473c Better handling of cert errors. 2013-08-10 23:07:09 +12:00
Aldo Cortesi
f5fdfd8a9f Clarify the interface for flush and close methods. 2013-07-30 09:42:13 +12:00
Aldo Cortesi
6709253629 Merge pull request #16 from mitmproxy/fix_socket_buffer
attempt to fix 'half-duplex' TCP close sequence
2013-07-28 14:55:40 -07:00
Aldo Cortesi
ef2f099c08 Merge pull request #17 from AndreyPlotnikov/master
Socket binding support for TCPClient
2013-07-22 14:45:27 -07:00
Andrey Plotnikov
02376b6a75 Add socket binding support for TCPClient 2013-07-07 13:33:56 +08:00
Maximilian Hils
68e2e782b0 attempt to fix 'half-duplex' TCP close sequence 2013-06-17 17:03:17 +02:00
Aldo Cortesi
3defe0cbb1 Bump version. 2013-06-16 15:31:25 +12:00
Aldo Cortesi
73f8a1e2e0 Bump version. 2013-06-16 13:38:39 +12:00
Aldo Cortesi
868d8278e6 Merge branch 'master' of ssh.github.com:cortesi/pathod 2013-06-16 11:00:22 +12:00
Aldo Cortesi
27092454bf Merge pull request #10 from mhils/master
always read files in binary mode
2013-06-15 15:35:57 -07:00
Aldo Cortesi
00cf889837 Merge pull request #15 from mhils/fix_binary_rw
always read files in binary mode
2013-06-15 15:35:36 -07:00
Aldo Cortesi
698f6f198d Merge pull request #14 from mhils/commonname_invalid_chars
add test case for invalid characters in cert commonnames
2013-06-15 15:35:25 -07:00
Maximilian Hils
0382b809ea always read files in binary mode 2013-06-16 00:30:13 +02:00
Maximilian Hils
c9ab1c60b5 always read files in binary mode 2013-06-16 00:28:21 +02:00
Maximilian Hils
f02c04d9d8 add test case for invalid characters in cert commonnames 2013-06-14 20:46:14 +02:00
Aldo Cortesi
b8e9fdf637 Changelog. 2013-05-15 19:06:12 +12:00
Aldo Cortesi
9e7f08acea Download path, version flags for both tools. 2013-05-15 18:56:05 +12:00
Aldo Cortesi
c65ab6961d Layout and docs. 2013-05-15 08:47:19 +12:00
Aldo Cortesi
d698ee50a7 Add MANIFEST.in 2013-05-15 08:36:22 +12:00
Aldo Cortesi
5eeb52183a Adapt for new request_client_cert option in netlib. 2013-05-13 09:03:48 +12:00
Aldo Cortesi
7f0aa415e1 Add a request_client_cert argument to server SSL conversion.
By default, we now do not request the client cert. We're supposed to be able to
do this with no negative effects - if the client has no cert to present, we're
notified and proceed as usual.  Unfortunately, Android seems to have a bug
(tested on 4.2.2) - when an Android client is asked to present a certificate it
does not have, it hangs up, which is frankly bogus.  Some time down the track
we may be able to make the proper behaviour the default again, but until then
we're conservative.
2013-05-13 08:48:21 +12:00
Aldo Cortesi
9c13224353 Fix exception hierarchy. 2013-05-05 13:49:20 +12:00
Aldo Cortesi
3217fcad14 Doc layout refactoring. 2013-05-02 09:11:16 +12:00
Aldo Cortesi
0504bcfd96 Changelog, minor cleanups. 2013-04-30 09:32:11 +12:00
Aldo Cortesi
0ae37c7b79 Merge pull request #13 from a2800276/extension_set_version
extensions aren't supported in v1, set to v3 (value=2) if using them.
2013-04-19 17:23:50 -07:00
Tim Becker
241465c368 extensions aren't supported in v1, set to v3 (value=2) if using them. 2013-04-19 15:37:14 +02:00
Aldo Cortesi
beb47eba51 Sync version number with mitmproxy. 2013-03-05 09:11:19 +13:00
Aldo Cortesi
a94d17970e Sync version number with mitmproxy. 2013-03-05 09:09:52 +13:00
Aldo Cortesi
5f0ad7b2a6 Ensure that HTTP methods are ASCII. 2013-03-03 22:13:23 +13:00
Aldo Cortesi
5a050bb6b2 Tighten up checks on port ranges and path character sets. 2013-03-03 21:39:15 +13:00
Aldo Cortesi
110a8bb594 Print pathod craft explanations to stdout. 2013-03-03 16:33:50 +13:00
Aldo Cortesi
b21a7da142 parse_url: Handle invalid IPv6 addresses 2013-03-03 15:12:58 +13:00
Aldo Cortesi
7b9300743e More parse_url solidification: check that port is in range 0-65535 2013-03-03 15:08:17 +13:00
Aldo Cortesi
cd4ed8530f Check that hosts in parse_url do not contain NULL bytes. 2013-03-03 15:03:57 +13:00
Aldo Cortesi
2897ddfbee Stricter error checking for http.parse_url 2013-03-03 14:52:06 +13:00
Aldo Cortesi
1fe1a802ad 100% test coverage. 2013-03-03 12:16:09 +13:00
Aldo Cortesi
0acab862a6 Integrate HTTP auth, test to 100% 2013-03-03 10:37:28 +13:00
Aldo Cortesi
97537417f0 Factor out http.parse_response_line 2013-03-02 16:57:38 +13:00
Aldo Cortesi
155710f991 Improve robustness of proxy CONNECT, test coverage to 100%. 2013-03-02 16:57:00 +13:00
Aldo Cortesi
0fa6351965 ODict.keys 2013-02-28 09:28:48 +13:00
Aldo Cortesi
9167b9b8b6 Make pathoc request return more human-friendly. 2013-02-27 09:07:16 +13:00
Aldo Cortesi
25656f4889 Adapt for new netlib SNI API. 2013-02-27 09:05:05 +13:00
Aldo Cortesi
f30df13384 Make sni_handler an argument to BaseHandler.convert_to_ssl 2013-02-25 21:11:09 +13:00
Aldo Cortesi
ba0caff2dc Wrap webapp in a creation function.
This lets us spawn multiple instances of Pathod.
2013-02-24 19:42:40 +13:00
Aldo Cortesi
69339836c2 Adapt to netlib API changes. 2013-02-24 15:36:35 +13:00
Aldo Cortesi
97e11a219f Housekeeping and cleanup, some minor argument name changes. 2013-02-24 15:36:15 +13:00
Aldo Cortesi
c6f9a2d74d More accurate description of an HTTP read error, make pyflakes happy. 2013-02-24 11:08:43 +13:00
Aldo Cortesi
9c9e15341f Make last_log return None if nothing is logged. 2013-02-23 21:46:01 +13:00
Aldo Cortesi
7d18535665 100% test coverage 2013-01-27 19:21:18 +13:00
Aldo Cortesi
7433dfceae Bump unit tests, fix two serious wee buglets discovered. 2013-01-26 21:29:45 +13:00
Aldo Cortesi
e5b125eec8 Introduce the mock module to improve unit tests.
There are a few socket corner-cases that are incredibly hard to reproduce in a
unit test suite, so we use mock to trigger the exceptions instead.
2013-01-26 21:19:35 +13:00
Aldo Cortesi
cc4867064b Streamline netlib.test API 2013-01-25 16:03:59 +13:00
Aldo Cortesi
2eb6651e51 Extract TCP test utilities into netlib.test 2013-01-25 15:54:41 +13:00
Aldo Cortesi
5288848d03 Adjust docs, old -C is now -I. 2013-01-21 09:36:20 +13:00
Aldo Cortesi
9bd269c26a Add support for client certificates
- pathod request logs now include a clientcert member with details on the
client cert, or None if there wasn't one.
- pathoc has a -C option to specify a client certificate
2013-01-20 22:37:43 +13:00
Aldo Cortesi
7248a22d5e Improve error signalling for client certificates. 2013-01-20 22:36:54 +13:00
Aldo Cortesi
00d20abdd4 Beef up client certificate handling substantially. 2013-01-20 22:13:38 +13:00
Aldo Cortesi
1499529e62 Fix client cert typo. 2013-01-18 17:07:35 +13:00
Aldo Cortesi
ad92d37147 Merge pull request #8 from rouli/master
Improving timestamp feature
2013-01-16 19:15:39 -08:00
Rouli
04048b4c73 renaming the timestamp in preparation of other timestamps that will be added later, adding tests 2013-01-16 22:30:19 +02:00
Aldo Cortesi
f673cfed63 Merge pull request #7 from rouli/master
Adding read timestamp
2013-01-14 10:02:17 -08:00
Israel Nir
10457e876a adding read timestamp to enable better resolution of when certain reads were performed (timestamp is updated when the first byte is available on the network) 2013-01-10 15:51:37 +02:00
Aldo Cortesi
e4acace8ea Sanity-check certstore common names. 2013-01-06 01:34:39 +13:00
Aldo Cortesi
91834ea78f Generate certificates with a commencement date an hour in the past.
This helps smooth over small discrepancies in client and server times, where
it's possible for a certificate to seem to be "in the future" to the client.
2013-01-06 01:16:58 +13:00
Aldo Cortesi
72032d7fe7 Basic certificate store implementation and cert utils API cleanup. 2013-01-06 01:16:25 +13:00
Aldo Cortesi
369b55b094 Docs - pathoc and pathod proxy behaviour 2013-01-05 20:46:31 +13:00
Aldo Cortesi
ed7ef84557 Implement and unit test not-after-connect option. 2013-01-05 20:36:06 +13:00
Aldo Cortesi
5493925ea0 CONNECT through proxy mode for pathoc
Also, use this to unit test the pathod CONNECT implementation.
2013-01-05 20:29:46 +13:00
Aldo Cortesi
a9a4064ff9 Unit test for ODict.__iter__ 2013-01-05 20:08:48 +13:00
Aldo Cortesi
d3b46feb60 Handle non-integer port error in parse_init_connect correctly 2013-01-05 20:06:55 +13:00
Aldo Cortesi
c744ef2dcb Proxy mode: drop to SSL if we see an HTTP CONNECT request 2013-01-05 17:15:42 +13:00
Aldo Cortesi
1e932e7045 Collect SSL options into an SSLOptions object
Also split SSL cert specifications from SSL service mode - we can now enter SSL
service mode through a proxy CONNECT request as well.
2013-01-05 16:48:49 +13:00
Aldo Cortesi
3886ccae93 Provisional proxy mode support for pathod. 2013-01-05 15:25:09 +13:00
Aldo Cortesi
ddc08efde1 Minor cleanup of http.parse_init* methods. 2013-01-04 14:23:52 +13:00
Aldo Cortesi
d7f641c6ee Shift SSL parameters into Pathoc class 2013-01-04 10:37:26 +13:00
Aldo Cortesi
bb317051a4 Merge branch 'master' of ssh.github.com:cortesi/netlib 2013-01-03 14:05:33 +13:00
Aldo Cortesi
082f398b8f Add getcertnames, a tool for retrieving the CN and SANs from a remote server. 2013-01-03 13:54:54 +13:00
Aldo Cortesi
b07ab253b7 Require requests > 1.0.4
This changes the API slightly, since json is now a method, not a property.
2012-12-31 12:23:42 +13:00
Aldo Cortesi
06d4ed9ba1 Merge pull request #4 from mhils/master
Add __iter__ to ODict
2012-12-04 19:33:05 -08:00
Maximilian Hils
043d05bcde add __iter__ for odict 2012-12-05 04:03:39 +01:00
Aldo Cortesi
781592d6c0 Fix timeout test. 2012-11-18 09:34:15 +13:00
Aldo Cortesi
e40482576c Add disconnect specifiers to test suite.
Fixes hangs seen in test suite with recent versions of requetss.
2012-11-18 09:04:49 +13:00
Aldo Cortesi
b11260f064 Expand basic fuzzing example. 2012-11-16 15:00:15 +13:00
Aldo Cortesi
5fb31f9162 Add :u shortcut example.
Update trove specifiers, netlib dependency.
2012-11-16 14:51:31 +13:00
Aldo Cortesi
af698b2fda :u belongs on Request not Response 2012-11-16 14:41:02 +13:00
Aldo Cortesi
39fcc600a6 Update changelog. 2012-11-16 14:22:20 +13:00
Aldo Cortesi
ef9cbe3b25 Add u User-agent shortcut.
Usage:
    200:ua       - Shortcut "a" for Android.
    200:u"foo"   - Or a value literal

Shortcuts can be listed using the --show-uas argument to pathoc.
2012-11-16 13:46:42 +13:00
Aldo Cortesi
5d18830f71 Fix typo. 2012-11-02 14:36:19 +13:00
Aldo Cortesi
791252ac5e Examples and documentation. 2012-11-02 14:22:54 +13:00
Aldo Cortesi
f8e10bd6ae Bump version. 2012-10-31 22:26:09 +13:00
Aldo Cortesi
3ca3e7c485 Merge branch 'master' of ssh.github.com:cortesi/pathod 2012-10-31 12:44:17 +13:00
Aldo Cortesi
27d90a3594 Bump version, update CHANGELOG 2012-10-31 12:37:11 +13:00
Aldo Cortesi
3e3c5af006 Bump version, update CHANGELOG 2012-10-31 12:32:13 +13:00
Aldo Cortesi
3f50930dc0 Use .freeze to implement the -e explain flags for pathod and pathoc.
This now prints (in pathoc) or logs (in pathod) a frozen specification that
includes an expanded record of all generated values and locations.
2012-10-31 11:34:58 +13:00
Aldo Cortesi
8c6cc8140c Fix generated values in request path specification. 2012-10-31 09:48:55 +13:00
Aldo Cortesi
0c9cfb3f38 Add a .freeze() method to all components.
This expands and freezes all randomly generated values. The message returned
can be queried for a precise spec to reproduce the message.
2012-10-31 09:32:21 +13:00
Aldo Cortesi
f8df0a1e75 Add a .values method to messages, simplify a lot of stuff as a consequence. 2012-10-30 16:08:36 +13:00
Aldo Cortesi
a09584b9e6 Make Message classes more self-contained. 2012-10-30 15:22:53 +13:00
Aldo Cortesi
b2deb470de Extract .serve() method from message classes. 2012-10-30 14:46:18 +13:00
Aldo Cortesi
677f0e0580 Change preview_safe to return a safe copy of the current message. 2012-10-30 13:36:32 +13:00
Aldo Cortesi
a1f782b543 Simplify Request/Response class hierarchy. 2012-10-30 13:28:22 +13:00
Aldo Cortesi
3e0cd6442a Add .spec methods for Request and Response objects. 2012-10-29 17:33:10 +13:00
Aldo Cortesi
747eafd107 Add a .spec method to the token ABC, and to all tokens. 2012-10-29 16:31:35 +13:00
Aldo Cortesi
8741600ce7 Refactoring: canonical storage of a message is now the sequence of tokens that defines it.
We use a set of accessor properties to ease access to tokens. We can now ditch
the .accept() methods.
2012-10-29 15:16:44 +13:00
Aldo Cortesi
882969086c Cleaup, some more ABCs. 2012-10-29 10:19:58 +13:00
Aldo Cortesi
61f8992fbf Change response spec format to code[:features]
Reason message is now specified as just another feature with the "m" mnemonic.
2012-10-28 22:18:06 +13:00
Aldo Cortesi
07560ffe30 Cleaup, ABC for Value classes. 2012-10-28 22:00:19 +13:00
Aldo Cortesi
35f37626a9 Clean up .accept() signature. 2012-10-28 17:39:58 +13:00
Aldo Cortesi
7d74f75f6d Split Code and Reason into separate _Component objects. 2012-10-28 17:07:16 +13:00
Aldo Cortesi
e9af434c2b .body and .method to lazy generator instantiation.
Also introduce a _Component ABC.
2012-10-28 14:15:29 +13:00
Aldo Cortesi
9d42a06c92 Move message body to new lazy-generator scheme. 2012-10-28 12:56:08 +13:00
Aldo Cortesi
f54ed69a35 Adjust serve() API. 2012-10-28 09:06:55 +13:00
Aldo Cortesi
ac5aacce44 Remove check argument to serve() methods.
Refactoring means we can now do this without a callback.

Also introduce the maximum_length method that estimates the max possible
message length.
2012-10-27 17:40:22 +13:00
Aldo Cortesi
06864e5a1b Major refactoring towars separate representation of expressions and request/response service. 2012-10-27 14:00:50 +13:00
Aldo Cortesi
6174e46023 Unit test suite love: 100% coverage
Also start figuring out how to sanitize binary data in the JSON API.
2012-10-25 10:59:18 +13:00
Aldo Cortesi
173b5c596e Start moving policy checks to service-time, rather than parse-time. 2012-10-25 09:45:55 +13:00
Aldo Cortesi
c684f7417d Extend Action and Value classes
- Values now know how to print their own specs
- Actions now know how to print their own specs
- Actions have a resolve_offset method that resolves relative and random offsets.
2012-10-24 11:32:53 +13:00
Aldo Cortesi
6517d9e717 More info on disconnect exception. 2012-10-14 09:03:23 +13:00
Aldo Cortesi
77869634e2 Limit reads to block length. 2012-10-09 16:25:15 +13:00
Aldo Cortesi
e83392bfc8 Start making Action objects more sophisticated. 2012-10-05 11:23:30 +13:00
Aldo Cortesi
495daf2b64 Remove actions log and explain, preparing for a more sophisticated take on this. 2012-10-05 11:14:17 +13:00
Aldo Cortesi
2bdb5d15b9 Add a simple libpathod.pathoc example 2012-10-05 10:46:09 +13:00
Aldo Cortesi
f5d5cc4988 rparse.py -> language.py 2012-10-05 10:30:32 +13:00
Aldo Cortesi
d3e1f8a014 Stub out documentation changes 2012-10-04 12:17:35 +13:00
Aldo Cortesi
41f1c66772 Add -q and -r flags to pathod, logging request and respnose bytes.
- These flags also mean that a bytes log is included in the internal log
buffer.
- There's an -x flag to turn on hex dump output in the text logs (does
not affect the log buffer).
2012-10-01 12:48:26 +13:00
Aldo Cortesi
915bcfbd30 Add timeout argument to Pathod, and matching -t command-line option. 2012-10-01 12:01:02 +13:00
Aldo Cortesi
15679e010d Add a settimeout method to tcp.BaseHandler. 2012-10-01 11:30:02 +13:00
Aldo Cortesi
8bb81be2b0 Add pathoc -T to ignore timeouts.
Also move -c to -C for consistency.
2012-09-28 11:38:49 +12:00
Aldo Cortesi
064b4c8001 Make cleanBin escape carriage returns.
We get confusing output on terminals if we leave \r unescaped.
2012-09-27 10:59:46 +12:00
Aldo Cortesi
65108ed429 Add pathoc -o, oneshot mode, exits after the first non-ignored response. 2012-09-27 10:56:06 +12:00
Aldo Cortesi
7209a75201 Add pathoc -c to specify a list of return codes to ignore. 2012-09-27 09:44:25 +12:00
Aldo Cortesi
10a19fc4da Refactor print_requests -> print_request
- Change to handle one request at a time
- Shift error handling around
2012-09-26 14:25:39 +12:00
Aldo Cortesi
424d15c28b Expand the docs to explain pathoc multiple requests. 2012-09-26 11:21:40 +12:00
Aldo Cortesi
b67d99638a Response printing
Options to output full response, as sniffed from the socket.
2012-09-26 11:07:22 +12:00
Aldo Cortesi
a69d602087 Hex and verbatim output of requests.
This works by sniffing traffic through the socket, so always gives us the exact
traffic sent upstream.
2012-09-26 10:38:47 +12:00
Aldo Cortesi
0a5d4fbbbb Stub out new output argument structure. 2012-09-26 10:12:30 +12:00
Aldo Cortesi
b308824193 Create netlib.utils, move cleanBin and hexdump from libmproxy.utils. 2012-09-24 11:21:48 +12:00
Aldo Cortesi
3a21e28bf1 Split FileLike into Writer and Reader, and add logging functionality. 2012-09-24 11:10:21 +12:00
Aldo Cortesi
8a6cca530c Don't create fresh FileLike objects when converting to SSL 2012-09-24 10:47:41 +12:00
Aldo Cortesi
0dd250d4f8 Fix utils.get_header case handling. 2012-09-24 10:08:18 +12:00
Aldo Cortesi
1c80c2fdd7 Add a collection of standard User-Agent strings.
These will be used in both mitmproxy and pathod.
2012-09-01 23:04:44 +12:00
Aldo Cortesi
9db2bcabad Auto-generate download links. 2012-08-25 11:30:55 +12:00
Aldo Cortesi
d36cf63112 Bump for minor release. 2012-08-25 11:26:18 +12:00
Aldo Cortesi
2597d24b33 Merge pull request #5 from starenka/patch-1
pathoc missing from setup.py/setup(scripts=)
2012-08-24 16:23:20 -07:00
starenka
6d15943acc pathoc missing from setup.py/setup(scripts=)
pathoc was not specified as distributed script
2012-08-25 01:40:26 +03:00
Aldo Cortesi
384e2f93c3 Correct URL. 2012-08-24 23:52:31 +12:00
Aldo Cortesi
dc097fbd63 Add flask dependency. 2012-08-23 18:35:37 +12:00
Aldo Cortesi
60b016365f Use 24-hour clock for log timestamps. 2012-08-23 17:22:17 +12:00
Aldo Cortesi
b1cbea8cb7 Depend on netlib 0.2.1 2012-08-23 13:04:53 +12:00
Aldo Cortesi
33557245bf v0.2.1 2012-08-23 12:57:22 +12:00
Aldo Cortesi
2f7188164c Download page, MANIFEST.in 2012-08-23 12:54:58 +12:00
Aldo Cortesi
b78a3817cd Adjust examples and docs. 2012-08-23 12:37:02 +12:00
Aldo Cortesi
d758409b76 Make sure date stamps are added to all logs. 2012-08-23 12:00:16 +12:00
Aldo Cortesi
39cf105886 Add a changelog. 2012-08-22 13:59:24 +12:00
Aldo Cortesi
877a3e2062 Add a get_first convenience function to ODict. 2012-08-18 18:14:13 +12:00
Aldo Cortesi
95968ad558 Don't allow negative integer offsets for now. 2012-08-17 10:08:02 +12:00
Aldo Cortesi
13cb0cab90 Tweak front page: correct public pathod URL, more illustrative examples. 2012-08-16 22:29:14 +12:00
Aldo Cortesi
ea2ca98bea Add -D to daemonize pathod. 2012-08-16 16:07:23 +12:00
Aldo Cortesi
51d10f53c1 Add Cache-Control directives to static pages. 2012-08-11 17:06:51 +12:00
Aldo Cortesi
8d26db4931 Docs. 2012-08-07 23:19:48 +12:00
Aldo Cortesi
158106d346 Doc tweaks. 2012-07-30 21:12:42 +12:00
Aldo Cortesi
fde65270af Testing examples and docs. 2012-07-30 20:58:59 +12:00
Aldo Cortesi
e52a37ffa9 Cleanup of libpathod.test, test example for front page. 2012-07-30 17:29:36 +12:00
Aldo Cortesi
e26aac1d3c 100% test coverage. 2012-07-30 13:52:40 +12:00
Aldo Cortesi
43314c77c8 Handle invalid headers better. 2012-07-30 12:53:41 +12:00
Aldo Cortesi
1c21a28e64 read_headers: handle some crashes, return None on invalid data. 2012-07-30 12:50:35 +12:00
Aldo Cortesi
5b08703fa8 Handle disconnects on flush. 2012-07-30 12:02:42 +12:00
Aldo Cortesi
eafa5566c2 Handle disconnects on flush. 2012-07-30 11:30:31 +12:00
Aldo Cortesi
b1ac4245c8 docs: pathod 2012-07-30 00:14:34 +12:00
Aldo Cortesi
bc1cfd9f75 Docs. 2012-07-29 22:26:31 +12:00
Aldo Cortesi
d7db6757b2 Listen on localhost by default. 2012-07-29 17:29:38 +12:00
Aldo Cortesi
c21639deab Tweak about page to be less po-faced. 2012-07-29 16:46:24 +12:00
Aldo Cortesi
08b95f6aa1 Refactor preview display pages. 2012-07-29 16:33:45 +12:00
Aldo Cortesi
bc84cc99cd Handle file access denied in pathod. 2012-07-29 16:10:22 +12:00
Aldo Cortesi
4fb5d15f14 Bump version. 2012-07-29 15:53:42 +12:00
Aldo Cortesi
680801a47e README.txt and README.mkd tweaks. 2012-07-29 15:49:26 +12:00
Aldo Cortesi
f5ca88fe0a README 2012-07-29 15:36:00 +12:00
Aldo Cortesi
483e8182ff Add new styling (thanks to bootswatch.com) 2012-07-29 13:55:59 +12:00
Aldo Cortesi
d8c53cbc57 Add an option to specify a log file to pathod. 2012-07-27 14:03:15 +12:00
Aldo Cortesi
3e158211a8 Add a --nohang flag that turns off pauses in response generation. 2012-07-26 20:01:51 +12:00
Aldo Cortesi
b879890412 Add the public pathod server. 2012-07-25 13:07:27 +12:00
Aldo Cortesi
eb43291b3c Note that pauses are skipped during previews. 2012-07-25 12:49:22 +12:00
Aldo Cortesi
24f69419df Unit test about page. 2012-07-25 12:39:51 +12:00
Aldo Cortesi
adac9a35c3 Use tabs for request/response definitions on language docs page. 2012-07-25 12:36:53 +12:00
Aldo Cortesi
87306164a6 Expand examples for responses, remove dupes from pathod doc. 2012-07-25 12:18:36 +12:00
Aldo Cortesi
0b916ebbb1 Add a basic about page. 2012-07-25 11:55:44 +12:00
Aldo Cortesi
410144c579 Add examples for each preview form. 2012-07-25 11:36:19 +12:00
Aldo Cortesi
e7e6a60246 Nicer error for empty preview spec submission. 2012-07-25 10:55:00 +12:00
Aldo Cortesi
59f408dcf4 Refine parse error message a bit. 2012-07-25 10:44:21 +12:00
Aldo Cortesi
8cfbc2f80e Refactor test.py, add unit tests for app.py corner case. 2012-07-25 10:34:57 +12:00
Aldo Cortesi
e1df7f47a6 Sizing and placeholder for preview forms. 2012-07-25 10:24:09 +12:00
Aldo Cortesi
7dab85e8b1 Handle file access denied errors in previews. 2012-07-25 00:18:23 +12:00
Aldo Cortesi
64ef0a4561 Swap the offset, seconds arguments for the pause operator.
This makes it uniform with the other operators.s
2012-07-24 23:57:18 +12:00
Aldo Cortesi
cb09488dc8 Make actions at end of message work. 2012-07-24 23:49:58 +12:00
Aldo Cortesi
8f0ebb405d Hide "go" button if crafting is off. Use configured crafting anchor point. 2012-07-24 23:38:41 +12:00
Aldo Cortesi
ab59d6dccf Add preview for pathoc requests to web app. 2012-07-24 23:13:04 +12:00
Aldo Cortesi
6c565e778f Make previews safer by stripping pauses. 2012-07-24 22:38:48 +12:00
Aldo Cortesi
e9de11f0e3 Don't add stuff to our internal log buffer if noapi is on. 2012-07-24 22:30:15 +12:00
Aldo Cortesi
11896d2118 Turn off /log when noapi is set. 2012-07-24 22:27:04 +12:00
Aldo Cortesi
eb1f2c3fc4 Add option to specify craft anchor point. 2012-07-24 21:51:43 +12:00
Aldo Cortesi
97fe026c32 Add basic docs for request spec language. 2012-07-24 21:45:05 +12:00
Aldo Cortesi
94b491bb27 Add a Host header to pathoc requests by default. 2012-07-24 21:38:28 +12:00
Aldo Cortesi
728ef107a0 Ignore SAN entries that we don't understand. 2012-07-24 14:55:54 +12:00
Aldo Cortesi
9502eeadaa Document raw flag. 2012-07-24 12:52:53 +12:00
Aldo Cortesi
a9e60fa3e6 Add a Date header to server responses, unless raw is set. 2012-07-24 12:46:14 +12:00
Aldo Cortesi
dbed251fb9 Add a raw modifier to requests and responses, which turn off automatic additions.
For now, this just turns off adding a Content-Length header when a body is specified.
2012-07-24 12:18:14 +12:00
Aldo Cortesi
91752990d5 Handle HTTP responses that have a body but no content-length or transfer encoding
We check if the server sent a connection:close header, and read till the socket
closes.

Closes #2
2012-07-24 11:41:18 +12:00
Aldo Cortesi
2dd2137d44 Better handling of binary data output by pathoc. 2012-07-24 00:00:55 +12:00
Aldo Cortesi
a950a4d7a3 Add pathod --noapi to turn off the service API. 2012-07-23 23:31:26 +12:00
Aldo Cortesi
eb88cea3c7 Catch an amazingly subtle SSL connection corruption bug.
Closing a set of pseudo-file descriptors in the wrong order caused junk data to
be written to the SSL stream. An apparent bug in OpenSSL then lets this corrupt
the _next_ SSL connection.
2012-07-23 23:20:32 +12:00
Aldo Cortesi
190392ea13 Add a --nocraft option to pathod that turns off crafting. 2012-07-23 21:39:31 +12:00
Aldo Cortesi
622a2b5607 Add a --noweb option to turn web iface off, refactor unit tests. 2012-07-23 19:55:33 +12:00
Aldo Cortesi
eba485f5eb 100% unit test coverage 2012-07-23 19:25:57 +12:00
Aldo Cortesi
763e1ff786 pathod.py unit tests++ 2012-07-23 17:53:17 +12:00
Aldo Cortesi
1d1098687c 100% test coverage for pathoc.py 2012-07-23 17:42:44 +12:00
Aldo Cortesi
c1f75dd5a3 Use local scrolling with a JQuery module, because anchor jumps are braindead. 2012-07-23 17:30:50 +12:00
Aldo Cortesi
091d90011b Unify offset specifications, and document them. 2012-07-23 17:19:25 +12:00
Aldo Cortesi
2880fee4e3 Escape unprintable content in preview. 2012-07-23 16:39:25 +12:00
Aldo Cortesi
e354974787 100% test coverage for app.py 2012-07-23 16:28:34 +12:00
Aldo Cortesi
773ada882d Unit tests for most of app.py, return 404 for unknown log entry. 2012-07-23 16:18:47 +12:00
Aldo Cortesi
3027aae142 Use configured size limit to keep previews in check. 2012-07-23 15:38:06 +12:00
Aldo Cortesi
5283bb2507 Refactor rparse.InternalResponse -> rparse.PathodErrorResponse 2012-07-23 15:11:40 +12:00
Aldo Cortesi
1c45f5b05c Use policy hook to apply a size limit in pathod, add corresponding cmdline arg. 2012-07-23 15:03:56 +12:00
Aldo Cortesi
c7b5faf7db Add hooks for policy checks of served data. 2012-07-23 14:37:00 +12:00
Aldo Cortesi
204a556aa7 Add function for effective length calculation when actions are present. 2012-07-23 10:47:33 +12:00
Aldo Cortesi
32bd16aa31 Make file generators display nicely in pathoc actions dump. 2012-07-22 23:51:44 +12:00
Aldo Cortesi
96db3557ce Constrain file access to configured directory in pathod. 2012-07-22 23:46:56 +12:00
Aldo Cortesi
1b03fd6780 Allow execution of specs from file, using +./path 2012-07-22 23:37:46 +12:00
Aldo Cortesi
33208b8720 Doc reorg. 2012-07-22 22:24:16 +12:00
Aldo Cortesi
817e550aa1 Multiline specifications for pathod and pathoc. 2012-07-22 15:26:05 +12:00
Aldo Cortesi
30a6988392 pathod: handle keyboard interrupts and SSL errors. 2012-07-22 12:49:59 +12:00
Aldo Cortesi
1e93e42883 Escape special characters in first line error log. 2012-07-22 12:40:27 +12:00
Aldo Cortesi
ed64b0e796 Fix http_protocol parsing crash discovered with pathoc fuzzing. 2012-07-22 12:35:16 +12:00
Aldo Cortesi
8d8ede7e26 Handle invalid content length headers. 2012-07-22 12:30:10 +12:00
Aldo Cortesi
619f3c6edc Handle unexpected SSL connection termination in readline. 2012-07-21 20:51:05 +12:00
Aldo Cortesi
7a49cdfef3 More robust response handling. 2012-07-21 20:50:41 +12:00
Aldo Cortesi
86fe199988 pathoc: add a flag to dump request information. 2012-07-21 20:20:37 +12:00
Aldo Cortesi
b2c491fe39 Handle socket disconnects on reads. 2012-07-21 17:50:21 +12:00
Aldo Cortesi
29f907ecf9 Handle HTTP versions malformed due to non-integer major/minor numbers. 2012-07-21 17:27:23 +12:00
Aldo Cortesi
059a232903 Add support for client timeout to pathoc. 2012-07-21 16:19:44 +12:00
Aldo Cortesi
2387d2e8ed Timeout for TCP clients. 2012-07-21 16:10:54 +12:00
Aldo Cortesi
72e30d4712 Add an -n argument to pathoc, to repeat the specified requests N times. 2012-07-21 15:15:10 +12:00
Aldo Cortesi
3e6f440b8d Document Python-style string escaping. 2012-07-21 14:17:41 +12:00
Aldo Cortesi
5577d85ce6 Use injection to test a corner case in pathod daemon. 2012-07-21 14:14:31 +12:00
Aldo Cortesi
8ec44c6277 Allow Python string escape sequences in value literals. 2012-07-21 14:12:45 +12:00
Aldo Cortesi
8e0c01ae39 Fine-tuning for injection: docs, bugfixes. 2012-07-20 23:47:34 +12:00
Aldo Cortesi
d7841898e3 Add an injection operator. 2012-07-20 23:36:39 +12:00
Aldo Cortesi
2bdbbaa8af Convert documentation to HTML, fix styling. 2012-07-20 23:19:58 +12:00
Aldo Cortesi
21ef35fd28 Much simpler rewrite of inner data sending loop.
We don't have to do the asynchronous code contortion anymore.
2012-07-20 20:14:35 +12:00
Aldo Cortesi
3d9e8b2dbf We shouldn't ever get a socket error emanating from netlib. 2012-07-20 15:21:36 +12:00
Aldo Cortesi
ba53d2e4ca Set ssl_established right after the connection object is changed. 2012-07-20 15:15:07 +12:00
Aldo Cortesi
a1a1663c0f Fix cert path. 2012-07-20 14:45:58 +12:00
Aldo Cortesi
0791fe6cc6 Merge branch 'master' of ssh.github.com:cortesi/netlib 2012-07-20 14:44:23 +12:00
Aldo Cortesi
63d789109a close() methods for clients and servers. 2012-07-20 14:43:51 +12:00
Aldo Cortesi
03f4dcc02b Extend test suite to cover SSL. Log SSL connection errors. 2012-07-20 13:21:33 +12:00
Aldo Cortesi
76f0c3ea78 Handle invalid first line errors, add an error log buffer type. 2012-07-20 11:40:37 +12:00
Aldo Cortesi
f62d5b43b6 Merge pull request #1 from mhils/master
Fix cert generation if confdir is relative
2012-07-11 02:14:38 -07:00
Maximilian Hils
9ab7842c81 fix relative certdir 2012-07-11 11:09:41 +02:00
Aldo Cortesi
1227369db3 Signal errors back to caller in WSGI .serve() 2012-07-11 07:16:45 +12:00
Aldo Cortesi
4fdc2179e2 Don't write empty values. 2012-07-10 16:34:39 +12:00
Aldo Cortesi
721e2c8277 Somewhat nicer handling of errors after thread termination. 2012-07-10 16:22:45 +12:00
Aldo Cortesi
1bb93176da Handle NetLibDisconnect error. 2012-07-09 11:09:37 +12:00
Aldo Cortesi
ba7437abcb Add an exception to indicate remote disconnects. 2012-07-08 23:50:38 +12:00
Aldo Cortesi
20cc1b6aa4 Refactor TCP test suite. 2012-07-05 10:57:20 +12:00
Aldo Cortesi
96af5c16a0 Expose SSL options, use TLSv1 by default for client connections. 2012-07-04 21:30:07 +12:00
Aldo Cortesi
67669a2a57 Allow control of buffer size for TCPClient, improve error messages. 2012-06-30 10:52:28 +12:00
Aldo Cortesi
2cb55ee0f5 Factor out request printing in to a method, and test it. 2012-06-30 10:51:13 +12:00
Aldo Cortesi
654a84174a Move docs into pathod server. 2012-06-29 11:53:59 +12:00
Aldo Cortesi
1b42f5ab1f Allow naked literals for path specification. 2012-06-29 10:42:15 +12:00
Aldo Cortesi
4040df664b Add netlib dependency pointer. 2012-06-28 16:17:45 +12:00
Aldo Cortesi
7480f87cd7 Add utility function for converstion to PEM. 2012-06-28 14:56:21 +12:00
Aldo Cortesi
3f9aad53ab Return a certutils.SSLCert object from get_remote_cert. 2012-06-28 10:59:03 +12:00
Aldo Cortesi
bae86480d4 Merge branch 'master' of github.com:cortesi/netlib 2012-06-28 09:57:33 +12:00
Aldo Cortesi
92c7d38bd3 Handle obscure termination scenario, where interpreter exits before thread termination. 2012-06-28 09:56:58 +12:00
Aldo Cortesi
a1491a6ae0 Add a get_remote_cert method to tcp client. 2012-06-28 08:15:55 +12:00
Aldo Cortesi
b0ef9ad07b Refactor certutils.SSLCert API. 2012-06-27 22:11:58 +12:00
Aldo Cortesi
f7fcb1c80b Add certutils to netlib. 2012-06-27 16:42:00 +12:00
Aldo Cortesi
97071c0952 Merge branch 'master' of ssh.github.com:cortesi/netlib 2012-06-27 16:24:34 +12:00
Aldo Cortesi
5d4c7829bf Minor refactoring. 2012-06-27 16:24:22 +12:00
Aldo Cortesi
9588da4ab4 Catch errors that may happen on interpreter shutdown. 2012-06-27 16:15:22 +12:00
Aldo Cortesi
d0fd8385e6 Fix termiantion error in file read. 2012-06-27 12:11:55 +12:00
Aldo Cortesi
abe335e57d Add a flag to track SSL connection establishment. 2012-06-26 23:52:35 +12:00
Aldo Cortesi
8f148b6b14 Split pathod and pathoc daemon test suites out. 2012-06-26 17:28:07 +12:00
Aldo Cortesi
a68b4498b8 Allow naked value literal for pathoc path specifications. 2012-06-26 15:36:59 +12:00
Aldo Cortesi
65aef81997 parse -> parse_response in web app 2012-06-26 15:09:05 +12:00
Aldo Cortesi
33be5a72bf Fixed the WSGI server hang in netlib, remove fudge. 2012-06-26 14:49:40 +12:00
Aldo Cortesi
658c9c0446 Hunt down a tricky WSGI socket hang. 2012-06-26 14:49:23 +12:00
Aldo Cortesi
15aab74ddb Catch and log SSL connection errors. Improve log format. 2012-06-26 11:03:35 +12:00
Aldo Cortesi
f32258e8f7 Port pathoc to new netlib API. Add SNI. 2012-06-26 10:15:11 +12:00
Aldo Cortesi
ccf2603ddc Add SNI. 2012-06-26 09:50:42 +12:00
Aldo Cortesi
ea457fac2e Perform handshake immediately on SSL conversion.
Otherwise the handshake happens at first write, which can balls up if either
side hangs immediately.
2012-06-25 16:16:01 +12:00
Aldo Cortesi
353efec7ce Improve TCPClient interface.
- Don't pass SSL parameters on instantiation.
- Add a convert_to_ssl method analogous to that in TCPServer.
2012-06-25 14:42:15 +12:00
Aldo Cortesi
8352c0278f Handle client close more gracefully. 2012-06-25 11:34:29 +12:00
Aldo Cortesi
47f862ae27 Add a finished flag to BaseHandler, and catch an extra OpenSSL exception. 2012-06-25 11:34:10 +12:00
Aldo Cortesi
f3237503a7 Don't connect during __init__ methods for either client or server.
This means we now need to do these things explicitly at the caller.
2012-06-25 11:23:04 +12:00
Aldo Cortesi
3d8610b6bc Move server to new explicit netlib API. 2012-06-25 11:22:44 +12:00
Aldo Cortesi
8f0754b9c4 SSL tests, plus some self-signed test certificates. 2012-06-25 11:00:39 +12:00
Aldo Cortesi
1662d6d572 Repair test suite. 2012-06-24 23:16:06 +12:00
Aldo Cortesi
7d01d5c797 Don't read all from server by default.
This can cause us to hang waiting for data. More research is needed to
establish the right course of action here.
2012-06-24 23:13:09 +12:00
Aldo Cortesi
15c48cfc5e Simple HTTP connection keep-alive for pathod. 2012-06-24 23:11:25 +12:00
Aldo Cortesi
a747043cc8 Use http.read_response to read server response.
Also add a few different output formats, and a verbosity flag.
2012-06-24 22:59:20 +12:00
Aldo Cortesi
820ac5152e WSGI SERVER_PORT should be a string. 2012-06-24 22:57:09 +12:00
Aldo Cortesi
5988b65419 Add and unit test http.read_response 2012-06-24 22:45:40 +12:00
Aldo Cortesi
ddda57179a read_headers now returns an ODictCaseless object. 2012-06-24 21:49:43 +12:00
Aldo Cortesi
0de765f360 Make read_headers return an ODictCaseless object. 2012-06-24 21:49:23 +12:00
Aldo Cortesi
65487ead6d Logging truss for pathod. 2012-06-24 21:40:31 +12:00
Aldo Cortesi
90c6fb394d Sketch out pathoc commandline interaction. 2012-06-24 21:10:10 +12:00
Aldo Cortesi
8bec99f858 Request service rendering. 2012-06-24 19:12:52 +12:00
Aldo Cortesi
2ac84be7cb Add Path specification to request parser. 2012-06-24 18:38:22 +12:00
Aldo Cortesi
f8622ea914 Simple request spec parsing. 2012-06-24 17:47:55 +12:00
Aldo Cortesi
75f06d56cd Request method parsing. 2012-06-24 17:23:37 +12:00
Aldo Cortesi
d4ad3f0b2c Refactor to extract ready_actions and write_values. 2012-06-24 17:01:04 +12:00
Aldo Cortesi
05f5e772c3 Document our use of the 800 response code. 2012-06-24 16:47:44 +12:00
Aldo Cortesi
4fc64ac04f Enable anchors on command line. 2012-06-24 16:38:32 +12:00
Aldo Cortesi
e6aa9ff675 Re-enable anchors. 2012-06-24 16:20:50 +12:00
Aldo Cortesi
877b5a2d11 Add staticdir to test.Test. 2012-06-24 15:12:31 +12:00
Aldo Cortesi
2e558b7e9d Fix disconnect, improve coverage, enable file value specifier. 2012-06-24 15:07:45 +12:00
Aldo Cortesi
b71e2f6f2b More doc refinement. 2012-06-24 11:14:54 +12:00
Aldo Cortesi
6d0b49dfef Documentation. 2012-06-24 10:54:37 +12:00
Aldo Cortesi
3bc7f4e1cd Documentation skeleton. 2012-06-24 10:18:20 +12:00
Aldo Cortesi
171de05d8e Add http_status.py 2012-06-23 18:34:51 +12:00
Aldo Cortesi
e236d7746a Move http.py to netlib.http_status 2012-06-23 18:34:35 +12:00
Aldo Cortesi
1263221ddd 100% testcoverage for netlib.http 2012-06-23 15:07:42 +12:00
Aldo Cortesi
cb2f11a68e Bump version, adapt for API canges in netlib. 2012-06-23 14:06:54 +12:00
Aldo Cortesi
5cf6aeb926 protocol.py -> http.py 2012-06-23 13:56:17 +12:00
Aldo Cortesi
227e72abf4 README, setup.py, version 2012-06-23 13:49:57 +12:00
Aldo Cortesi
b335b3a335 Remove last vestige of Tornado pathod. 2012-06-21 17:00:04 +12:00
Aldo Cortesi
cd8fba1d70 Finalize porting built-in web app to Flask. 2012-06-21 16:54:49 +12:00
Aldo Cortesi
f88e899274 Built-in app: Index page. 2012-06-21 16:25:27 +12:00
Aldo Cortesi
f0fd33fb11 Log inspection and manipulation from tests. 2012-06-21 15:39:40 +12:00
Aldo Cortesi
12c140b951 Restore client argument parsing. Add thread-safe logging subsystem. 2012-06-21 14:29:49 +12:00
Aldo Cortesi
1089a52f3d Disconnect, rest refactoring. 2012-06-21 10:56:30 +12:00
Aldo Cortesi
b706200796 Drop default poll interval to 0.1s. 2012-06-20 11:01:40 +12:00
Aldo Cortesi
de00497b40 Re-enable SSL service. 2012-06-20 10:59:38 +12:00
Aldo Cortesi
7922e70037 Basic response generation. 2012-06-20 10:51:37 +12:00
Aldo Cortesi
084be7684d Close socket on shutdown. 2012-06-20 10:51:02 +12:00
Aldo Cortesi
892ee2a904 Start porting web app to Flask. 2012-06-19 16:57:57 +12:00
Aldo Cortesi
ce1ef55456 Adapt WSGI, convert test suite to nose. 2012-06-19 14:23:22 +12:00
Aldo Cortesi
a700721891 Porting to netlib proceeds apace. 2012-06-19 13:23:07 +12:00
Aldo Cortesi
c7e9051cbb Import wsgi. 2012-06-19 10:42:25 +12:00
Aldo Cortesi
b558997fd9 Initial checkin. 2012-06-19 09:42:32 +12:00
Aldo Cortesi
bd99a13f39 Start refactoring towards netlib, adding SNI and client testing. 2012-06-17 07:57:24 +12:00
Aldo Cortesi
b1f410c78d Join thread on test exit to avoid race condition. 2012-06-09 20:42:43 +12:00
Aldo Cortesi
00c8bef0ff Port test suite over to Nose. 2012-06-09 15:08:51 +12:00
Aldo Cortesi
456b11df9a Add requests to install_requires. 2012-06-07 17:03:16 +12:00
Aldo Cortesi
a29ebe31dc SSL support for test struss.
Also, rewrite requests usage for latest version.
2012-06-07 17:02:17 +12:00
Aldo Cortesi
81fc990314 Fail if only one of certfile or keyfile is specified. 2012-06-07 16:36:54 +12:00
Aldo Cortesi
9ae53aecd0 We can't sensibly unit test pages withhout firing up a server.
We've just added functionality to do this ourselves, so rip out the old stuff.
2012-06-07 16:35:54 +12:00
Aldo Cortesi
26c8437e88 Better test daemon cleanup, improve utils test coverage. 2012-06-07 14:05:42 +12:00
Aldo Cortesi
34ffe46fa0 Add /api/info, returning general info on the running pathod daemon. 2012-06-07 11:39:37 +12:00
Aldo Cortesi
14b2a69d21 Start building a Pathod unit testing truss.
- Add test.py, which will house the testing API.
- Extend API with a shutdown method, used to terminate the test daemon.
- Refactor to allow clean shutdown.
2012-06-07 11:23:23 +12:00
Aldo Cortesi
b5a74a26ee Let Pathod pick an arbitrary empty port if -p 0 is specified. 2012-06-07 10:17:30 +12:00
Aldo Cortesi
049d3d2b45 lippathod/app.py -> libpathod/pathod.py 2012-06-07 08:50:06 +12:00
Aldo Cortesi
d171e13fd3 Fix redundant imports, tweak TODO for 0.2 2012-04-30 10:09:16 +12:00
Aldo Cortesi
3365acf69f Clear log API. 2012-04-30 09:54:49 +12:00
Aldo Cortesi
24b0acbfab Log retrieval API. 2012-04-30 09:46:49 +12:00
Aldo Cortesi
5d6bd3291e Docs. 2012-04-29 22:13:47 +12:00
Aldo Cortesi
8b02ebe2a4 Docs, installation instructions. 2012-04-29 22:08:35 +12:00
Aldo Cortesi
cd025636fa Docs and spelling errors. 2012-04-29 21:51:03 +12:00
Aldo Cortesi
0b347db612 Doc tweaks. 2012-04-29 21:43:28 +12:00
Aldo Cortesi
c2029496b8 Doc tweaks. 2012-04-29 21:41:56 +12:00
Aldo Cortesi
04f4f8e2a1 setup.py, LICENSE, README.txt 2012-04-29 21:30:48 +12:00
Aldo Cortesi
ccd6eeed4b Make "Go" button on preview form work. 2012-04-29 21:22:00 +12:00
Aldo Cortesi
1431b36c4a Preview in web application. 2012-04-29 21:15:02 +12:00
Aldo Cortesi
37e880b399 Add a rendered version of the docs to the web app. 2012-04-29 18:56:49 +12:00
Aldo Cortesi
d5aa88e092 Doc tweaks.
There will be a lot of these, because the only way to see how things render on
Github is to upload a new README...
2012-04-29 18:46:12 +12:00
Aldo Cortesi
e7ed79e38b Docs for Value Specifiers. 2012-04-29 18:42:06 +12:00
Aldo Cortesi
29ca64472d Feature specification documentation. 2012-04-29 18:28:46 +12:00
Aldo Cortesi
80c3a9c9f8 README -> README.mkd 2012-04-29 17:38:41 +12:00
Aldo Cortesi
5650086ca1 First pass at a README. 2012-04-29 17:37:47 +12:00
Aldo Cortesi
f2b11e5d5c Add logging, expose logs through the web app interface. 2012-04-29 16:22:53 +12:00
Aldo Cortesi
fd946f0c04 Basic logging. 2012-04-29 14:59:54 +12:00
Aldo Cortesi
6d4500c679 Regularize language even further
- Unify offset specifcation syntax, so there's now oly one form for specify
pauses and disconnects.
- Use @ instead of ! for content generation. Mildy more convenient in the shell.
2012-04-29 14:20:27 +12:00
Aldo Cortesi
f03ce81070 Anchor management: list and remove anchors. 2012-04-29 12:18:34 +12:00
Aldo Cortesi
2d88d88f8c Basic anchor adding. 2012-04-29 12:05:38 +12:00
Aldo Cortesi
7ca5c7ae90 Basic SSL support. 2012-04-29 11:18:56 +12:00
Aldo Cortesi
77eca33f26 Refactor application definitions and startup.
Also, create one of the dodgiest web testing trusses in history. Tornado just
seems to have no nice way of doing this.
2012-04-29 10:56:33 +12:00
Aldo Cortesi
ee909e265b Add a shortcut for setting Location header. 2012-04-28 22:54:45 +12:00
Aldo Cortesi
2d989e2fbb Add a shortcut for setting content-type. 2012-04-28 22:51:36 +12:00
Aldo Cortesi
5052a6d34e Unify pause and disconnect event frameworks. 2012-04-28 22:28:28 +12:00
Aldo Cortesi
7810ee475d More language tweaks.
Separators this time - move to colon-separated features, use = for header
key/value separation.
2012-04-28 17:28:40 +12:00
Aldo Cortesi
a779aac9db Make specification language more terse, and more regular. 2012-04-28 17:12:39 +12:00
Aldo Cortesi
5fc2a63781 Better internal error pages. 2012-04-28 14:43:57 +12:00
Aldo Cortesi
2c8f17eae7 First pass at static file serving. 2012-04-28 13:16:51 +12:00
Aldo Cortesi
b4105be21e Initial checkin. 2012-04-28 12:42:03 +12:00
845 changed files with 111332 additions and 87071 deletions

47
.appveyor.yml Normal file
View File

@@ -0,0 +1,47 @@
version: '{build}'
build: off # Not a C# project
environment:
CI_DEPS: codecov>=2.0.5
CI_COMMANDS: codecov
matrix:
- PYTHON: "C:\\Python35"
TOXENV: "py35"
- PYTHON: "C:\\Python27"
TOXENV: "py27"
SNAPSHOT_HOST:
secure: NeTo57s2rJhCd/mjKHetXVxCFd3uhr8txnjnAXD1tUI=
SNAPSHOT_PORT:
secure: TiJPtg60/edYTH8RnoBErg==
SNAPSHOT_USER:
secure: 6yBwmO5gv4vAwoFYII8qjQ==
SNAPSHOT_PASS:
secure: LPjrtFrWxYhOVGXzfPRV1GjtZE/wHoKq9m/PI6hSalfysUK5p2DxTG9uHlb4Q9qV
install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "python -m pip install --disable-pip-version-check -U pip"
- "pip install -U tox"
test_script:
- ps: "tox -- --cov netlib --cov mitmproxy --cov pathod -v"
deploy_script:
ps: |
if(
($Env:TOXENV -match "py35") -and
(($Env:APPVEYOR_REPO_BRANCH -match "master") -or ($Env:APPVEYOR_REPO_TAG -match "true"))
) {
pip install -U virtualenv
.\dev.ps1
cmd /c "python -u .\release\rtool.py bdist 2>&1"
python -u .\release\rtool.py upload-snapshot --bdist --wheel
}
cache:
- C:\Users\appveyor\AppData\Local\pip\cache
notifications:
- provider: Slack
incoming_webhook: https://hooks.slack.com/services/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

1
.codecov.yml Normal file
View File

@@ -0,0 +1 @@
comment: off

View File

@@ -1,6 +0,0 @@
[rum]
branch = True
[report]
omit = *contrib*, *tnetstring*, *platform*, *console*, *main.py
include = *libmproxy*

7
.env
View File

@@ -1,5 +1,6 @@
DIR="${0%/*}"
if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then
DIR="$( dirname "${BASH_SOURCE[0]}" )"
ACTIVATE_DIR="$(if [ -f "$DIR/venv/bin/activate" ]; then echo 'bin'; else echo 'Scripts'; fi;)"
if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/venv/$ACTIVATE_DIR/activate" ]; then
echo "Activating mitmproxy virtualenv..."
source "$DIR/../venv.mitmproxy/bin/activate"
source "$DIR/venv/$ACTIVATE_DIR/activate"
fi

4
.gitattributes vendored
View File

@@ -1,2 +1,2 @@
libmproxy/web/static/**/* -diff
web/src/js/filt/filt.js -diff
mitmproxy/web/static/**/* -diff
web/src/js/filt/filt.js -diff

24
.gitignore vendored
View File

@@ -1,27 +1,21 @@
.DS_Store
MANIFEST
/build
/dist
/tmp
/doc
/venv
/libmproxy/gui
/release/build
*/tmp
/venv*
*.py[cdo]
*.swp
*.swo
mitmproxy.egg-info/
mitmproxyc
mitmdumpc
.coverage
*.egg-info/
.coverage*
.idea
netlib
pathod
libpathod
.cache/
.tox*/
build/
# UI
node_modules
bower_components
*.compiled.js
*.map
sslkeylogfile.log
.tox/

20
.landscape.yml Normal file
View File

@@ -0,0 +1,20 @@
ignore-paths:
- docs
- examples
- mitmproxy/contrib
- web
max-line-length: 140
pylint:
options:
dummy-variables-rgx: _$|.+_$|dummy_.+
disable:
- missing-docstring
- protected-access
- too-few-public-methods
- too-many-arguments
- too-many-instance-attributes
- too-many-locals
- too-many-public-methods
- too-many-return-statements
- too-many-statements
- unpacking-non-sequence

View File

@@ -1,25 +1,81 @@
language: python
sudo: false
python:
- "2.7"
- pypy
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
language: python
addons:
apt:
sources:
# Debian sid currently holds OpenSSL 1.0.2
# change this with future releases!
- debian-sid
packages:
- libssl-dev
env:
global:
- CI_DEPS=codecov>=2.0.5
- CI_COMMANDS=codecov
matrix:
fast_finish: true
include:
- python: 3.5
env: TOXENV=lint
- os: osx
osx_image: xcode7.3
language: generic
env: TOXENV=py35 BDIST=1
- python: 3.5
env: TOXENV=py35 BDIST=1
- python: 3.5
env: TOXENV=py35 NO_ALPN=1
- python: 2.7
env: TOXENV=py27
- python: 2.7
env: TOXENV=py27 NO_ALPN=1
- python: 3.5
env: TOXENV=docs
allow_failures:
- python: pypy
install:
- "pip install --src . -r requirements.txt"
# command to run tests, e.g. python setup.py test
script:
- "nosetests --with-cov --cov-report term-missing"
after_success:
- coveralls
- |
if [[ $TRAVIS_OS_NAME == "osx" ]]
then
brew update || brew update # try again if it fails
brew upgrade
brew reinstall openssl
brew reinstall pyenv
eval "$(pyenv init -)"
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install --skip-existing 3.5.2
pyenv global 3.5.2
pyenv shell 3.5.2
pip install -U pip setuptools wheel virtualenv
fi
- pip install tox
script: tox -- --cov netlib --cov mitmproxy --cov pathod -v
after_success:
- |
if [[ $BDIST == "1" && $TRAVIS_PULL_REQUEST == "false" && ($TRAVIS_BRANCH == "master" || -n $TRAVIS_TAG) ]]
then
git fetch --unshallow
./dev.sh 3.5
source venv3.5/bin/activate
pip install -e ./release
python -u ./release/rtool.py bdist
python -u ./release/rtool.py upload-snapshot --bdist
fi
notifications:
irc:
channels:
- "irc.oftc.net#mitmproxy"
on_success: change
on_failure: always
slack:
-rooms:
mitmproxy:YaDGC9Gt9TEM7o8zkC2OLNsu
on_success: change
on_failure: change
on_start: never
cache:
directories:
- /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages
- /home/travis/virtualenv/python2.7.9/bin
- /home/travis/virtualenv/pypy-2.5.0/site-packages
- /home/travis/virtualenv/pypy-2.5.0/bin
- $HOME/.pyenv
- $HOME/.cache/pip

288
CHANGELOG
View File

@@ -1,3 +1,194 @@
16 October 2016: mitmproxy 0.18
* Python 3 Compatibility for mitmproxy and pathod (Shadab Zafar, GSoC 2016)
* Major improvements to mitmweb (Clemens Brunner & Jason Hao, GSoC 2016)
* Internal Core Refactor: Separation of most features into isolated Addons
* Initial Support for WebSockets
* Improved HTTP/2 Support
* Reverse Proxy Mode now automatically adjusts host headers and TLS Server Name Indication
* Improved HAR export
* Improved export functionality for curl, python code, raw http etc.
* Flow URLs are now truncated in the console for better visibility
* New filters for TCP, HTTP and marked flows.
* Mitmproxy now handles comma-separated Cookie headers
* Merge mitmproxy and pathod documentation
* Mitmdump now sanitizes its console output to not include control characters
* Improved message body handling for HTTP messages:
.raw_content provides the message body as seen on the wire
.content provides the decompressed body (e.g. un-gzipped)
.text provides the body decompressed and decoded body
* New HTTP Message getters/setters for cookies and form contents.
* Add ability to view only marked flows in mitmproxy
* Improved Script Reloader (Always use polling, watch for whole directory)
* Use tox for testing
* Unicode support for tnetstrings
* Add dumpfile converters for mitmproxy versions 0.11 and 0.12
* Numerous bugfixes
9 April 2016: mitmproxy 0.17
* Simplify repository and release structure. mitmproxy now comes as a single package, including netlib and pathod.
* Rename the Python package from libmproxy to mitmproxy.
* New option to add server certs to client chain (CVE-2016-2402, John Kozyrakis)
* Enable HTTP/2 by default (Thomas Kriechbaumer)
* Improved HAR extractor (Shadab Zafar)
* Add icon for OSX and Windows binaries
* Add content view for query parameters (Will Coster)
* Initial work on Python 3 compatibility
* locust.io export (Zohar Lorberbaum)
* Fix XSS vulnerability in HTTP errors (Will Coster)
* Numerous bugfixes and minor improvements
15 February 2016: mitmproxy 0.16
* Completely revised HTTP2 implementation based on hyper-h2 (Thomas Kriechbaumer)
* Export flows as cURL command, Python code or raw HTTP (Shadab Zafar)
* Fixed compatibility with the Android Emulator (Will Coster)
* Script Reloader: Inline scripts are reloaded automatically if modified (Matthew Shao)
* Inline script hooks for TCP mode (Michael J. Bazzinotti)
* Add default ciphers to support iOS9 App Transport Security (Jorge Villacorta)
* Basic Authentication for mitmweb (Guillem Anguera)
* Exempt connections from interception based on TLS Server Name Indication (David Weinstein)
* Provide Python Wheels for faster installation
* Numerous bugfixes and minor improvements
4 December 2015: mitmproxy 0.15
* Support for loading and converting older dumpfile formats (0.13 and up)
* Content views for inline script (@chrisczub)
* Better handling of empty header values (Benjamin Lee/@bltb)
* Fix a gnarly memory leak in mitmdump
* A number of bugfixes and small improvements
6 November 2015: mitmproxy 0.14
* Statistics: 399 commits, 13 contributors, 79 closed issues, 37 closed
PRs, 103 days
* Docs: Greatly updated docs now hosted on ReadTheDocs!
http://docs.mitmproxy.org
* Docs: Fixed Typos, updated URLs etc. (Nick Badger, Ben Lerner, Choongwoo
Han, onlywade, Jurriaan Bremer)
* mitmdump: Colorized TTY output
* mitmdump: Use mitmproxy's content views for human-readable output (Chris
Czub)
* mitmproxy and mitmdump: Support for displaying UTF8 contents
* mitmproxy: add command line switch to disable mouse interaction (Timothy
Elliott)
* mitmproxy: bug fixes (Choongwoo Han, sethp-jive, FreeArtMan)
* mitmweb: bug fixes (Colin Bendell)
* libmproxy: Add ability to fall back to TCP passthrough for non-HTTP
connections.
* libmproxy: Avoid double-connect in case of TLS Server Name Indication.
This yields a massive speedup for TLS handshakes.
* libmproxy: Prevent unneccessary upstream connections (macmantrl)
* Inline Scripts: New API for HTTP Headers:
http://docs.mitmproxy.org/en/latest/dev/models.html#netlib.http.Headers
* Inline Scripts: Properly handle exceptions in `done` hook
* Inline Scripts: Allow relative imports, provide `__file__`
* Examples: Add probabilistic TLS passthrough as an inline script
* netlib: Refactored HTTP protocol handling code
* netlib: ALPN support
* netlib: fixed a bug in the optional certificate verification.
* netlib: Initial Python 3.5 support (this is the first prerequisite for
3.x support in mitmproxy)
24 July 2015: mitmproxy 0.13
* Upstream certificate validation. See the --verify-upstream-cert,
--upstream-trusted-cadir and --upstream-trusted-ca parameters. Thanks to
Kyle Morton (github.com/kyle-m) for his work on this.
* Add HTTP transparent proxy mode. This uses the host headers from HTTP
traffic (rather than SNI and IP address information from the OS) to
implement perform transparent proxying. Thanks to github.com/ijiro123 for
this feature.
* Add ~src and ~dst REGEX filters, allowing matching on source and
destination addresses in the form of <IP>:<Port>
* mitmproxy console: change g/G keyboard shortcuts to match less. Thanks to
Jose Luis Honorato (github.com/jlhonora).
* mitmproxy console: Flow marking and unmarking. Marked flows are not
deleted when the flow list is cleared. Thanks to Jake Drahos
(github.com/drahosj).
* mitmproxy console: add marking of flows
* Remove the certforward feature. It was added to allow exploitation of
#gotofail, which is no longer a common vulnerability. Permitting this
hugely increased the complexity of packaging and distributing mitmproxy.
3 June 2015: mitmproxy 0.12.1
* mitmproxy console: mouse interaction - scroll in the flow list, click on
@@ -105,6 +296,19 @@
* Countless bugfixes and other small improvements
* pathod: Hugely improved SSL support, including dynamic generation of certificates
using the mitproxy cacert
7 November 2014: pathod 0.11:
* Hugely improved SSL support, including dynamic generation of certificates
using the mitproxy cacert
* pathoc -S dumps information on the remote SSL certificate chain
* Big improvements to fuzzing, including random spec selection and memoization to avoid repeating randomly generated patterns
* Reflected patterns, allowing you to embed a pathod server response specification in a pathoc request, resolving both on client side. This makes fuzzing proxies and other intermediate systems much better.
28 January 2014: mitmproxy 0.10:
@@ -146,6 +350,9 @@
* Many other small bugfixes and improvements.
25 August 2013: pathod 0.9.2:
* Adapt to interface changes in netlib
16 June 2013: mitmproxy 0.9.1:
@@ -204,6 +411,87 @@
* Proxy authentication to limit access to mitmproxy
* pathod: Proxy mode. You can now configure clients to use pathod as an
HTTP/S proxy.
* pathoc: Proxy support, including using CONNECT to tunnel directly to
targets.
* pathoc: client certificate support.
* pathod: API improvements, bugfixes.
15 May 2013: pathod 0.9 (version synced with mitmproxy):
* Pathod proxy mode. You can now configure clients to use pathod as an
HTTP/S proxy.
* Pathoc proxy support, including using CONNECT to tunnel directly to
targets.
* Pathoc client certificate support.
* API improvements, bugfixes.
16 November 2012: pathod 0.3:
A release focusing on shoring up our fuzzing capabilities, especially with
pathoc.
* pathoc -q and -r options, output full request and response text.
* pathod -q and -r options, add full request and response text to pathod's
log buffer.
* pathoc and pathod -x option, makes -q and -r options log in hex dump
format.
* pathoc -C option, specify response codes to ignore.
* pathoc -T option, instructs pathoc to ignore timeouts.
* pathoc -o option, a one-shot mode that exits after the first non-ignored
response.
* pathoc and pathod -e option, which explains the resulting message by
expanding random and generated portions, and logging a reproducible
specification.
* Streamline the specification langauge. HTTP response message is now
specified using the "r" mnemonic.
* Add a "u" mnemonic for specifying User-Agent strings. Add a set of
standard user-agent strings accessible through shortcuts.
* Major internal refactoring and cleanup.
* Many bugfixes.
22 August 2012: pathod 0.2:
* Add pathoc, a pathological HTTP client.
* Add libpathod.test, a truss for using pathod in unit tests.
* Add an injection operator to the specification language.
* Allow Python escape sequences in value literals.
* Allow execution of requests and responses from file, using the new + operator.
* Add daemonization to Pathod, and make it more robust for public-facing use.
* Let pathod pick an arbitrary open port if -p 0 is specified.
* Move from Tornado to netlib, the network library written for mitmproxy.
* Move the web application to Flask.
* Massively expand the documentation.
5 April 2012: mitmproxy 0.8:

View File

@@ -1,39 +0,0 @@
# Contributing
Thank you for your interest in contributing to mitmproxy!
# Bug Reports
Bug Reports are very welcome - please file them on the GitHub [issue tracker](https://github.com/mitmproxy/mitmproxy/issues).
You can use the following template to structure your report:
```
##### Steps to reproduce the problem:
1.
2.
3.
##### What is the expected behavior?
##### What went wrong?
##### Any other comments?
---
mitmproxy version:
Operating System:
```
# Feature Requests
We're happy to hear what you'd like to see in mitmproxy. Please file feature requests on the GitHub [issue tracker](https://github.com/mitmproxy/mitmproxy/issues).
# Patches
We're always happy to accept patches. Please submit them in the form of pull requests to the main [mitmproxy repository](https://github.com/mitmproxy/mitmproxy/).
If you're working on something cool, please do not hesistate and get in touch!
Instructions for setting up a development environment can be found in the [README](README.mkd).

View File

@@ -1,88 +1,181 @@
1067 Aldo Cortesi
542 Maximilian Hils
76 Marcelo Glezer
2184 Aldo Cortesi
1745 Maximilian Hils
507 Thomas Kriechbaumer
258 Shadab Zafar
97 Jason
83 Marcelo Glezer
68 Clemens
28 Jim Shaver
18 Henrik Nordstrom
16 Matthew Shao
14 Pedro Worcel
14 David Weinstein
13 Thomas Roth
12 Pedro Worcel
11 Stephen Altamirano
11 Jake Drahos
11 arjun23496
11 Justus Wingert
11 Jim Shaver
10 Sandor Nemes
10 Zohar Lorberbaum
10 András Veres-Szentkirályi
10 Chris Czub
10 smill
9 ikoz
9 Kyle Morton
9 Legend Tang
8 Rouli
9 Rouli
8 Jason A. Novak
8 Chandler Abraham
7 Alexis Hildebrandt
5 Matthias Urlichs
5 Brad Peabody
7 Matthias Urlichs
7 Brad Peabody
7 dufferzafar
6 Felix Yan
5 Tomaz Muraus
5 elitest
5 iroiro123
5 Sam Cleveland
5 Choongwoo Han
5 Will Coster
4 root
4 Clemens Brunner
4 Schamper
4 Valtteri Virtanen
4 Wade 524
4 Bryan Bishop
4 Youhei Sakurai
4 Bryan Bishop
4 Marc Liyanage
4 Michael J. Bazzinotti
4 yonder
3 Eli Shvartsman
3 Chris Neasbitt
3 Guillem Anguera
3 MatthewShao
3 Ryan Welton
3 smill@cuckoo.sh
3 Manish Kumar
3 Benjamin Lee
3 Ryan Laughlin
3 Zack B
3 Kyle Manna
3 Eli Shvartsman
2 Choongwoo Han
2 Rob Wills
3 redfast00
3 requires.io
2 isra17
2 israel
2 Mark E. Haase
2 Jaime Soriano Pastor
2 Jim Lloyd
2 Heikki Hannikainen
2 Krzysztof Bielicki
2 Bennett Blodinger
2 Colin Bendell
2 jpkrause
2 Paul
2 lilydjwg
2 Michael Frister
2 依云
2 Jaime Soriano Pastor
2 Nick Badger
2 Rob Wills
2 Heikki Hannikainen
2 Vincent Haupert
2 strohu
2 Wade Catron
2 Krzysztof Bielicki
2 Sachin Kelkar
2 Israel Nir
2 Anant
2 alts
1 Yuangxuan Wang
1 capt8bit
1 davidpshaw
1 deployable
1 joebowbeer
1 meeee
1 michaeljau
1 peralta
1 phil plante
1 sentient07
1 vzvu3k6k
2 Doug Freed
2 Niko Kommenda
2 Terry Long
2 Mark E. Haase
2 Steven Van Acker
2 Jim Lloyd
2 Bennett Blodinger
2 Sean Coates
2 Cory Benfield
1 Sergey Chipiga
1 Andrey Plotnikov
1 Andy Smith
1 Angelo Agatino Nicolosi
1 Anthony Zhang
1 BSalita
1 Ben Lerner
1 Bradley Baetz
1 Brett Randall
1 Chris Hamant
1 Christian Frichot
1 Dan Wilbraham
1 David Dworken
1 David Shaw
1 Doug Lethin
1 Drake Caraker
1 Eric Entzel
1 Felix Wolfsteller
1 FreeArtMan
1 Gabriel Kirkpatrick
1 Henrik Nordström
1 Israel Blancas
1 Ivaylo Popov
1 JC
1 Jakub Nawalaniec
1 Jakub Wilk
1 James Billingham
1 Jason Pepas
1 Jean Regisser
1 Jonathan Jones
1 Jorge Villacorta
1 Kit Randel
1 Kostya Esmukov
1 Linmiao Xu
1 Lucas Cimon
1 M. Utku Altinkaya
1 Mathieu Mitchell
1 Michael Bisbjerg
1 Mike C
1 Mikhail Korobov
1 Morton Fox
1 Nick HS
1 Nick Raptis
1 Nicolas Esteves
1 Oleksandr Sheremet
1 Paul
1 Parth Ganatra
1 Pritam Baral
1 Rich Somerfield
1 Rory McCann
1 Rune Halvorsen
1 Ryo Onodera
1 Sahn Lam
1 Sanchit Sokhey
1 Seppo Yli-Olli
1 Sergey Chipiga
1 Aditya
1 Stefan Wärting
1 Steve Phillips
1 Steven Van Acker
1 Steven Noble
1 Suyash
1 Tai Dickerson
1 Tarashish Mishra
1 Terry Long
1 TearsDontFalls
1 Thiago Arrais
1 Tim Becker
1 Timothy Elliott
1 Tyler St. Onge
1 Ulrich Petri
1 Vyacheslav Bakhmutov
1 Wade Catron
1 Wes Turner
1 Yoginski
1 Yuangxuan Wang
1 capt8bit
1 chhsiao90
1 cle1000
1 davidpshaw
1 deployable
1 gecko655
1 jlhonora
1 joebowbeer
1 kronick
1 meeee
1 michaeljau
1 peralta
1 phackt
1 phil plante
1 sentient07
1 sethp-jive
1 starenka
1 vulnminer
1 vzvu3k6k

View File

@@ -1,10 +1,4 @@
include mitmproxy mitmdump
include LICENSE CHANGELOG CONTRIBUTORS README.txt
exclude README.mkd
recursive-include examples *
recursive-include doc *
recursive-include test *
recursive-include libmproxy *
recursive-exclude * *.pyc *.pyo *.swo *.swp
recursive-exclude netlib *
recursive-exclude libpathod *
graft mitmproxy
graft pathod
graft netlib
recursive-exclude * *.pyc *.pyo *.swo *.swp *.map

View File

@@ -1,99 +0,0 @@
[![Build Status](https://travis-ci.org/mitmproxy/mitmproxy.svg?branch=master)](https://travis-ci.org/mitmproxy/mitmproxy) [![Coverage Status](https://coveralls.io/repos/mitmproxy/mitmproxy/badge.svg?branch=master)](https://coveralls.io/r/mitmproxy/mitmproxy)
[![Latest Version](https://pypip.in/version/mitmproxy/badge.svg?style=flat)](https://pypi.python.org/pypi/mitmproxy/)
[![Supported Python versions](https://pypip.in/py_versions/mitmproxy/badge.svg?style=flat)](https://pypi.python.org/pypi/mitmproxy)
[![Supported Python implementations](https://pypip.in/implementation/mitmproxy/badge.svg?style=flat)](https://pypi.python.org/pypi/mitmproxy/)
__mitmproxy__ is an interactive, SSL-capable man-in-the-middle proxy for HTTP
with a console interface.
__mitmdump__ is the command-line version of mitmproxy. Think tcpdump for HTTP.
__libmproxy__ is the library that mitmproxy and mitmdump are built on.
Documentation, tutorials and distribution packages can be found on the
mitmproxy.org website:
[mitmproxy.org](http://mitmproxy.org).
You can find complete directions for installing mitmproxy [here](http://mitmproxy.org/doc/install.html).
Features
--------
- Intercept HTTP requests and responses and modify them on the fly.
- Save complete HTTP conversations for later replay and analysis.
- Replay the client-side of an HTTP conversations.
- Replay HTTP responses of a previously recorded server.
- Reverse proxy mode to forward traffic to a specified server.
- Transparent proxy mode on OSX and Linux.
- Make scripted changes to HTTP traffic using Python.
- SSL certificates for interception are generated on the fly.
- And much, much more.
__mitmproxy__ is tested and developed on OSX, Linux and OpenBSD. On Windows,
only mitmdump is supported, which does not have a graphical user interface.
Hacking
-------
To get started hacking on mitmproxy, make sure you have
[Python](http://www.python.org) 2.7.x. with
[virtualenv](https://virtualenv.pypa.io/en/latest/) installed (you can find
installation instructions for virtualenv
[here](https://virtualenv.pypa.io/en/latest/installation.html)). Then do the
following:
```
$ git clone https://github.com/mitmproxy/mitmproxy.git
$ git clone https://github.com/mitmproxy/netlib.git
$ git clone https://github.com/mitmproxy/pathod.git
$ cd mitmproxy
$ ./dev
```
The *dev* script will create a virtualenv environment in a directory called
"venv.mitmproxy", and install all of mitmproxy's development requirements, plus
all optional modules. The primary mitmproxy components - mitmproxy, netlib and
pathod - are all installed "editable", so any changes to the source in the git
checkouts will be reflected live in the virtualenv.
To confirm that you're up and running, activate the virtualenv, and run the
mitmproxy test suite:
```shell
$ source ../venv.mitmproxy/bin/activate # ..\venv.mitmproxy\Scripts\activate.bat on Windows
$ nosetests ./test
```
Note that the main executables for the project - **mitmdump**, **mitmproxy** and
**mitmweb** - are all created within the virtualenv. After activating the
virtualenv, they will be on your $PATH, and you can run them like any other
command:
```$ mitmdump --version```
For convenience, the project includes an
[autoenv](https://github.com/kennethreitz/autoenv) file
([.env](https://github.com/mitmproxy/mitmproxy/blob/master/.env)) that
auto-activates the virtualenv when you cd into the mitmproxy directory.
### Testing
If you've followed the procedure above, you already have all the development
requirements installed, and you can simply run the test suite:
```nosetests ./test```
Please ensure that all patches are accompanied by matching changes in the test
suite. The project maintains 100% test coverage.
### Docs
Rendering the documentation requires [countershape](http://github.com/cortesi/countershape). After installation, you can render the documentation to the doc like this:
`cshape doc-src doc`

203
README.rst Normal file
View File

@@ -0,0 +1,203 @@
mitmproxy
^^^^^^^^^
|travis| |appveyor| |coverage| |latest_release| |python_versions|
This repository contains the **mitmproxy** and **pathod** projects, as well as
their shared networking library, **netlib**.
``mitmproxy`` is an interactive, SSL-capable intercepting proxy with a console
interface.
``mitmdump`` is the command-line version of mitmproxy. Think tcpdump for HTTP.
``pathoc`` and ``pathod`` are perverse HTTP client and server applications
designed to let you craft almost any conceivable HTTP request, including ones
that creatively violate the standards.
Documentation & Help
--------------------
General information, tutorials, and precompiled binaries can be found on the mitmproxy
and pathod websites.
|mitmproxy_site| |pathod_site|
The latest documentation for mitmproxy is also available on ReadTheDocs.
|mitmproxy_docs|
Join our discussion forum on Discourse to ask questions, help
each other solve problems, and come up with new ideas for the project.
|mitmproxy_discourse|
Join our developer chat on Slack if you would like to hack on mitmproxy itself.
|slack|
Installation
------------
The installation instructions are `here <http://docs.mitmproxy.org/en/stable/install.html>`_.
If you want to contribute changes, keep on reading.
Hacking
-------
To get started hacking on mitmproxy, make sure you have Python_ 3.5.x or above with
virtualenv_ installed (you can find installation instructions for virtualenv
`here <http://virtualenv.readthedocs.org/en/latest/>`_). Then do the following:
.. code-block:: text
git clone https://github.com/mitmproxy/mitmproxy.git
cd mitmproxy
./dev.sh # powershell .\dev.ps1 on Windows
The *dev* script will create a virtualenv environment in a directory called
"venv", and install all mandatory and optional dependencies into it. The
primary mitmproxy components - mitmproxy, netlib and pathod - are installed as
"editable", so any changes to the source in the repository will be reflected
live in the virtualenv.
To confirm that you're up and running, activate the virtualenv, and run the
mitmproxy test suite:
.. code-block:: text
. venv/bin/activate # venv\Scripts\activate on Windows
py.test
Note that the main executables for the project - ``mitmdump``, ``mitmproxy``,
``mitmweb``, ``pathod``, and ``pathoc`` - are all created within the
virtualenv. After activating the virtualenv, they will be on your $PATH, and
you can run them like any other command:
.. code-block:: text
mitmdump --version
For convenience, the project includes an autoenv_ file (`.env`_) that
auto-activates the virtualenv when you cd into the mitmproxy directory.
Testing
-------
If you've followed the procedure above, you already have all the development
requirements installed, and you can simply run the test suite:
.. code-block:: text
py.test
Please ensure that all patches are accompanied by matching changes in the test
suite. The project tries to maintain 100% test coverage.
You can also use `tox` to run a full suite of tests in Python 2.7 and 3.5,
including a quick test to check documentation and code linting.
The following tox environments are relevant for local testing:
.. code-block:: text
tox -e py27 # runs all tests with Python 2.7
tox -e py35 # runs all tests with Python 3.5
tox -e docs # runs a does-it-compile check on the documentation
tox -e lint # runs the linter for coding style checks
We support Python 2.7 and 3.5, so please make sure all tests pass in both
environments. Running `tox` ensures all necessary tests are executed.
Documentation
-------------
The mitmproxy documentation is build using Sphinx_, which is installed
automatically if you set up a development environment as described above. After
installation, you can render the documentation like this:
.. code-block:: text
cd docs
make clean
make html
make livehtml
The last command invokes `sphinx-autobuild`_, which watches the Sphinx directory and rebuilds
the documentation when a change is detected.
Style
-----
Keeping to a consistent code style throughout the project makes it easier to
contribute and collaborate. Please stick to the guidelines in
`PEP8`_ and the `Google Style Guide`_ unless there's a very
good reason not to.
This is automatically enforced on every PR. If we detect a linting error, the
PR checks will fail and block merging. We are using this command to check for style compliance:
.. code-block:: text
flake8 --jobs 8 --count mitmproxy netlib pathod examples test
.. |mitmproxy_site| image:: https://shields.mitmproxy.org/api/https%3A%2F%2F-mitmproxy.org-blue.svg
:target: https://mitmproxy.org/
:alt: mitmproxy.org
.. |pathod_site| image:: https://shields.mitmproxy.org/api/https%3A%2F%2F-pathod.net-blue.svg
:target: https://pathod.net/
:alt: pathod.net
.. |mitmproxy_docs| image:: https://readthedocs.org/projects/mitmproxy/badge/
:target: http://docs.mitmproxy.org/en/latest/
:alt: mitmproxy documentation
.. |mitmproxy_discourse| image:: https://shields.mitmproxy.org/api/https%3A%2F%2F-discourse.mitmproxy.org-orange.svg
:target: https://discourse.mitmproxy.org
:alt: Discourse: mitmproxy
.. |slack| image:: http://slack.mitmproxy.org/badge.svg
:target: http://slack.mitmproxy.org/
:alt: Slack Developer Chat
.. |travis| image:: https://shields.mitmproxy.org/travis/mitmproxy/mitmproxy/master.svg?label=Travis%20build
:target: https://travis-ci.org/mitmproxy/mitmproxy
:alt: Travis Build Status
.. |appveyor| image:: https://shields.mitmproxy.org/appveyor/ci/mhils/mitmproxy/master.svg?label=Appveyor%20build
:target: https://ci.appveyor.com/project/mhils/mitmproxy
:alt: Appveyor Build Status
.. |coverage| image:: https://codecov.io/gh/mitmproxy/mitmproxy/branch/master/graph/badge.svg
:target: https://codecov.io/gh/mitmproxy/mitmproxy
:alt: Coverage Status
.. |latest_release| image:: https://shields.mitmproxy.org/pypi/v/mitmproxy.svg
:target: https://pypi.python.org/pypi/mitmproxy
:alt: Latest Version
.. |python_versions| image:: https://shields.mitmproxy.org/pypi/pyversions/mitmproxy.svg
:target: https://pypi.python.org/pypi/mitmproxy
:alt: Supported Python versions
.. _Python: https://www.python.org/
.. _virtualenv: http://virtualenv.readthedocs.org/en/latest/
.. _autoenv: https://github.com/kennethreitz/autoenv
.. _.env: https://github.com/mitmproxy/mitmproxy/blob/master/.env
.. _Sphinx: http://sphinx-doc.org/
.. _sphinx-autobuild: https://pypi.python.org/pypi/sphinx-autobuild
.. _issue_tracker: https://github.com/mitmproxy/mitmproxy/issues
.. _PEP8: https://www.python.org/dev/peps/pep-0008
.. _Google Style Guide: https://google.github.io/styleguide/pyguide.html

View File

@@ -1,11 +0,0 @@
**mitmproxy** is an interactive, SSL-capable man-in-the-middle proxy for HTTP
with a console interface.
**mitmdump** is the command-line version of mitmproxy. Think tcpdump for HTTP.
**libmproxy** is the library that mitmproxy and mitmdump are built on.
Complete documentation and a set of practical tutorials is included in the
distribution package, and is also available at mitmproxy.org_.
.. _mitmproxy.org: http://mitmproxy.org

View File

@@ -1,20 +0,0 @@
#!/bin/bash
autopep8 -i -r -a -a .
if [[ -n "$(git status -s)" ]]; then
echo "autopep8 yielded the following changes:"
git status -s
git --no-pager diff
exit 1
fi
autoflake -i -r --remove-all-unused-imports --remove-unused-variables .
if [[ -n "$(git status -s)" ]]; then
echo "autoflake yielded the following changes:"
git status -s
git --no-pager diff
exit 1
fi
echo "Coding style seems to be ok."
exit 0

12
dev
View File

@@ -1,12 +0,0 @@
#!/bin/bash
set -e
VENV=../venv.mitmproxy
python -m virtualenv $VENV
source $VENV/bin/activate
pip install --src .. -r requirements.txt
echo ""
echo "* Created virtualenv environment in $VENV."
echo "* Installed all dependencies into the virtualenv."
echo "* Activated virtualenv environment."

14
dev.bat
View File

@@ -1,14 +0,0 @@
@echo off
set VENV=..\venv.mitmproxy
virtualenv %VENV%
if %errorlevel% neq 0 exit /b %errorlevel%
call %VENV%\Scripts\activate.bat
if %errorlevel% neq 0 exit /b %errorlevel%
pip install --src .. -r requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo * Created virtualenv environment in %VENV%.
echo * Installed all dependencies into the virtualenv.
echo * Activated virtualenv environment.

16
dev.ps1 Normal file
View File

@@ -0,0 +1,16 @@
$ErrorActionPreference = "Stop"
$VENV = ".\venv"
virtualenv $VENV --always-copy
& $VENV\Scripts\activate.ps1
python -m pip install --disable-pip-version-check -U pip
cmd /c "pip install -r requirements.txt 2>&1"
echo @"
* Created virtualenv environment in $VENV.
* Installed all dependencies into the virtualenv.
* Activated virtualenv environment.
"@

17
dev.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
set -e
set -x
PYVERSION=$1
VENV="venv$1"
echo "Creating dev environment in $VENV using Python $PYVERSION"
python$PYVERSION -m virtualenv "$VENV" --always-copy
. "$VENV/bin/activate"
pip$PYVERSION install -U pip setuptools
pip$PYVERSION install -r requirements.txt
echo ""
echo "* Virtualenv created in $VENV and all dependencies installed."
echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV/bin/activate\`"

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +0,0 @@
.masthead {
text-align: center;
border-bottom: 0;
}
.frontpage .talks div {
margin-bottom: 10px;
}
.nav-sidebar {
background-color: #f0f0f0;
margin-bottom: 20px;
}
.nav-sidebar li {
line-height: 1.1;
}
.nav-sidebar li > a,
.nav-sidebar .nav-header {
padding-left: 20px;
}
.nav-sidebar .nav-header {
margin-top: 1em;
font-size: 1.2em;
font-weight: bold;
}
.nav-sidebar .active > a,
.nav-sidebar .active > a:hover,
.nav-sidebar .active > a:focus {
color: #fff;
background-color: #428bca;
}
.tablenum {
font-weight: bold;
}
.nowrap {
white-space: nowrap;
}
.page-header {
margin: 0px 0 22px;
}
.page-header h1 {
margin-top: 0px;
}
/*# sourceMappingURL=02-app.css.map */

View File

@@ -1,44 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>@!pageTitle!@</title>
$!header!$
</head>
<body>
<div class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="@!urlTo("/index.html")!@">
<img height="20px" src="@!urlTo("mitmproxy-long.png")!@"/>
</a>
</div>
<div class="navbar-header navbar-right">
<a class="navbar-brand" hre="#">$!VERSION!$ docs</a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
$!navbar!$
</div>
<div class="col-md-9">
<div class="page-header">
<h1>@!this.title!@</h1>
</div>
$!body!$
</div>
</div>
</div>
<div class="container">
<hr>
<footer>
<p>@!copyright!@</p>
</footer>
</div>
</body>
</html>

View File

@@ -1,50 +0,0 @@
<ul class="nav nav-sidebar">
$!nav(idxpath, this, state)!$
$!nav("install.html", this, state)!$
$!nav("certinstall.html", this, state)!$
$!nav("howmitmproxy.html", this, state)!$
$!nav("modes.html", this, state)!$
<li class="nav-header">Tools</li>
$!nav("mitmproxy.html", this, state)!$
$!nav("mitmdump.html", this, state)!$
$!nav("config.html", this, state)!$
<li class="nav-header">Features</li>
$!nav("anticache.html", this, state)!$
$!nav("filters.html", this, state)!$
$!nav("replacements.html", this, state)!$
$!nav("clientreplay.html", this, state)!$
$!nav("serverreplay.html", this, state)!$
$!nav("setheaders.html", this, state)!$
$!nav("passthrough.html", this, state)!$
$!nav("proxyauth.html", this, state)!$
$!nav("reverseproxy.html", this, state)!$
$!nav("responsestreaming.html", this, state)!$
$!nav("socksproxy.html", this, state)!$
$!nav("sticky.html", this, state)!$
$!nav("tcpproxy.html", this, state)!$
$!nav("upstreamproxy.html", this, state)!$
$!nav("upstreamcerts.html", this, state)!$
<li class="nav-header">Transparent Proxying</li>
$!nav("transparent.html", this, state)!$
$!nav("transparent/linux.html", this, state)!$
$!nav("transparent/osx.html", this, state)!$
<li class="nav-header">Scripting</li>
$!nav("scripting/inlinescripts.html", this, state)!$
$!nav("scripting/libmproxy.html", this, state)!$
<li class="nav-header">Tutorials</li>
$!nav("tutorials/30second.html", this, state)!$
$!nav("tutorials/gamecenter.html", this, state)!$
$!nav("tutorials/transparent-dhcp.html", this, state)!$
<li class="nav-header">Hacking</li>
$!nav("dev/architecture.html", this, state)!$
$!nav("dev/testing.html", this, state)!$
$!nav("dev/sslkeylogfile.html", this, state)!$
</ul>

View File

@@ -1,151 +0,0 @@
## On This Page
* [Introduction](#docIntro)
* [Quick Setup](#docQuick)
* [Installing the mitmproxy CA certificate manually](#docManual)
* [More on mitmproxy certificates](#docMore)
* [CA and cert files](#docCertfiles)
* [Using a custom certificate](#docCustom)
* [Using a client side certificate](#docClient)
* [Using a custom certificate authority](#docCA)
## <a id="docIntro"></a>Introduction
Mitmproxy can decrypt encrypted traffic on the fly, as long as the client
trusts its built-in certificate authority. Usually this means that the
mitmproxy CA certificates have to be installed on the client device.
## <a id="docQuick"></a>Quick Setup
By far the easiest way to install the mitmproxy certificates is to use the
built-in certificate installation app. To do this, just start mitmproxy and
configure your target device with the correct proxy settings. Now start a
browser on the device, and visit the magic domain **mitm.it**. You should see
something like this:
<img src="@!urlTo("certinstall-webapp.png")!@"></img>
Click on the relevant icon, and follow the setup instructions for the platform
you're on, and you are good to go.
## <a id="docManual"></a>Installing the mitmproxy CA certificate manually
Sometimes using the quick install app is not an option - Java or the IOS
similator spring to mind - or you just need to do it manually for some other
reason. Below is a list of pointers to manual certificate installation
documentation for some common platforms:
<table class="table">
<tr>
<td><a href="https://github.com/ADVTOOLS/ADVTrustStore#how-to-use-advtruststore"</a>iOS Simulator</td>
<td><a href="http://docs.oracle.com/cd/E19906-01/820-4916/geygn/index.html">Java</a></td>
</tr>
<tr>
<td><a href="http://kb.mit.edu/confluence/pages/viewpage.action?pageId=152600377">iOS</a></td>
<td><a href="http://wiki.cacert.org/FAQ/ImportRootCert#Android_Phones_.26_Tablets">Android/Android Simulator</a></td>
</tr>
<tr>
<td><a href="http://windows.microsoft.com/en-ca/windows/import-export-certificates-private-keys#1TC=windows-7">Windows</a></td>
<td><a href="https://support.apple.com/kb/PH7297?locale=en_US">Mac OS X</a></td>
</tr>
<tr>
<td><a href="http://askubuntu.com/questions/73287/how-do-i-install-a-root-certificate/94861#94861">Ubuntu/Debian</a></td>
<td><a href="https://wiki.mozilla.org/MozillaRootCertificate#Mozilla_Firefox">Firefox</a></td>
</tr>
<tr>
<td><a href="https://code.google.com/p/chromium/wiki/LinuxCertManagement">Chrome on Linux</a></td>
</tr>
</table>
## <a id="docMore"></a>More on mitmproxy certificates
The first time __mitmproxy__ or __mitmdump__ is run, the mitmproxy Certificate
Authority(CA) is created in the config directory (~/.mitmproxy by default).
This CA is used for on-the-fly generation of dummy certificates for each of the
SSL sites that your client visits. Since your browser won't trust the
__mitmproxy__ CA out of the box , you will see an SSL certificate warning every
time you visit a new SSL domain through __mitmproxy__. When you are testing a
single site through a browser, just accepting the bogus SSL cert manually is
not too much trouble, but there are a many circumstances where you will want to
configure your testing system or browser to trust the __mitmproxy__ CA as a
signing root authority.
## <a id="docCertfiles"></a>CA and cert files
The files created by mitmproxy in the .mitmproxy directory are as follows:
<table class="table">
<tr>
<td class="nowrap">mitmproxy-ca.pem</td>
<td>The private key and certificate in PEM format.</td>
</tr>
<tr>
<td class="nowrap">mitmproxy-ca-cert.pem</td>
<td>The certificate in PEM format. Use this to distribute to most
non-Windows platforms.</td>
</tr>
<tr>
<td class="nowrap">mitmproxy-ca-cert.p12</td>
<td>The certificate in PKCS12 format. For use on Windows.</td>
</tr>
<tr>
<td class="nowrap">mitmproxy-ca-cert.cer</td>
<td>Same file as .pem, but with an extension expected by some Android
devices.</td>
</tr>
</table>
## <a id="docCustom"></a>Using a custom certificate
You can use your own certificate by passing the <kbd>--cert</kbd> option to
mitmproxy. mitmproxy then uses the provided certificate for interception of the
specified domains instead of generating a certificate signed by its own CA.
The certificate file is expected to be in the PEM format. You can include
intermediary certificates right below your leaf certificate, so that you PEM
file roughly looks like this:
<pre>
-----BEGIN PRIVATE KEY-----
&lt;private key&gt;
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
&lt;cert&gt;
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
&lt;intermediary cert (optional)&gt;
-----END CERTIFICATE-----
</pre>
For example, you can generate a certificate in this format using these instructions:
<pre class="terminal">
$ openssl genrsa -out cert.key 2048
$ openssl req -new -x509 -key cert.key -out cert.crt
(Specify the mitm domain as Common Name, e.g. *.google.com)
$ cat cert.key cert.crt > cert.pem
$ mitmproxy --cert=cert.pem
</pre>
## <a id="docClient"></a>Using a client side certificate
You can use a client certificate by passing the <kbd>--client-certs
DIRECTORY</kbd> option to mitmproxy. If you visit example.org, mitmproxy looks
for a file named example.org.pem in the specified directory and uses this as
the client cert. The certificate file needs to be in the PEM format and should
contain both the unencrypted private key and the certificate.
## <a id="docCA"></a>Using a custom certificate authority
By default, mitmproxy will use <samp>~/.mitmproxy/mitmproxy-ca.pem</samp> as
the certificate authority to generate certificates for all domains for which no
custom certificate is provided (see above). You can use your own certificate
authority by passing the <kbd>--confdir</kbd> option to mitmproxy. Mitmproxy
will then look for <samp>mitmproxy-ca.pem</samp> in the specified directory. If
no such file exists, it will be generated automatically.

View File

@@ -1,86 +0,0 @@
Mitmproxy is configured through a set of files in the users ~/.mitmproxy
directory.
<table class="table">
<tbody>
<tr>
<th>mitmproxy.conf</th>
<td>Settings for the <b>mitmproxy</b>. This file can contain any options supported by mitmproxy.</td>
</tr>
<tr>
<th>mitmdump.conf</th>
<td>Settings for the <b>mitmdump</b>. This file can contain any options supported by mitmdump.</td>
</tr>
<tr>
<th>common.conf</th>
<td>Settings shared between all command-line tools. Settings in
this file are over-ridden by those in the tool-specific
files. Only options shared by mitmproxy and mitmdump should be used in this file. </td>
</tr>
</tbody>
</table>
# Syntax
## Comments
<pre>
# this is a comment
; this is also a comment (.ini style)
--- and this is a comment too (yaml style)
</pre>
## Key/Value pairs
- Keys and values are case-sensitive
- Whitespace is ignored
- Lists are comma-delimited, and enclosed in square brackets
<pre>
name = value # (.ini style)
name: value # (yaml style)
--name value # (command-line option style)
fruit = [apple, orange, lemon]
indexes = [1, 12, 35 , 40]
</pre>
## Flags
These are boolean options that take no value but true/false.
<pre>
name = true # (.ini style)
name
--name # (command-line option style)
</pre>
# Options
The options available in the config files are precisely those available as
command-line flags, with the key being the option's long name. To get a
complete list of these, use the __--help__ option on each of the tools. Be
careful to only specify common options in the __common.conf__ file -
unsupported options in this file will be detected as an error on startup.
# Examples
## common.conf
Note that __port__ is an option supported by all tools.
<pre class="code">
port = 8080
</pre>
## mitmproxy.conf
<pre class="code">
palette = light
</pre>

View File

@@ -1,8 +0,0 @@
To give you a better understanding of how mitmproxy works, mitmproxy's
high-level architecture is detailed in the following graphic:
<img class="img-responsive" src="@!urlTo('schematics/architecture.png')!@">
<a href="@!urlTo('schematics/architecture.pdf')!@">(architecture.pdf)</a>
<p>Please don't refrain from asking any further
questions on the mailing list, the IRC channel or the GitHub issue tracker.</p>

View File

@@ -1,8 +0,0 @@
from countershape import Page
pages = [
Page("testing.html", "Testing"),
Page("architecture.html", "Architecture"),
Page("sslkeylogfile.html", "TLS Master Secrets"),
# Page("addingviews.html", "Writing Content Views"),
]

View File

@@ -1,8 +0,0 @@
The SSL master keys can be logged by mitmproxy so that external programs can decrypt TLS connections both from and to the proxy.
Key logging is enabled by setting the environment variable <samp>SSLKEYLOGFILE</samp> so that it points to a writable
text file. Recent versions of WireShark can use these log files to decrypt packets.
You can specify the key file path in WireShark via<br>
<samp>Edit → Preferences → Protocols → SSL → (Pre)-Master-Secret log filename</samp>.
Note that <samp>SSLKEYLOGFILE</samp> is respected by other programs as well, e.g. Firefox and Chrome.
If this creates any issues, you can set <samp>MITMPROXY_SSLKEYLOGFILE</samp> alternatively.

View File

@@ -1,43 +0,0 @@
All the mitmproxy projects strive to maintain 100% code coverage. In general,
patches and pull requests will be declined unless they're accompanied by a
suitable extension to the test suite.
Our tests are written for the [nose](https://nose.readthedocs.org/en/latest/).
At the point where you send your pull request, a command like this:
<pre class="terminal">
> nosetests --with-cov --cov-report term-missing ./test
</pre>
Should give output something like this:
<pre class="terminal">
> ---------- coverage: platform darwin, python 2.7.2-final-0 --
> Name Stmts Miss Cover Missing
> ----------------------------------------------------
> libmproxy/__init__ 0 0 100%
> libmproxy/app 4 0 100%
> libmproxy/cmdline 100 0 100%
> libmproxy/controller 69 0 100%
> libmproxy/dump 150 0 100%
> libmproxy/encoding 39 0 100%
> libmproxy/filt 201 0 100%
> libmproxy/flow 891 0 100%
> libmproxy/proxy 427 0 100%
> libmproxy/script 27 0 100%
> libmproxy/utils 133 0 100%
> libmproxy/version 4 0 100%
> ----------------------------------------------------
> TOTAL 2045 0 100%
> ----------------------------------------------------
> Ran 251 tests in 11.864s
</pre>
There are exceptions to the coverage requirement - for instance, much of the
console interface code can't sensibly be unit tested. These portions are
excluded from coverage analysis either in the **.coveragerc** file, or using
**#pragma no-cover** directives. To keep our coverage analysis relevant, we use
these measures as sparingly as possible.

View File

@@ -1,18 +0,0 @@
When the __anticache__ option is passed to mitmproxy, it removes headers
(__if-none-match__ and __if-modified-since__) that might elicit a
304-not-modified response from the server. This is useful when you want to make
sure you capture an HTTP exchange in its totality. It's also often used during
[client replay](@!urlTo("clientreplay.html")!@), when you want to make sure the
server responds with complete data.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>--anticache</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>o</b> then <b>a</b></td>
</tr>
</tbody>
</table>

View File

@@ -1,19 +0,0 @@
from countershape import Page
pages = [
Page("anticache.html", "Anticache"),
Page("clientreplay.html", "Client-side replay"),
Page("filters.html", "Filter expressions"),
Page("passthrough.html", "Ignore Domains"),
Page("proxyauth.html", "Proxy Authentication"),
Page("replacements.html", "Replacements"),
Page("responsestreaming.html", "Response Streaming"),
Page("reverseproxy.html", "Reverse proxy mode"),
Page("socksproxy.html", "SOCKS Mode"),
Page("setheaders.html", "Set Headers"),
Page("serverreplay.html", "Server-side replay"),
Page("sticky.html", "Sticky cookies and auth"),
Page("tcpproxy.html", "TCP Proxy"),
Page("upstreamcerts.html", "Upstream Certs"),
Page("upstreamproxy.html", "Upstream proxy mode"),
]

View File

@@ -1,84 +0,0 @@
There are two main reasons why you may want to exempt some traffic from mitmproxy's interception mechanism:
- **Certificate pinning:** Some traffic is is protected using
[certificate pinning](https://security.stackexchange.com/questions/29988/what-is-certificate-pinning) and mitmproxy's
interception leads to errors. For example, Windows Update or the Apple App Store fail to work if mitmproxy is active.
- **Convenience:** You really don't care about some parts of the traffic and just want them to go away.
If you want to peek into (SSL-protected) non-HTTP connections, check out the [tcp proxy](@!urlTo("tcpproxy.html")!@) feature.
If you want to ignore traffic from mitmproxy's processing because of large response bodies, take a look at the
[response streaming](@!urlTo("responsestreaming.html")!@) feature.
## How it works
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>--ignore regex</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>I</b></td>
</tr>
</tbody>
</table>
mitmproxy allows you to specify a regex which is matched against a <code>host:port</code> string (e.g. "example.com:443")
to determine hosts that should be excluded.
There are two important quirks to consider:
- **In transparent mode, the ignore pattern is matched against the IP.** While we usually infer the hostname from the
Host header if the --host argument is passed to mitmproxy, we do not have access to this information before the SSL
handshake.
- In regular mode, explicit HTTP requests are never ignored.[^explicithttp] The ignore pattern is applied on CONNECT
requests, which initiate HTTPS or clear-text WebSocket connections.
### Tutorial
If you just want to ignore one specific domain, there's usually a bulletproof method to do so:
1. Run mitmproxy or mitmdump in verbose mode (-v) and observe the host:port information in the serverconnect
messages. mitmproxy will filter on these.
2. Take the host:port string, surround it with ^ and $, escape all dots (. becomes \\.)
and use this as your ignore pattern:
<pre class="terminal">
$ mitmdump -v
127.0.0.1:50588: clientconnect
127.0.0.1:50588: request
-> CONNECT example.com:443 HTTP/1.1
127.0.0.1:50588: Set new server address: example.com:443
127.0.0.1:50588: serverconnect
-> example.com:443
^C
$ mitmproxy --ignore ^example\.com:443$
</pre>
Here are some other examples for ignore patterns:
<pre>
# Exempt traffic from the iOS App Store (the regex is lax, but usually just works):
--ignore apple.com:443
# "Correct" version without false-positives:
--ignore '^(.+\.)?apple\.com:443$'
# Ignore example.com, but not its subdomains:
--ignore '^example.com:'
# Ignore everything but example.com and mitmproxy.org:
--ignore '^(?!example\.com)(?!mitmproxy\.org)'
# Transparent mode:
--ignore 17\.178\.96\.59:443
# IP address range:
--ignore 17\.178\.\d+\.\d+:443
</pre>
### See Also
- [TCP Proxy](@!urlTo("tcpproxy.html")!@)
- [Response Streaming](@!urlTo("responsestreaming.html")!@)
[^explicithttp]: This stems from an limitation of explicit HTTP proxying: A single connection can be re-used for multiple target domains - a <code>GET http://example.com/</code> request may be followed by a <code>GET http://evil.com/</code> request on the same connection. If we start to ignore the connection after the first request, we would miss the relevant second one.

View File

@@ -1,26 +0,0 @@
Asks the user for authentication before they are permitted to use the proxy.
Authentication headers are stripped from the flows, so they are not passed to
upstream servers. For now, only HTTP Basic authentication is supported. The
proxy auth options are ignored if the proxy is in transparent or reverse proxy
mode.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th>
<td>
<ul>
<li>--nonanonymous</li>
<li>--singleuser USER</li>
<li>--htpasswd PATH</li>
</ul>
</td>
</tr>
</tbody>
</table>

View File

@@ -1,58 +0,0 @@
By using mitmproxy's streaming feature, response contents can be passed to the client incrementally before they have been fully received by the proxy.
This is especially useful for large binary files such as videos, where buffering the whole file slows down the client's browser.
By default, mitmproxy will read the entire response, perform any indicated
manipulations on it and then send the (possibly modified) response to
the client. In some cases this is undesirable and you may wish to "stream"
the reponse back to the client. When streaming is enabled, the response is
not buffered on the proxy but directly sent back to the client instead.
<h2>On the command-line</h2>
Streaming can be enabled on the command line for all response bodies exceeding a certain size. The SIZE argument understands
k/m/g suffixes, e.g. 3m for 3 megabytes.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th>
<td>
--stream SIZE
</td>
</tr>
</tbody>
</table>
<h2>Caveats</h2>
When response streaming is enabled, <strong>streamed response contents will not be
recorded or preserved in any way.</strong>
When response streaming is enabled, the response body cannot be modified.
<h2>Customizing Response Streaming</h2>
You can also use an <a href="@!urlTo("scripting/inlinescripts.html")!@">inline script</a> to customize exactly
which responses are streamed.
Responses that should be tagged for streaming by setting their respective .stream attribute to True:
$!example("examples/stream.py")!$
<h2>Implementation Details</h2>
When response streaming is enabled, portions of the code which would have otherwise performed changes
on the response body will see an empty response body instead (<code>libmproxy.protocol.http.CONTENT_MISSING</code>). Any modifications will be ignored.
Streamed responses are usually sent in chunks of 4096 bytes. If the response is sent with a <code>Transfer-Encoding:
chunked</code> header, the response will be streamed one chunk at a time.
<h2>Modifying streamed data</h2>
If the <code>.stream</code> attribute is callable, .stream will work as a hook in chunk data processing.
$!example("examples/stream_modify.py")!$
### See Also
- [Ignore Domains](@!urlTo("passthrough.html")!@)

View File

@@ -1,52 +0,0 @@
In reverse proxy mode, mitmproxy accepts standard HTTP requests and forwards
them to the specified upstream server. This is in contrast to
<a href="@!urlTo("upstreamproxy.html")!@">upstream proxy mode</a>, in which
mitmproxy forwards HTTP proxy requests to an upstream proxy server.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>-R <i>schema</i>://hostname[:port]</td>
</tr>
</tbody>
</table>
Here, **schema** is one of http, https, http2https or https2http. The latter
two extended schema specifications control the use of HTTP and HTTPS on
mitmproxy and the upstream server. You can indicate that mitmproxy should use
HTTP, and the upstream server uses HTTPS like this:
http2https://hostname:port
And you can indicate that mitmproxy should use HTTPS while the upstream
service uses HTTP like this:
https2http://hostname:port
### Host Header
In reverse proxy mode, mitmproxy does not rewrite the host header. While often useful, this
may lead to issues with public web servers. For example, consider the following scenario:
$ python mitmdump -d -R http://example.com/ &
$ curl http://localhost:8080/
>> GET https://example.com/
Host: localhost:8080
User-Agent: curl/7.35.0
[...]
<< 404 Not Found 345B
Since the Host header doesn't match <samp>example.com</samp>, an error is returned.<br>
There are two ways to solve this:
<ol>
<li>Modify the hosts file of your OS so that example.com resolves to 127.0.0.1.</li>
<li>
Instruct mitmproxy to rewrite the host header by passing <kbd>&#8209;&#8209;setheader&nbsp;:~q:Host:example.com</kbd>.
However, keep in mind that absolute URLs within the returned document or HTTP redirects will cause the client application
to bypass the proxy.
</li>
</ol>

View File

@@ -1,18 +0,0 @@
This feature lets you specify a set of headers to be added to requests or
responses, based on a filter pattern. You can specify these either on the
command-line, or through an interactive editor in mitmproxy.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th>
<td>
--setheader PATTERN
</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>H</b></td>
</tr>
</tbody>
</table>

View File

@@ -1,10 +0,0 @@
In this mode, mitmproxy acts as a SOCKS5 proxy server.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>--socks</td>
</tr>
</tbody>
</table>

View File

@@ -1,60 +0,0 @@
## Sticky cookies
When the sticky cookie option is set, __mitmproxy__ will add the cookie most
recently set by the server to any cookie-less request. Consider a service that
sets a cookie to track the session after authentication. Using sticky cookies,
you can fire up mitmproxy, and authenticate to a service as you usually would
using a browser. After authentication, you can request authenticated resources
through mitmproxy as if they were unauthenticated, because mitmproxy will
automatically add the session tracking cookie to requests. Among other things,
this lets you script interactions with authenticated resources (using tools
like wget or curl) without having to worry about authentication.
Sticky cookies are especially powerful when used in conjunction with [client
replay](@!urlTo("clientreplay.html")!@) - you can record the authentication
process once, and simply replay it on startup every time you need to interact
with the secured resources.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th>
<td>
<ul>
<li>-t FILTER</li>
</ul>
</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>t</b></td>
</tr>
</tbody>
</table>
## Sticky auth
The sticky auth option is analogous to the sticky cookie option, in that HTTP
__Authorization__ headers are simply replayed to the server once they have been
seen. This is enough to allow you to access a server resource using HTTP Basic
authentication through the proxy. Note that __mitmproxy__ doesn't (yet) support
replay of HTTP Digest authentication.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th>
<td>
<ul>
<li>-u FILTER</li>
</ul>
</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>u</b></td>
</tr>
</tbody>
</table>

View File

@@ -1,30 +0,0 @@
WebSockets or other non-HTTP protocols are not supported by mitmproxy yet. However, you can exempt hostnames from
processing, so that mitmproxy acts as a generic TCP forwarder. This feature is closely related to the
[ignore domains](@!urlTo("passthrough.html")!@) functionality, but differs in two important aspects:
- The raw TCP messages are printed to the event log.
- SSL connections will be intercepted.
Please note that message interception or modification are not possible yet.
If you are not interested in the raw TCP messages, you should use the ignore domains feature.
## How it works
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>--tcp HOST</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>T</b></td>
</tr>
</tbody>
</table>
For a detailed description on the structure of the hostname pattern, please refer to the [Ignore Domains](@!urlTo("passthrough.html")!@) feature.
### See Also
- [Ignore Domains](@!urlTo("passthrough.html")!@)
- [Response Streaming](@!urlTo("responsestreaming.html")!@)

View File

@@ -1,13 +0,0 @@
In this mode, mitmproxy accepts proxy requests and unconditionally forwards all
requests to a specified upstream proxy server. This is in contrast to <a
href="@!urlTo("reverseproxy.html")!@">reverse proxy mode</a>, in which
mitmproxy forwards ordinary HTTP requests to an upstream server.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>-U http://hostname[:port]</td>
</tr>
</tbody>
</table>

View File

@@ -1,360 +0,0 @@
Mitmproxy is an enormously flexible tool. Knowing exactly how the proxying
process works will help you deploy it creatively, and take into account its
fundamental assumptions and how to work around them. This document explains
mitmproxy's proxy mechanism in detail, starting with the simplest unencrypted
explicit proxying, and working up to the most complicated interaction -
transparent proxying of SSL-protected traffic[^ssl] in the presence of
[SNI](http://en.wikipedia.org/wiki/Server_Name_Indication).
<div class="page-header">
<h1>Explicit HTTP</h1>
</div>
Configuring the client to use mitmproxy as an explicit proxy is the simplest
and most reliable way to intercept traffic. The proxy protocol is codified in
the [HTTP RFC](http://www.ietf.org/rfc/rfc2068.txt), so the behaviour of both
the client and the server is well defined, and usually reliable. In the
simplest possible interaction with mitmproxy, a client connects directly to the
proxy, and makes a request that looks like this:
<pre>GET http://example.com/index.html HTTP/1.1</pre>
This is a proxy GET request - an extended form of the vanilla HTTP GET request
that includes a schema and host specification, and it includes all the
information mitmproxy needs to proceed.
<img class="img-responsive" src="explicit.png"/>
<table class="table">
<tbody>
<tr>
<td><b>1</b></td>
<td>The client connects to the proxy and makes a request.</td>
</tr>
<tr>
<td><b>2</b></td>
<td>Mitmproxy connects to the upstream server and simply forwards
the request on.</td>
</tr>
</tbody>
</table>
<div class="page-header">
<h1>Explicit HTTPS</h1>
</div>
The process for an explicitly proxied HTTPS connection is quite different. The
client connects to the proxy and makes a request that looks like this:
<pre>CONNECT example.com:443 HTTP/1.1</pre>
A conventional proxy can neither view nor manipulate an SSL-encrypted data
stream, so a CONNECT request simply asks the proxy to open a pipe between the
client and server. The proxy here is just a facilitator - it blindly forwards
data in both directions without knowing anything about the contents. The
negotiation of the SSL connection happens over this pipe, and the subsequent
flow of requests and responses are completely opaque to the proxy.
## The MITM in mitmproxy
This is where mitmproxy's fundamental trick comes into play. The MITM in its
name stands for Man-In-The-Middle - a reference to the process we use to
intercept and interfere with these theoretically opaque data streams. The basic
idea is to pretend to be the server to the client, and pretend to be the client
to the server, while we sit in the middle decoding traffic from both sides. The
tricky part is that the [Certificate
Authority](http://en.wikipedia.org/wiki/Certificate_authority) system is
designed to prevent exactly this attack, by allowing a trusted third-party to
cryptographically sign a server's SSL certificates to verify that they are
legit. If this signature doesn't match or is from a non-trusted party, a secure
client will simply drop the connection and refuse to proceed. Despite the many
shortcomings of the CA system as it exists today, this is usually fatal to
attempts to MITM an SSL connection for analysis. Our answer to this conundrum
is to become a trusted Certificate Authority ourselves. Mitmproxy includes a
full CA implementation that generates interception certificates on the fly. To
get the client to trust these certificates, we [register mitmproxy as a trusted
CA with the device manually](@!urlTo("certinstall.html")!@).
## Complication 1: What's the remote hostname?
To proceed with this plan, we need to know the domain name to use in the
interception certificate - the client will verify that the certificate is for
the domain it's connecting to, and abort if this is not the case. At first
blush, it seems that the CONNECT request above gives us all we need - in this
example, both of these values are "example.com". But what if the client had
initiated the connection as follows:
<pre>CONNECT 10.1.1.1:443 HTTP/1.1</pre>
Using the IP address is perfectly legitimate because it gives us enough
information to initiate the pipe, even though it doesn't reveal the remote
hostname.
Mitmproxy has a cunning mechanism that smooths this over - [upstream
certificate sniffing](@!urlTo("features/upstreamcerts.html")!@). As soon as we
see the CONNECT request, we pause the client part of the conversation, and
initiate a simultaneous connection to the server. We complete the SSL handshake
with the server, and inspect the certificates it used. Now, we use the Common
Name in the upstream SSL certificates to generate the dummy certificate for the
client. Voila, we have the correct hostname to present to the client, even if
it was never specified.
## Complication 2: Subject Alternative Name
Enter the next complication. Sometimes, the certificate Common Name is not, in
fact, the hostname that the client is connecting to. This is because of the
optional [Subject Alternative
Name](http://en.wikipedia.org/wiki/SubjectAltName) field in the SSL certificate
that allows an arbitrary number of alternative domains to be specified. If the
expected domain matches any of these, the client will proceed, even though the
domain doesn't match the certificate Common Name. The answer here is simple:
when extract the CN from the upstream cert, we also extract the SANs, and add
them to the generated dummy certificate.
## Complication 3: Server Name Indication
One of the big limitations of vanilla SSL is that each certificate requires its
own IP address. This means that you couldn't do virtual hosting where multiple
domains with independent certificates share the same IP address. In a world
with a rapidly shrinking IPv4 address pool this is a problem, and we have a
solution in the form of the [Server Name
Indication](http://en.wikipedia.org/wiki/Server_Name_Indication) extension to
the SSL and TLS protocols. This lets the client specify the remote server name
at the start of the SSL handshake, which then lets the server select the right
certificate to complete the process.
SNI breaks our upstream certificate sniffing process, because when we connect
without using SNI, we get served a default certificate that may have nothing to
do with the certificate expected by the client. The solution is another tricky
complication to the client connection process. After the client connects, we
allow the SSL handshake to continue until just _after_ the SNI value has been
passed to us. Now we can pause the conversation, and initiate an upstream
connection using the correct SNI value, which then serves us the correct
upstream certificate, from which we can extract the expected CN and SANs.
There's another wrinkle here. Due to a limitation of the SSL library mitmproxy
uses, we can't detect that a connection _hasn't_ sent an SNI request until it's
too late for upstream certificate sniffing. In practice, we therefore make a
vanilla SSL connection upstream to sniff non-SNI certificates, and then discard
the connection if the client sends an SNI notification. If you're watching your
traffic with a packet sniffer, you'll see two connections to the server when an
SNI request is made, the first of which is immediately closed after the SSL
handshake. Luckily, this is almost never an issue in practice.
## Putting it all together
Lets put all of this together into the complete explicitly proxied HTTPS flow.
<img class="img-responsive" src="explicit_https.png"/>
<table class="table">
<tbody>
<tr>
<td><b>1</b></td>
<td>The client makes a connection to mitmproxy, and issues an HTTP
CONNECT request.</td>
</tr>
<tr>
<td><b>2</b></td>
<td>Mitmproxy responds with a 200 Connection Established, as if it
has set up the CONNECT pipe.</td>
</tr>
<tr>
<td><b>3</b></td>
<td>The client believes it's talking to the remote server, and
initiates the SSL connection. It uses SNI to indicate the hostname
it is connecting to.</td>
</tr>
<tr>
<td><b>4</b></td>
<td>Mitmproxy connects to the server, and establishes an SSL
connection using the SNI hostname indicated by the client.</td>
</tr>
<tr>
<td><b>5</b></td>
<td>The server responds with the matching SSL certificate, which
contains the CN and SAN values needed to generate the interception
certificate.</td>
</tr>
<tr>
<td><b>6</b></td>
<td>Mitmproxy generates the interception cert, and continues the
client SSL handshake paused in step 3.</td>
</tr>
<tr>
<td><b>7</b></td>
<td>The client sends the request over the established SSL
connection.</td>
</tr>
<tr>
<td><b>7</b></td>
<td>Mitmproxy passes the request on to the server over the SSL
connection initiated in step 4.</td>
</tr>
</tbody>
</table>
<div class="page-header">
<h1>Transparent HTTP</h1>
</div>
When a transparent proxy is used, the HTTP/S connection is redirected into a
proxy at the network layer, without any client configuration being required.
This makes transparent proxying ideal for those situations where you can't
change client behaviour - proxy-oblivious Android applications being a common
example.
To achieve this, we need to introduce two extra components. The first is a
redirection mechanism that transparently reroutes a TCP connection destined for
a server on the Internet to a listening proxy server. This usually takes the
form of a firewall on the same host as the proxy server -
[iptables](http://www.netfilter.org/) on Linux or
[pf](http://en.wikipedia.org/wiki/PF_\(firewall\)) on OSX. Once the client has
initiated the connection, it makes a vanilla HTTP request, which might look
something like this:
<pre>GET /index.html HTTP/1.1</pre>
Note that this request differs from the explicit proxy variation, in that it
omits the scheme and hostname. How, then, do we know which upstream host to
forward the request to? The routing mechanism that has performed the
redirection keeps track of the original destination for us. Each routing
mechanism has a different way of exposing this data, so this introduces the
second component required for working transparent proxying: a host module that
knows how to retrieve the original destination address from the router. In
mitmproxy, this takes the form of a built-in set of
[modules](https://github.com/mitmproxy/mitmproxy/tree/master/libmproxy/platform)
that know how to talk to each platform's redirection mechanism. Once we have
this information, the process is fairly straight-forward.
<img class="img-responsive" src="transparent.png"/>
<table class="table">
<tbody>
<tr>
<td><b>1</b></td>
<td>The client makes a connection to the server.</td>
</tr>
<tr>
<td><b>2</b></td>
<td>The router redirects the connection to mitmproxy, which is
typically listening on a local port of the same host. Mitmproxy
then consults the routing mechanism to establish what the original
destination was.</td>
</tr>
<tr>
<td><b>3</b></td>
<td>Now, we simply read the client's request...</td>
</tr>
<tr>
<td><b>4</b></td>
<td>... and forward it upstream.</td>
</tr>
</tbody>
</table>
<div class="page-header">
<h1>Transparent HTTPS</h1>
</div>
The first step is to determine whether we should treat an incoming connection
as HTTPS. The mechanism for doing this is simple - we use the routing mechanism
to find out what the original destination port is. By default, we treat all
traffic destined for ports 443 and 8443 as SSL.
From here, the process is a merger of the methods we've described for
transparently proxying HTTP, and explicitly proxying HTTPS. We use the routing
mechanism to establish the upstream server address, and then proceed as for
explicit HTTPS connections to establish the CN and SANs, and cope with SNI.
<img class="img-responsive" src="transparent_https.png"/>
<table class="table">
<tbody>
<tr>
<td><b>1</b></td>
<td>The client makes a connection to the server.</td>
</tr>
<tr>
<td><b>2</b></td>
<td>The router redirects the connection to mitmproxy, which is
typically listening on a local port of the same host. Mitmproxy
then consults the routing mechanism to establish what the original
destination was.</td>
</tr>
<tr>
<td><b>3</b></td>
<td>The client believes it's talking to the remote server, and
initiates the SSL connection. It uses SNI to indicate the hostname
it is connecting to.</td>
</tr>
<tr>
<td><b>4</b></td>
<td>Mitmproxy connects to the server, and establishes an SSL
connection using the SNI hostname indicated by the client.</td>
</tr>
<tr>
<td><b>5</b></td>
<td>The server responds with the matching SSL certificate, which
contains the CN and SAN values needed to generate the interception
certificate.</td>
</tr>
<tr>
<td><b>6</b></td>
<td>Mitmproxy generates the interception cert, and continues the
client SSL handshake paused in step 3.</td>
</tr>
<tr>
<td><b>7</b></td>
<td>The client sends the request over the established SSL
connection.</td>
</tr>
<tr>
<td><b>7</b></td>
<td>Mitmproxy passes the request on to the server over the SSL
connection initiated in step 4.</td>
</tr>
</tbody>
</table>
[^ssl]: I use "SSL" to refer to both SSL and TLS in the generic sense, unless otherwise specified.

View File

@@ -1,27 +0,0 @@
__mitmproxy__ is an interactive, SSL-capable man-in-the-middle proxy for HTTP
with a console interface.
__mitmdump__ is the command-line version of mitmproxy. Think tcpdump for HTTP.
__libmproxy__ is the library that mitmproxy and mitmdump are built on.
Documentation, tutorials and distribution packages can be found on the
mitmproxy.org website:
[mitmproxy.org](http://mitmproxy.org).
Features
--------
- Intercept HTTP requests and responses and modify them on the fly.
- Save complete HTTP conversations for later replay and analysis.
- Replay the client-side of an HTTP conversations.
- Replay HTTP responses of a previously recorded server.
- Reverse proxy mode to forward traffic to a specified server.
- Transparent proxy mode on OSX and Linux.
- Make scripted changes to HTTP traffic using Python.
- SSL certificates for interception are generated on the fly.
- And much, much more.

View File

@@ -1,76 +0,0 @@
import os
import sys
import datetime
import countershape
from countershape import Page, Directory, markup
import countershape.template
MITMPROXY_SRC = os.path.abspath(
os.path.expanduser(os.environ.get("MITMPROXY_SRC", ".."))
)
sys.path.insert(0, MITMPROXY_SRC)
from libmproxy import filt, version
ns.VERSION = version.VERSION
if ns.options.website:
ns.idxpath = "doc/index.html"
else:
ns.idxpath = "index.html"
this.layout = countershape.layout.FileLayout("_layout.html")
ns.title = countershape.template.Template(None, "<h1>@!this.title!@</h1>")
this.titlePrefix = "%s - " % version.NAMEVERSION
this.markup = markup.Markdown(extras=["footnotes"])
ns.docMaintainer = "Aldo Cortesi"
ns.docMaintainerEmail = "aldo@corte.si"
ns.copyright = u"\u00a9 mitmproxy project, %s" % datetime.date.today().year
def mpath(p):
p = os.path.join(MITMPROXY_SRC, p)
return os.path.expanduser(p)
def example(s):
d = file(mpath(s)).read().rstrip()
extemp = """<div class="example">%s<div class="example_legend">(%s)</div></div>"""
return extemp % (countershape.template.Syntax("py")(d), s)
ns.example = example
ns.filt_help = filt.help
def nav(page, current, state):
if current.match(page, False):
pre = '<li class="active">'
else:
pre = "<li>"
p = state.application.getPage(page)
return pre + \
'<a href="%s">%s</a></li>' % (countershape.widgets.UrlTo(page), p.title)
ns.nav = nav
ns.navbar = countershape.template.File(None, "_nav.html")
pages = [
Page("index.html", "Introduction"),
Page("install.html", "Installation"),
Page("certinstall.html", "About Certificates"),
Page("howmitmproxy.html", "How mitmproxy works"),
Page("modes.html", "Modes of Operation"),
Page("mitmproxy.html", "mitmproxy"),
Page("mitmdump.html", "mitmdump"),
Page("config.html", "configuration"),
Directory("scripting"),
Directory("tutorials"),
Page("transparent.html", "Overview"),
Directory("transparent"),
]

View File

@@ -1,79 +0,0 @@
## On This Page
* [Installation On Ubuntu](#docUbuntu)
* [Installation On Mac OS X](#docOSX)
* [Installation On Windows](#docWindows)
## <a id=docUbuntu></a>Installation On Ubuntu
Ubuntu comes with Python but we need to install pip, python-dev and several libraries. This was tested on a fully patched installation of Ubuntu 14.04.
<pre class="terminal">
$ sudo apt-get install python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev
$ sudo pip install mitmproxy
</pre>
Once installation is complete you can run <a href="mitmproxy.html">mitmproxy</a> or <a href="mitmdump.html">mitmdump</a> from a terminal.
### Installation From Source
If you would like to install mitmproxy directly from the master branch on GitHub or would like to get set up to contribute to the project,
install the dependencies as you would for a regular mitmproxy installation (see previous section).
Then see the <a href="https://github.com/mitmproxy/mitmproxy/blob/master/README.mkd#hacking">Hacking</a> section of the README on GitHub.
## <a id=docOSX></a>Installation On Mac OS X
The easiest way to get up and running on OSX is to download the pre-built binary packages from [mitmproxy.org](http://mitmproxy.org).
There are a few bits of customization you might want to do to make mitmproxy comfortable to use on OSX. The default color scheme is optimized for a dark background terminal, but you can select a palette for a light terminal background with the --palette option. You can use the OSX <b>open</b> program to create a simple and effective <b>~/.mailcap</b> file to view request and response bodies:
<pre class="terminal">
application/*; /usr/bin/open -Wn %s
audio/*; /usr/bin/open -Wn %s
image/*; /usr/bin/open -Wn %s
video/*; /usr/bin/open -Wn %s
</pre>
Once installation is complete you can run <a href="mitmproxy.html">mitmproxy</a> or <a href="mitmdump.html">mitmdump</a> from a terminal.
### Installation From Source
If you would like to install mitmproxy directly from the master branch on GitHub or would like to get set up to contribute to the project, ithere are a few OS X specific things to keep in mind.
- Make sure that XCode is installed from the App Store, and that the command-line tools have been downloaded (XCode/Preferences/Downloads).
- If you're running a Python interpreter installed with homebrew (or similar), you may have to install some dependencies by hand.
Then see the <a href="https://github.com/mitmproxy/mitmproxy/blob/master/README.mkd#hacking">Hacking</a> section of the README on GitHub.
## <a id=docWindows></a>Installation On Windows
Please note that mitmdump is the only component of mitmproxy that is supported on Windows at the moment.
There is no interactive user interface on Windows.
First, install the latest version of Python 2.7 from the <a href="https://www.python.org/downloads/windows/">Python website</a>.
If you already have an older version of Python 2.7 installed, make sure to install <a href="https://pip.pypa.io/en/latest/installing.html">pip</a>
(pip is included in Python 2.7.9+ by default).
Next, add Python and the Python Scripts directory to your <strong>PATH</strong> variable. You can do this easily by running the following in powershell:
<pre class="terminal">
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
</pre>
Now, you can install mitmproxy by running
<pre class="terminal">
pip install mitmproxy
</pre>
Once the installation is complete, you can run <a href="mitmdump.html">mitmdump</a> from a command prompt.
### Installation From Source
If you would like to install mitmproxy directly from the master branch on GitHub or would like to get set up to contribute to the project, install Python as outlined above, then see the <a href="https://github.com/mitmproxy/mitmproxy/blob/master/README.mkd#hacking">Hacking</a> section of the README on GitHub.

View File

@@ -1,68 +0,0 @@
__mitmdump__ is the command-line companion to mitmproxy. It provides
tcpdump-like functionality to let you view, record, and programmatically
transform HTTP traffic. See the _--help_ flag output for complete
documentation.
# Examples
## Saving traffic
<pre class="terminal">
> mitmdump -w outfile
</pre>
Start up mitmdump in proxy mode, and write all traffic to __outfile__.
## Filtering saved traffic
<pre class="terminal">
> mitmdump -nr infile -w outfile "~m post"
</pre>
Start mitmdump without binding to the proxy port (_-n_), read all flows from
infile, apply the specified filter expression (only match POSTs), and write to
outfile.
## Client replay
<pre class="terminal">
> mitmdump -nc outfile
</pre>
Start mitmdump without binding to the proxy port (_-n_), then replay all
requests from outfile (_-c filename_). Flags combine in the obvious way, so
you can replay requests from one file, and write the resulting flows to
another:
<pre class="terminal">
> mitmdump -nc srcfile -w dstfile
</pre>
See the [Client-side Replay](@!urlTo("clientreplay.html")!@) section for more information.
## Running a script
<pre class="terminal">
> mitmdump -s examples/add_header.py
</pre>
This runs the __add_header.py__ example script, which simply adds a new header
to all responses.
## Scripted data transformation
<pre class="terminal">
> mitmdump -ns examples/add_header.py -r srcfile -w dstfile
</pre>
This command loads flows from __srcfile__, transforms it according to the
specified script, then writes it back to __dstfile__.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

View File

@@ -1,115 +0,0 @@
__mitmproxy__ is a console tool that allows interactive examination and
modification of HTTP traffic. It differs from mitmdump in that all flows are
kept in memory, which means that it's intended for taking and manipulating
small-ish samples. Use the _?_ shortcut key to view, context-sensitive
documentation from any __mitmproxy__ screen.
## Flow list
The flow list shows an index of captured flows in chronological order.
<img class="img-responsive" src="@!urlTo('screenshots/mitmproxy.png')!@"/>
- __1__: A GET request, returning a 302 Redirect response.
- __2__: A GET request, returning 16.75kb of text/html data.
- __3__: A replayed request.
- __4__: Intercepted flows are indicated with orange text. The user may edit
these flows, and then accept them (using the _a_ key) to continue. In this
case, the request has been intercepted on the way to the server.
- __5__: A response intercepted from the server on the way to the client.
- __6__: The event log can be toggled on and off using the _e_ shortcut key. This
pane shows events and errors that may not result in a flow that shows up in the
flow pane.
- __7__: Flow count.
- __8__: Various information on mitmproxy's state. In this case, we have an
interception pattern set to ".*".
- __9__: Bind address indicator - mitmproxy is listening on port 8080 of all
interfaces.
## Flow view
The __Flow View__ lets you inspect and manipulate a single flow:
<img class="img-responsive" src="@!urlTo('screenshots/mitmproxy-flowview.png')!@"/>
- __1__: Flow summary.
- __2__: The Request/Response tabs, showing you which part of the flow you are
currently viewing. In the example above, we're viewing the Response. Hit _tab_
to switch between the Response and the Request.
- __3__: Headers.
- __4__: Body.
- __5__: View Mode indicator. In this case, we're viewing the body in __hex__
mode. The other available modes are __pretty__, which uses a number of
heuristics to show you a friendly view of various content types, and __raw__,
which shows you exactly what's there without any changes. You can change modes
using the _m_ key.
## Grid Editor
Much of the data that we'd like to interact with in mitmproxy is structured.
For instance, headers, queries and form data can all be thought of as a list of
key/value pairs. Mitmproxy has a built-in editor that lays this type of data
out in a grid for easy manipulation.
At the moment, the Grid Editor is used in four parts of mitmproxy:
- Editing request or response headers (_e_ for edit, then _h_ for headers in flow view)
- Editing a query string (_e_ for edit, then _q_ for query in flow view)
- Editing a URL-encoded form (_e_ for edit, then _f_ for form in flow view)
- Editing replacement patterns (_R_ globally)
If there is is no data, an empty editor will be started to let you add some.
Here is the editor showing the headers from a request:
<img class="img-responsive" src="@!urlTo('screenshots/mitmproxy-kveditor.png')!@"/>
To edit, navigate to the key or value you want to modify using the arrow or vi
navigation keys, and press enter. The background color will change to show that
you are in edit mode for the specified field:
<img class="img-responsive" src="@!urlTo('screenshots/mitmproxy-kveditor-editmode.png')!@"/>
Modify the field as desired, then press escape to exit edit mode when you're
done. You can also add a row (_a_ key), delete a row (_d_ key), spawn an
external editor on a field (_e_ key). Be sure to consult the context-sensitive
help (_?_ key) for more.
# Example: Interception
__mitmproxy__'s interception functionality lets you pause an HTTP request or
response, inspect and modify it, and then accept it to send it on to the server
or client.
### 1: Set an interception pattern
<img class="img-responsive" src="@!urlTo('mitmproxy-intercept-filt.png')!@"/>
We press _i_ to set an interception pattern. In this case, the __~q__ filter
pattern tells __mitmproxy__ to intercept all requests. For complete filter
syntax, see the [Filter expressions](@!urlTo("filters.html")!@) section of this
document, or the built-in help function in __mitmproxy__.
### 2: Intercepted connections are indicated with orange text:
<img class="img-responsive" src="@!urlTo('mitmproxy-intercept-mid.png')!@"/>
### 3: You can now view and modify the request:
<img class="img-responsive" src="@!urlTo('mitmproxy-intercept-options.png')!@"/>
In this case, we viewed the request by selecting it, pressed _e_ for "edit"
and _m_ for "method" to change the HTTP request method.
### 4: Accept the intercept to continue:
<img class="img-responsive" src="@!urlTo('mitmproxy-intercept-result.png')!@"/>
Finally, we press _a_ to accept the modified request, which is then sent on to
the server. In this case, we changed the request from an HTTP GET to
OPTIONS, and Google's server has responded with a 405 "Method not allowed".

View File

@@ -1,222 +0,0 @@
Mitmproxy has four modes of operation that allow you to use mitmproxy in a
variety of scenarios:
- **Regular** (the default)
- **Transparent**
- **Reverse Proxy**
- **Upstream Proxy**
Now, which one should you pick? Use this flow chart:
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-flowchart.png')!@"/>
<div class="page-header">
<h1>Regular Proxy</h1>
</div>
Mitmproxy's regular mode is the simplest and the easiest to set up.
1. Start mitmproxy.
2. Configure your client to use mitmproxy. For instance on IOS, the settings might look like <a href="@!urlTo('screenshots/ios-manual.png')!@">this</a>.
3. Quick Check: You should already be able to visit an unencrypted HTTP site
through the proxy.
4. Open the magic domain <strong>mitm.it</strong> and install the certificate for your device.
<div class="well">
<strong>Heads Up:</strong> Unfortunately, some applications bypass the
system HTTP proxy settings - Android applications are a common example. In
these cases, you need to use mitmproxy's transparent mode.
</div>
If you are proxying an external device, your network will probably look like this:
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-regular.png')!@">
The square brackets signify the source and destination IP addresses. Your
client explicitly connects to mitmproxy and mitmproxy explicitly connects
to the target server.
<div class="page-header">
<h1>Transparent Proxy</h1>
</div>
In transparent mode, traffic is directed into a proxy at the network layer,
without any client configuration required. This makes transparent proxying
ideal for situations where you can't change client behaviour. In the graphic
below, a machine running mitmproxy has been inserted between the router and
the internet:
<a href="@!urlTo('schematics/proxy-modes-transparent-1.png')!@">
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-transparent-1.png')!@">
</a>
The square brackets signify the source and destination IP addresses. Round
brackets mark the next hop on the *Ethernet/data link* layer. This distinction
is important: when the packet arrives at the mitmproxy machine, it must still
be addressed to the target server. This means that Network Address Translation
should not be applied before the traffic reaches mitmproxy, since this would
remove the target information, leaving mitmproxy unable to determine the real
destination.
<a href="@!urlTo('schematics/proxy-modes-transparent-wrong.png')!@">
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-transparent-wrong.png')!@"></a>
<h2>Common Configurations</h2>
There are many ways to configure your network for transparent proxying. We'll
look at three common scenarios:
1. Configuring the client to use a custom gateway/router/"next hop"
2. Implementing custom routing on the router
In most cases, the first option is recommended due to its ease of use.
<h3>(a) Custom Gateway</h3>
One simple way to get traffic to the mitmproxy machine with the destination IP
intact, is to simply configure the client with the mitmproxy box as the
default gateway.
<a href="@!urlTo('schematics/proxy-modes-transparent-2.png')!@">
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-transparent-2.png')!@"></a>
In this scenario, we would:
- Configure the proxy machine for transparent mode. You can find instructions
in the <em>Transparent Proxying</em> section of the mitmproxy docs.
- Configure the client to use the proxy machine's IP as the default gateway.
<a href="@!urlTo('screenshots/ios-gateway.png')!@">Here</a> is what this would
look like on IOS.
- Quick Check: At this point, you should already be able to visit an
unencrypted HTTP site over the proxy.
- Open the magic domain <strong>mitm.it</strong> and install the certificate
for your device.
Setting the custom gateway on clients can be automated by serving the settings
out to clients over DHCP. This lets set up an interception network where all
clients are proxied automatically, which can save time and effort.
<div class="well">
<strong style="text-align: center; display: block">Troubleshooting Transparent Mode</strong>
<p>Incorrect transparent mode configurations are a frequent source of
error. If it doesn't work for you, try the following things:</p>
<ul>
<li>
Open mitmproxy's event log (press `e`) - do you see clientconnect
messages? If not, the packets are not arriving at the proxy. One common
cause is the occurrence of ICMP redirects, which means that your
machine is telling the client that there's a faster way to the
internet by contacting your router directly (see the
<em>Transparent Proxying</em> section on how to disable them). If in
doubt, <a href="https://wireshark.org/">Wireshark</a> may help you
to see whether something arrives at your machine or not.
</li>
<li>
Make sure you have not explicitly configured an HTTP proxy on the
client. This is not needed in transparent mode.
</li>
<li>
Re-check the instructions in the <em>Transparent Proxying</em> section. Anything you missed?
</li>
</ul>
If you encounter any other pitfalls that should be listed here, please let us know!
</div>
<h3>(b) Custom Routing</h3>
In some cases, you may need more fine-grained control of which traffic reaches
the mitmproxy instance, and which doesn't. You may, for instance, choose only
to divert traffic to some hosts into the transparent proxy. There are a huge
number of ways to accomplish this, and much will depend on the router or
packet filter you're using. In most cases, the configuration will look like
this:
<a href="@!urlTo('schematics/proxy-modes-transparent-3.png')!@">
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-transparent-3.png')!@">
</a>
<div class="page-header">
<h1>Reverse Proxy</h1>
</div>
Mitmproxy is usually used with a client that uses the proxy to access the
Internet. Using reverse proxy mode, you can use mitmproxy to act like a normal
HTTP server:
<a href="@!urlTo('schematics/proxy-modes-reverse.png')!@">
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-reverse.png')!@">
</a>
There are various use-cases:
- Say you have an internal API running at http://example.local/. You could now
set up mitmproxy in reverse proxy mode at http://debug.example.local/ and
dynamically point clients to this new API endpoint, which provides clients
with the same data and you with debug information. Similarly, you could move
your real server to a different IP/port and set up mitmproxy at the original
place to debug all sessions.
- Say you're a web developer working on example.com (with a development
version running on localhost:8000). You can modify your hosts file so that
example.com points to 127.0.0.1 and then run mitmproxy in reverse proxy mode
on port 80. You can test your app on the example.com domain and get all
requests recorded in mitmproxy.
- Say you have some toy project that should get SSL support. Simply set up
mitmproxy with SSL termination and you're done (<code>mitmdump -p 443 -R
https2http://localhost:80/</code>). There are better tools for this specific
task, but mitmproxy is very quick and simple way to set up an SSL-speaking
server.
- Want to add a non-SSL-capable compression proxy in front of your server? You
could even spawn a mitmproxy instance that terminates SSL (https2http://...),
point it to the compression proxy and let the compression proxy point to a
SSL-initiating mitmproxy (http2https://...), which then points to the real
server. As you see, it's a fairly flexible thing.
Note that mitmproxy supports either an HTTP or an HTTPS upstream server, not
both at the same time. You can work around this by spawning a second mitmproxy
instance.
<div class="well">
<strong style="text-align: center; display: block">Caveat: Interactive Use</strong>
One caveat is that reverse proxy mode is often not sufficient for interactive
browsing. Consider trying to clone Google by using:
<code>mitmproxy -R http://google.com/</code>
This works for the initial request, but the HTML served to the client remains
unchanged. As soon as the user clicks on an non-relative URL (or downloads a
non-relative image resource), traffic no longer passes through mitmproxy, and
the client connects to Google directly again.
</div>
<div class="page-header">
<h1>Upstream Proxy</h1>
</div>
If you want to chain proxies by adding mitmproxy in front of a different proxy
appliance, you can use mitmproxy's upstream mode. In upstream mode, all
requests are unconditionally transferred to an upstream proxy of your choice.
<a href="@!urlTo('schematics/proxy-modes-upstream.png')!@">
<img class="img-responsive" src="@!urlTo('schematics/proxy-modes-upstream.png')!@"></a>
mitmproxy supports both explicit HTTP and explicit HTTPS in upstream proxy
mode. You could in theory chain multiple mitmproxy instances in a row, but
that doesn't make any sense in practice (i.e. outside of our tests).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,6 +0,0 @@
from countershape import Page
pages = [
Page("inlinescripts.html", "Inline Scripts"),
Page("libmproxy.html", "libmproxy"),
]

View File

@@ -1,176 +0,0 @@
__mitmproxy__ has a powerful scripting API that allows you to modify flows
on-the-fly or rewrite previously saved flows locally.
The mitmproxy scripting API is event driven - a script is simply a Python
module that exposes a set of event methods. Here's a complete mitmproxy script
that adds a new header to every HTTP response before it is returned to the
client:
$!example("examples/add_header.py")!$
The first argument to each event method is an instance of ScriptContext that
lets the script interact with the global mitmproxy state. The __response__
event also gets an instance of Flow, which we can use to manipulate the
response itself.
We can now run this script using mitmdump or mitmproxy as follows:
<pre class="terminal">
> mitmdump -s add_header.py
</pre>
The new header will be added to all responses passing through the proxy.
## Example Scripts
mitmproxy comes with a variety of example inline scripts, which demonstrate
many basic tasks. We encourage you to either browse them locally or in our
[GitHub repo](https://github.com/mitmproxy/mitmproxy/tree/master/examples).
## Events
### start(ScriptContext, argv)
Called once on startup, before any other events.
### clientconnect(ScriptContext, ConnectionHandler)
Called when a client initiates a connection to the proxy. Note that
a connection can correspond to multiple HTTP requests.
### serverconnect(ScriptContext, ConnectionHandler)
Called when the proxy initiates a connection to the target server. Note that
a connection can correspond to multiple HTTP requests.
### request(ScriptContext, HTTPFlow)
Called when a client request has been received. The __HTTPFlow__ object is
guaranteed to have a non-None __request__ attribute.
### responseheaders(ScriptContext, HTTPFlow)
Called when the headers of a server response have been received.
This will always be called before the response hook.
The __HTTPFlow__ object is guaranteed to have non-None __request__ and
__response__ attributes. __response.content__ will be None,
as the response body has not been read yet.
### response(ScriptContext, HTTPFlow)
Called when a server response has been received. The __HTTPFlow__ object is
guaranteed to have non-None __request__ and __response__ attributes.
Note that if response streaming is enabled for this response,
__response.content__ will not contain the response body.
### error(ScriptContext, HTTPFlow)
Called when a flow error has occurred, e.g. invalid server responses, or
interrupted connections. This is distinct from a valid server HTTP error
response, which is simply a response with an HTTP error code. The __HTTPFlow__
object is guaranteed to have non-None __request__ and __error__ attributes.
### clientdisconnect(ScriptContext, ConnectionHandler)
Called when a client disconnects from the proxy.
### done(ScriptContext)
Called once on script shutdown, after any other events.
## API
The main classes you will deal with in writing mitmproxy scripts are:
<table class="table">
<tr>
<th>libmproxy.proxy.server.ConnectionHandler</th>
<td>Describes a proxy client connection session. Always has a client_conn attribute, might have a server_conn
attribute.
</td>
</tr>
<tr>
<th>libmproxy.proxy.connection.ClientConnection</th>
<td>Describes a client connection.</td>
</tr>
<tr>
<th>libmproxy.proxy.connection.ServerConnection</th>
<td>Describes a server connection.</td>
</tr>
<tr>
<th>libmproxy.protocol.http.HTTPFlow</th>
<td>A collection of objects representing a single HTTP transaction.</td>
</tr>
<tr>
<th>libmproxy.protocol.http.HTTPResponse</th>
<td>An HTTP response.</td>
</tr>
<tr>
<th>libmproxy.protocol.http.HTTPRequest</th>
<td>An HTTP request.</td>
</tr>
<tr>
<th>libmproxy.protocol.primitives.Error</th>
<td>A communications error.</td>
</tr>
<tr>
<th>libmproxy.script.ScriptContext</th>
<td> A handle for interacting with mitmproxy's from within scripts.</td>
</tr>
<tr>
<th>netlib.odict.ODict</th>
<td>A dictionary-like object for managing sets of key/value data. There
is also a variant called ODictCaseless that ignores key case for some
calls (used mainly for headers).</td>
</tr>
<tr>
<th>netlib.certutils.SSLCert</th>
<td>Exposes information SSL certificates.</td>
</tr>
</table>
The canonical API documentation is the code, which you can browse locally or in our
[GitHub repo](https://github.com/mitmproxy/mitmproxy).
You can view the API documentation using pydoc (which is installed with Python by default), like this:
<pre class="terminal">
> pydoc libmproxy.protocol.http.HTTPRequest
</pre>
## Running scripts in parallel
We have a single flow primitive, so when a script is handling something, other requests block.
While that's a very desirable behaviour under some circumstances, scripts can be run threaded by using the <code>libmproxy.script.concurrent</code> decorator.
$!example("examples/nonblocking.py")!$
## Make scripts configurable with arguments
Sometimes, you want to pass runtime arguments to the inline script. This can be simply done by surrounding the script call with quotes, e.g.
<code>mitmdump -s "script.py --foo 42"</code>. The arguments are then exposed in the start event:
$!example("examples/modify_response_body.py")!$
## Running scripts on saved flows
Sometimes, we want to run a script on __Flow__ objects that are already
complete. This happens when you start a script, and then load a saved set of
flows from a file (see the "scripted data transformation" example on the
[mitmdump](@!urlTo("mitmdump.html")!@) page). It also happens when you run a
one-shot script on a single flow through the _|_ (pipe) shortcut in mitmproxy.
In this case, there are no client connections, and the events are run in the
following order: __start__, __request__, __responseheaders__, __response__, __error__, __done__. If
the flow doesn't have a __response__ or __error__ associated with it, the
matching events will be skipped.
## Spaces in the script path
By default, spaces are interpreted as separator between the inline script and its arguments (e.g. <code>-s "foo.py
42"</code>). Consequently, the script path needs to be wrapped in a separate pair of quotes if it contains spaces:
<code>-s "'./foo bar/baz.py' 42"</code>.

View File

@@ -1,22 +0,0 @@
<div class="well">
<strong>Heads up!</strong> We strongly encourage you to use <a href="@!urlTo("scripting/inlinescripts.html")!@">inline scripts</a> rather than libmproxy
directly.<br><br>
<ul>
<li>Inline Scripts are equally powerful and provide an easier syntax.</li>
<li>Most examples are written as inline scripts.</li>
<li>Multiple inline scripts can be combined and used together.</li>
<li>Inline Scripts can either be executed headless with mitmdump or within the mitmproxy UI.</li>
</ul>
</div>
All of mitmproxy's basic functionality is exposed through the __libmproxy__
library. The example below shows a simple implementation of the "sticky cookie"
functionality included in the interactive mitmproxy program. Traffic is
monitored for __cookie__ and __set-cookie__ headers, and requests are rewritten
to include a previously seen cookie if they don't already have one. In effect,
this lets you log in to a site using your browser, and then make subsequent
requests using a tool like __curl__, which will then seem to be part of the
authenticated session.
$!example("examples/stickycookies")!$

View File

@@ -1,120 +0,0 @@
.highlight { background: #f8f8f8; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #808080 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #7D9029 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
.grokdoc { background: #f8f8f8; }
.grokdoc .c { color: #408080; font-style: italic } /* Comment */
.grokdoc .err { border: 1px solid #FF0000 } /* Error */
.grokdoc .k { color: #008000; font-weight: bold } /* Keyword */
.grokdoc .o { color: #666666 } /* Operator */
.grokdoc .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.grokdoc .cp { color: #BC7A00 } /* Comment.Preproc */
.grokdoc .c1 { color: #408080; font-style: italic } /* Comment.Single */
.grokdoc .cs { color: #408080; font-style: italic } /* Comment.Special */
.grokdoc .gd { color: #A00000 } /* Generic.Deleted */
.grokdoc .ge { font-style: italic } /* Generic.Emph */
.grokdoc .gr { color: #FF0000 } /* Generic.Error */
.grokdoc .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.grokdoc .gi { color: #00A000 } /* Generic.Inserted */
.grokdoc .go { color: #808080 } /* Generic.Output */
.grokdoc .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.grokdoc .gs { font-weight: bold } /* Generic.Strong */
.grokdoc .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.grokdoc .gt { color: #0040D0 } /* Generic.Traceback */
.grokdoc .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.grokdoc .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.grokdoc .kp { color: #008000 } /* Keyword.Pseudo */
.grokdoc .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.grokdoc .kt { color: #B00040 } /* Keyword.Type */
.grokdoc .m { color: #666666 } /* Literal.Number */
.grokdoc .s { color: #BA2121 } /* Literal.String */
.grokdoc .na { color: #7D9029 } /* Name.Attribute */
.grokdoc .nb { color: #008000 } /* Name.Builtin */
.grokdoc .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.grokdoc .no { color: #880000 } /* Name.Constant */
.grokdoc .nd { color: #AA22FF } /* Name.Decorator */
.grokdoc .ni { color: #999999; font-weight: bold } /* Name.Entity */
.grokdoc .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.grokdoc .nf { color: #0000FF } /* Name.Function */
.grokdoc .nl { color: #A0A000 } /* Name.Label */
.grokdoc .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.grokdoc .nt { color: #008000; font-weight: bold } /* Name.Tag */
.grokdoc .nv { color: #19177C } /* Name.Variable */
.grokdoc .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.grokdoc .w { color: #bbbbbb } /* Text.Whitespace */
.grokdoc .mf { color: #666666 } /* Literal.Number.Float */
.grokdoc .mh { color: #666666 } /* Literal.Number.Hex */
.grokdoc .mi { color: #666666 } /* Literal.Number.Integer */
.grokdoc .mo { color: #666666 } /* Literal.Number.Oct */
.grokdoc .sb { color: #BA2121 } /* Literal.String.Backtick */
.grokdoc .sc { color: #BA2121 } /* Literal.String.Char */
.grokdoc .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.grokdoc .s2 { color: #BA2121 } /* Literal.String.Double */
.grokdoc .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.grokdoc .sh { color: #BA2121 } /* Literal.String.Heredoc */
.grokdoc .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.grokdoc .sx { color: #008000 } /* Literal.String.Other */
.grokdoc .sr { color: #BB6688 } /* Literal.String.Regex */
.grokdoc .s1 { color: #BA2121 } /* Literal.String.Single */
.grokdoc .ss { color: #19177C } /* Literal.String.Symbol */
.grokdoc .bp { color: #008000 } /* Name.Builtin.Pseudo */
.grokdoc .vc { color: #19177C } /* Name.Variable.Class */
.grokdoc .vg { color: #19177C } /* Name.Variable.Global */
.grokdoc .vi { color: #19177C } /* Name.Variable.Instance */
.grokdoc .il { color: #666666 } /* Literal.Number.Integer.Long */

View File

@@ -1,19 +0,0 @@
When a transparent proxy is used, traffic is redirected into a proxy at the
network layer, without any client configuration being required. This makes
transparent proxying ideal for those situations where you can't change client
behaviour - proxy-oblivious Android applications being a common example.
To set up transparent proxying, we need two new components. The first is a
redirection mechanism that transparently reroutes a TCP connection destined for
a server on the Internet to a listening proxy server. This usually takes the
form of a firewall on the same host as the proxy server -
[iptables](http://www.netfilter.org/) on Linux or
[pf](http://en.wikipedia.org/wiki/PF_\(firewall\)) on OSX. When the proxy
receives a redirected connection, it sees a vanilla HTTP request, without a
host specification. This is where the second new component comes in - a host
module that allows us to query the redirector for the original destination of
the TCP connection.
At the moment, mitmproxy supports transparent proxying on OSX Lion and above,
and all current flavors of Linux.

View File

@@ -1,6 +0,0 @@
from countershape import Page
pages = [
Page("osx.html", "OSX"),
Page("linux.html", "Linux"),
]

View File

@@ -1,53 +0,0 @@
On Linux, mitmproxy integrates with the iptables redirection mechanism to
achieve transparent mode.
<ol class="tlist">
<li> <a href="@!urlTo('certinstall.html')!@">Install the mitmproxy
certificates on the test device</a>. </li>
<li> Enable IP forwarding:
<pre class="terminal">sysctl -w net.ipv4.ip_forward=1</pre>
You may also want to consider enabling this permanently in
<b>/etc/sysctl.conf</b>.
</li>
<li> If your target machine is on the same physical network and you configured it to use a custom gateway,
disable ICMP redirects:
<pre class="terminal">echo 0 | sudo tee /proc/sys/net/ipv4/conf/*/send_redirects</pre>
You may also want to consider enabling this permanently in
<b>/etc/sysctl.conf</b> as demonstrated <a href="http://unix.stackexchange.com/a/58081">here</a>.
</li>
<li> Create an iptables ruleset that redirects the desired traffic to the
mitmproxy port. Details will differ according to your setup, but the
ruleset should look something like this:
<pre class="terminal">iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080</pre>
</li>
<li> Fire up mitmproxy. You probably want a command like this:
<pre class="terminal">mitmproxy -T --host</pre>
The <b>-T</b> flag turns on transparent mode, and the <b>--host</b>
argument tells mitmproxy to use the value of the Host header for URL
display.
</li>
<li> Finally, configure your test device to use the host on which mitmproxy is
running as the default gateway.</li>
</ol>
For a detailed walkthrough, have a look at the <a href="@!urlTo('tutorials/transparent-dhcp.html')!@"><i>Transparently proxify virtual machines</i></a> tutorial.

View File

@@ -1,78 +0,0 @@
OSX Lion integrated the [pf](http://www.openbsd.org/faq/pf/) packet filter from
the OpenBSD project, which mitmproxy uses to implement transparent mode on OSX.
Note that this means we don't support transparent mode for earlier versions of
OSX.
<ol class="tlist">
<li> <a href="@!urlTo('certinstall.html')!@">Install the mitmproxy
certificates on the test device</a>. </li>
<li> Enable IP forwarding:
<pre class="terminal">sudo sysctl -w net.inet.ip.forwarding=1</pre>
</li>
<li> Place the following two lines in a file called, say, <b>pf.conf</b>:
<pre class="terminal">rdr on en2 inet proto tcp to any port 80 -&gt; 127.0.0.1 port 8080
rdr on en2 inet proto tcp to any port 443 -&gt; 127.0.0.1 port 8080
</pre>
These rules tell pf to redirect all traffic destined for port 80 or 443
to the local mitmproxy instance running on port 8080. You should
replace <b>en2</b> with the interface on which your test device will
appear.
</li>
<li> Configure pf with the rules:
<pre class="terminal">sudo pfctl -f pf.conf</pre>
</li>
<li> And now enable it:
<pre class="terminal">sudo pfctl -e</pre>
</li>
<li> Configure sudoers to allow mitmproxy to access pfctl. Edit the file
<b>/etc/sudoers</b> on your system as root. Add the following line to the end
of the file:
<pre>ALL ALL=NOPASSWD: /sbin/pfctl -s state</pre>
Note that this allows any user on the system to run the command
"/sbin/pfctl -s state" as root without a password. This only allows
inspection of the state table, so should not be an undue security risk. If
you're special feel free to tighten the restriction up to the user running
mitmproxy.</li>
<li> Fire up mitmproxy. You probably want a command like this:
<pre class="terminal">mitmproxy -T --host</pre>
The <b>-T</b> flag turns on transparent mode, and the <b>--host</b>
argument tells mitmproxy to use the value of the Host header for URL
display.
</li>
<li> Finally, configure your test device to use the host on which mitmproxy is
running as the default gateway.</li>
</ol>
Note that the **rdr** rules in the pf.conf given above only apply to inbound
traffic. This means that they will NOT redirect traffic coming from the box
running pf itself. We can't distinguish between an outbound connection from a
non-mitmproxy app, and an outbound connection from mitmproxy itself - if you
want to intercept your OSX traffic, you should use an external host to run
mitmproxy. None the less, pf is flexible to cater for a range of creative
possibilities, like intercepting traffic emanating from VMs. See the
**pf.conf** man page for more.

View File

@@ -1,119 +0,0 @@
## The setup
In this tutorial, I'm going to show you how simple it is to creatively
interfere with Apple Game Center traffic using mitmproxy. To set things up,
install the [mitmproxy root certificate](@!urlTo("certinstall.html")!@). Then
start mitmproxy on your desktop, and confige the iPhone to use it as a proxy.
## Taking a look at the Game Center traffic
Lets take a first look at the Game Center traffic. The game I'll use in this
tutorial is [Super Mega
Worm](http://itunes.apple.com/us/app/super-mega-worm/id388541990?mt=8) - a
great little retro-apocalyptic sidescroller for the iPhone:
<center>
<img class="img-responsive" src="@!urlTo('tutorials/supermega.png')!@"/>
</center>
After finishing a game (take your time), watch the traffic flowing through
mitmproxy:
<center>
<img class="img-responsive" src="@!urlTo('tutorials/one.png')!@"/>
</center>
We see a bunch of things we might expect - initialisation, the retrieval of
leaderboards and so forth. Then, right at the end, there's a POST to this
tantalising URL:
<pre>
https://service.gc.apple.com/WebObjects/GKGameStatsService.woa/wa/submitScore
</pre>
The contents of the submission are particularly interesting:
<!--(block|syntax("xml"))-->
<plist version="1.0">
<dict>
<key>scores</key>
<array>
<dict>
<key>category</key>
<string>SMW_Adv_USA1</string>
<key>context</key>
<integer>0</integer>
<key>score-value</key>
<integer>0</integer>
<key>timestamp</key>
<integer>1363515361321</integer>
</dict>
</array>
</dict>
</plist>
<!--(end)-->
This is a [property list](http://en.wikipedia.org/wiki/Property_list),
containing an identifier for the game, a score (55, in this case), and a
timestamp. Looks pretty simple to mess with.
## Modifying and replaying the score submission
Lets edit the score submission. First, select it in mitmproxy, then press
__enter__ to view it. Make sure you're viewing the request, not the response -
you can use __tab__ to flick between the two. Now press __e__ for edit. You'll
be prompted for the part of the request you want to change - press __r__ for
raw body. Your preferred editor (taken from the EDITOR environment variable) will
now fire up. Lets bump the score up to something a bit more ambitious:
<!--(block|syntax("xml"))-->
<plist version="1.0">
<dict>
<key>scores</key>
<array>
<dict>
<key>category</key>
<string>SMW_Adv_USA1</string>
<key>context</key>
<integer>0</integer>
<key>score-value</key>
<integer>2200272667</integer>
<key>timestamp</key>
<integer>1363515361321</integer>
</dict>
</array>
</dict>
</plist>
<!--(end)-->
Save the file and exit your editor.
The final step is to replay this modified request. Simply press __r__ for
replay.
## The glorious result and some intrigue
<center>
<img class="img-responsive" src="@!urlTo('tutorials/leaderboard.png')!@"/>
</center>
And that's it - according to the records, I am the greatest Super Mega Worm
player of all time.
There's a curious addendum to this tale. When I first wrote this tutorial, all
the top competitors' scores were the same: 2,147,483,647 (this is no longer the
case, beacause there are now so many fellow cheaters using this tutorial). If
you think that number seems familiar, you're right: it's 2^31-1, the maximum
value you can fit into a signed 32-bit int. Now let me tell you another
peculiar thing about Super Mega Worm - at the end of every game, it submits
your highest previous score to the Game Center, not your current score. This
means that it stores your highscore somewhere, and I'm guessing that it reads
that stored score back into a signed integer. So, if you _were_ to cheat by the
relatively pedestrian means of modifying the saved score on your jailbroken
phone, then 2^31-1 might well be the maximum score you could get. Then again,
if the game itself stores its score in a signed 32-bit int, you could get the
same score through perfect play, effectively beating the game. So, which is it
in this case? I'll leave that for you to decide.

View File

@@ -1,7 +0,0 @@
from countershape import Page
pages = [
Page("30second.html", "Client playback: a 30 second example"),
Page("gamecenter.html", "Setting highscores on Apple's GameCenter"),
Page("transparent-dhcp.html", "Transparently proxify virtual machines")
]

View File

@@ -1,53 +0,0 @@
This walkthrough illustrates how to set up transparent proxying with mitmproxy. We use VirtualBox VMs with an Ubuntu proxy machine in this example, but the general principle can be applied to other setups.
1. **Configure VirtualBox Network Adapters for the proxy machine**
The network setup is simple: `internet <--> proxy vm <--> (virtual) internal network`.
For the proxy machine, *eth0* represents the outgoing network. *eth1* is connected to the internal network that will be proxified, using a static ip (192.168.3.1).
<hr>VirtualBox configuration:
<img class="img-responsive" src="@!urlTo('tutorials/transparent-dhcp/step1_vbox_eth0.png')!@"/><br><br>
<img class="img-responsive" src="@!urlTo('tutorials/transparent-dhcp/step1_vbox_eth1.png')!@"/>
<br>Proxy VM:
<img class="img-responsive" src="@!urlTo('tutorials/transparent-dhcp/step1_proxy.png')!@"/>
<hr>
2. **Configure DHCP and DNS**
We use dnsmasq to provide DHCP and DNS in our internal network.
Dnsmasq is a lightweight server designed to provide DNS (and optionally DHCP and TFTP) services to a small-scale
network.
- Before we get to that, we need to fix some Ubuntu quirks:
**Ubuntu >12.04** runs an internal dnsmasq instance (listening on loopback only) by default
<a href="https://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/">[1]</a>. For our use case, this needs to be
disabled by changing <br>`dns=dnsmasq` to `#dns=dnsmasq` in */etc/NetworkManager/NetworkManager.conf*
and running `sudo restart network-manager` afterwards.
- Now, dnsmasq can be be installed and configured:
`sudo apt-get install dnsmasq`
Replace */etc/dnsmasq.conf* with the following configuration:
<pre>\# Listen for DNS requests on the internal network
interface=eth1
\# Act as a DHCP server, assign IP addresses to clients
dhcp-range=192.168.3.10,192.168.3.100,96h
\# Broadcast gateway and dns server information
dhcp-option=option:router,192.168.3.1
dhcp-option=option:dns-server,192.168.3.1
</pre>
Apply changes:
`sudo service dnsmasq restart`
<hr>
Your proxied machine's network settings should now look similar to this:
<img class="img-responsive" src="@!urlTo('tutorials/transparent-dhcp/step2_proxied_vm.png')!@"/>
<hr>
3. **Set up traffic redirection to mitmproxy**
To redirect traffic to mitmproxy, we need to add two iptables rules:
<pre class="terminal">
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 \
-j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 \
-j REDIRECT --to-port 8080
</pre>
4. If required, <a href="@!urlTo('certinstall.html')!@">install the mitmproxy
certificates on the test device</a>.
5. Finally, we can run <code>mitmproxy -T</code>.
The proxied machine cannot to leak any data outside of HTTP or DNS requests.

1
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_build/

195
docs/Makefile Normal file
View File

@@ -0,0 +1,195 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/mitmproxy.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/mitmproxy.qhc"
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/mitmproxy"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/mitmproxy"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
livehtml:
sphinx-autobuild -b html -z '../mitmproxy' -r '___jb_(old|bak|tmp)___$$' $(ALLSPHINXOPTS) $(BUILDDIR)/html

44
docs/_static/theme_overrides.css vendored Normal file
View File

@@ -0,0 +1,44 @@
/* override table width restrictions */
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: normal;
}
.wy-table-responsive > table > tbody > tr > td {
vertical-align: top !important;
}
.wy-table-responsive {
margin-bottom: 24px;
max-width: 100%;
overflow: visible;
}
.wy-menu-vertical header, .wy-menu-vertical p.caption {
color: #e0e0e0;
}
.code-block-caption {
height: 1.5em;
}
.code-block-caption .caption-text {
font-size: 0.8em;
float: right;
}
.code-block-caption .headerlink {
display: none !important;
}
.function .headerlink {
display: none !important;
}
dl .reference.internal {
display: none !important;
}
dl .headerlink {
display: none !important;
}

10
docs/_templates/page.html vendored Normal file
View File

@@ -0,0 +1,10 @@
{% extends "!page.html" %}
{% block sidebartitle %}
<a href="https://mitmproxy.org/" style="margin-bottom: 7px; background: none !important;">
<button class="btn btn-info">
<i class="fa fa-arrow-left"></i>
Return to mitmproxy.org
</button>
</a>
{{ super() }}
{% endblock %}

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

206
docs/certinstall.rst Normal file
View File

@@ -0,0 +1,206 @@
.. _certinstall:
About Certificates
==================
Introduction
------------
Mitmproxy can decrypt encrypted traffic on the fly, as long as the client
trusts its built-in certificate authority. Usually this means that the
mitmproxy CA certificates have to be installed on the client device.
Quick Setup
-----------
By far the easiest way to install the mitmproxy certificates is to use the
built-in certificate installation app. To do this, just start mitmproxy and
configure your target device with the correct proxy settings. Now start a
browser on the device, and visit the magic domain **mitm.it**. You should see
something like this:
.. image:: certinstall-webapp.png
Click on the relevant icon, follow the setup instructions for the platform
you're on and you are good to go.
Installing the mitmproxy CA certificate manually
------------------------------------------------
Sometimes using the quick install app is not an option - Java or the iOS
Simulator spring to mind - or you just need to do it manually for some other
reason. Below is a list of pointers to manual certificate installation
documentation for some common platforms.
The mitmproxy CA cert is located in ``~/.mitmproxy`` after it has been generated at the first
start of mitmproxy.
iOS
^^^
http://kb.mit.edu/confluence/pages/viewpage.action?pageId=152600377
iOS Simulator
^^^^^^^^^^^^^
See https://github.com/ADVTOOLS/ADVTrustStore#how-to-use-advtruststore
Java
^^^^
See http://docs.oracle.com/cd/E19906-01/820-4916/geygn/index.html
Android/Android Simulator
^^^^^^^^^^^^^^^^^^^^^^^^^
See http://wiki.cacert.org/FAQ/ImportRootCert#Android_Phones_.26_Tablets
Windows
^^^^^^^
See http://windows.microsoft.com/en-ca/windows/import-export-certificates-private-keys#1TC=windows-7
Windows (automated)
^^^^^^^^^^^^^^^^^^^
>>> certutil.exe -importpfx Root mitmproxy-ca-cert.p12
See also: https://technet.microsoft.com/en-us/library/cc732443.aspx
Mac OS X
^^^^^^^^
See https://support.apple.com/kb/PH7297?locale=en_US
Ubuntu/Debian
^^^^^^^^^^^^^
See http://askubuntu.com/questions/73287/how-do-i-install-a-root-certificate/94861#94861
Mozilla Firefox
^^^^^^^^^^^^^^^
See https://wiki.mozilla.org/MozillaRootCertificate#Mozilla_Firefox
Chrome on Linux
^^^^^^^^^^^^^^^
See https://code.google.com/p/chromium/wiki/LinuxCertManagement
The mitmproxy certificate authority
-----------------------------------
The first time **mitmproxy** or **mitmdump** is run, the mitmproxy Certificate
Authority (CA) is created in the config directory (``~/.mitmproxy`` by default).
This CA is used for on-the-fly generation of dummy certificates for each of the
SSL sites that your client visits. Since your browser won't trust the
mitmproxy CA out of the box, you will see an SSL certificate warning every
time you visit a new SSL domain through mitmproxy. When you are testing a
single site through a browser, just accepting the bogus SSL cert manually is
not too much trouble, but there are a many circumstances where you will want to
configure your testing system or browser to trust the mitmproxy CA as a
signing root authority. For security reasons, the mitmproxy CA is generated uniquely on the first start and is not shared between mitmproxy installations on different devices.
Certificate Pinning
^^^^^^^^^^^^^^^^^^^
Some applications employ `Certificate Pinning`_ to prevent man-in-the-middle attacks.
This means that **mitmproxy** and **mitmdump's** certificates will not be
accepted by these applications without modifying them. It is recommended to use the
:ref:`passthrough` feature in order to prevent **mitmproxy** and **mitmdump** from intercepting
traffic to these specific domains. If you want to intercept the pinned connections, you need to patch the application manually. For Android and (jailbroken) iOS devices, various tools exist to accomplish this.
CA and cert files
-----------------
The files created by mitmproxy in the .mitmproxy directory are as follows:
===================== ==========================================================================
mitmproxy-ca.pem The certificate **and the private key** in PEM format.
mitmproxy-ca-cert.pem The certificate in PEM format.
Use this to distribute on most non-Windows platforms.
mitmproxy-ca-cert.p12 The certificate in PKCS12 format. For use on Windows.
mitmproxy-ca-cert.cer Same file as .pem, but with an extension expected by some Android devices.
===================== ==========================================================================
Using a custom certificate
--------------------------
You can use your own certificate by passing the ``--cert [domain=]path_to_certificate`` option to
mitmproxy. Mitmproxy then uses the provided certificate for interception of the
specified domain instead of generating a certificate signed by its own CA.
The certificate file is expected to be in the PEM format. You can include
intermediary certificates right below your leaf certificate, so that your PEM
file roughly looks like this:
.. code-block:: none
-----BEGIN PRIVATE KEY-----
<private key>
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
<cert>
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
<intermediary cert (optional)>
-----END CERTIFICATE-----
For example, you can generate a certificate in this format using these instructions:
>>> openssl genrsa -out cert.key 2048
>>> openssl req -new -x509 -key cert.key -out cert.crt
(Specify the mitm domain as Common Name, e.g. *.google.com)
>>> cat cert.key cert.crt > cert.pem
Now, you can run mitmproxy with the generated certificate:
**For all domain names**
``>>>mitmproxy --cert *=cert.pem``
**For specific domain names**
``>>>mitmproxy --cert *.example.com=cert.pem``
**Note:** ``*.example.com`` is for all the subdomains. You can also use ``www.example.com`` for a particular subdomain.
Using a custom certificate authority
------------------------------------
By default, mitmproxy will use ``~/.mitmproxy/mitmproxy-ca.pem`` as
the certificate authority to generate certificates for all domains for which no
custom certificate is provided (see above). You can use your own certificate
authority by passing the ``--cadir DIRECTORY`` option to mitmproxy. Mitmproxy
will then look for ``mitmproxy-ca.pem`` in the specified directory. If
no such file exists, it will be generated automatically.
Using a client side certificate
-------------------------------
You can use a client certificate by passing the ``--client-certs DIRECTORY|FILE``
option to mitmproxy. Using a directory allows certs to be selected based on
hostname, while using a filename allows a single specific certificate to be used for
all SSL connections. Certificate files must be in the PEM format and should
contain both the unencrypted private key and the certificate.
Multiple certs by Hostname
^^^^^^^^^^^^^^^^^^^^^^^^^^
If you've specified a directory to ``--client-certs``, then the following
behavior will be taken:
If you visit example.org, mitmproxy looks for a file named ``example.org.pem`` in the specified
directory and uses this as the client cert.
.. _Certificate Pinning: http://security.stackexchange.com/questions/29988/what-is-certificate-pinning/

246
docs/conf.py Normal file
View File

@@ -0,0 +1,246 @@
import importlib
import inspect
import os
import subprocess
import sys
sys.path.insert(0, os.path.abspath('..'))
import netlib.version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.linkcode',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinxcontrib.documentedlist'
]
# https://github.com/sphinx-doc/sphinx/pull/2053
napoleon_include_special_with_doc = False
autodoc_member_order = "bysource"
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'mitmproxy docs'
copyright = u'2016, the mitmproxy project'
author = u'The mitmproxy project'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = netlib.version.VERSION
# The full version, including alpha/beta/rc tags.
release = netlib.version.VERSION
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['mitmproxy.']
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'logo_only': True,
}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = "mitmproxy %s documentation" % version
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "mitmproxy-docs.png"
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = "favicon.ico"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
#html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'mitmproxydoc'
last_tag, tag_dist, commit = (
subprocess.check_output(["git", "describe", "--tags", "--long"])
.decode()
.strip()
.rsplit("-", 2)
)
tag_dist = int(tag_dist)
if tag_dist == 0:
tag = last_tag
else:
tag = "master"
SRCBASE = "https://github.com/mitmproxy/mitmproxy/blob/{}".format(tag)
extlinks = dict(
src = (SRCBASE + r"/%s", '')
)
def linkcode_resolve(domain, info):
if domain != 'py':
return None
module, fullname = info['module'], info['fullname']
if not module:
return None
obj = importlib.import_module(module)
for item in fullname.split('.'):
obj = getattr(obj, item, None)
if obj is None:
return None
try:
spath = inspect.getsourcefile(obj)
_, line = inspect.getsourcelines(obj)
except (TypeError, IOError):
return None
if spath.rfind("netlib") > -1:
off = spath.rfind("netlib")
mpath = spath[off:]
elif spath.rfind("mitmproxy") > -1:
off = spath.rfind("mitmproxy")
mpath = spath[off:]
else:
return None
return SRCBASE + "/%s#L%s" % (mpath, line)
def setup(app):
app.add_stylesheet('theme_overrides.css')

86
docs/config.rst Normal file
View File

@@ -0,0 +1,86 @@
.. _config:
Configuration
=============
Mitmproxy is configured through a set of files in the users ~/.mitmproxy
directory.
mitmproxy.conf
Settings for the :program:`mitmproxy`. This file can contain any options supported by
mitmproxy.
mitmdump.conf
Settings for the :program:`mitmdump`. This file can contain any options supported by mitmdump.
common.conf
Settings shared between all command-line tools. Settings in this file are over-ridden by those
in the tool-specific files. Only options shared by mitmproxy and mitmdump should be used in
this file.
Syntax
------
Comments
^^^^^^^^
.. code-block:: none
# this is a comment
; this is also a comment (.ini style)
--- and this is a comment too (yaml style)
Key/Value pairs
^^^^^^^^^^^^^^^
- Keys and values are case-sensitive
- Whitespace is ignored
- Lists are comma-delimited, and enclosed in square brackets
.. code-block:: none
name = value # (.ini style)
name: value # (yaml style)
--name value # (command-line option style)
fruit = [apple, orange, lemon]
indexes = [1, 12, 35 , 40]
Flags
^^^^^
These are boolean options that take no value but true/false.
.. code-block:: none
name = true # (.ini style)
name
--name # (command-line option style)
Options
-------
The options available in the config files are precisely those available as
command-line flags, with the key being the option's long name. To get a
complete list of these, use the ``--help`` option on each of the tools. Be
careful to only specify common options in the **common.conf** file -
unsupported options in this file will be detected as an error on startup.
Examples
--------
common.conf
^^^^^^^^^^^
Note that ``--port`` is an option supported by all tools.
.. code-block:: none
port = 8080
mitmproxy.conf
^^^^^^^^^^^^^^
.. code-block:: none
palette = light

View File

@@ -18,22 +18,22 @@ __prompt__, and __content\_types__ and a function named __\_\_call\_\___.
Adding a new content viewer to parse a data type is as simple as writing a new
View class. Your new content viewer View class should have the same properties
as the other View classes: __name__, __prompt__, and __content\_types__ and a
__\_\_call\_\___ function to parse the content of the request/response.
__\_\_call\_\___ function to parse the content of the request/response.
* The __name__ property should be a string describing the contents and new content viewer;
* The __name__ property should be a string describing the contents and new content viewer;
* The __prompt__ property should be a two item tuple:
- __1__: A string that will be used to display the new content viewer's type; and
- __2__: A one character string that will be the hotkey used to select the new content viewer from the Flow View screen;
- __2__: A one character string that will be the hotkey used to select the new content viewer from the Flow View screen;
* The __content\_types__ property should be a list of strings of HTTP Content\-Types that the new content viewer can parse.
* The __content\_types__ property should be a list of strings of HTTP Content\-Types that the new content viewer can parse.
* Note that mitmproxy will use the content\_types to try and heuristically show a friendly view of content and that you can override the built-in views by populating content\_types with values for content\_types that are already parsed -- e.g. "image/png".
After defining the __name__, __prompt__, and __content\_types__ properties of
the class, you should write the __\_\_call\_\___ function, which will parse the
request/response data and provide a friendly view of the data. The
__\_\_call\_\___ function should take the following arguments: __self__,
__hdrs__, __content__, __limit__; __hdrs__ is a ODictCaseless object containing
__hdrs__, __content__, __limit__; __hdrs__ is a MultiDict object containing
the headers of the request/response; __content__ is the content of the
request/response, and __limit__ is an integer representing the amount of data
to display in the view window.
@@ -46,7 +46,7 @@ Alternatively, you can display content as a series of key-value pairs; to do
so, prepare a list of lists, where each list item is a two item list -- a key
that describes the data, and then the data itself; after preparing the list of
lists, use the __common.format\_keyvals__ function on it to prepare it as text
for display.
for display.
If the new content viewer fails or throws an exception, mitmproxy will default
to a __raw__ view.

14
docs/dev/architecture.rst Normal file
View File

@@ -0,0 +1,14 @@
.. _architecture:
Architecture
============
To give you a better understanding of how mitmproxy works, mitmproxy's
high-level architecture is detailed in the following graphic:
.. image:: ../schematics/architecture.png
:download:`architecture.pdf <../schematics/architecture.pdf>`
Please don't refrain from asking any further
questions on the mailing list, the Slack channel or the GitHub issue tracker.

View File

@@ -0,0 +1,15 @@
.. _sslkeylogfile:
TLS Master Secrets
==================
The SSL master keys can be logged by mitmproxy so that external programs can decrypt TLS
connections both from and to the proxy. Key logging is enabled by setting the environment variable
:envvar:`SSLKEYLOGFILE` so that it points to a writable text file.
Recent versions of WireShark can use these log files to decrypt packets.
You can specify the key file path in WireShark via
:samp:`Edit -> Preferences -> Protocols -> SSL -> (Pre)-Master-Secret log filename`.
Note that :envvar:`SSLKEYLOGFILE` is respected by other programs as well, e.g. Firefox and Chrome.
If this creates any issues, you can set :envvar:`MITMPROXY_SSLKEYLOGFILE` alternatively.

47
docs/dev/testing.rst Normal file
View File

@@ -0,0 +1,47 @@
.. _testing:
Testing
=======
All the mitmproxy projects strive to maintain 100% code coverage. In general,
patches and pull requests will be declined unless they're accompanied by a
suitable extension to the test suite.
Our tests are written for the `py.test`_ or nose_ test frameworks.
At the point where you send your pull request, a command like this:
>>> py.test --cov mitmproxy --cov netlib
Should give output something like this:
.. code-block:: none
> ---------- coverage: platform darwin, python 2.7.2-final-0 --
> Name Stmts Miss Cover Missing
> ----------------------------------------------------
> mitmproxy/__init__ 0 0 100%
> mitmproxy/app 4 0 100%
> mitmproxy/cmdline 100 0 100%
> mitmproxy/controller 69 0 100%
> mitmproxy/dump 150 0 100%
> mitmproxy/encoding 39 0 100%
> mitmproxy/flowfilter 201 0 100%
> mitmproxy/flow 891 0 100%
> mitmproxy/proxy 427 0 100%
> mitmproxy/script 27 0 100%
> mitmproxy/utils 133 0 100%
> mitmproxy/version 4 0 100%
> ----------------------------------------------------
> TOTAL 2045 0 100%
> ----------------------------------------------------
> Ran 251 tests in 11.864s
There are exceptions to the coverage requirement - for instance, much of the
console interface code can't sensibly be unit tested. These portions are
excluded from coverage analysis either in the **.coveragerc** file, or using
**#pragma no-cover** directives. To keep our coverage analysis relevant, we use
these measures as sparingly as possible.
.. _nose: https://nose.readthedocs.org/en/latest/
.. _py.test: https://pytest.org/

BIN
docs/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,15 @@
.. _anticache:
Anticache
=========
When the ``--anticache`` option is passed to mitmproxy, it removes headers
(``if-none-match`` and ``if-modified-since``) that might elicit a
``304 not modified`` response from the server. This is useful when you want to make
sure you capture an HTTP exchange in its totality. It's also often used during
:ref:`clientreplay`, when you want to make sure the server responds with complete data.
================== ======================
command-line ``--anticache``
mitmproxy shortcut :kbd:`o` then :kbd:`a`
================== ======================

View File

@@ -1,3 +1,7 @@
.. _clientreplay:
Client-side replay
==================
Client-side replay does what it says on the tin: you provide a previously saved
HTTP conversation, and mitmproxy replays the client requests one by one. Note
@@ -6,17 +10,9 @@ before starting the next request. This might differ from the recorded
conversation, where requests may have been made concurrently.
You may want to use client-side replay in conjunction with the
[anticache](@!urlTo("anticache.html")!@) option, to make sure the server
responds with complete data.
:ref:`anticache` option, to make sure the server responds with complete data.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>-c path</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>c</b></td>
</tr>
</tbody>
</table>
================== ===========
command-line ``-c path``
mitmproxy shortcut :kbd:`R` then :kbd:`c`
================== ===========

View File

@@ -1,36 +1,38 @@
.. _filters:
Many commands in __mitmproxy__ and __mitmdump__ take a filter expression.
Filter expressions
==================
Many commands in :program:`mitmproxy` and :program:`mitmdump` take a filter expression.
Filter expressions consist of the following operators:
<table class="table">
<tbody>
<!--(for i in filt_help)-->
<tr>
<td class="filt_cmd">@!i[0]!@</td>
<td class="filt_help">@!i[1]!@</td>
</tr>
<!--(end)-->
</tbody>
</table>
.. documentedlist::
:header: "Expression" "Description"
:listobject: mitmproxy.flowfilter.help
- Regexes are Python-style
- Regexes can be specified as quoted strings
- Header matching (~h, ~hq, ~hs) is against a string of the form "name: value".
- Strings with no operators are matched against the request URL.
- The default binary operator is &amp;.
- The default binary operator is &.
Examples
========
--------
URL containing "google.com":
.. code-block:: none
google\.com
Requests whose body contains the string "test":
.. code-block:: none
~q ~b test
Anything but requests with a text/html content type:
!(~q & ~t \"text/html\")
.. code-block:: none
!(~q & ~t "text/html")

View File

@@ -0,0 +1,102 @@
.. _passthrough:
Ignore Domains
==============
There are two main reasons why you may want to exempt some traffic from mitmproxy's interception
mechanism:
- **Certificate pinning:** Some traffic is is protected using `Certificate Pinning`_ and
mitmproxy's interception leads to errors. For example, the Twitter app, Windows Update or
the Apple App Store fail to work if mitmproxy is active.
- **Convenience:** You really don't care about some parts of the traffic and just want them to go
away. Note that mitmproxy's "Limit" option is often the better alternative here, as it is
not affected by the limitations listed below.
If you want to peek into (SSL-protected) non-HTTP connections, check out the :ref:`tcpproxy`
feature.
If you want to ignore traffic from mitmproxy's processing because of large response bodies,
take a look at the :ref:`responsestreaming` feature.
How it works
------------
================== ======================
command-line ``--ignore regex``
mitmproxy shortcut :kbd:`o` then :kbd:`I`
================== ======================
mitmproxy allows you to specify a regex which is matched against a ``host:port`` string
(e.g. "example.com:443") to determine hosts that should be excluded.
Limitations
-----------
There are two important quirks to consider:
- **In transparent mode, the ignore pattern is matched against the IP and ClientHello SNI host.** While we usually infer the
hostname from the Host header if the ``--host`` argument is passed to mitmproxy, we do not
have access to this information before the SSL handshake. If the client uses SNI however, then we treat the SNI host as an ignore target.
- **In regular mode, explicit HTTP requests are never ignored.** [#explicithttp]_ The ignore pattern is
applied on CONNECT requests, which initiate HTTPS or clear-text WebSocket connections.
Tutorial
--------
If you just want to ignore one specific domain, there's usually a bulletproof method to do so:
1. Run mitmproxy or mitmdump in verbose mode (``-v``) and observe the ``host:port``
information in the serverconnect messages. mitmproxy will filter on these.
2. Take the ``host:port`` string, surround it with ^ and $, escape all dots (. becomes \\.)
and use this as your ignore pattern:
.. code-block:: none
:emphasize-lines: 6,7,9
>>> mitmdump -v
127.0.0.1:50588: clientconnect
127.0.0.1:50588: request
-> CONNECT example.com:443 HTTP/1.1
127.0.0.1:50588: Set new server address: example.com:443
127.0.0.1:50588: serverconnect
-> example.com:443
^C
>>> mitmproxy --ignore ^example\.com:443$
Here are some other examples for ignore patterns:
.. code-block:: none
# Exempt traffic from the iOS App Store (the regex is lax, but usually just works):
--ignore apple.com:443
# "Correct" version without false-positives:
--ignore '^(.+\.)?apple\.com:443$'
# Ignore example.com, but not its subdomains:
--ignore '^example.com:'
# Ignore everything but example.com and mitmproxy.org:
--ignore '^(?!example\.com)(?!mitmproxy\.org)'
# Transparent mode:
--ignore 17\.178\.96\.59:443
# IP address range:
--ignore 17\.178\.\d+\.\d+:443
.. seealso::
- :ref:`tcpproxy`
- :ref:`responsestreaming`
- mitmproxy's "Limit" feature
.. rubric:: Footnotes
.. [#explicithttp] This stems from an limitation of explicit HTTP proxying:
A single connection can be re-used for multiple target domains - a
``GET http://example.com/`` request may be followed by a ``GET http://evil.com/`` request on the
same connection. If we start to ignore the connection after the first request,
we would miss the relevant second one.
.. _Certificate Pinning: https://security.stackexchange.com/questions/29988/what-is-certificate-pinning

View File

@@ -0,0 +1,17 @@
.. _proxyauth:
Proxy Authentication
====================
Asks the user for authentication before they are permitted to use the proxy.
Authentication headers are stripped from the flows, so they are not passed to
upstream servers. For now, only HTTP Basic authentication is supported. The
proxy auth options are not compatible with the transparent, socks or reverse proxy
mode.
================== ======================
command-line ``--nonanonymous``,
``--singleuser USER``,
``--htpasswd PATH``
================== ======================

View File

@@ -1,3 +1,8 @@
.. _replacements:
Replacements
============
Mitmproxy lets you specify an arbitrary number of patterns that define text
replacements within flows. Each pattern has 3 components: a filter that defines
which flows a replacement applies to, a regular expression that defines what
@@ -9,66 +14,59 @@ replace hook is triggered on server response, the replacement is only run on
the Response object leaving the Request intact. You control whether the hook
triggers on the request, response or both using the filter pattern. If you need
finer-grained control than this, it's simple to create a script using the
replacement API on Flow components.
replacement API on Flow components.
Replacement hooks are extremely handy in interactive testing of applications.
For instance you can use a replace hook to replace the text "XSS" with a
complicated XSS exploit, and then "inject" the exploit simply by interacting
with the application through the browser. When used with tools like Firebug and
mitmproxy's own interception abilities, replacement hooks can be an amazingly
flexible and powerful feature.
flexible and powerful feature.
## On the command-line
On the command-line
-------------------
The replacement hook command-line options use a compact syntax to make it easy
to specify all three components at once. The general form is as follows:
.. code-block:: none
/patt/regex/replacement
Here, __patt__ is a mitmproxy filter expression, __regex__ is a valid Python
regular expression, and __replacement__ is a string literal. The first
character in the expression (__/__ in this case) defines what the separation
Here, **patt** is a mitmproxy filter expression, **regex** is a valid Python
regular expression, and **replacement** is a string literal. The first
character in the expression (``/`` in this case) defines what the separation
character is. Here's an example of a valid expression that replaces "foo" with
"bar" in all requests:
.. code-block:: none
:~q:foo:bar
In practice, it's pretty common for the replacement literal to be long and
complex. For instance, it might be an XSS exploit that weighs in at hundreds or
thousands of characters. To cope with this, there's a variation of the
replacement hook specifier that lets you load the replacement text from a file.
So, you might start __mitmdump__ as follows:
So, you might start **mitmdump** as follows:
<pre class="terminal">
mitmdump --replace-from-file :~q:foo:~/xss-exploit
</pre>
>>> mitmdump --replace-from-file :~q:foo:~/xss-exploit
This will load the replacement text from the file __~/xss-exploit__.
This will load the replacement text from the file ``~/xss-exploit``.
Both the _--replace_ and _--replace-from-file_ flags can be passed multiple
Both the ``--replace`` and ``--replace-from-file`` flags can be passed multiple
times.
## Interactively
Interactively
-------------
The _R_ shortcut key in mitmproxy lets you add and edit replacement hooks using
a built-in editor. The context-sensitive help (_h_) has complete usage
information.
The :kbd:`R` shortcut key in the mitmproxy options menu (:kbd:`o`) lets you add and edit
replacement hooks using a built-in editor. The context-sensitive help (:kbd:`?`) has
complete usage information.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th>
<td>
<ul>
<li>--replace</li>
<li>--replace-from-file</li>
</ul>
</td>
</tr>
<tr>
<th>mitmproxy shortcut</th> <td><b>R</b></td>
</tr>
</tbody>
</table>
================== =======================
command-line ``--replace``,
``--replace-from-file``
mitmproxy shortcut :kbd:`o` then :kbd:`R`
================== =======================

View File

@@ -0,0 +1,68 @@
.. _responsestreaming:
Response Streaming
==================
By using mitmproxy's streaming feature, response contents can be passed to the client incrementally
before they have been fully received by the proxy. This is especially useful for large binary files
such as videos, where buffering the whole file slows down the client's browser.
By default, mitmproxy will read the entire response, perform any indicated
manipulations on it and then send the (possibly modified) response to
the client. In some cases this is undesirable and you may wish to "stream"
the response back to the client. When streaming is enabled, the response is
not buffered on the proxy but directly sent back to the client instead.
On the command-line
-------------------
Streaming can be enabled on the command line for all response bodies exceeding a certain size.
The SIZE argument understands k/m/g suffixes, e.g. 3m for 3 megabytes.
================== =================
command-line ``--stream SIZE``
================== =================
.. warning::
When response streaming is enabled, **streamed response contents will not be
recorded or preserved in any way.**
.. note::
When response streaming is enabled, the response body cannot be modified by the usual means.
Customizing Response Streaming
------------------------------
You can also use a script to customize exactly which responses are streamed.
Responses that should be tagged for streaming by setting their ``.stream``
attribute to ``True``:
.. literalinclude:: ../../examples/stream.py
:caption: examples/stream.py
:language: python
Implementation Details
----------------------
When response streaming is enabled, portions of the code which would have otherwise performed
changes on the response body will see an empty response body. Any modifications will be ignored.
Streamed responses are usually sent in chunks of 4096 bytes. If the response is sent with a
``Transfer-Encoding: chunked`` header, the response will be streamed one chunk at a time.
Modifying streamed data
-----------------------
If the ``.stream`` attribute is callable, ``.stream`` will wrap the generator that yields all
chunks.
.. literalinclude:: ../../examples/stream_modify.py
:caption: examples/stream_modify.py
:language: python
.. seealso::
- :ref:`passthrough`

View File

@@ -0,0 +1,42 @@
.. _reverseproxy:
Reverse Proxy
=============
In reverse proxy mode, mitmproxy accepts standard HTTP(S) requests and forwards
them to the specified upstream server. This is in contrast to :ref:`upstreamproxy`, in which
mitmproxy forwards HTTP(S) proxy requests to an upstream proxy server.
================== ================================
command-line ``-R http[s]://hostname[:port]``
================== ================================
Here, **http[s]** signifies if the proxy should use TLS to connect to the server.
mitmproxy always accepts both encrypted and unencrypted requests and transforms
them to what the server expects.
.. code-block:: none
>>> mitmdump -R https://httpbin.org -p 80
>>> curl http://localhost/
# requests will be transparently upgraded to TLS by mitmproxy
>>> mitmdump -R https://httpbin.org -p 443
>>> curl https://localhost/
# mitmproxy will use TLS on both ends.
Host Header
-----------
In reverse proxy mode, mitmproxy automatically rewrites the Host header to match the
upstream server. This allows mitmproxy to easily connect to existing endpoints on the
open web (e.g. ``mitmproxy -R https://example.com``).
However, keep in mind that absolute URLs within the returned document or HTTP redirects will
NOT be rewritten by mitmproxy. This means that if you click on a link for "http://example.com"
in the returned web page, you will be taken directly to that URL, bypassing mitmproxy.
One possible way to address this is to modify the hosts file of your OS so that "example.com"
resolves to your proxy's IP, and then access the proxy by going directly to example.com.
Make sure that your proxy can still resolve the original IP, or specify an IP in mitmproxy.

View File

@@ -1,6 +1,7 @@
.. _serverreplay:
- command-line: _-S path_
- mitmproxy shortcut: _S_
Server-side replay
==================
Server-side replay lets us replay server responses from a saved HTTP
conversation.
@@ -8,12 +9,12 @@ conversation.
Matching requests with responses
--------------------------------
By default, __mitmproxy__ excludes request headers when matching incoming
By default, :program:`mitmproxy` excludes request headers when matching incoming
requests with responses from the replay file. This works in most circumstances,
and makes it possible to replay server responses in situations where request
headers would naturally vary, e.g. using a different user agent. The _--rheader
headername_ command-line option allows you to override this behaviour by
specifying individual headers that should be included in matching.
headers would naturally vary, e.g. using a different user agent.
The ``--rheader headername`` command-line option allows you to override
this behaviour by specifying individual headers that should be included in matching.
Response refreshing
@@ -22,14 +23,17 @@ Response refreshing
Simply replaying server responses without modification will often result in
unexpected behaviour. For example cookie timeouts that were in the future at
the time a conversation was recorded might be in the past at the time it is
replayed. By default, __mitmproxy__ refreshes server responses before sending
them to the client. The __date__, __expires__ and __last-modified__ headers are
replayed. By default, :program:`mitmproxy` refreshes server responses before sending
them to the client. The **date**, **expires** and **last-modified** headers are
all updated to have the same relative time offset as they had at the time of
recording. So, if they were in the past at the time of recording, they will be
in the past at the time of replay, and vice versa. Cookie expiry times are
updated in a similar way.
You can turn off response refreshing using the _--norefresh_ argument, or using
the _o_ options shortcut within __mitmproxy__.
You can turn off response refreshing using the ``--norefresh`` argument, or using
the :kbd:`o` options shortcut within :program:`mitmproxy`.
================== ===========
command-line ``-S path``
mitmproxy shortcut :kbd:`R` then :kbd:`s`
================== ===========

View File

@@ -0,0 +1,19 @@
.. _setheaders:
Set Headers
===========
This feature lets you specify a set of headers to be added to requests or
responses, based on a filter pattern. You can specify these either on the
command-line, or through an interactive editor in mitmproxy.
Example: Set the **Host** header to "example.com" for all requests.
.. code-block:: none
mitmdump -R http://example.com --setheader :~q:Host:example.com
================== =======================
command-line ``--setheader PATTERN``
mitmproxy shortcut :kbd:`o` then :kbd:`H`
================== =======================

View File

@@ -0,0 +1,10 @@
.. _socksproxy:
SOCKS Mode
==========
In this mode, mitmproxy acts as a SOCKS5 proxy server.
================== ===========
command-line ``--socks``
================== ===========

41
docs/features/sticky.rst Normal file
View File

@@ -0,0 +1,41 @@
.. _sticky:
Sticky cookies and auth
=======================
Sticky cookies
--------------
When the sticky cookie option is set, __mitmproxy__ will add the cookie most
recently set by the server to any cookie-less request. Consider a service that
sets a cookie to track the session after authentication. Using sticky cookies,
you can fire up mitmproxy, and authenticate to a service as you usually would
using a browser. After authentication, you can request authenticated resources
through mitmproxy as if they were unauthenticated, because mitmproxy will
automatically add the session tracking cookie to requests. Among other things,
this lets you script interactions with authenticated resources (using tools
like wget or curl) without having to worry about authentication.
Sticky cookies are especially powerful when used in conjunction with :ref:`clientreplay` - you can
record the authentication process once, and simply replay it on startup every time you need
to interact with the secured resources.
================== ======================
command-line ``-t FILTER``
mitmproxy shortcut :kbd:`o` then :kbd:`t`
================== ======================
Sticky auth
-----------
The sticky auth option is analogous to the sticky cookie option, in that HTTP
**Authorization** headers are simply replayed to the server once they have been
seen. This is enough to allow you to access a server resource using HTTP Basic
authentication through the proxy. Note that :program:`mitmproxy` doesn't (yet) support
replay of HTTP Digest authentication.
================== ======================
command-line ``-u FILTER``
mitmproxy shortcut :kbd:`o` then :kbd:`A`
================== ======================

View File

@@ -0,0 +1,31 @@
.. _tcpproxy:
TCP Proxy
=========
WebSockets or other non-HTTP protocols are not supported by mitmproxy yet. However, you can exempt
hostnames from processing, so that mitmproxy acts as a generic TCP forwarder.
This feature is closely related to the :ref:`passthrough` functionality,
but differs in two important aspects:
- The raw TCP messages are printed to the event log.
- SSL connections will be intercepted.
Please note that message interception or modification are not possible yet.
If you are not interested in the raw TCP messages, you should use the ignore domains feature.
How it works
------------
================== ======================
command-line ``--tcp HOST``
mitmproxy shortcut :kbd:`o` then :kbd:`T`
================== ======================
For a detailed description how the hostname pattern works, please look at the :ref:`passthrough`
feature.
.. seealso::
- :ref:`passthrough`
- :ref:`responsestreaming`

View File

@@ -1,21 +1,23 @@
.. _upstreamcerts:
Upstream Certificates
=====================
When mitmproxy receives a connection destined for an SSL-protected service, it
freezes the connection before reading its request data, and makes a connection
to the upstream server to "sniff" the contents of its SSL certificate. The
information gained - the __Common Name__ and __Subject Alternative Names__ - is
information gained - the **Common Name** and **Subject Alternative Names** - is
then used to generate the interception certificate, which is sent to the client
so the connection can continue.
This rather intricate little dance lets us seamlessly generate correct
certificates even if the client has specifed only an IP address rather than the
certificates even if the client has specified only an IP address rather than the
hostname. It also means that we don't need to sniff additional data to generate
certs in transparent mode.
Upstream cert sniffing is on by default, and can optionally be turned off.
<table class="table">
<tbody>
<tr>
<th width="20%">command-line</th> <td>--no-upstream-cert</td>
</tr>
</tbody>
</table>
================== ======================
command-line ``--no-upstream-cert``
mitmproxy shortcut :kbd:`o` then :kbd:`U`
================== ======================

View File

@@ -0,0 +1,12 @@
.. _upstreamproxy:
Upstream proxy mode
===================
In this mode, mitmproxy accepts proxy requests and unconditionally forwards all
requests to a specified upstream proxy server. This is in contrast to :ref:`reverseproxy`,
in which mitmproxy forwards ordinary HTTP requests to an upstream server.
================== =============================
command-line ``-U http://hostname[:port]``
================== =============================

240
docs/howmitmproxy.rst Normal file
View File

@@ -0,0 +1,240 @@
How mitmproxy works
===================
Mitmproxy is an enormously flexible tool. Knowing exactly how the proxying
process works will help you deploy it creatively, and take into account its
fundamental assumptions and how to work around them. This document explains
mitmproxy's proxy mechanism in detail, starting with the simplest unencrypted
explicit proxying, and working up to the most complicated interaction -
transparent proxying of TLS-protected traffic [#tls]_ in the presence of `Server
Name Indication`_.
Explicit HTTP
-------------
Configuring the client to use mitmproxy as an explicit proxy is the simplest and
most reliable way to intercept traffic. The proxy protocol is codified in the
`HTTP RFC`_, so the behaviour of both the client and the server is well defined,
and usually reliable. In the simplest possible interaction with mitmproxy, a
client connects directly to the proxy, and makes a request that looks like this:
.. code-block:: none
GET http://example.com/index.html HTTP/1.1
This is a proxy GET request - an extended form of the vanilla HTTP GET request
that includes a schema and host specification, and it includes all the
information mitmproxy needs to proceed.
.. image:: schematics/how-mitmproxy-works-explicit.png
:align: center
1. The client connects to the proxy and makes a request.
2. Mitmproxy connects to the upstream server and simply forwards the request on.
Explicit HTTPS
--------------
The process for an explicitly proxied HTTPS connection is quite different. The
client connects to the proxy and makes a request that looks like this:
.. code-block:: none
CONNECT example.com:443 HTTP/1.1
A conventional proxy can neither view nor manipulate an TLS-encrypted data
stream, so a CONNECT request simply asks the proxy to open a pipe between the
client and server. The proxy here is just a facilitator - it blindly forwards
data in both directions without knowing anything about the contents. The
negotiation of the TLS connection happens over this pipe, and the subsequent
flow of requests and responses are completely opaque to the proxy.
The MITM in mitmproxy
^^^^^^^^^^^^^^^^^^^^^
This is where mitmproxy's fundamental trick comes into play. The MITM in its
name stands for Man-In-The-Middle - a reference to the process we use to
intercept and interfere with these theoretically opaque data streams. The basic
idea is to pretend to be the server to the client, and pretend to be the client
to the server, while we sit in the middle decoding traffic from both sides. The
tricky part is that the `Certificate Authority`_ system is designed to prevent
exactly this attack, by allowing a trusted third-party to cryptographically sign
a server's certificates to verify that they are legit. If this signature doesn't
match or is from a non-trusted party, a secure client will simply drop the
connection and refuse to proceed. Despite the many shortcomings of the CA system
as it exists today, this is usually fatal to attempts to MITM an TLS connection
for analysis. Our answer to this conundrum is to become a trusted Certificate
Authority ourselves. Mitmproxy includes a full CA implementation that generates
interception certificates on the fly. To get the client to trust these
certificates, we :ref:`register mitmproxy as a trusted CA with the device
manually <certinstall>`.
Complication 1: What's the remote hostname?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To proceed with this plan, we need to know the domain name to use in the
interception certificate - the client will verify that the certificate is for
the domain it's connecting to, and abort if this is not the case. At first
blush, it seems that the CONNECT request above gives us all we need - in this
example, both of these values are "example.com". But what if the client had
initiated the connection as follows:
.. code-block:: none
CONNECT 10.1.1.1:443 HTTP/1.1
Using the IP address is perfectly legitimate because it gives us enough
information to initiate the pipe, even though it doesn't reveal the remote
hostname.
Mitmproxy has a cunning mechanism that smooths this over - :ref:`upstream
certificate sniffing <upstreamcerts>`. As soon as we see the CONNECT request, we
pause the client part of the conversation, and initiate a simultaneous
connection to the server. We complete the TLS handshake with the server, and
inspect the certificates it used. Now, we use the Common Name in the upstream
certificates to generate the dummy certificate for the client. Voila, we have
the correct hostname to present to the client, even if it was never specified.
Complication 2: Subject Alternative Name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Enter the next complication. Sometimes, the certificate Common Name is not, in
fact, the hostname that the client is connecting to. This is because of the
optional `Subject Alternative Name`_ field in the certificate that allows an
arbitrary number of alternative domains to be specified. If the expected domain
matches any of these, the client will proceed, even though the domain doesn't
match the certificate CN. The answer here is simple: when we extract the CN from
the upstream cert, we also extract the SANs, and add them to the generated dummy
certificate.
Complication 3: Server Name Indication
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
One of the big limitations of vanilla TLS is that each certificate requires its
own IP address. This means that you couldn't do virtual hosting where multiple
domains with independent certificates share the same IP address. In a world with
a rapidly shrinking IPv4 address pool this is a problem, and we have a solution
in the form of the `Server Name Indication`_ extension to the TLS protocols.
This lets the client specify the remote server name at the start of the TLS
handshake, which then lets the server select the right certificate to complete
the process.
SNI breaks our upstream certificate sniffing process, because when we connect
without using SNI, we get served a default certificate that may have nothing to
do with the certificate expected by the client. The solution is another tricky
complication to the client connection process. After the client connects, we
allow the TLS handshake to continue until just **after** the SNI value has been
passed to us. Now we can pause the conversation, and initiate an upstream
connection using the correct SNI value, which then serves us the correct
upstream certificate, from which we can extract the expected CN and SANs.
Putting it all together
^^^^^^^^^^^^^^^^^^^^^^^
Lets put all of this together into the complete explicitly proxied HTTPS flow.
.. image:: schematics/how-mitmproxy-works-explicit-https.png
:align: center
1. The client makes a connection to mitmproxy, and issues an HTTP CONNECT request.
2. Mitmproxy responds with a ``200 Connection Established``, as if it has set up the CONNECT pipe.
3. The client believes it's talking to the remote server, and initiates the TLS connection.
It uses SNI to indicate the hostname it is connecting to.
4. Mitmproxy connects to the server, and establishes an TLS connection using the SNI hostname
indicated by the client.
5. The server responds with the matching certificate, which contains the CN and SAN values
needed to generate the interception certificate.
6. Mitmproxy generates the interception cert, and continues the
client TLS handshake paused in step 3.
7. The client sends the request over the established TLS connection.
8. Mitmproxy passes the request on to the server over the TLS connection initiated in step 4.
Transparent HTTP
----------------
When a transparent proxy is used, the connection is redirected into a proxy at
the network layer, without any client configuration being required. This makes
transparent proxying ideal for those situations where you can't change client
behaviour - proxy-oblivious Android applications being a common example.
To achieve this, we need to introduce two extra components. The first is a
redirection mechanism that transparently reroutes a TCP connection destined for
a server on the Internet to a listening proxy server. This usually takes the
form of a firewall on the same host as the proxy server - `iptables`_ on Linux
or pf_ on OSX. Once the client has initiated the connection, it makes a vanilla
HTTP request, which might look something like this:
.. code-block:: none
GET /index.html HTTP/1.1
Note that this request differs from the explicit proxy variation, in that it
omits the scheme and hostname. How, then, do we know which upstream host to
forward the request to? The routing mechanism that has performed the redirection
keeps track of the original destination for us. Each routing mechanism has a
different way of exposing this data, so this introduces the second component
required for working transparent proxying: a host module that knows how to
retrieve the original destination address from the router. In mitmproxy, this
takes the form of a built-in set of modules_ that know how to talk to each
platform's redirection mechanism. Once we have this information, the process is
fairly straight-forward.
.. image:: schematics/how-mitmproxy-works-transparent.png
:align: center
1. The client makes a connection to the server.
2. The router redirects the connection to mitmproxy, which is typically
listening on a local port of the same host. Mitmproxy then consults the
routing mechanism to establish what the original destination was.
3. Now, we simply read the client's request...
4. ... and forward it upstream.
Transparent HTTPS
-----------------
The first step is to determine whether we should treat an incoming connection as
HTTPS. The mechanism for doing this is simple - we use the routing mechanism to
find out what the original destination port is. All incoming connections pass
through different layers which can determin the actual protocol to use.
Automatic TLS detection works for SSLv3, TLS 1.0, TLS 1.1, and TLS 1.2 by
looking for a *ClientHello* message at the beginning of each connection. This
works independently of the used TCP port.
From here, the process is a merger of the methods we've described for
transparently proxying HTTP, and explicitly proxying HTTPS. We use the routing
mechanism to establish the upstream server address, and then proceed as for
explicit HTTPS connections to establish the CN and SANs, and cope with SNI.
.. image:: schematics/how-mitmproxy-works-transparent-https.png
:align: center
1. The client makes a connection to the server.
2. The router redirects the connection to mitmproxy, which is typically listening on a local port
of the same host. Mitmproxy then consults the routing mechanism to establish what the original
destination was.
3. The client believes it's talking to the remote server, and initiates the TLS connection.
It uses SNI to indicate the hostname it is connecting to.
4. Mitmproxy connects to the server, and establishes an TLS connection using the SNI hostname
indicated by the client.
5. The server responds with the matching certificate, which contains the CN and SAN values
needed to generate the interception certificate.
6. Mitmproxy generates the interception cert, and continues the client TLS handshake paused in
step 3.
7. The client sends the request over the established TLS connection.
8. Mitmproxy passes the request on to the server over the TLS connection initiated in step 4.
.. rubric:: Footnotes
.. [#tls] The use of "TLS" refers to both SSL (outdated and insecure) and TLS
(1.0 and up) in the generic sense, unless otherwise specified.
.. _Server Name Indication: https://en.wikipedia.org/wiki/Server_Name_Indication
.. _HTTP RFC: https://tools.ietf.org/html/rfc7230
.. _Certificate Authority: https://en.wikipedia.org/wiki/Certificate_authority
.. _Subject Alternative Name: https://en.wikipedia.org/wiki/SubjectAltName
.. _iptables: http://www.netfilter.org/
.. _pf: https://en.wikipedia.org/wiki/PF_\(firewall\)
.. _modules: https://github.com/mitmproxy/mitmproxy/tree/master/mitmproxy/platform

90
docs/index.rst Normal file
View File

@@ -0,0 +1,90 @@
.. include:: introduction.rst
.. toctree::
:hidden:
:maxdepth: 1
introduction
install
certinstall
howmitmproxy
modes
.. toctree::
:hidden:
:caption: Tools
mitmproxy
mitmdump
config
.. toctree::
:hidden:
:caption: Features
features/anticache
features/filters
features/replacements
features/clientreplay
features/serverreplay
features/setheaders
features/passthrough
features/proxyauth
features/reverseproxy
features/responsestreaming
features/socksproxy
features/sticky
features/tcpproxy
features/upstreamproxy
features/upstreamcerts
.. toctree::
:hidden:
:caption: Transparent Proxying
transparent
transparent/linux
transparent/osx
.. toctree::
:hidden:
:caption: Scripting
scripting/overview
scripting/events
scripting/api
.. toctree::
:hidden:
:caption: Tutorials
tutorials/30second
tutorials/gamecenter
tutorials/transparent-dhcp
.. toctree::
:hidden:
:caption: Pathod & Pathoc
pathod/intro
pathod/language
pathod/library
pathod/test
.. toctree::
:hidden:
:caption: Hacking
dev/architecture
dev/testing
dev/sslkeylogfile
.. Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`

132
docs/install.rst Normal file
View File

@@ -0,0 +1,132 @@
.. _install:
Installation
============
.. _install-ubuntu:
Installation On Ubuntu
----------------------
Ubuntu comes with Python but we need to install pip, python-dev and several libraries.
This was tested on a fully patched installation of Ubuntu 14.04.
.. code:: bash
sudo apt-get install python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev g++
sudo pip install mitmproxy # or pip install --user mitmproxy
Once installation is complete you can run :ref:`mitmproxy` or :ref:`mitmdump` from a terminal.
On **Ubuntu 12.04** (and other systems with an outdated version of pip),
you may need to update pip using ``pip install -U pip`` before installing mitmproxy.
Installation From Source (Ubuntu)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you would like to install mitmproxy directly from the master branch on GitHub or would like to
get set up to contribute to the project, install the dependencies as you would for a regular
mitmproxy installation (see :ref:`install-ubuntu`).
Then see the Hacking_ section of the README on GitHub.
.. _install-fedora:
Installation On Fedora
----------------------
Fedora comes with Python but we need to install pip, python-dev and several libraries.
This was tested on a fully patched installation of Fedora 23.
.. code:: bash
sudo dnf install -y python-pip python-devel libffi-devel openssl-devel libxml2-devel libxslt-devel libpng-devel libjpeg-devel
sudo pip install mitmproxy # or pip install --user mitmproxy
Once installation is complete you can run :ref:`mitmproxy` or :ref:`mitmdump` from a terminal.
.. _install-arch:
Installation On Arch Linux
--------------------------
mitmproxy has been added into the [community] repository. Use pacman to install it:
>>> sudo pacman -S mitmproxy
Installation On Mac OS X
------------------------
The easiest way to get up and running on OSX is to download the pre-built binary packages from
`mitmproxy.org`_.
There are a few bits of customization you might want to do to make mitmproxy comfortable to use on
OSX. The default color scheme is optimized for a dark background terminal, but you can select a
palette for a light terminal background with the ``--palette`` option.
You can use the OSX **open** program to create a simple and effective ``~/.mailcap`` file to view
request and response bodies:
.. code-block:: none
application/*; /usr/bin/open -Wn %s
audio/*; /usr/bin/open -Wn %s
image/*; /usr/bin/open -Wn %s
video/*; /usr/bin/open -Wn %s
Once installation is complete you can run :ref:`mitmproxy` or :ref:`mitmdump` from a terminal.
Installation From Source (Mac OS X)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you would like to install mitmproxy directly from the master branch on GitHub or would like to
get set up to contribute to the project, there are a few OS X specific things to keep in mind.
- Make sure that XCode is installed from the App Store, and that the command-line tools have been
downloaded (XCode/Preferences/Downloads).
- If you're running a Python interpreter installed with homebrew (or similar), you may have to
install some dependencies by hand.
Then see the Hacking_ section of the README on GitHub.
Installation On Windows
-----------------------
.. note::
Please note that mitmdump is the only component of mitmproxy that is supported on Windows at
the moment.
**There is no interactive user interface on Windows.**
First, install the latest version of Python 2.7 from the `Python website`_.
If you already have an older version of Python 2.7 installed, make sure to install pip_
(pip is included in Python 2.7.9+ by default). If pip aborts with an error, make sure you are using the current version of pip.
>>> python -m pip install --upgrade pip
Next, add Python and the Python Scripts directory to your **PATH** variable.
You can do this easily by running the following in powershell:
>>> [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27;C:\Python27\Scripts", "User")
Now, you can install mitmproxy by running
>>> pip install mitmproxy
Once the installation is complete, you can run :ref:`mitmdump` from a command prompt.
Installation From Source (Windows)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you would like to install mitmproxy directly from the master branch on GitHub or would like to
get set up to contribute to the project, install Python as outlined above, then see the
Hacking_ section of the README on GitHub.
.. _Hacking: https://github.com/mitmproxy/mitmproxy/blob/master/README.rst#hacking
.. _mitmproxy.org: https://mitmproxy.org/
.. _`Python website`: https://www.python.org/downloads/windows/
.. _pip: https://pip.pypa.io/en/latest/installing.html

23
docs/introduction.rst Normal file
View File

@@ -0,0 +1,23 @@
Introduction
============
**mitmproxy** is an interactive man-in-the-middle proxy for HTTP and HTTPS
with a console interface.
**mitmdump** is the command-line version of mitmproxy. Think tcpdump for HTTP.
Documentation, tutorials and distribution packages can be found on the
mitmproxy website: `mitmproxy.org <https://mitmproxy.org/>`_
.. rubric:: Features
- Intercept HTTP & HTTPS requests and responses and modify them on the fly
- Save complete HTTP conversations for later replay and analysis
- Replay the client-side of an HTTP conversations
- Replay HTTP responses of a previously recorded server
- Reverse proxy mode to forward traffic to a specified server
- Transparent proxy mode on OSX and Linux
- Make scripted changes to HTTP traffic using Python
- SSL/TLS certificates for interception are generated on the fly
- And much, much more...

66
docs/mitmdump.rst Normal file
View File

@@ -0,0 +1,66 @@
.. _mitmdump:
.. program:: mitmdump
mitmdump
========
**mitmdump** is the command-line companion to mitmproxy. It provides
tcpdump-like functionality to let you view, record, and programmatically
transform HTTP traffic. See the ``--help`` flag output for complete
documentation.
Examples
--------
Saving traffic
^^^^^^^^^^^^^^
>>> mitmdump -w outfile
Start up mitmdump in proxy mode, and write all traffic to **outfile**.
Filtering saved traffic
^^^^^^^^^^^^^^^^^^^^^^^
>>> mitmdump -nr infile -w outfile "~m post"
Start mitmdump without binding to the proxy port (``-n``), read all flows from
infile, apply the specified filter expression (only match POSTs), and write to
outfile.
Client replay
^^^^^^^^^^^^^
>>> mitmdump -nc outfile
Start mitmdump without binding to the proxy port (``-n``), then replay all
requests from outfile (``-c filename``). Flags combine in the obvious way, so
you can replay requests from one file, and write the resulting flows to
another:
>>> mitmdump -nc srcfile -w dstfile
See the :ref:`clientreplay` section for more information.
Running a script
^^^^^^^^^^^^^^^^
>>> mitmdump -s examples/add_header.py
This runs the **add_header.py** example script, which simply adds a new header
to all responses.
Scripted data transformation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> mitmdump -ns examples/add_header.py -r srcfile -w dstfile
This command loads flows from **srcfile**, transforms it according to the
specified script, then writes it back to **dstfile**.

BIN
docs/mitmproxy-docs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

125
docs/mitmproxy.rst Normal file
View File

@@ -0,0 +1,125 @@
.. _mitmproxy:
.. program:: mitmproxy
mitmproxy
=========
**mitmproxy** is a console tool that allows interactive examination and
modification of HTTP traffic. It differs from mitmdump in that all flows are
kept in memory, which means that it's intended for taking and manipulating
small-ish samples. Use the :kbd:`?` shortcut key to view, context-sensitive
documentation from any **mitmproxy** screen.
Flow list
---------
The flow list shows an index of captured flows in chronological order.
.. image:: screenshots/mitmproxy.png
- **1**: A GET request, returning a 302 Redirect response.
- **2**: A GET request, returning 16.75kb of text/html data.
- **3**: A replayed request.
- **4**: Intercepted flows are indicated with orange text. The user may edit
these flows, and then accept them (using the :kbd:`a` key) to continue. In this
case, the request has been intercepted on the way to the server.
- **5**: A response intercepted from the server on the way to the client.
- **6**: The event log can be toggled on and off using the :kbd:`e` shortcut key. This
pane shows events and errors that may not result in a flow that shows up in the
flow pane.
- **7**: Flow count.
- **8**: Various information on mitmproxy's state. In this case, we have an
interception pattern set to ``.*``.
- **9**: Bind address indicator - mitmproxy is listening on port 8080 of all
interfaces.
Flow view
---------
The **Flow View** lets you inspect and manipulate a single flow:
.. image:: screenshots/mitmproxy-flowview.png
- **1**: Flow summary.
- **2**: The Request/Response tabs, showing you which part of the flow you are
currently viewing. In the example above, we're viewing the Response. Hit :kbd:`tab`
to switch between the Response and the Request.
- **3**: Headers.
- **4**: Body.
- **5**: View Mode indicator. In this case, we're viewing the body in **hex** mode. The other
available modes are **pretty**, which uses a number of heuristics to show you a friendly
view of various content types, and **raw**, which shows you exactly what's there without any
changes. You can change modes using the :kbd:`m` key.
Grid Editor
-----------
Much of the data that we'd like to interact with in mitmproxy is structured.
For instance, headers, queries and form data can all be thought of as a list of
key/value pairs. Mitmproxy has a built-in editor that lays this type of data
out in a grid for easy manipulation.
At the moment, the Grid Editor is used in four parts of mitmproxy:
- Editing request or response headers (:kbd:`e` for edit, then :kbd:`h` for headers in flow view)
- Editing a query string (:kbd:`e` for edit, then :kbd:`q` for query in flow view)
- Editing a URL-encoded form (:kbd:`e` for edit, then :kbd:`f` for form in flow view)
- Editing replacement patterns (:kbd:`o` for options, then :kbd:`R` for Replacement Patterns)
If there is is no data, an empty editor will be started to let you add some.
Here is the editor showing the headers from a request:
.. image:: screenshots/mitmproxy-kveditor.png
To edit, navigate to the key or value you want to modify using the arrow or vi
navigation keys, and press enter. The background color will change to show that
you are in edit mode for the specified field:
.. image:: screenshots/mitmproxy-kveditor-editmode.png
Modify the field as desired, then press escape to exit edit mode when you're
done. You can also add a row (:kbd:`a` key), delete a row (:kbd:`d` key), spawn an
external editor on a field (:kbd:`e` key). Be sure to consult the context-sensitive
help (:kbd:`?` key) for more.
Example: Interception
---------------------
**mitmproxy**'s interception functionality lets you pause an HTTP request or
response, inspect and modify it, and then accept it to send it on to the server
or client.
1: Set an interception pattern
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: screenshots/mitmproxy-intercept-filt.png
We press :kbd:`i` to set an interception pattern. In this case, the ``~q`` filter
pattern tells **mitmproxy** to intercept all requests. For complete filter
syntax, see the :ref:`filters` section of the documentation,
or the built-in help function in **mitmproxy**.
2: Intercepted connections are indicated with orange text:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: screenshots/mitmproxy-intercept-mid.png
3: You can now view and modify the request:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: screenshots/mitmproxy-intercept-options.png
In this case, we viewed the request by selecting it, pressed :kbd:`e` for "edit"
and :kbd:`m` for "method" to change the HTTP request method.
4: Accept the intercept to continue:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: screenshots/mitmproxy-intercept-result.png
Finally, we press :kbd:`a` to accept the modified request, which is then sent on to
the server. In this case, we changed the request from an HTTP GET to
OPTIONS, and Google's server has responded with a 405 "Method not allowed".

6
docs/modd.conf Normal file
View File

@@ -0,0 +1,6 @@
@build = ./_build
** !_build/** ../netlib/**/*.py ../mitmproxy/**/*.py {
prep: sphinx-build -W -d @build/doctrees -b html . @build/html
daemon: devd -m @build/html
}

193
docs/modes.rst Normal file
View File

@@ -0,0 +1,193 @@
.. _modes:
Modes of Operation
==================
Mitmproxy has four modes of operation that allow you to use mitmproxy in a
variety of scenarios:
- **Regular** (the default)
- **Transparent**
- **Reverse Proxy**
- **Upstream Proxy**
Now, which one should you pick? Use this flow chart:
.. image:: schematics/proxy-modes-flowchart.png
:align: center
Regular Proxy
-------------
Mitmproxy's regular mode is the simplest and the easiest to set up.
1. Start mitmproxy.
2. Configure your client to use mitmproxy by explicitly setting an HTTP proxy.
3. Quick Check: You should already be able to visit an unencrypted HTTP site through the proxy.
4. Open the magic domain **mitm.it** and install the certificate for your device.
.. note::
Unfortunately, some applications bypass the system HTTP proxy settings - Android applications
are a common example. In these cases, you need to use mitmproxy's transparent mode.
If you are proxying an external device, your network will probably look like this:
.. image:: schematics/proxy-modes-regular.png
:align: center
The square brackets signify the source and destination IP addresses. Your
client explicitly connects to mitmproxy and mitmproxy explicitly connects
to the target server.
Transparent Proxy
-----------------
In transparent mode, traffic is directed into a proxy at the network layer,
without any client configuration required. This makes transparent proxying
ideal for situations where you can't change client behaviour. In the graphic
below, a machine running mitmproxy has been inserted between the router and
the internet:
.. image:: schematics/proxy-modes-transparent-1.png
:align: center
The square brackets signify the source and destination IP addresses. Round
brackets mark the next hop on the *Ethernet/data link* layer. This distinction
is important: when the packet arrives at the mitmproxy machine, it must still
be addressed to the target server. This means that Network Address Translation
should not be applied before the traffic reaches mitmproxy, since this would
remove the target information, leaving mitmproxy unable to determine the real
destination.
.. image:: schematics/proxy-modes-transparent-wrong.png
:align: center
Common Configurations
^^^^^^^^^^^^^^^^^^^^^
There are many ways to configure your network for transparent proxying. We'll
look at two common scenarios:
1. Configuring the client to use a custom gateway/router/"next hop"
2. Implementing custom routing on the router
In most cases, the first option is recommended due to its ease of use.
(a) Custom Gateway
~~~~~~~~~~~~~~~~~~
One simple way to get traffic to the mitmproxy machine with the destination IP
intact, is to simply configure the client with the mitmproxy box as the
default gateway.
.. image:: schematics/proxy-modes-transparent-2.png
:align: center
In this scenario, we would:
1. Configure the proxy machine for transparent mode. You can find instructions
in the :ref:`transparent` section.
2. Configure the client to use the proxy machine's IP as the default gateway.
3. Quick Check: At this point, you should already be able to visit an
unencrypted HTTP site over the proxy.
4. Open the magic domain **mitm.it** and install the certificate
for your device.
Setting the custom gateway on clients can be automated by serving the settings
out to clients over DHCP. This lets set up an interception network where all
clients are proxied automatically, which can save time and effort.
.. admonition:: Troubleshooting Transparent Mode
:class: note
Incorrect transparent mode configurations are a frequent source of
error. If it doesn't work for you, try the following things:
- Open mitmproxy's event log (press :kbd:`e`) - do you see clientconnect messages?
If not, the packets are not arriving at the proxy. One common cause is the occurrence of ICMP
redirects, which means that your machine is telling the client that there's a faster way to
the internet by contacting your router directly (see the :ref:`transparent` section on how to
disable them). If in doubt, Wireshark_ may help you to see whether something arrives at your
machine or not.
- Make sure you have not explicitly configured an HTTP proxy on the client.
This is not needed in transparent mode.
- Re-check the instructions in the :ref:`transparent` section. Anything you missed?
If you encounter any other pitfalls that should be listed here, please let us know!
(b) Custom Routing
~~~~~~~~~~~~~~~~~~
In some cases, you may need more fine-grained control of which traffic reaches
the mitmproxy instance, and which doesn't. You may, for instance, choose only
to divert traffic to some hosts into the transparent proxy. There are a huge
number of ways to accomplish this, and much will depend on the router or
packet filter you're using. In most cases, the configuration will look like
this:
.. image:: schematics/proxy-modes-transparent-3.png
:align: center
Reverse Proxy
-------------
mitmproxy is usually used with a client that uses the proxy to access the
Internet. Using reverse proxy mode, you can use mitmproxy to act like a normal
HTTP server:
.. image:: schematics/proxy-modes-reverse.png
:align: center
There are various use-cases:
- Say you have an internal API running at http://example.local/. You could now
set up mitmproxy in reverse proxy mode at http://debug.example.local/ and
dynamically point clients to this new API endpoint, which provides them
with the same data and you with debug information. Similarly, you could move
your real server to a different IP/port and set up mitmproxy in the original
place to debug and or redirect all sessions.
- Say you're a web developer working on http://example.com/ (with a development
version running on http://localhost:8000/). You can modify your hosts file so that
example.com points to 127.0.0.1 and then run mitmproxy in reverse proxy mode
on port 80. You can test your app on the example.com domain and get all
requests recorded in mitmproxy.
- Say you have some toy project that should get SSL support. Simply set up
mitmproxy as a reverse proxy on port 443 and you're done (``mitmdump -p 443 -R
http://localhost:80/``). Mitmproxy auto-detects TLS traffic and intercepts it dynamically.
There are better tools for this specific task, but mitmproxy is very quick and simple way to
set up an SSL-speaking server.
- Want to add a non-SSL-capable compression proxy in front of your server? You
could even spawn a mitmproxy instance that terminates SSL (``-R http://...``),
point it to the compression proxy and let the compression proxy point to a
SSL-initiating mitmproxy (``-R https://...``), which then points to the real
server. As you see, it's a fairly flexible thing.
.. admonition:: Caveat: Interactive Use
:class: warning
Reverse Proxy mode is usually not sufficient to create a copy of an interactive website at
different URL. The HTML served to the client remains unchanged - as soon as the user clicks on
an non-relative URL (or downloads a non-relative image resource), traffic no longer passes
through mitmproxy.
Upstream Proxy
--------------
If you want to chain proxies by adding mitmproxy in front of a different proxy
appliance, you can use mitmproxy's upstream mode. In upstream mode, all
requests are unconditionally transferred to an upstream proxy of your choice.
.. image:: schematics/proxy-modes-upstream.png
:align: center
mitmproxy supports both explicit HTTP and explicit HTTPS in upstream proxy
mode. You could in theory chain multiple mitmproxy instances in a row, but
that doesn't make any sense in practice (i.e. outside of our tests).
.. _Wireshark: https://wireshark.org/

307
docs/pathod/intro.rst Normal file
View File

@@ -0,0 +1,307 @@
.. _intro:
Pathology 101
=============
pathod
------
Pathod is a pathological HTTP daemon designed to let you craft almost any
conceivable HTTP response, including ones that creatively violate the
standards. HTTP responses are specified using a :ref:`small, terse language
<language>` which pathod shares with its evil twin :ref:`pathoc`. To start
playing with pathod, fire up the daemon:
>>> pathod
By default, the service listens on port 9999 of localhost, and the default
crafting anchor point is the path **/p/**. Anything after this URL prefix is
treated as a response specifier. So, hitting the following URL will generate an
HTTP 200 response with 100 bytes of random data:
http://localhost:9999/p/200:b@100
See the :ref:`language documentation <language>` to get (much) fancier. The
pathod daemon also takes a range of configuration options. To view those, use
the command-line help:
>>> pathod --help
Mimicing a proxy
^^^^^^^^^^^^^^^^
Pathod automatically responds to both straight HTTP and proxy requests. For
proxy requests, the upstream host is ignored, and the path portion of the URL
is used to match anchors. This lets you test software that supports a proxy
configuration by spoofing responses from upstream servers.
By default, we treat all proxy CONNECT requests as HTTPS traffic, serving the
response using either pathod's built-in certificates, or the cert/key pair
specified by the user. You can over-ride this behaviour if you're testing a
client that makes a non-SSL CONNECT request using the **-C** command-line
option.
Anchors
^^^^^^^
Anchors provide an alternative to specifying the response in the URL. Instead,
you attach a response to a pre-configured anchor point, specified with a regex.
When a URL matching the regex is requested, the specified response is served.
>>> pathod -a "/foo=200"
Here, "/foo" is the regex specifying the anchor path, and the part after the "="
is a response specifier.
File Access
^^^^^^^^^^^
There are two operators in the :ref:`language <language>` that load contents
from file - the **+** operator to load an entire request specification from
file, and the **>** value specifier. In pathod, both of these operators are
restricted to a directory specified at startup, or disabled if no directory is
specified:
>>> pathod -d ~/staticdir"
Internal Error Responses
^^^^^^^^^^^^^^^^^^^^^^^^
Pathod uses the non-standard 800 response code to indicate internal errors, to
distinguish them from crafted responses. For example, a request to:
http://localhost:9999/p/foo
... will return an 800 response because "foo" is not a valid page specifier.
.. _pathoc:
pathoc
------
Pathoc is a perverse HTTP daemon designed to let you craft almost any
conceivable HTTP request, including ones that creatively violate the standards.
HTTP requests are specified using a :ref:`small, terse language <language>`,
which pathod shares with its server-side twin pathod. To view pathoc's complete
range of options, use the command-line help:
>>> pathoc --help
Getting Started
^^^^^^^^^^^^^^^
The basic pattern for pathoc commands is as follows:
pathoc hostname request [request ...]
That is, we specify the hostname to connect to, followed by one or more
requests. Lets start with a simple example::
> pathoc google.com get:/
07-06-16 12:13:43: >> 'GET':/
<< 302 Found: 261 bytes
Here, we make a GET request to the path / on port 80 of google.com. Pathoc's
output tells us that the server responded with a 302 redirection. We can tell
pathoc to connect using SSL, in which case the default port is changed to 443
(you can over-ride the default port with the **-p** command-line option)::
> pathoc -s www.google.com get:/
07-06-16 12:14:56: >> 'GET':/
<< 302 Found: 262 bytes
Multiple Requests
^^^^^^^^^^^^^^^^^
There are two ways to tell pathoc to issue multiple requests. The first is to specify
them on the command-line, like so::
> pathoc google.com get:/ get:/
07-06-16 12:21:04: >> 'GET':/
<< 302 Found: 261 bytes
07-06-16 12:21:04: >> 'GET':/
<< 302 Found: 261 bytes
In this case, pathoc issues the specified requests over the same TCP connection -
so in the above example only one connection is made to google.com
The other way to issue multiple requests is to use the **-n** flag::
> pathoc -n 2 google.com get:/
07-06-16 12:21:04: >> 'GET':/
<< 302 Found: 261 bytes
07-06-16 12:21:04: >> 'GET':/
<< 302 Found: 261 bytes
The output is identical, but two separate TCP connections are made to the
upstream server. These two specification styles can be combined::
pathoc -n 2 google.com get:/ get:/
Here, two distinct TCP connections are made, with two requests issued over
each.
Basic Fuzzing
^^^^^^^^^^^^^
The combination of pathoc's powerful request specification language and a few
of its command-line options makes for quite a powerful basic fuzzer. Here's an
example::
pathoc -e -I 200 -t 2 -n 1000 localhost get:/:b@10:ir,@1
The request specified here is a valid GET with a body consisting of 10 random bytes,
but with 1 random byte inserted in a random place. This could be in the headers,
in the initial request line, or in the body itself. There are a few things
to note here:
- Corrupting the request in this way will often make the server enter a state where
it's awaiting more input from the client. This is where the
**-t** option comes in, which sets a timeout that causes pathoc to
disconnect after two seconds.
- The **-n** option tells pathoc to repeat the request 1000 times.
- The **-I** option tells pathoc to ignore HTTP 200 response codes.
You can use this to fine-tune what pathoc considers to be an exceptional
condition, and therefore log-worthy.
- The **-e** option tells pathoc to print an explanation of each logged
request, in the form of an expanded pathoc specification with all random
portions and automatic header additions resolved. This lets you precisely
replay a request that triggered an error.
Interacting with Proxies
^^^^^^^^^^^^^^^^^^^^^^^^
Pathoc has a reasonably sophisticated suite of features for interacting with
proxies. The proxy request syntax very closely mirrors that of straight HTTP,
which means that it is possible to make proxy-style requests using pathoc
without any additional syntax, by simply specifying a full URL instead of a
simple path:
>>> pathoc -p 8080 localhost "get:'http://google.com'"
Another common use case is to use an HTTP CONNECT request to probe remote
servers via a proxy. This is done with the **-c** command-line option, which
allows you to specify a remote host and port pair:
>>> pathoc -c google.com:80 -p 8080 localhost get:/
Note that pathoc does **not** negotiate SSL without being explictly instructed
to do so. If you're making a CONNECT request to an SSL-protected resource, you
must also pass the **-s** flag:
>>> pathoc -sc google.com:443 -p 8080 localhost get:/
Embedded response specification
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
One interesting feature of the Request specification language is that you can
embed a response specification in it, which is then added to the request path.
Here's an example:
>>> pathoc localhost:9999 "get:/p/:s'401:ir,@1'"
This crafts a request that connects to the pathod server, and which then crafts
a response that generates a 401, with one random byte embedded at a random
point. The response specification is parsed and expanded by pathoc, so you see
syntax errors immediately. This really becomes handy when combined with the
**-e** flag to show the expanded request::
07-06-16 12:32:01: >> 'GET':/p/:s'401:i35,\x27\\x1b\x27:h\x27Content-Length\x27=\x270\x27:h\x27Content-Length\x27=\x270\x27':h'Host'='localhost'
<< 401 Unauthorized: 0 bytes
Note that the embedded response has been resolved *before* being sent to
the server, so that "ir,@1" (embed a random byte at a random location) has
become "i15,\'o\'" (embed the character "o" at offset 15). You now have a
pathoc request specification that is precisely reproducible, even with random
components. This feature comes in terribly handy when testing a proxy, since
you can now drive the server response completely from the client, and have a
complete log of reproducible requests to analyze afterwards.
Request Examples
----------------
.. list-table::
:widths: 50 50
:header-rows: 0
* - get:/
- Get path /
* - get:/:b@100
- 100 random bytes as the body
* - get:/:h"Etag"="&;drop table browsers;"
- Add a header
* - get:/:u"&;drop table browsers;"
- Add a User-Agent header
* - get:/:b@100:dr
- Drop the connection randomly
* - get:/:b@100,ascii:ir,@1
- 100 ASCII bytes as the body, and randomly inject a random byte
* - ws:/
- Initiate a websocket handshake.
Response Examples
-----------------
.. list-table::
:widths: 50 50
:header-rows: 0
* - 200
- A basic HTTP 200 response.
* - 200:r
- A basic HTTP 200 response with no Content-Length header. This will hang.
* - 200:da
- Server-side disconnect after all content has been sent.
* - 200:b\@100
- 100 random bytes as the body. A Content-Length header is added, so the disconnect
is no longer needed.
* - 200:b\@100:h"Etag"="';drop table servers;"
- Add a Server header
* - 200:b\@100:dr
- Drop the connection randomly
* - 200:b\@100,ascii:ir,@1
- 100 ASCII bytes as the body, and randomly inject a random byte
* - 200:b\@1k:c"text/json"
- 1k of random bytes, with a text/json content type
* - 200:b\@1k:p50,120
- 1k of random bytes, pause for 120 seconds after 50 bytes
* - 200:b\@1k:pr,f
- 1k of random bytes, but hang forever at a random location
* - 200:b\@100:h\@1k,ascii_letters='foo'
- 100 ASCII bytes as the body, randomly generated 100k header name, with the value
'foo'.

Some files were not shown because too many files have changed in this diff Show More