Skip to content

Instantly share code, notes, and snippets.

View mhils's full-sized avatar

Maximilian Hils mhils

View GitHub Profile
@mhils
mhils / template.md
Last active March 21, 2023 12:02
Mitmproxy GSoC Application Template

Mitmproxy GSoC Application Template

Your Background

Your Name:
Slack Username:
Email Address:
Primary Spoken Language:

1. Please describe your preferred coding languages and experience.

@mhils
mhils / transparent_proxy.md
Last active March 10, 2022 01:41
Windows Transparent Proxying
  1. Enable IP forwarding
  2. Open regedit
  3. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
  4. Change IPEnableRouter to 1
  5. Run services->Routing and Remote->start
@mhils
mhils / iptables.txt
Created January 8, 2015 11:17
mitmproxy client ip spoofing
You currently suggest the following iptables rules:
# iptables -A PREROUTING -s {SOURCE} -p tcp -m tcp --dport 80 -j
REDIRECT --to-ports 8080
In order to utilize fully transparent mode, you also need:
# iptables -t mangle -N DIVERT
# iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
# ip tables -t mangle -A DIVERT -j MARK --set-mark 0x2/0x2 # your mark may vary
# iptables -t mangle -A DIVERT -j ACCEPT
"""
Memory Finder
- Use case: Find out what's holding on to a flow to troubleshoot garbage collection
- Holds a reference to the first flow in a capture
- Prints out who else is holding on to the flow every 5 seconds
"""
import threading
import weakref
import gc
@mhils
mhils / memfinder.py
Last active September 5, 2018 11:19
"""
Memory Finder
- Use case: Find out what's holding on to a flow to troubleshoot garbage collection
- Holds a reference to the first flow in a capture
- Prints out who else is holding on to the flow every second
"""
import threading
import weakref
import gc
@mhils
mhils / refs
Created September 5, 2018 09:53
##########
----------
frame@78956848:<frame object at 0x04B4C930>
frame@78956848:<frame object at 0x04B4C930>
----------
----------
dict@81651152:{'obj': <HTTPFlow; request = Request(GET localhost:8000/);
frame@78956848:<frame object at 0x04B4C930>
----------
Reply@81574576:<mitmproxy.controller.Reply object at 0x04DCBAB0>
@mhils
mhils / refs
Created September 5, 2018 09:51
##########
----------
frame@79434160:<frame object at 0x04BC11B0>
frame@79434160:<frame object at 0x04BC11B0>
----------
----------
; request = Request(GET localhost:8000/)
frame@79434160:<frame object at 0x04BC11B0>
----------
Reply@81924912:<mitmproxy.controller.Reply object at 0x04E21330>
@mhils
mhils / refs
Last active September 5, 2018 09:38
##########
----------
[<HTTPFlow
request = Request(GET example.org:80/)
response = Response(200 OK, text/html; charset=UTF-8, 1.24k)
client_conn = <ClientConnection: 127.0.0.1:58429>
server_conn = <ServerConnection: example.org:80>>]
[[<HTTPFlow
request = Request(GET example.org:80/)
response = Response(200 OK, text/html; charset=UTF-8, 1.24k)
@mhils
mhils / after
Last active September 5, 2018 09:37
##########
----------
[<HTTPFlow
request = Request(GET example.org:80/)
response = Response(200 OK, text/html; charset=UTF-8, 1.24k)
client_conn = <ClientConnection: 127.0.0.1:58429>
server_conn = <ServerConnection: example.org:80>>]
[[<HTTPFlow
request = Request(GET example.org:80/)
response = Response(200 OK, text/html; charset=UTF-8, 1.24k)
@mhils
mhils / animatedScrollTo.js
Last active April 10, 2017 18:03
Image Presentation
(function (window) {
var requestAnimFrame = (function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};})();
var easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) return c/2*t*t + b;
t--;
return -c/2 * (t*(t-2) - 1) + b;
};