Aldo Cortesi
269780c577
Unit test dummy response functions.
2013-02-23 16:34:59 +13:00
Aldo Cortesi
aaf892e3af
Significantly refactor the master/slave message passing interface.
2013-02-17 12:42:48 +13:00
Aldo Cortesi
1ccb2c5dea
Test WSGI app calling.
...
- Factor out test servers into a separate file
- Adjust docs to note new Flask dependency
2013-02-16 16:46:16 +13:00
Eric Entzel
6bcf29c0ed
Keep blank URL parameters
...
TODO: This should probably be configurable
2013-02-11 13:22:25 +11:00
Aldo Cortesi
782bbee8c0
Unit tests for ServerConnectionPool
2013-01-29 11:35:57 +13:00
Aldo Cortesi
53792a5a28
Beef up unit tests for HAR utility functions - flow.py coverage now 100%.
2013-01-29 10:41:45 +13:00
Aldo Cortesi
6f157d936f
Merge pull request #99 from rouli/master
...
Adding helper functions to make HAR export easier
2013-01-28 13:28:49 -08:00
Rouli
330fbfe8cc
adding helper functions to make HAR export easier
2013-01-28 17:37:25 +02:00
Aldo Cortesi
57f01ffb07
Test suite, remove extraneous code.
2013-01-28 21:59:03 +13:00
Aldo Cortesi
25cb9471f0
Add tests for client certificate support.
2013-01-20 22:39:28 +13:00
Aldo Cortesi
6600c589ab
Rudimentary testing for client certs.
2013-01-18 17:08:30 +13:00
Aldo Cortesi
0f406e9daa
Speed up the test suite by reducing time sleeping in tests.
2013-01-18 14:52:19 +13:00
Aldo Cortesi
7a79eeb143
Merge branch 'master' of ssh.github.com:cortesi/mitmproxy
...
Conflicts:
test/test_server.py
2013-01-18 14:50:31 +13:00
Rouli
6212b69fb4
fixes due to merge with master
2013-01-17 17:36:18 +02:00
Rouli
446f9f0a0f
Merge remote-tracking branch 'upstream/master'
2013-01-17 17:33:29 +02:00
Rouli
20fa6a3083
changing requests and responses to have two timestamps, one marking their initiation, and the other their complete
2013-01-17 17:32:56 +02:00
Aldo Cortesi
d0ee4d60d0
Unit tests and minor code refactoring for ServerConnection.
2013-01-05 19:44:12 -08:00
Aldo Cortesi
891c441a6d
Use new netlib certificate store implementation.
2013-01-06 01:16:08 +13:00
Aldo Cortesi
9cfc785cd3
Unit test love - 100% for flow.py, dump.py
2013-01-05 21:56:33 +13:00
Aldo Cortesi
46ab6ed491
Minor cleanups of proxy request handling.
2013-01-04 14:19:32 +13:00
Aldo Cortesi
f5e49ef598
First draft of "How mitmproxy works", a complete guide to the mechanics of the proxy process
2013-01-03 17:26:59 +13:00
Aldo Cortesi
e2dc7ba09d
First draft of OSX transparent proxy mode.
2013-01-01 11:13:56 +13:00
Aldo Cortesi
5347cb9c26
More work on proxy auth
...
- Strip auth header if auth succeeds, so it's not passed upstream
- Actually use realm specification to BasicProxyAuth, and make it mandatory
- Cleanups and unit tests
2012-12-31 10:56:44 +13:00
Aldo Cortesi
3b84111493
Test and robustify BasicProxyAuth.parse_auth_value
...
- This is partly in preparation for moving the implementation to netlib
- Also add an unparse_auth_value for testing (and use in pathod once the move is done)
2012-12-31 10:34:25 +13:00
Aldo Cortesi
018c229ae4
Start solidifying proxy authentication
...
- Add a unit test file
- Remove some extraneous methods
- Change the auth API to make the authenticate method take a header object.
2012-12-31 09:15:56 +13:00
Aldo Cortesi
8c976ac7f0
Substantially rewrite AMF decoding.
...
This is tricky, but we should now handle a lot more corner-cases.
2012-11-26 13:25:07 +13:00
Aldo Cortesi
0d59fd7e01
Move cleanBin and hexdump into netutils.
2012-09-24 11:21:12 +12:00
Aldo Cortesi
d115b5ae70
Expand Flow.match to accept either a string or a compiled filter expression.
2012-09-14 09:41:01 +12:00
Aldo Cortesi
a77ccc406d
Getter and setter for path component on Requests.
2012-08-19 13:03:21 +12:00
Aldo Cortesi
60659a89c3
Little bit of love for the unit tests.
2012-08-19 00:22:42 +12:00
Aldo Cortesi
1b7990897e
Command-line options for header setting.
2012-08-19 00:14:16 +12:00
Aldo Cortesi
3e96015e61
Add SetHeaders, analogous to ReplaceHooks, with a graphical editor in mitmproxy (H shortcut).
...
SetHeaders defines headers that are set on flows, based on a matching pattern.
Existing headers are over-ridden.
2012-08-18 23:41:04 +12:00
Aldo Cortesi
b70e91bbd4
Send tracebacks from content viewers to event log.
...
Also, 100% test coverage for content viewers.
2012-08-18 17:42:40 +12:00
Aldo Cortesi
e8553f966f
Further simplifcation and testing of contentviews.
2012-08-18 17:29:29 +12:00
Aldo Cortesi
11c63dcb9f
Huge cleanup of content viewers.
2012-08-18 17:08:17 +12:00
Sahn Lam
3189d144a5
Optional AMF decoding support
...
If PyAMF is installed, enable AMF decoding.
2012-08-17 18:45:26 -07:00
Aldo Cortesi
a66d018363
Fix unit tests after argparse conversion.
2012-08-18 10:27:31 +12:00
Aldo Cortesi
32ad26f8bf
Add a size() method to flow.Request and flow.Response.
2012-08-04 13:18:05 +12:00
Aldo Cortesi
84bffad3fc
Fix flow read unit test to accomodate more tolerant dumpfile parsing.
2012-07-24 15:30:52 +12:00
András Veres-Szentkirályi
1a26f8215d
removed assigned but unread variables
2012-07-15 22:42:59 +02:00
András Veres-Szentkirályi
da496669c2
removed unused imports
2012-07-15 22:42:45 +02:00
Aldo Cortesi
e4079aa746
Add an ~a filter expression, matching an asset content type in responses.
...
Asset content types are Javascript, images, Flash and CSS. This is useful
because doing a quick "!~a" while auditing an app will filter out the majority
of the static asset cruft, letting you focus on what matters.
2012-07-14 16:55:21 +12:00
Aldo Cortesi
01b8b0d876
Refine semantics of replay_request method.
2012-07-10 23:29:33 +12:00
Aldo Cortesi
04d9ec8c3c
Make WSGI apps work in transparent mode.
2012-07-10 15:53:53 +12:00
Aldo Cortesi
79af9e89c4
Test replay corner cases. Fix discovered bugs.
2012-07-09 11:18:03 +12:00
Aldo Cortesi
aab45078ad
Unit test request replay thread.
...
This is a small patch, but is the culmination of lots of work: we can now unit
test the deep innards of mitmproxy, with coverage. There's a lot more to come
in this vein.
2012-07-09 11:03:55 +12:00
Aldo Cortesi
e49c920d16
Refator server tests to use flow.FlowMaster and flow.State
2012-07-09 10:58:28 +12:00
Aldo Cortesi
572e8a4962
Add streaming to FlowMaster
2012-07-09 10:18:37 +12:00
Aldo Cortesi
4b6fdc92dc
Remove ODict tests. ODict is now in netlib.
2012-07-09 09:54:15 +12:00
Aldo Cortesi
d02bcade3a
Add a domain match filter (~d regex)
2012-07-06 22:21:44 +12:00
Aldo Cortesi
aa708a2d28
Fix error when serializing reverted SSL flows.
2012-07-05 11:52:56 +12:00
Aldo Cortesi
90365e270e
Catch and handle SSL connection errors.
2012-07-01 12:10:32 +12:00
Aldo Cortesi
d74a341e5d
Beef up logging substantially.
2012-07-01 00:15:03 +12:00
Aldo Cortesi
f070e4523a
Handle invalid data more gracefully.
...
Fixes #47
2012-06-30 15:59:42 +12:00
Aldo Cortesi
47651b1ff2
Serialization and de-serialization of new cert format.
2012-06-28 14:29:15 +12:00
Aldo Cortesi
35ee0c098f
Remove certutils from mitmproxy.
2012-06-27 16:43:33 +12:00
Aldo Cortesi
8ccfb376f3
Remove -T and -U command-line options.
...
They're redundant convenience options, and we need more space.
2012-06-26 19:57:59 +12:00
Aldo Cortesi
874649f134
Adapt for API changes in netlib.
2012-06-23 14:06:34 +12:00
Aldo Cortesi
7cb242c168
Move wsgi to netlib.
2012-06-19 10:42:55 +12:00
Aldo Cortesi
1b1ccab8b7
Extract protocol and tcp server implementations into netlib.
2012-06-19 09:58:50 +12:00
Aldo Cortesi
7b9756f48e
Refactor protocol.py to remove dependence on flow and utils.
2012-06-17 10:52:39 +12:00
Aldo Cortesi
aae8a9959c
Pull out protocol components into protocol.py
2012-06-16 21:23:32 +12:00
Aldo Cortesi
d5a0099f49
Test suite and refactoring for netlib.
2012-06-16 16:22:51 +12:00
Aldo Cortesi
4e53f1ee90
Rename our tcpserver to netlib, expand to include client network functions.
2012-06-16 13:38:10 +12:00
Aldo Cortesi
c7952371b7
Fix a problem in ODictCaseless that could cause duplicate headers.
2012-06-15 17:40:08 +12:00
Aldo Cortesi
8ae3270807
Basic transparent mode.
2012-06-15 09:47:04 +12:00
Aldo Cortesi
a9495dc02f
Refactor test suite to make room for transparent mode tests.
2012-06-15 09:20:10 +12:00
Aldo Cortesi
8a9352b3f7
First draft conversion of server to PyOpenSSL.
2012-06-13 18:16:47 +12:00
Aldo Cortesi
d032504b17
Fix an exception when replaying a flow with no response.
2012-06-10 17:10:43 +12:00
Aldo Cortesi
d60fa9918b
Localise client connection object manipulation.
...
This simplifies the call signature for a bunch of functions.
2012-06-10 16:49:59 +12:00
Aldo Cortesi
6ba5f0f35b
Add HTTP version to response objects.
...
Another change in the serialization format.
2012-06-10 13:27:43 +12:00
Aldo Cortesi
52779d9db9
Refactoring of proxy.py
...
- Correctly pass HTTP request version on to upstream servers
- Adjust tests not to hang due to a pathod response with no content-length
2012-06-10 13:17:18 +12:00
Aldo Cortesi
55ddf853cd
Add HTTP version to flow.Request
...
This is a serialization format change, that makes us incompatible with previous
versions.
2012-06-10 10:46:22 +12:00
Aldo Cortesi
a3b47e0cb5
Consolidate HTTP major and minor versions into a single variable.
2012-06-10 10:31:04 +12:00
Aldo Cortesi
8254187bf3
Add proxy.should_connection_close, and strip out unused code.
2012-06-10 10:10:46 +12:00
Aldo Cortesi
18c1b44475
Reverse proxy testing.
2012-06-09 20:41:28 +12:00
Aldo Cortesi
05492baf8d
Move from requests to human_curl.
...
It turns out that _none_ of the Python stdlib or anything that relies on it
supports CONNECT through a proxy. Beggars belief, but there you go.
2012-06-09 16:17:51 +12:00
Aldo Cortesi
22192d1a46
Nose mopup: docs, no cover pragmas, a few missing path specs.
2012-06-09 13:55:55 +12:00
Aldo Cortesi
b7b357528c
Port mitmproxy test suite entirely to nose.
2012-06-09 13:42:43 +12:00
Aldo Cortesi
a63240a848
Move pathod service testing truss to nose.
2012-06-09 12:13:01 +12:00
Aldo Cortesi
e78b48ab20
Start conversion to nose.
...
RIP pry.
2012-06-09 10:57:00 +12:00
Aldo Cortesi
7a312546f3
Shift mitmproxy test suite over to pathod.
...
This opens a whole brave new world of testing for mitmproxy.
2012-06-08 10:00:16 +12:00
Aldo Cortesi
e9109812e1
Split parsing of intial line into separate protocols.
2012-06-03 06:04:57 -07:00
Aldo Cortesi
491f9bdcee
Add unit tests for console/help.py
2012-06-03 01:11:07 -07:00
Aldo Cortesi
ee2950cd19
Fix a crashing bug when replacing text in a flow with unicode bodies.
2012-05-25 18:10:31 -07:00
Aldo Cortesi
0a90a3eaba
Refuse to replay a request with missing content.
2012-05-16 18:24:32 +12:00
Aldo Cortesi
0c2d894cea
Add the ability to flag content as missing in a request or a response.
...
We'll use this in a number of situations. First, we'll soon have response
streaming that directly pipes responses to clients. These will be content-less
from mitmproxy's perspective. Second, we'll be growing new events that fire
after headers are received, but before content is read.
2012-05-16 15:42:58 +12:00
Aldo Cortesi
116fcfcf7a
Internal error page for WSGI.
...
Also, 100% test coverage.
2012-04-27 15:56:42 +12:00
Aldo Cortesi
c8d2b2594b
Add a WSGI adapter that lets us serve a WSGI app out of mitmproxy.
...
This commit adds:
- A WSGI App adapter for mitmproxy
- An app registry in the proxy instance that lets us link WSGI apps with
(hostname, port) combinations.
- Fixes for a number of bugs discovered while creating this feature.
2012-04-24 14:52:29 +12:00
Aldo Cortesi
8c96264304
Serialized data version check.
2012-04-11 10:10:53 +12:00
Aldo Cortesi
4e2d19714c
Add an "f" shortcut key to load full body contents.
2012-04-08 19:44:01 +12:00
Aldo Cortesi
a4f7728fad
XML/HTML pretty view tweaks.
2012-04-07 22:15:31 +12:00
Aldo Cortesi
f1dc3f2ab2
Integrate lxml for pretty-printing HTML and XML.
...
Tackling the pretty-printing performance problem head-on, at the cost of a
major dependency.
2012-04-07 13:47:03 +12:00
Aldo Cortesi
ab0e10e60f
Serialize requestcount for ClientConnect objects.
2012-04-03 22:37:24 +12:00
Aldo Cortesi
61fab03b24
Add a details page, available from a flow view with the 'X' shortcut
...
At the moment, this shows the upstream SSL certificate details. More
fine-grained detail that doesn't fit in the flow view itself will be added.
2012-04-03 11:10:25 +12:00
Aldo Cortesi
f526e5fa12
Minor unit test bump.
2012-04-03 09:52:26 +12:00
Aldo Cortesi
4979a22d3e
Add accessor method for SSLCert object on Response.
2012-04-02 17:02:23 +12:00
Aldo Cortesi
ab1d8fa350
Expand SSL cert support
...
- Capture the remote SSL certificate
- Expose the remote cert as an attribute on Response
- Expand the certutils.SSLCert interface to expose more cert info
2012-04-02 16:21:23 +12:00
Aldo Cortesi
c02fdb2463
Refactor proxy.Server to fix a crash when replaying with -n
2012-04-02 13:24:51 +12:00
Aldo Cortesi
15cc09f1b8
Start rationalizing content views.
...
We now no longer have distinction between "pretty" view and hex/raw. Instead,
we simply a default AUTO view with a global override (M) and a local override
(m).
2012-04-02 10:30:35 +12:00
Aldo Cortesi
7fef0ecdf5
Make "T" pretty view over-ride persistent when switching between flows.
...
We do this by adding a flow settings mechanism to ConsoleState. This is pretty
rough at the moment and should become more sophisticated as needed.
2012-04-02 09:30:38 +12:00
Aldo Cortesi
e9ac4bef20
Add a variant of cleanBin that escapes newlines and tabs.
...
Use this to fix the hex display option.
2012-03-27 11:25:50 +13:00
Aldo Cortesi
a050eeef05
Add a pretty-viewer for images.
...
This shows basic image information like dimensions, plus extracted EXIF tags
and other metadata.
2012-03-26 11:26:02 +13:00
Aldo Cortesi
2240d2a6a5
Pretty view now indents Javascript.
...
Thanks to the JSBeautifier project, which is now included in the contrib directory.
2012-03-25 10:56:45 +13:00
Aldo Cortesi
74c51df580
Re-enable simple multipart form parsing and preview.
2012-03-25 10:10:48 +13:00
Aldo Cortesi
62e51018d0
Refactor pretty view mechanism.
...
Also start adding unit tests for this subsystem.
2012-03-24 14:20:24 +13:00
Aldo Cortesi
ed74ed24a0
Add error indications to GridEditor.
2012-03-23 13:28:33 +13:00
Aldo Cortesi
2739cb4861
Add a simple parser for content type specifications.
2012-03-20 10:31:07 +13:00
Aldo Cortesi
5690e7c399
Generalize GridEditor to N columns.
...
Start adding a replacement rule editor.
2012-03-18 14:39:21 +13:00
Aldo Cortesi
76175672ad
Add specification of replacement patterns on the command line.
2012-03-17 17:20:34 +13:00
Aldo Cortesi
c8ae1e85b3
Hooks -> ReplaceHooks
...
It makes more sense to specialize this, which will let me build a nicer
interface for replacement hooks in mitmproxy.
2012-03-17 11:31:05 +13:00
Aldo Cortesi
08f410cacc
Add a hooks mechanism, based on filter expressions.
2012-03-16 17:13:11 +13:00
Aldo Cortesi
d138af7217
replace() methods now decode and re-encode contents before substitution.
2012-03-16 11:24:18 +13:00
Aldo Cortesi
d51b8cab0c
Add a decoded context manager.
...
This simplifies a common chore when modifying traffic - decoding the object,
modifying it, then re-encoding it with the same encoding afterwards. You can
now simply say:
with flow.decoded(request):
request.content = "bar"
2012-03-16 11:12:56 +13:00
Aldo Cortesi
fa6305ee98
Cleanliness fixes.
...
- Remove unused code during previous commit.
- Code coverage fixes.
2012-03-12 11:25:50 +13:00
Aldo Cortesi
d3aad7a185
Merge remote-tracking branch 'taiste/server-replay-pop'
2012-03-10 13:36:50 +13:00
Valtteri Virtanen
041eafba73
Added tests for ServerPlaybackState with nopop
2012-03-05 13:57:57 +02:00
Valtteri Virtanen
5b5b79f5c4
Fixed old tests
2012-03-05 13:40:18 +02:00
Aldo Cortesi
e1356dd2b6
Create an SSL certificate class.
2012-03-05 10:22:47 +13:00
András Veres-Szentkirályi
15ad7704d2
Removed imports left unused after Py{OpenSSL,ASN1}
...
Commits 533f61f67a
and
8b841bc9e3
left some imports unused while
swithing to PyOpenSSL and PyASN1 -- this commit removes these imports.
2012-03-01 16:20:34 +01:00
Aldo Cortesi
533f61f67a
Use PyOpenSSL and PyASN1 for certificate parsing.
...
Yes, these are two more major dependencies for mitmproxy, but if we're going to
do all the cool things I want to do with SSL certs, there is no other way.
2012-03-01 21:08:44 +13:00
Aldo Cortesi
8b841bc9e3
Factor out cert operations in to certutils.py.
2012-02-29 13:20:53 +13:00
Aldo Cortesi
688faa9baa
Repair unit tests.
2012-02-27 20:34:47 +13:00
Aldo Cortesi
764724748b
Fix cert generation harder.
2012-02-27 15:59:29 +13:00
Aldo Cortesi
2ba8296843
Better certificate parsing.
2012-02-27 15:21:05 +13:00
Aldo Cortesi
00942c1431
Add upstream certificate lookup.
...
This initiates a connection to the server to obtain certificate information to
generate interception certificates. At the moment, the information used is the
Common Name, and the list of Subject Alternative Names.
2012-02-27 15:05:45 +13:00
Aldo Cortesi
986a41d180
Unit test++.
2012-02-25 12:19:54 +13:00
Aldo Cortesi
25fa596cd6
Fix detection of URL-encoded forms.
...
Thanks to Paul Capestany <capestany@gmail.com> for reporting this.
2012-02-24 13:03:24 +13:00
Aldo Cortesi
ddc9155c24
Make "~q" filter work more intuitively.
...
It now matches any flow that has no response.
2012-02-23 17:06:09 +13:00
Aldo Cortesi
2df9c52c09
Refactor filter matching.
2012-02-23 17:03:58 +13:00
Aldo Cortesi
dbd75e02f7
Create ODictCaseless for headers, use vanilla ODict for everything else.
2012-02-20 11:29:36 +13:00
Aldo Cortesi
18029df99c
Use ODict for request.get_form_urlencoded and set_form_urlencoded
2012-02-20 11:13:35 +13:00
Aldo Cortesi
b0f77dfefd
Unit test import cleanups.
2012-02-20 11:04:07 +13:00
Aldo Cortesi
fa11b7c9be
Use ODict for Request.get_query and Request.set_query
2012-02-20 10:44:47 +13:00
Aldo Cortesi
2616f490fe
Rename Headers class to ODict
...
ODict is an ordered dictionary class that will be useful in many other parts of
our API.
2012-02-20 10:39:00 +13:00
Aldo Cortesi
d32d6bc5e3
Add "p" key binding to connection list view to copy a flow.
2012-02-19 00:17:47 +13:00
Aldo Cortesi
8ddc3b4ef2
Add API for duplicating flows.
2012-02-18 23:56:40 +13:00
Aldo Cortesi
7aa79b89e8
Firm up what we consider to be a valid proxy spec.
2012-02-18 16:29:02 +13:00
Aldo Cortesi
6ad8b1a15d
Firm up reverse proxy specification.
...
- Extract proxy spec parsing and unparsing functions.
- Add a status indicator in mitmproxy.
- Add the "R" keybinding for changing the reverse proxy from within mitmproxy.
2012-02-18 16:27:09 +13:00
Aldo Cortesi
a7df6e1503
Refactor reverse proxying
...
- Retain the specification from the Host header as a Request's description.
- Expand upstream proxy specifications to include the scheme. We now say https://hostname:port
- Move the "R" revert keybinding to "v" to make room for a reverse proxy
binding that matches the command-line flag.
2012-02-18 14:45:22 +13:00
Aldo Cortesi
acdc2d00b4
Repair unit tests.
2012-02-18 12:27:59 +13:00
Aldo Cortesi
da1ccfddeb
100% test coverage for flow.py
2012-02-10 15:55:58 +13:00
Aldo Cortesi
1ad7e91527
Make filter matching act more sensibly.
2012-02-10 15:31:45 +13:00
Aldo Cortesi
5f785e26b9
Add filter for detecting flows with errors.
...
Also, remove dependency on weird _is_response method.
2012-02-10 15:22:26 +13:00
Aldo Cortesi
b14c29b25c
Expand test coverage.
2012-02-10 15:04:20 +13:00
Aldo Cortesi
9c985f2d20
Methods for getting and setting form urlencoded data on Request.
2012-02-10 14:27:39 +13:00
Aldo Cortesi
2709441d5b
Add get_query and set_query methods to Request.
2012-02-09 16:40:31 +13:00
Aldo Cortesi
cdd5a53767
Refactor console.
...
Split the console implementation out into logical components.
2012-02-07 16:39:37 +13:00
Aldo Cortesi
35a914a549
Fix unit tests broken during previous commit.
2012-01-21 14:39:36 +13:00
Aldo Cortesi
d5e3722c97
Fix an issue caused by some editors when editing a request/response body.
...
Many editors make it hard save a file without a terminating newline on the last
line. When editing message bodies, this can cause problems. For now, I just
strip the newlines off the end of the body when we return from an editor.
2012-01-21 12:43:00 +13:00
Mark E. Haase
05111f093d
Add support for filtering by HTTP method (get, post, etc.) using ~m operator.
2011-12-28 17:32:29 -05:00
Aldo Cortesi
67f2610032
Add HTTP body size limit specification to command-line tools.
2011-09-09 15:27:31 +12:00
Aldo Cortesi
28daa93268
Basic infrastructure for request and response body size limits.
2011-09-09 14:49:34 +12:00
Aldo Cortesi
e5bded7dee
Improve robustness against invalid data.
2011-09-05 07:47:47 +12:00
Aldo Cortesi
45f4768a5c
Add attribution and license for tnetstring.py
2011-08-19 21:53:52 +12:00
Aldo Cortesi
a566684e32
Move to typed netstrings for serialization.
...
This change is backwards incompatible with the old serialization format!
2011-08-19 21:30:24 +12:00
Aldo Cortesi
b51aac8a86
Code cleanliness - appease pychecker.
2011-08-04 10:34:34 +12:00
Aldo Cortesi
730c78ac53
Move script.Context to flow.ScriptContext
2011-08-04 10:14:44 +12:00
Aldo Cortesi
7a3b871b33
Request class now has a clean pydoc profile.
2011-08-04 09:26:26 +12:00
Aldo Cortesi
0760607a7d
Further interface cleaning.
2011-08-03 23:02:33 +12:00
Aldo Cortesi
9042d3f3b9
Clean up interfaces by making some methods pseudo-private.
2011-08-03 22:48:57 +12:00
Aldo Cortesi
57c653be5f
Move all HTTP objects to flow.py
...
That's Request, Response, ClientConnect, ClientDisconnect, Error, and Headers.
2011-08-03 22:41:38 +12:00
Aldo Cortesi
e337682d8e
Enable "|" command to run a oneshot script on a single flow.
2011-08-03 17:35:18 +12:00
Aldo Cortesi
179cf75862
Add script hooks, enable new engine for mitmdump.
2011-08-03 16:36:20 +12:00
Aldo Cortesi
12d2b1f926
Rip out old script interface, start replacing with new stubs.
...
Scripts are broken for now.
2011-08-03 13:20:36 +12:00
Aldo Cortesi
62088a6661
Start stubbing out a much more powerful script architecture.
2011-08-03 11:06:29 +12:00
Aldo Cortesi
a817db5bd6
Refresh current connection when toggling autodecode.
...
Also fix the unit tests I forgot to commit...
2011-08-02 20:47:53 +12:00
Aldo Cortesi
1ff6a767d0
Unit test++
2011-08-02 16:52:47 +12:00
Aldo Cortesi
357502fe03
General cleanup.
...
Cut out unused variables and code, generally shut up pychecker as much as is
reasonable.
2011-08-02 16:14:33 +12:00
Aldo Cortesi
f3742f29da
We no longer need to track clientconnections.
2011-08-02 14:56:09 +12:00
Aldo Cortesi
675b3133b4
Improve performance of loading flows from a file hugely.
...
Fell into the "expensive __eq__ method" trap. Oh, Python, you little scamp.
2011-08-01 11:26:09 +12:00
Aldo Cortesi
43f1c72511
Refactor the way we calculate views of the flow list.
...
The naive approach we used before recalculated the view on every access, and
consequently had serious performance problems.
2011-08-01 11:17:01 +12:00
Aldo Cortesi
ddb5748a76
Add decoding/encoding for requests.
2011-08-01 10:43:01 +12:00
Aldo Cortesi
c89c4361c3
Merge remote-tracking branch 'alts/encoding'
2011-07-28 11:19:07 +12:00
Stephen Altamirano
78049abac1
Changes replace logic to function in both Python 2.6.x and 2.7.x
...
Tests now only assume Python 2.6.x rather than requiring 2.7.x. This does not preclude the use of flags as a kwarg in replace
2011-07-26 22:47:08 -07:00
Stephen Altamirano
acd511f676
Adds test method for Response encoding and decoding
2011-07-26 22:38:42 -07:00
Aldo Cortesi
4043829cf2
Add an eventlog option to mitmdump
...
This shows client connections, disconnections and requests (before a complete
flow is assembled). We need to add an analogous display to mitmproxy.
2011-07-23 12:57:54 +12:00
Aldo Cortesi
47e1695512
Also replace strings path for requests.
2011-07-22 20:52:13 +12:00
Aldo Cortesi
1b961fc4ad
Add utility functions to search and replace strings in flows
...
This is a common task in pentesting scenarios. This commit adds the following
functions:
utils.Headers.replace
proxy.Request.replace
proxy.Response.replace
flow.Flow.replace
2011-07-22 17:48:42 +12:00
Stephen Altamirano
ecd4645988
Adds encode counterparts to decode functions
2011-07-17 20:16:47 -07:00
Aldo Cortesi
ce41046786
Refine encoding support
...
- Push decoding down into the LRU cache
- Cope gracefully with corrupted data and incorrect encoding headers
2011-07-17 10:25:25 +12:00
alts
6dc0f105cc
Adds support for content encoding, namely gip and deflate
2011-07-16 02:47:06 -07:00
Aldo Cortesi
94ae720a22
Add a pretty-printing mode for urlencoded form data.
2011-07-15 16:46:54 +12:00
Aldo Cortesi
76b4c6ba82
Introduce an anti-compression command-line argument.
...
This is on by default, which means we avoid compressed content unless the -z
flag is specified.
2011-07-15 15:24:56 +12:00
Aldo Cortesi
7e21ac0eb8
Refine path completion somewhat.
...
Make it match the behaviour of vim and mutt more closely
2011-07-14 16:54:04 +12:00
Aldo Cortesi
1c9e7b982a
Rewrite Headers object to preserve order and case.
2011-07-14 16:01:54 +12:00
Aldo Cortesi
8e176c2086
Cast some data read from dump files to str, to prevent unicode promotion.
...
This fixes a bug that caused a traceback when de-serialized requests were
replayed. Also adds unit tests for the problem.
2011-07-01 14:20:42 +12:00
Aldo Cortesi
18d4c3a9e9
JSON pretty-printing.
...
Also rename the display modes ("pretty" instead of "indent"), and expand the
built-in documentation.
2011-06-30 13:27:27 +12:00
Aldo Cortesi
f004326855
Try not to hang when user views large request & response bodies
...
Two different strategies here:
- Use a simple heuristic to detect if we're looking at XML data when indent
mode is used. On non-XML data we can hang even on small documents.
- Only view partial data for large bodies. At the moment the cutoff is
100k. I might finetune this later.
2011-06-27 15:59:17 +12:00
Aldo Cortesi
7d7803a4d9
Add a hideous kludge to fix not-yet-valid certificates.
...
- The OpenSSL x509 has no way to explicitly set the notBefore value on
certificates.
- If two systems have the same configured time, it's possible to return a
certificate before the validity start time has arrived.
- We "solve" this by waiting for one second when a certificate is first
generated before returning the cert. The alternative is to rewrite pretty much
all of our certificate generation, a thought too horrible to contemplate.
2011-06-11 15:16:16 +12:00
Aldo Cortesi
613e9a298e
Add a new flow loading mechanism.
...
We now simulate the normal connection flow when we load flows. That means
that we can run scripts, hooks, sticky cookies, etc.
2011-05-15 11:22:35 +12:00
Aldo Cortesi
c0bd1a39e4
unit test coverage ++
2011-03-20 18:52:16 +13:00
Aldo Cortesi
c726519e73
Add a stickyauth option.
...
This allows us to replay an HTTP Authorization header, in the same way as we
replay cookies using stickycookies. This lets us conveniently get at HTTP Basic
Auth protected resources through the proxy, but is not enough to do the same
for HTTP Digest auth. We'll put that on the todo list.
2011-03-20 17:31:54 +13:00
Aldo Cortesi
4f877cde6a
Reverse order of flows in mitmproxy.
...
It matches user expectations much better to have new flows appended to the bottom.
2011-03-20 09:31:39 +13:00
Aldo Cortesi
e22fd74d06
Revamp key generation.
...
We now create three different files in the .mitmproxy directory when a dummy CA
is made:
mitmproxy-ca.pem - the CA, including private key
mitmproxy-ca-cert.p12 - A pkcs12 version of the certificate, for distribution to Windows.
mitmproxy-ca-cert.pem - A PEM version of the certificate, for distribution to everyone else.
2011-03-18 16:45:31 +13:00
Aldo Cortesi
394bd1d6b0
Interrupt interception when deleting an intercepting flow.
...
Prompting the user for this is annoying.
2011-03-15 17:53:29 +13:00
Aldo Cortesi
6d5c32ad4b
Fix hang on shutdown.
2011-03-15 17:21:35 +13:00
Aldo Cortesi
fb28e71f0b
Do pre-processing of requests before replay.
...
This enables scripts, anticache, server playback and sticky cookies for
request replays.
2011-03-15 15:11:03 +13:00
Aldo Cortesi
fe1e2f16ff
Improve responsiveness of request and response viewing.
...
- Computing the view of a large body is expensive, so we introduce an LRU cache
to hold the latest 20 results.
- Use ListView more correctly, passing it individual urwid.Text snippets,
rather than a single large one. This hugely improves render time.
2011-03-15 13:05:33 +13:00
Aldo Cortesi
2e70a0e44b
Fix unit tests on OSX when a system proxy is configured.
2011-03-14 14:05:14 +13:00