mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-21 22:58:24 +00:00
Improve Markdown syntax(styling) (#4496)
* Improve Markdown syntax - Add missing blank lines - Remove trailing spaces - Remove additional blank lines - Fix indentation consistency and correctness * Update addons-examples.md Co-authored-by: Maximilian Hils <github@maximilianhils.com>
This commit is contained in:
parent
aede8849db
commit
123342ea0b
@ -34,7 +34,6 @@ We wanted to bring these improvements out, so we have a few temporary regression
|
||||
If you depend on these features, please raise your voice in
|
||||
[#4348](https://github.com/mitmproxy/mitmproxy/issues/4348)!
|
||||
|
||||
|
||||
### Full Changelog
|
||||
|
||||
* New Proxy Core based on sans-io pattern (@mhils)
|
||||
@ -485,7 +484,6 @@ If you depend on these features, please raise your voice in
|
||||
* 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)
|
||||
@ -643,7 +641,6 @@ If you depend on these features, please raise your voice in
|
||||
* 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
|
||||
|
||||
* Support for multiple scripts and multiple script arguments
|
||||
@ -725,7 +722,6 @@ If you depend on these features, please raise your voice in
|
||||
* Pathoc client certificate support.
|
||||
* API improvements, bugfixes.
|
||||
|
||||
|
||||
## 16 November 2012: pathod 0.3
|
||||
|
||||
A release focusing on shoring up our fuzzing capabilities, especially with
|
||||
|
@ -14,10 +14,11 @@ forward, please consider contributing in the following areas:
|
||||
|
||||
## Development Setup
|
||||
|
||||
To get started hacking on mitmproxy, please install a recent version of Python (we require at least Python 3.8).
|
||||
To get started hacking on mitmproxy, please install a recent version of Python (we require at least Python 3.8).
|
||||
Then, do the following:
|
||||
|
||||
##### Linux / macOS
|
||||
|
||||
```shell
|
||||
# 1) Verify that these commands work:
|
||||
python3 --version
|
||||
@ -31,6 +32,7 @@ venv/bin/pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
##### Windows
|
||||
|
||||
```shell
|
||||
# 1) Verify that this command works:
|
||||
python --version
|
||||
@ -49,12 +51,14 @@ The main executables for the project – `mitmdump`, `mitmproxy`, and `mitmweb`
|
||||
After activating the virtualenv, they will be on your $PATH, and you can run them like any other command:
|
||||
|
||||
##### Linux / macOS
|
||||
|
||||
```shell
|
||||
source venv/bin/activate
|
||||
mitmdump --version
|
||||
```
|
||||
|
||||
##### Windows
|
||||
|
||||
```shell
|
||||
venv\Scripts\activate
|
||||
mitmdump --version
|
||||
|
@ -5,7 +5,6 @@
|
||||
[![Latest Version](https://shields.mitmproxy.org/pypi/v/mitmproxy.svg)](https://pypi.python.org/pypi/mitmproxy)
|
||||
[![Supported Python versions](https://shields.mitmproxy.org/pypi/pyversions/mitmproxy.svg)](https://pypi.python.org/pypi/mitmproxy)
|
||||
|
||||
|
||||
``mitmproxy`` is an interactive, SSL/TLS-capable intercepting proxy with a console
|
||||
interface for HTTP/1, HTTP/2, and WebSockets.
|
||||
|
||||
@ -34,12 +33,9 @@ ask them on StackOverflow!
|
||||
|
||||
[![StackOverflow: mitmproxy](https://shields.mitmproxy.org/stackexchange/stackoverflow/t/mitmproxy?color=orange&label=stackoverflow%20questions)](https://stackoverflow.com/questions/tagged/mitmproxy)
|
||||
|
||||
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
As an open source project, mitmproxy welcomes contributions of all forms.
|
||||
As an open source project, mitmproxy welcomes contributions of all forms.
|
||||
|
||||
[![Dev Guide](https://shields.mitmproxy.org/badge/dev_docs-CONTRIBUTING.md-blue)](./CONTRIBUTING.md)
|
||||
|
||||
|
@ -12,7 +12,6 @@ This directory houses the mitmproxy documentation available at <https://docs.mit
|
||||
|
||||
Now you can run `hugo server -D` in ./src.
|
||||
|
||||
|
||||
## Extended Install
|
||||
|
||||
This is required to modify CSS files.
|
||||
|
@ -10,7 +10,6 @@ menu:
|
||||
|
||||
mitmproxy is a set of tools that provide an interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
- Intercept HTTP & HTTPS requests and responses and modify them on the fly
|
||||
@ -23,7 +22,6 @@ mitmproxy is a set of tools that provide an interactive, SSL/TLS-capable interce
|
||||
- SSL/TLS certificates for interception are generated on the fly
|
||||
- And [much, much more...]({{< relref "overview-features">}})
|
||||
|
||||
|
||||
## 3 Powerful Core Tools
|
||||
|
||||
The mitmproxy project's tools are a set of front-ends that expose common
|
||||
@ -77,7 +75,6 @@ tcpdump-like functionality to let you view, record, and programmatically
|
||||
transform HTTP traffic. See the `--help` flag output for complete
|
||||
documentation.
|
||||
|
||||
|
||||
#### Example: Saving traffic
|
||||
|
||||
```bash
|
||||
@ -131,4 +128,3 @@ mitmdump -ns examples/simple/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**.
|
||||
|
||||
|
@ -19,7 +19,6 @@ header with a count of the number of responses seen:
|
||||
|
||||
{{< example src="examples/addons/http-add-header.py" lang="py" >}}
|
||||
|
||||
|
||||
## Available Hooks
|
||||
|
||||
The following addons list all available event hooks.
|
||||
|
@ -14,7 +14,6 @@ invocations and data returned from commands are checked at runtime. Commands are
|
||||
a very powerful construct - for instance, all user interaction in mitmproxy
|
||||
console are built by binding commands to keys.
|
||||
|
||||
|
||||
## Simple example
|
||||
|
||||
Let's begin with a simple example.
|
||||
@ -46,7 +45,6 @@ builtin commands. There are a few things to note about this example:
|
||||
included in the built-in help, the command editor in mitmproxy console can
|
||||
perform sophisticated completion and error checking, and so forth.
|
||||
|
||||
|
||||
## Working with flows
|
||||
|
||||
Since command arguments are typed, we can provide special conveniences for
|
||||
@ -95,7 +93,6 @@ mitmproxy if we plan to use them frequently. Flow selectors combined with
|
||||
commands are amazingly powerful, and lets us build and expose re-usable functions
|
||||
for operating on flows.
|
||||
|
||||
|
||||
## Paths
|
||||
|
||||
Commands can take an arbitrary number of arguments. Let's build on the previous
|
||||
@ -114,8 +111,6 @@ command. Try invoking it like this:
|
||||
Notice that mitmproxy provides tab completion both for the flow specification
|
||||
and the path.
|
||||
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
The following types are supported for options. If you need to use a type not
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
---
|
||||
title: "Examples"
|
||||
menu:
|
||||
|
@ -18,7 +18,6 @@ presenting typed values for editing in interactive programs. Attempting to set a
|
||||
value with the wrong type will result in an error. This means that addon options
|
||||
get full support throughout mitmproxy's toolchain simply by declaring a type.
|
||||
|
||||
|
||||
## Simple example
|
||||
|
||||
{{< example src="examples/addons/options-simple.py" lang="py" >}}
|
||||
@ -62,7 +61,6 @@ using the `--set` flag:
|
||||
mitmproxy -s ./examples/addons/options-simple.py --set addheader=true
|
||||
```
|
||||
|
||||
|
||||
## Handling configuration updates
|
||||
|
||||
Sometimes, simply testing the value of an option from an event is not
|
||||
@ -91,7 +89,6 @@ Loading script: ./examples/addons/options-configure.py
|
||||
/Users/cortesi/mitmproxy/mitmproxy/venv/bin/mitmdump: addheader must be <= 100
|
||||
```
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
The following types are supported for options.
|
||||
|
@ -8,19 +8,18 @@ menu:
|
||||
# Addons
|
||||
|
||||
Mitmproxy's addon mechanism is an exceptionally powerful part of mitmproxy. In fact, much of mitmproxy's own
|
||||
functionality is defined in
|
||||
[a suite of built-in addons](https://github.com/mitmproxy/mitmproxy/tree/master/mitmproxy/addons),
|
||||
functionality is defined in
|
||||
[a suite of built-in addons](https://github.com/mitmproxy/mitmproxy/tree/master/mitmproxy/addons),
|
||||
implementing everything from functionality like
|
||||
[anticaching]({{< relref "overview-features#anticache" >}}) and [sticky cookies]({{< relref
|
||||
"overview-features#sticky-cookies" >}}) to our onboarding webapp.
|
||||
|
||||
Addons interact with mitmproxy by responding to [events]({{< relref addons-api >}}), which allow them to hook into and
|
||||
change mitmproxy's behaviour. They are configured through [options]({{< relref addons-options >}}), which can be set in
|
||||
mitmproxy's config file, changed interactively by users, or passed on the command-line. Finally, they can expose
|
||||
[commands]({{< relref addons-commands >}}), which allows users to invoke their actions either directly or by binding
|
||||
Addons interact with mitmproxy by responding to [events]({{< relref addons-api >}}), which allow them to hook into and
|
||||
change mitmproxy's behaviour. They are configured through [options]({{< relref addons-options >}}), which can be set in
|
||||
mitmproxy's config file, changed interactively by users, or passed on the command-line. Finally, they can expose
|
||||
[commands]({{< relref addons-commands >}}), which allows users to invoke their actions either directly or by binding
|
||||
them to keys in the interactive tools.
|
||||
|
||||
|
||||
# Anatomy of an addon
|
||||
|
||||
{{< example src="examples/addons/anatomy.py" lang="py" >}}
|
||||
@ -52,12 +51,11 @@ Here are a few things to note about the code above:
|
||||
an importable global. In this case, we're using the `ctx.log` object to do our
|
||||
logging.
|
||||
|
||||
|
||||
# Abbreviated Scripting Syntax
|
||||
|
||||
Sometimes, we would like to write a quick script without going through the trouble of creating a class.
|
||||
The addons mechanism has a shorthand that allows a module as a whole to be treated as an addon object.
|
||||
This lets us place event handler functions in the module scope.
|
||||
The addons mechanism has a shorthand that allows a module as a whole to be treated as an addon object.
|
||||
This lets us place event handler functions in the module scope.
|
||||
For instance, here is a complete script that adds a header to every request:
|
||||
|
||||
{{< example src="examples/addons/anatomy2.py" lang="py" >}}
|
||||
|
@ -21,7 +21,6 @@ all registered commands, their arguments and their return values to screen. In
|
||||
mimtproxy console you can also view a palette of all commands in the command
|
||||
browser (by default accessible with the `C` key binding).
|
||||
|
||||
|
||||
# Working with Flows
|
||||
|
||||
Many of mitmproxy's commands take flows as arguments. For instance, the
|
||||
@ -31,7 +30,6 @@ signature for the client replay commands looks like this:
|
||||
replay.client [flow]
|
||||
```
|
||||
|
||||
|
||||
That means that it expects a sequence of one or more flows. This is where [flow
|
||||
specifications]({{< relref concepts-filters >}}) come in - mitmproxy will
|
||||
intelligently expand a flexible flow selection language to a list of flows when
|
||||
|
@ -18,7 +18,6 @@ expressions consist of the following operators:
|
||||
- Strings with no operators are matched against the request URL.
|
||||
- The default binary operator is &.
|
||||
|
||||
|
||||
## View flow selectors
|
||||
|
||||
In interactive contexts, mitmproxy has a set of convenient flow selectors that
|
||||
@ -35,7 +34,6 @@ operate on the current view:
|
||||
|
||||
These are frequently used in commands and key bindings.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
URL containing "google.com":
|
||||
@ -53,4 +51,3 @@ Anything but requests with a text/html content type:
|
||||
Replace entire GET string in a request (quotes required to make it work):
|
||||
|
||||
":~q ~m GET:.*:/replacement.html"
|
||||
|
||||
|
@ -33,14 +33,11 @@ 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.
|
||||
|
||||
|
||||
{{< figure src="/schematics/how-mitmproxy-works-explicit.png" title="Explicit" >}}
|
||||
|
||||
|
||||
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
|
||||
|
@ -17,7 +17,6 @@ Now, which one should you pick? Use this flow chart:
|
||||
|
||||
{{< figure src="/schematics/proxy-modes-flowchart.png" >}}
|
||||
|
||||
|
||||
## Regular Proxy
|
||||
|
||||
Mitmproxy's regular mode is the simplest and the easiest to set up.
|
||||
@ -183,7 +182,6 @@ One possible way to address this is to modify the hosts file of your OS so that
|
||||
directly to example.com. Make sure that your proxy can still resolve the
|
||||
original IP, or specify an IP in mitmproxy.
|
||||
|
||||
|
||||
{{% note %}}
|
||||
|
||||
### Caveat: Interactive Use
|
||||
@ -195,7 +193,6 @@ remains unchanged - as soon as the user clicks on an non-relative URL
|
||||
through mitmproxy.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
## Upstream Proxy
|
||||
|
||||
If you want to chain proxies by adding mitmproxy in front of a different
|
||||
@ -210,7 +207,6 @@ 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).
|
||||
|
||||
|
||||
## SOCKS Proxy
|
||||
|
||||
In this mode, mitmproxy acts as a SOCKS5 proxy.
|
||||
|
@ -25,7 +25,6 @@ are treated exactly like mitmproxy's own. This means that addons can also be
|
||||
configured through the central configuration file, and their options will appear
|
||||
in the options editors in interactive tools.
|
||||
|
||||
|
||||
## Tools
|
||||
|
||||
Both **mitmproxy** and **mitmweb** have built-in editors that let you view and
|
||||
@ -37,7 +36,6 @@ the specific tool's interactive help for details on how to do this).
|
||||
For all tools, options can be set directly by name using the `--set`
|
||||
command-line option. Please see the command-line help (`--help`) for usage.
|
||||
|
||||
|
||||
## Available Options
|
||||
|
||||
This list might not reflect what is actually available in your current mitmproxy
|
||||
|
@ -23,7 +23,6 @@ If you want to peek into (SSL-protected) non-HTTP connections, check out the
|
||||
**tcp_proxy** feature. If you want to ignore traffic from mitmproxy's processing
|
||||
because of large response bodies, take a look at the [streaming]({{< relref "overview-features#streaming" >}}) feature.
|
||||
|
||||
|
||||
## ignore_hosts
|
||||
|
||||
The `ignore_hosts` option allows you to specify a regex which is matched against
|
||||
@ -35,7 +34,6 @@ are excluded from interception, and passed on unmodified.
|
||||
| command-line alias | `--ignore-hosts regex` |
|
||||
| mitmproxy option | `ignore_hosts` |
|
||||
|
||||
|
||||
## Limitations
|
||||
|
||||
There are two important quirks to consider:
|
||||
@ -59,7 +57,6 @@ method to do so:
|
||||
2. Take the `host:port` string, surround it with ^ and $, escape all dots (.
|
||||
becomes \\.) and use this as your ignore pattern:
|
||||
|
||||
|
||||
```
|
||||
>>> mitmdump -v
|
||||
127.0.0.1:50588: clientconnect
|
||||
|
@ -15,27 +15,31 @@ Please note, that apps can decide to ignore the system certificate store and mai
|
||||
|
||||
## 1. Prerequisites
|
||||
|
||||
- Emulator from Android SDK with proxy settings pointing to mitmproxy
|
||||
- Emulator from Android SDK with proxy settings pointing to mitmproxy
|
||||
|
||||
- Mitmproxy CA certificate
|
||||
- Usually located in `~/.mitmproxy/mitmproxy-ca-cert.cer`
|
||||
- If the folder is empty or does not exist, run `mitmproxy` in order to generate the certificates
|
||||
|
||||
- Mitmproxy CA certificate
|
||||
- Usually located in `~/.mitmproxy/mitmproxy-ca-cert.cer`
|
||||
- If the folder is empty or does not exist, run `mitmproxy` in order to generate the certificates
|
||||
|
||||
## 2. Rename certificate
|
||||
|
||||
Enter your certificate folder
|
||||
|
||||
```bash
|
||||
cd ~/.mitmproxy/
|
||||
```
|
||||
|
||||
- CA Certificates in Android are stored by the name of their hash, with a '0' as extension
|
||||
- Now generate the hash of your certificate
|
||||
- CA Certificates in Android are stored by the name of their hash, with a '0' as extension
|
||||
- Now generate the hash of your certificate
|
||||
|
||||
```bash
|
||||
openssl x509 -inform PEM -subject_hash_old -in mitmproxy-ca-cert.cer | head -1
|
||||
```
|
||||
|
||||
Lets assume, the output is `c8450d0d`
|
||||
|
||||
We can now copy `mitmproxy-ca-cert.cer` to `c8450d0d.0` and our system certificate is ready to use
|
||||
|
||||
```bash
|
||||
cp mitmproxy-ca-cert.cer c8450d0d.0
|
||||
```
|
||||
@ -44,30 +48,30 @@ cp mitmproxy-ca-cert.cer c8450d0d.0
|
||||
|
||||
Note, that Android 9 (API LEVEL 28) was used to test the following steps and that the `emulator` executable is located in the Android SDK
|
||||
|
||||
- Start your android emulator.
|
||||
- Get a list of your AVDs with `emulator -list-avds`
|
||||
- Make sure to use the `-writable-system` option. Otherwise it will not be possible to write to `/system`
|
||||
- Keep in mind, that the **emulator will load a clean system image when starting without `-writable-system` option**.
|
||||
- This means you always have to start the emulator with `-writable-system` option in order to use your certificate
|
||||
- Start your android emulator.
|
||||
- Get a list of your AVDs with `emulator -list-avds`
|
||||
- Make sure to use the `-writable-system` option. Otherwise it will not be possible to write to `/system`
|
||||
- Keep in mind, that the **emulator will load a clean system image when starting without `-writable-system` option**.
|
||||
- This means you always have to start the emulator with `-writable-system` option in order to use your certificate
|
||||
|
||||
```bash
|
||||
emulator -avd <avd_name_here> -writable-system
|
||||
```
|
||||
|
||||
- Restart adb as root
|
||||
- Restart adb as root
|
||||
|
||||
```bash
|
||||
adb root
|
||||
```
|
||||
|
||||
- Get write access to `/system` on the device
|
||||
- In earlier versions (API LEVEL < 28) of Android you have to use `adb shell "mount -o rw,remount /system"`
|
||||
- Get write access to `/system` on the device
|
||||
- In earlier versions (API LEVEL < 28) of Android you have to use `adb shell "mount -o rw,remount /system"`
|
||||
|
||||
```bash
|
||||
adb shell "mount -o rw,remount /"
|
||||
```
|
||||
|
||||
- Push your certificate to the system certificate store and set file permissions
|
||||
- Push your certificate to the system certificate store and set file permissions
|
||||
|
||||
```bash
|
||||
adb push c8450d0d.0 /system/etc/security/cacerts
|
||||
@ -76,9 +80,9 @@ adb shell "chmod 664 /system/etc/security/cacerts/c8450d0d.0"
|
||||
|
||||
## 4. Reboot device and enjoy decrypted TLS traffic
|
||||
|
||||
- Reboot your device.
|
||||
- You CA certificate should now be system trusted
|
||||
|
||||
- Reboot your device.
|
||||
- You CA certificate should now be system trusted
|
||||
|
||||
```bash
|
||||
adb reboot
|
||||
```
|
||||
|
@ -24,12 +24,10 @@ Usually with Ubuntu and Virtualbox, **eth0** or **enp0s3** (Ubuntu 15.10 and new
|
||||
|
||||
### VirtualBox configuration
|
||||
|
||||
|
||||
{{< figure src="/transparent-vms/step1_vbox_eth0.png" >}}
|
||||
|
||||
{{< figure src="/transparent-vms/step1_vbox_eth1.png" >}}
|
||||
|
||||
|
||||
### VM Network Configuration
|
||||
|
||||
{{< figure src="/transparent-vms/step1_proxy.png" >}}
|
||||
|
@ -26,7 +26,6 @@ connection.
|
||||
At the moment, mitmproxy supports transparent proxying on OSX Lion and above,
|
||||
and all current flavors of Linux.
|
||||
|
||||
|
||||
## Linux
|
||||
|
||||
On Linux, mitmproxy integrates with the iptables redirection mechanism to
|
||||
@ -107,12 +106,11 @@ ip6tables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitmproxyuser --dport 4
|
||||
```
|
||||
|
||||
This will redirect the packets from all users other than `mitmproxyuser` on the machine to mitmproxy. To avoid circularity, run mitmproxy as the user `mitmproxyuser`. Hence step **4** should look like:
|
||||
|
||||
```bash
|
||||
sudo -u mitmproxyuser -H bash -c '$HOME/.local/bin/mitmproxy --mode transparent --showhost --set block_global=false'
|
||||
```
|
||||
|
||||
|
||||
|
||||
## OpenBSD
|
||||
|
||||
### 1. Enable IP forwarding.
|
||||
@ -160,8 +158,6 @@ mitmproxy to use the value of the Host header for URL display.
|
||||
Set the test device up to use the host on which mitmproxy is running as the default gateway and
|
||||
[install the mitmproxy certificate authority on the test device]({{< relref "concepts-certificates" >}}).
|
||||
|
||||
|
||||
|
||||
{{% note %}}
|
||||
Note that the **divert-to** rules in the pf.conf given above only apply
|
||||
to inbound traffic. **This means that they will NOT redirect traffic
|
||||
@ -174,7 +170,6 @@ intercepting traffic emanating from VMs. See the **pf.conf** man page
|
||||
for more.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
## macOS
|
||||
|
||||
OSX Lion integrated the [pf](https://en.wikipedia.org/wiki/PF_(firewall))
|
||||
@ -190,7 +185,6 @@ sudo sysctl -w net.inet.ip.forwarding=1
|
||||
|
||||
### 2. Place the following line in a file called, say, **pf.conf**.
|
||||
|
||||
|
||||
```
|
||||
rdr pass on en0 inet proto tcp to any port {80, 443} -> 127.0.0.1 port 8080
|
||||
```
|
||||
|
@ -13,9 +13,11 @@ Wireshark can use these log files to decrypt packets. See the [Wireshark wiki](h
|
||||
|
||||
Key logging is enabled by setting the environment variable `SSLKEYLOGFILE` so
|
||||
that it points to a writable text file:
|
||||
|
||||
```bash
|
||||
SSLKEYLOGFILE="$PWD/.mitmproxy/sslkeylogfile.txt" mitmproxy
|
||||
```
|
||||
|
||||
You can also `export` this environment variable to make it persistent for all applications started from your current shell session.
|
||||
|
||||
You can specify the key file path in Wireshark via `Edit -> Preferences ->
|
||||
|
@ -7,7 +7,6 @@ menu:
|
||||
|
||||
# Features
|
||||
|
||||
|
||||
- [Anticache](#anticache)
|
||||
- [Client-side replay](#client-side-replay)
|
||||
- [Map Local](#map-local)
|
||||
@ -21,7 +20,6 @@ menu:
|
||||
- [Streaming](#streaming)
|
||||
- [Upstream Certificates](#upstream-certificates)
|
||||
|
||||
|
||||
## Anticache
|
||||
|
||||
When the `anticache` option is set, it removes headers (`if-none-match` and
|
||||
@ -30,7 +28,6 @@ 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-side replay, when you want
|
||||
to make sure the server responds with complete data.
|
||||
|
||||
|
||||
## Client-side replay
|
||||
|
||||
Client-side replay does what it says on the tin: you provide a previously saved
|
||||
@ -42,7 +39,6 @@ conversation, where requests may have been made concurrently.
|
||||
You may want to use client-side replay in conjunction with the `anticache`
|
||||
option, to make sure the server responds with complete data.
|
||||
|
||||
|
||||
## Map Local
|
||||
|
||||
The `map_local` option lets you specify an arbitrary number of patterns that
|
||||
@ -115,9 +111,6 @@ Served File: Preferred: <span style="color:#82b719">~/static-dir
|
||||
Otherwise: 404 response without content
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
## Map Remote
|
||||
|
||||
The `map_remote` option lets you specify an arbitrary number of patterns that
|
||||
@ -159,7 +152,6 @@ Re-route all GET requests from `example.org` to `mitmproxy.org` (using `|` as th
|
||||
|~m GET|//example.org/|//mitmproxy.org/
|
||||
```
|
||||
|
||||
|
||||
## Modify Body
|
||||
|
||||
The `modify_body` option lets you specify an arbitrary number of patterns that
|
||||
@ -204,7 +196,6 @@ Replace `foo` with the data read from `~/xss-exploit`:
|
||||
mitmdump --modify-body :~q:foo:@~/xss-exploit
|
||||
```
|
||||
|
||||
|
||||
## Modify Headers
|
||||
|
||||
The `modify_headers` option lets you specify a set of headers to be modified.
|
||||
@ -277,7 +268,7 @@ upstream servers. For now, only HTTP Basic Authentication is supported.
|
||||
Proxy Authentication does not work well in transparent proxy mode by design
|
||||
because the client is not aware that it is talking to a proxy.
|
||||
Mitmproxy will re-request credentials for every individual domain.
|
||||
SOCKS proxy authentication is currently unimplemented
|
||||
SOCKS proxy authentication is currently unimplemented
|
||||
([#738](https://github.com/mitmproxy/mitmproxy/issues/738)).
|
||||
|
||||
## Server-side replay
|
||||
@ -322,7 +313,6 @@ then the respective recorded responses are simply replayed by mitmproxy.
|
||||
Otherwise, the unmatched requests is forwarded to the upstream server. If
|
||||
forwarding is not desired, you can use the --kill (-k) switch to prevent that.
|
||||
|
||||
|
||||
## Sticky auth
|
||||
|
||||
The `stickyauth` option is analogous to the sticky cookie option, in that HTTP
|
||||
@ -332,7 +322,6 @@ authentication through the proxy. Note that <span
|
||||
data-role="program">mitmproxy</span> doesn't (yet) support replay of HTTP Digest
|
||||
authentication.
|
||||
|
||||
|
||||
## Sticky cookies
|
||||
|
||||
When the `stickycookie` option is set, **mitmproxy** will add the cookie most
|
||||
@ -350,7 +339,6 @@ replay]({{< relref "#client-side-replay" >}}) - you can record the
|
||||
authentication process once, and simply replay it on startup every time you need
|
||||
to interact with the secured resources.
|
||||
|
||||
|
||||
## Streaming
|
||||
|
||||
By default, mitmproxy will read an entire request/response, perform any
|
||||
@ -380,7 +368,6 @@ payload sent to the server as the frames are immediately forwarded to the
|
||||
server. In contrast to HTTP streaming, where the body is not stored, the message
|
||||
payload will still be stored in the WebSocket flow.
|
||||
|
||||
|
||||
## Upstream Certificates
|
||||
|
||||
When mitmproxy receives a connection destined for an SSL-protected service, it
|
||||
|
@ -11,18 +11,16 @@ menu:
|
||||
We assume you have already [installed]({{< relref "overview-installation">}}) mitmproxy on
|
||||
your machine.
|
||||
|
||||
|
||||
## Launch the tool you need
|
||||
|
||||
You can start any of our three tools from the command line / terminal.
|
||||
|
||||
* **mitmproxy** gives you an interactive TUI
|
||||
* **mitmweb** gives you a browser-based GUI
|
||||
* **mitmdump** gives you a plain and simple terminal output
|
||||
* **mitmproxy** gives you an interactive TUI
|
||||
* **mitmweb** gives you a browser-based GUI
|
||||
* **mitmdump** gives you a plain and simple terminal output
|
||||
|
||||
In case you use the console-based version of mitmproxy, we highly recommend you to take the [tutorial]({{< relref "mitmproxytutorial-userinterface" >}}) to get started.
|
||||
|
||||
|
||||
## Configure your browser or device
|
||||
|
||||
For the basic setup as [regular proxy]({{< relref
|
||||
@ -40,7 +38,6 @@ Authority - which is also the next steps. Follow the instructions for your OS /
|
||||
system and install the CA (and make sure to enable it, some system require
|
||||
multiple steps!).
|
||||
|
||||
|
||||
## Verifying everything works
|
||||
|
||||
At this point your running mitmproxy instance should already show the first HTTP
|
||||
@ -48,7 +45,6 @@ flows from your client. You can test that all TLS-encrypted web traffic is
|
||||
working as expected by browsing to https://mitmproxy.org - it should show up as
|
||||
new flow and you can inspect it.
|
||||
|
||||
|
||||
## Resources
|
||||
|
||||
* [**StackOverflow**](https://stackoverflow.com/questions/tagged/mitmproxy): If you want to ask usage questions, please do so on StackOverflow.
|
||||
|
@ -1,9 +1,8 @@
|
||||
# Mitmproxy Examples
|
||||
|
||||
Mitmproxy has a powerful scripting API that allows you to control almost any aspect of traffic being
|
||||
proxied. In fact, much of mitmproxy’s own core functionality is implemented using the exact same API
|
||||
Mitmproxy has a powerful scripting API that allows you to control almost any aspect of traffic being
|
||||
proxied. In fact, much of mitmproxy’s own core functionality is implemented using the exact same API
|
||||
(see [mitmproxy/addons](../mitmproxy/addons)).
|
||||
|
||||
|
||||
| :warning: | If you are browsing this on GitHub, make sure to select the git tag matching your mitmproxy version. |
|
||||
|------------|------------------------------------------------------------------------------------------------------|
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Community-Contributed Examples
|
||||
|
||||
Examples in this directory are contributed by the mitmproxy community.
|
||||
We do _not_ maintain them, but we welcome PRs that add/fix/modernize/clean up examples.
|
||||
Examples in this directory are contributed by the mitmproxy community.
|
||||
We do _not_ maintain them, but we welcome PRs that add/fix/modernize/clean up examples.
|
||||
|
@ -7,11 +7,12 @@ These steps assume you are on the correct branch and have a git remote called `o
|
||||
- Verify that all CI tests pass.
|
||||
- Verify that `mitmproxy/version.py` is correct. Remove `.dev` suffix if it exists.
|
||||
- Tag the release and push to Github.
|
||||
- `git tag v4.0.0`
|
||||
- `git push origin v4.0.0`
|
||||
- `git tag v4.0.0`
|
||||
- `git push origin v4.0.0`
|
||||
- Wait for tag CI to complete.
|
||||
|
||||
### GitHub Releases
|
||||
|
||||
- Create release notice on Github
|
||||
[here](https://github.com/mitmproxy/mitmproxy/releases/new) if not already
|
||||
auto-created by the tag.
|
||||
@ -20,36 +21,41 @@ These steps assume you are on the correct branch and have a git remote called `o
|
||||
`You can find the latest release packages at https://mitmproxy.org/downloads/.`
|
||||
|
||||
### PyPi
|
||||
|
||||
- The created wheel is uploaded to PyPi automatically.
|
||||
- Please verify that https://pypi.python.org/pypi/mitmproxy has the latest version.
|
||||
|
||||
### Homebrew
|
||||
|
||||
- The Homebrew maintainers are typically very fast and detect our new relese
|
||||
within a day.
|
||||
- If you feel the need, you can run this from a macOS machine:
|
||||
`brew bump-formula-pr --url https://github.com/mitmproxy/mitmproxy/archive/v<version number here>.tar.gz mitmproxy`
|
||||
|
||||
### Docker
|
||||
|
||||
- The docker image is built by our CI workers and pushed to Docker Hub automatically.
|
||||
- Please verify that https://hub.docker.com/r/mitmproxy/mitmproxy/tags/ has the latest version.
|
||||
- Please verify that the latest tag points to the most recent image (same digest / hash).
|
||||
|
||||
### Docs
|
||||
- `./build.sh`. If everything looks alright, continue with
|
||||
- `./upload-stable.sh`,
|
||||
- `DOCS_ARCHIVE=true ./build.sh`, and
|
||||
- `./upload-archive.sh v4`. Doing this now already saves you from switching back to an old state on the next release.
|
||||
|
||||
- `./build.sh`. If everything looks alright, continue with
|
||||
- `./upload-stable.sh`,
|
||||
- `DOCS_ARCHIVE=true ./build.sh`, and
|
||||
- `./upload-archive.sh v4`. Doing this now already saves you from switching back to an old state on the next release.
|
||||
|
||||
### Website
|
||||
- The website does not need to be updated for patch releases. New versions are automatically picked up once they are on the download server.
|
||||
- Update version here:
|
||||
https://github.com/mitmproxy/www/blob/master/src/config.toml
|
||||
- Update docs menu here:
|
||||
https://github.com/mitmproxy/www/blob/master/src/themes/mitmproxy/layouts/partials/header.html
|
||||
- Run `./build && ./upload-test`.
|
||||
- If everything looks alright at https://www-test.mitmproxy.org, run `./upload-prod`.
|
||||
|
||||
- The website does not need to be updated for patch releases. New versions are automatically picked up once they are on the download server.
|
||||
- Update version here:
|
||||
https://github.com/mitmproxy/www/blob/master/src/config.toml
|
||||
- Update docs menu here:
|
||||
https://github.com/mitmproxy/www/blob/master/src/themes/mitmproxy/layouts/partials/header.html
|
||||
- Run `./build && ./upload-test`.
|
||||
- If everything looks alright at https://www-test.mitmproxy.org, run `./upload-prod`.
|
||||
|
||||
### Prepare for next release
|
||||
- Last but not least, bump the major version on master in
|
||||
|
||||
- Last but not least, bump the major version on master in
|
||||
[https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/version.py](mitmproxy/version.py) and add a `.dev` suffix.
|
||||
|
@ -7,26 +7,31 @@ Containerized version of [mitmproxy](https://mitmproxy.org/): an interactive, SS
|
||||
```sh
|
||||
$ docker run --rm -it [-v ~/.mitmproxy:/home/mitmproxy/.mitmproxy] -p 8080:8080 mitmproxy/mitmproxy
|
||||
```
|
||||
|
||||
The *volume mount* is optional: It's to store the generated CA certificates.
|
||||
|
||||
Once started, mitmproxy listens as a HTTP proxy on `localhost:8080`:
|
||||
|
||||
```sh
|
||||
$ http_proxy=http://localhost:8080/ curl http://example.com/
|
||||
$ https_proxy=http://localhost:8080/ curl -k https://example.com/
|
||||
```
|
||||
|
||||
You can also start `mitmdump` by just adding that to the end of the command-line:
|
||||
|
||||
```sh
|
||||
$ docker run --rm -it -p 8080:8080 mitmproxy/mitmproxy mitmdump
|
||||
```
|
||||
|
||||
For `mitmweb`, you also need to expose port 8081:
|
||||
|
||||
```sh
|
||||
# this makes :8081 accessible to the local machine only
|
||||
$ docker run --rm -it -p 8080:8080 -p 127.0.0.1:8081:8081 mitmproxy/mitmproxy mitmweb --web-host 0.0.0.0
|
||||
```
|
||||
|
||||
You can also pass options directly via the CLI:
|
||||
|
||||
```sh
|
||||
$ docker run --rm -it -p 8080:8080 mitmproxy/mitmproxy mitmdump --set ssl_insecure=true
|
||||
```
|
||||
|
@ -1,20 +1,20 @@
|
||||
# Mitmproxy on the Windows Store
|
||||
|
||||
@mhils experimented with bringing mitmproxy to the Window Store using the Desktop Bridge. This would replace our current InstallBuilder setup and allow for clean installs and - more importantly - automatic updates.
|
||||
@mhils experimented with bringing mitmproxy to the Window Store using the Desktop Bridge. This would replace our current InstallBuilder setup and allow for clean installs and - more importantly - automatic updates.
|
||||
|
||||
## Advantages
|
||||
|
||||
- Automatic updates
|
||||
- Clean installs
|
||||
- Very simple setup on our end
|
||||
- Possibility to roll out experimental releases to a subset of users
|
||||
- Automatic updates
|
||||
- Clean installs
|
||||
- Very simple setup on our end
|
||||
- Possibility to roll out experimental releases to a subset of users
|
||||
|
||||
## Disadvantages
|
||||
|
||||
- No support for mitmproxy. That only runs under WSL. Making WSL nicer is a complementary effort.
|
||||
- "Your developer account doesn’t have permission to submit apps converted with the Desktop Bridge at this time." (requested)
|
||||
- New releases need to be submitted manually (Submission API is in preview).
|
||||
- No support for mitmproxy. That only runs under WSL. Making WSL nicer is a complementary effort.
|
||||
- "Your developer account doesn’t have permission to submit apps converted with the Desktop Bridge at this time." (requested)
|
||||
- New releases need to be submitted manually (Submission API is in preview).
|
||||
|
||||
## Notes
|
||||
|
||||
We do not want to force anyone to use this, we would of course keep our portable binaries (and, of course, WSL).
|
||||
We do not want to force anyone to use this, we would of course keep our portable binaries (and, of course, WSL).
|
||||
|
@ -4,7 +4,6 @@ the moment, this is simply to give developers a quick way to see the impact of
|
||||
their work. Eventually, this might grow into a performance dashboard with
|
||||
historical data, so we can track performance over time.
|
||||
|
||||
|
||||
# Setup
|
||||
|
||||
Install the following tools:
|
||||
@ -23,4 +22,3 @@ Now run the benchmark by loading the addon. A typical invocation is as follows:
|
||||
|
||||
This will start up the backend server, run the benchmark, save the results to
|
||||
/tmp/foo.bench and /tmp/foo.prof, and exit.
|
||||
|
||||
|
@ -1 +1 @@
|
||||
https://github.com/erikras/ducks-modular-redux
|
||||
https://github.com/erikras/ducks-modular-redux
|
||||
|
Loading…
Reference in New Issue
Block a user