Skip to content
saalmaan edited this page Aug 9, 2015 · 20 revisions

Tamper should install any missing dependencies. If however you encounter any errors during Tamper installation then follow detailed installation guide below (Tested on OS X only):

All instruction given below are for OS X and tested on OS X Yosemite. Command mentioned below are for console/terminal, some of these command will require sudo (administrator) access.

Step 1:

Install or update your xcode (this will take about 15 minutes depending on your internet connection):

xcode-select --install
Step 2:

Tamper and Mitmproxy are based on Python so we have to install Python Package Index (pip):

sudo easy_install pip
Step 3:

After xcode & pip installation, install Mitmproxy:

sudo pip install mitmproxy
Step 4:

Now it is the time to install Tamper itself:

For best results it has been observed that you should CLOSE CHROME BROWSER for consistent first try install of Tamper

sudo pip install tamper

If tamper installation is successful you should see following message at the end:

Successfully installed tamper mitmproxy pyOpenSSL Pillow netlib lxml Werkzeug Jinja2 itsdangerous certifi backports.ssl-match-hostname cryptography markupsafe cffi pycparser

Note: You can also view all installed packages in pip with this command pip list

Now verify that Mitmproxy is working by typing in this command mitmproxy, if you see a following or similar error:

You are using an outdated version of pyOpenSSL: mitmproxy requires pyOpenSSL 0.14 or greater. Your pyOpenSSL 0.13.1 installation is located at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL

or

Traceback (most recent call last): File "/usr/local/bin/mitmproxy", line 9, in load_entry_point('mitmproxy==0.13', 'console_scripts', 'mitmproxy')() File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 558, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 2682, in load_entry_point return ep.load() File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 2355, in load return self.resolve() File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 2361, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/Library/Python/2.7/site-packages/libmproxy/main.py", line 7, in from . import version, cmdline File "/Library/Python/2.7/site-packages/libmproxy/cmdline.py", line 5, in from netlib import http File "/Library/Python/2.7/site-packages/netlib/http.py", line 7, in from . import odict, utils, tcp, http_status File "/Library/Python/2.7/site-packages/netlib/tcp.py", line 26, in 'TLSv1.2': SSL.TLSv1_2_METHOD, AttributeError: 'module' object has no attribute 'TLSv1_2_METHOD'

or

Traceback (most recent call last): File "/usr/local/bin/mitmproxy", line 9, in load_entry_point('mitmproxy==0.13.1', 'console_scripts', 'mitmproxy')() File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 337, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2311, in load_entry_point return ep.load() File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2017, in load entry = import(self.module_name, globals(),globals(), ['name']) File "/Library/Python/2.7/site-packages/libmproxy/main.py", line 7, in from . import version, cmdline File "/Library/Python/2.7/site-packages/libmproxy/cmdline.py", line 6, in from . import filt, utils, version File "/Library/Python/2.7/site-packages/libmproxy/filt.py", line 38, in from .protocol.http import decoded File "/Library/Python/2.7/site-packages/libmproxy/protocol/init.py", line 1, in from .primitives import * File "/Library/Python/2.7/site-packages/libmproxy/protocol/primitives.py", line 4, in import netlib.tcp File "/Library/Python/2.7/site-packages/netlib/tcp.py", line 26, in 'TLSv1.2': SSL.TLSv1_2_METHOD, AttributeError: 'module' object has no attribute 'TLSv1_2_METHOD'

Then fear not, just rename old folder and you are good to go, use this command to rename the folder (change the path according to your PyOpenSSL installation path): more info here https://github.com/mitmproxy/mitmproxy/issues/705

sudo mv /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_OpenSSL

Now try to run Mitmproxy again and this time you should see famous Mitmproxy interface.

Note: (This setting is not required for Tamper to work, just to validate correct Mitmproxy installation) You can also change your network settings to see if Mitmproxy is intercepting the traffic, Open System PreferencesNetworkWIFI or EthernetAdvanceProxiesWeb Proxy (HTTP) → Web Proxy Server = 127.0.0.1:8080, save these details and apply them

Step 5:

Install Tamper's devtools extension from Chrome Web Store

Step 6:

To Debug website with SSL enabled you have to authorize Mitmproxy, open http://mitm.it and click on Apple (for any platform you intend to use Mitmproxy) icon and this will download the certificate, just open this certificate and install it in keychain.

Note: if you open http://mitm.it and you see a blank page or error message then you need to check if mitmproxy is working properly, one trick is to close any programs that may be conflicting with mitmproxy's default port 8080

Step 7:

Now open your target website in Chrome and enable Dev Tools (cmd+alt+I) and open Tamper panel and click on little wheel icon on bottom left hand of tamper panel to open tamper settings and restart proxy. Now just enable Tamper from top right corner and you are good to go (if everything is correct Tamper icon should turn blue).

Note: if default proxy port 8080 in Tamper settings doesn't work then try a different one like 8181 and restart proxy.

Other Settings

if you are mac user and want to use your favourite editor to edit tamper scripts then use full application path. For phpstorm use something like this in Tamper settings (wheel icon) in 'Editor Command Line' input field

/usr/local/bin/pstorm
Clone this wiki locally