Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Begin some simple fuzzing with pathod.

Finally doing what I started writing pathod for in the first place...
  • Loading branch information...
commit 7835e0c2c7be0e45262a06b5e2ec2399ae019977 1 parent e608d10
@cortesi cortesi authored
View
1  .gitignore
@@ -3,6 +3,7 @@ MANIFEST
/dist
/tmp
/doc
+/venv
*.py[cdo]
*.swp
*.swo
View
2  libmproxy/flow.py
@@ -463,7 +463,7 @@ def get_url(self):
"""
Returns a URL string, constructed from the Request's URL compnents.
"""
- return utils.unparse_url(self.scheme, self.host.decode("idna"), self.port, self.path).encode('ascii')
+ return utils.unparse_url(self.scheme, self.host.encode("idna"), self.port, self.path).encode('ascii')
def set_url(self, url):
"""
View
9 test/fuzzing/go_proxy
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Assuming:
+# mitmproxy/mitmdump is running on port 8080 in straight proxy mode.
+# pathod is running on port 9999
+
+BASE="/Users/aldo/git/public/pathod/venv/bin/pathoc -eo -I 200,400,502 -p 8080 localhost "
+$BASE -n 1000 "get:'http://localhost:9999':ir,@1"
+
+
View
12 test/test_fuzzing.py
@@ -0,0 +1,12 @@
+import tservers
+
+"""
+ A collection of errors turned up by fuzzing.
+"""
+
+class TestFuzzy(tservers.HTTPProxTest):
+ def test_idna_err(self):
+ req = r'get:"http://localhost:%s":i10,"\xc6"'
+ p = self.pathoc()
+ assert p.request(req%self.server.port).status_code == 400
+
Please sign in to comment.
Something went wrong with that request. Please try again.