Skip to content

Instantly share code, notes, and snippets.

View mhils's full-sized avatar

Maximilian Hils mhils

View GitHub Profile
#gist syntax highlighting is somewhat broken atm. Apologies.
import argparse, sys, shlex
print "sys.argv:\n",sys.argv,"\n"
main_parser = argparse.ArgumentParser()
main_parser.add_argument('-script')
main_args = main_parser.parse_args()
@mhils
mhils / gist:5012460
Created February 22, 2013 10:36
node build -d include=template
var iteratorTemplate = function(obj) {
var __p = 'var index, iterable = ' +
(obj.firstArg ) +
', result = iterable;\nif (!iterable) return result;\n' +
(obj.top ) +
';\n';
if (obj.arrays) {
__p += 'var length = iterable.length; index = -1;\nif (' +
(obj.arrays ) +
@mhils
mhils / lodash.custom.js
Created February 22, 2013 10:37
> node build -d include=template
var iteratorTemplate = function(obj) {
var __p = 'var index, iterable = ' +
(obj.firstArg ) +
', result = iterable;\nif (!iterable) return result;\n' +
(obj.top ) +
';\n';
if (obj.arrays) {
__p += 'var length = iterable.length; index = -1;\nif (' +
(obj.arrays ) +
@mhils
mhils / gist:5242093
Last active December 15, 2015 09:59
Add button to clear flows. Replace HoneyProxy/gui/HoneyProxy/views/templates/Sidebar.ejs with this content.
<div class="sidebar trafficSidebar">
<div class="searchbox">
<h2>Filter</h2>
<input id=filter class=search data-negate=true data-filterclass="hide" placeholder="Search"><br>
<h2>Highlight</h2>
<input data-filterclass="highlight highlight-1" class="search highlight highlight-1" placeholder="Modifiers:"><br>
<input data-filterclass="highlight highlight-2" class="search highlight highlight-2" placeholder="!not, ~regex"><br>
<input data-filterclass="highlight highlight-3" class="search highlight highlight-3" placeholder="=caseSensitive"><br><br>
@mhils
mhils / instance_resetter.py
Last active December 15, 2015 09:58
untested
from bottle import route, run, debug
from os import system
from time import time
import psutil
debug(False)
auth = 'changeme'
@route('/restart/:secret')
diff --git a/List.js b/List.js
index f67f08f..84f2a0a 100644
--- a/List.js
+++ b/List.js
@@ -467,6 +467,7 @@ function(kernel, declare, listen, has, miscUtil, TouchScroll, hasClass, put){
from != to && firstRow && self.adjustRowIndices(firstRow);
self._onNotification(rows, object, from, to);
}, true)) - 1;
+ beforeNode.observerIndex = observerIndex;
}
from libmproxy import flow
with open("outfile","rb") as f:
fr = flow.FlowReader(f)
for i in fr.stream():
print i.request.host
print i._get_state()
@mhils
mhils / choir.php
Created August 21, 2013 15:58
Choir PHP integration
<?php
$url = "http://api.choir.io/KEY";
$data = array (
"label" => "hello",
"text" => "Hello Choir!",
"sound" => "g/3"
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
@mhils
mhils / install.md
Last active September 17, 2016 05:47
Install mitmproxy from master

⚠️ This is unmaintained. Please use the official docs instead: http://docs.mitmproxy.org/en/stable/install.html

If you want to live on the dangerous side, you can install mitmproxy from its master branch. If you encounter any bugs, please do us the favor and report them on the Github issue tracker briefly.

pip uninstall mitmproxy netlib
git clone https://github.com/mitmproxy/mitmproxy.git
cd mitmproxy
pip install --src . -r requirements.txt
@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