aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/fuzzing
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-02-15 16:34:22 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-02-15 16:34:22 +0100
commitd7158f975e671b78f0a064dd873cfa7805667528 (patch)
tree9b40f263c4f613a0dc49f5d8628c371164afd546 /test/mitmproxy/fuzzing
parent5fe473fb431699c71aa74bb715c2cb5b0500f044 (diff)
downloadmitmproxy-d7158f975e671b78f0a064dd873cfa7805667528.tar.gz
mitmproxy-d7158f975e671b78f0a064dd873cfa7805667528.tar.bz2
mitmproxy-d7158f975e671b78f0a064dd873cfa7805667528.zip
move tests into shared folder
Diffstat (limited to 'test/mitmproxy/fuzzing')
-rw-r--r--test/mitmproxy/fuzzing/.env6
-rw-r--r--test/mitmproxy/fuzzing/README14
-rw-r--r--test/mitmproxy/fuzzing/client_patterns4
-rw-r--r--test/mitmproxy/fuzzing/go_proxy29
-rw-r--r--test/mitmproxy/fuzzing/reverse_patterns9
-rw-r--r--test/mitmproxy/fuzzing/straight_stream6
-rw-r--r--test/mitmproxy/fuzzing/straight_stream_patterns17
-rw-r--r--test/mitmproxy/fuzzing/straight_stream_ssl6
8 files changed, 91 insertions, 0 deletions
diff --git a/test/mitmproxy/fuzzing/.env b/test/mitmproxy/fuzzing/.env
new file mode 100644
index 00000000..82ae6a8d
--- /dev/null
+++ b/test/mitmproxy/fuzzing/.env
@@ -0,0 +1,6 @@
+
+MITMDUMP=../../mitmdump
+PATHOD=../../../pathod/pathod
+PATHOC=../../../pathod/pathoc
+FUZZ_SETTINGS=-remTt 1 -n 0
+
diff --git a/test/mitmproxy/fuzzing/README b/test/mitmproxy/fuzzing/README
new file mode 100644
index 00000000..2760506f
--- /dev/null
+++ b/test/mitmproxy/fuzzing/README
@@ -0,0 +1,14 @@
+
+A fuzzing architecture for mitmproxy
+====================================
+
+Quick start:
+
+ honcho -f ./straight_stream start
+
+
+Notes:
+
+ - Processes are managed using honcho (pip install honcho)
+ - Paths and common settings live in .env
+
diff --git a/test/mitmproxy/fuzzing/client_patterns b/test/mitmproxy/fuzzing/client_patterns
new file mode 100644
index 00000000..83457b6f
--- /dev/null
+++ b/test/mitmproxy/fuzzing/client_patterns
@@ -0,0 +1,4 @@
+get:'http://localhost:9999/p/200':ir,"\n"
+get:'http://localhost:9999/p/200':ir,"\0"
+get:'http://localhost:9999/p/200':ir,@5
+get:'http://localhost:9999/p/200':dr
diff --git a/test/mitmproxy/fuzzing/go_proxy b/test/mitmproxy/fuzzing/go_proxy
new file mode 100644
index 00000000..ea29400f
--- /dev/null
+++ b/test/mitmproxy/fuzzing/go_proxy
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Assuming:
+# mitmproxy/mitmdump is running on port 8080 in straight proxy mode.
+# pathod is running on port 9999
+
+BASE="../../../"
+BASE_HTTP=$BASE"/pathod/pathoc -Tt 1 -e -I 200,400,405,502 -p 8080 localhost "
+BASE_HTTPS=$BASE"/pathod/pathoc -sc localhost:9999 -Tt 1 -eo -I 200,400,404,405,502,800 -p 8080 localhost "
+
+#$BASE_HTTP -n 10000 "get:'http://localhost:9999':ir,@1"
+#$BASE_HTTP -n 100 "get:'http://localhost:9999':dr"
+#$BASE_HTTP -n 10000 "get:'http://localhost:9999/p/200':ir,@300"
+
+#$BASE_HTTP -n 10000 "get:'http://localhost:9999/p/200:ir,@1'"
+#$BASE_HTTP -n 100 "get:'http://localhost:9999/p/200:dr'"
+#$BASE_HTTP -n 10000 "get:'http://localhost:9999/p/200:ir,@100'"
+
+
+# Assuming:
+# mitmproxy/mitmdump is running on port 8080 in straight proxy mode.
+# pathod with SSL enabled is running on port 9999
+
+#$BASE_HTTPS -en 10000 "get:'/p/200:b@100:ir,@1'"
+#$BASE_HTTPS -en 10000 "get:'/p/200:ir,@1'"
+
+#$BASE_HTTPS -n 100 "get:'/p/200:dr'"
+#$BASE_HTTPS -n 10000 "get:'/p/200:ir,@3000'"
+#$BASE_HTTPS -n 10000 "get:'/p/200:ir,\"\\n\"'"
+
diff --git a/test/mitmproxy/fuzzing/reverse_patterns b/test/mitmproxy/fuzzing/reverse_patterns
new file mode 100644
index 00000000..8d1d76a2
--- /dev/null
+++ b/test/mitmproxy/fuzzing/reverse_patterns
@@ -0,0 +1,9 @@
+get:'/p/200':b@10:ir,"\n"
+get:'/p/200':b@10:ir,"\r\n"
+get:'/p/200':b@10:ir,"\0"
+get:'/p/200':b@10:ir,@5
+get:'/p/200':b@10:dr
+
+get:'/p/200:b@10:ir,@1'
+get:'/p/200:b@10:dr'
+get:'/p/200:b@10:ir,@100'
diff --git a/test/mitmproxy/fuzzing/straight_stream b/test/mitmproxy/fuzzing/straight_stream
new file mode 100644
index 00000000..41e2a6e1
--- /dev/null
+++ b/test/mitmproxy/fuzzing/straight_stream
@@ -0,0 +1,6 @@
+
+mitmdump: $MITMDUMP
+pathod: $PATHOD
+pathoc: sleep 2 && $PATHOC $FUZZ_SETTINGS localhost:8080 ./straight_stream_patterns
+#pathoc: sleep 2 && $PATHOC localhost:8080 /tmp/err
+
diff --git a/test/mitmproxy/fuzzing/straight_stream_patterns b/test/mitmproxy/fuzzing/straight_stream_patterns
new file mode 100644
index 00000000..93a066e6
--- /dev/null
+++ b/test/mitmproxy/fuzzing/straight_stream_patterns
@@ -0,0 +1,17 @@
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,'\n'
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,'a'
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,'9'
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,':'
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,'"'
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,'-'
+
+get:'http://localhost:9999/p/':s'200:b"foo":ir,"\n"'
+get:'http://localhost:9999/p/':s'200:b"foo":ir,"a"'
+get:'http://localhost:9999/p/':s'200:b"foo":ir,"9"'
+get:'http://localhost:9999/p/':s'200:b"foo":ir,":"'
+get:'http://localhost:9999/p/':s"200:b'foo':ir,'\"'"
+get:'http://localhost:9999/p/':s'200:b"foo":ir,"-"'
+get:'http://localhost:9999/p/':s'200:b"foo":dr'
+
+get:'http://localhost:9999/p/':s'200:b"foo"':ir,@2
+get:'http://localhost:9999/p/':s'200:b"foo":ir,@2'
diff --git a/test/mitmproxy/fuzzing/straight_stream_ssl b/test/mitmproxy/fuzzing/straight_stream_ssl
new file mode 100644
index 00000000..708ff0b3
--- /dev/null
+++ b/test/mitmproxy/fuzzing/straight_stream_ssl
@@ -0,0 +1,6 @@
+
+mitmdump: $MITMDUMP -q --stream 1
+pathod: $PATHOD
+pathoc: sleep 2 && $PATHOC $FUZZ_SETTINGS localhost:8080 ./straight_stream_patterns
+#pathoc: sleep 2 && $PATHOC localhost:8080 /tmp/err
+