MIM Usage
Description
This is a man-in-the-middle proxy server that shows a log of request and response headers; and fires signals that allow plugins to read and manipulate requests and responses.
A number of plugins are included. It is very easy to add more based on these examples.
Installation alternatives
- Pip
pip install mim
- Clone
git clone https://github.com/simonm3/mim
pip install -r requirements.txt
- Download .tar.gz
click download button at https://pypi.python.org/packages/source/m/mim
tar -zxvf <filename>.tar.gz
pip install -r requirements.txt
Installation of Beef
If you want to use the beef framework then: apt-get install beef-xss
Scripts (run with -h to see usage and options)
script |
description |
|---|---|
proxy |
start the proxyserver with plugins |
users |
list users on the network so you can select a target |
arp |
start arp poison |
fakeap |
create fake access point [https://github.com/DanMcInerney/fakeAP] |
Plugin options for proxy.py
option |
description |
|---|---|
–auth |
Log userids/passwords |
–beef |
Inject beef hook (browser exploitation framework) |
–cats |
Replace images with cats |
–favicon |
Replace favicon with lock symbol |
–inject |
Inject data/injection.html |
–kill |
Kill session on first visit to domain (forces relogin) |
–requests |
Log requests |
–sslstrip |
Replace https with http then proxy links via https |
–upsidedown |
Turn images upsidedown |
Alternative ways to send requests to the proxy
Redirect browser
proxy.py
Set browser proxy settings to point to ip address of proxy PC port 10000
Run arp attack
proxy.py
users.py to see available machines to target on the local network
arp -t <ip address> to initiate arp attack on a target ip
Run fake access point
fakeap
connect to Free Wifi from target pc
proxy.py [NOTE: run after fakeAP to set firewall settings]
How to create a plugin
To create a plugin called “test”:
Create a module file “plugins/test.py” based on other modules in plugins folder.
Use decorators e.g. @on(gotRequest) to link functions to the signals fired by the proxy. The signals are gotRequest, gotResponseTree, gotResponseText, gotResponseImage.
Edit the docstring for proxy.py to add the option
To add a plugin to “otherplugins” (a single file containing many smaller plugins):
Follow the same format as the other plugins in “plugins/otherplugins”
Edit the docstring for proxy.py to add the option
Where does it work
Tested via usage on a range of websites using proxy settings, arp attack and fakeAP
It should never block and has a timeout on web requests
Where does it not work
Some security software prevents arp attacks
Https requests typed directly in the address bar will not be intercepted
HttpsEverywhere (chrome extension) prevents interception
Some websites enforce https via the browser e.g. gmail, facebook
Some websites change http links back to https after the page loads e.g. ebay
Some websites have misformed html. Calling lxml.html.fromstring then tostring can change the appearance of the page as the parser attempts to correct problems. An alternative is to use lxml.etree instead but this causes issues with other pages and is missing functions such as rewrite_links.
MIM Design
Core files
Built in python2.7 using “twisted.web” and follows this chain:
proxy1 (a bash script that runs proxy.py with selected options)
=> Proxy.py
proxyserver [listens for connections]
=> ProxyFactory(http.HTTPFactory)
=> Proxy(http.HTTPChannel)
=> Request(http.Request)
proxyclient [creates connections to web]
=> ProxyClientFactory(proxy.ProxyClientFactory)
=> ProxyClient(proxy.ProxyClient, TimeoutMixin)
=> internet
Uses pydispatch2 (extended pydispatch) to manage signals
proxyclient and proxyserver send signals
plugins listen for signals
Other files
file |
description |
|---|---|
tools.fileserver.py |
simple file server e.g. to serve images |
tools.bash.py |
wrapper for bash commands |
tools.pydispatch2.py |
decorator that connects a function to a signal |
tools.logs.py |
configuration for tools.logs |
log.txt |
log of current session. This is cleared on each run. |
Metadata
Release files for mim 0.2.43
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mim-0.2.43.tar.gz | 38.4 kB | Without provenance | Details for mim-0.2.43.tar.gz |
Release files / mim-0.2.43.tar.gz
| Download URL | mim-0.2.43.tar.gz |
|---|---|
| Size | 38.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a02c3dcc71dc1fdf30499571aa4cd61f57f880fb13511d1ec5d6a1ed07579d36
|
|
BLAKE2b-256 checksum How to use checksums |
cb3f5f54ec6e009e958c06109b1e34218be7418d51ef3c875aa67ef6e6ad71d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mim 0.2.43
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.