Skip to content

Instantly share code, notes, and snippets.

Intercepts HTTPs Traffic with Python & mitmproxy

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

This manual helps you create your own proxy with Python and mitmproxy/libmproxy. Mitmproxy ships with both a standalone command-line tool (mitmproxy) and a Python library (libmproxy).

@birt
birt / macblockon.py
Last active August 29, 2015 14:00
Python script to automate Mijn Telenet MAC address filtering
#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver import firefox as ff
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
tn_login = 'insert_telenet_username'
tn_password = 'insert_telenet_password'
@birt
birt / imdbyear.pl
Last active May 18, 2016 18:48
Add movie year and imdb code as suffix to a filename or dirname
#!/usr/bin/perl -w
use Switch;
#use strict;
use IMDB::Film;
use File::Slurp;
#print "Cmd line params: " , join(',',@ARGV),"\n";
my @searchfilter = ();
@birt
birt / userchrome.css
Created May 23, 2012 07:21
Firefox 10 userchrome.css contents for multirow bookmarks toolbar
/* Multi-row bookmarks toolbar */
#personal-bookmarks {display:block}
#personal-bookmarks toolbarseparator { display:inline }
/* or this? : */
#bookmarks-ptf {display:block}
#bookmarks-ptf toolbarseparator {display:inline}