diff --git a/README.md b/README.md
index af83b59..ba53479 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,7 @@ m0nst3r(Song Xinlei) @ CFCA
- changed default pyro4 port, avoiding brida conflicts
- migration to python3
- dynamic context menu items extracted from your python script
+- add `first_line` variable to `header` dict
# Usage (`=v2.0`)
> NOTE: MAKE SURE YOU HAVE ALL DEPENDENCIES INSTALLED, INCLUDING THE DEPENDENCIES NEEDED FOR YOUR PYTHON SCRIPT
@@ -41,6 +42,8 @@ Just write your own logic to modify the header/body as your need, and return the
All functions will be extracted to generate context menu, except thos with `_`, `__`prefix!
+> Note: header["first_line"] ==> `GET /XXX/yyy.php?param1=hello HTTP/1.1`.
+
```python
class Burpy:
'''
diff --git a/pom.xml b/pom.xml
index 43d6468..d5b503b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
me.m0nst3r
burpy
- 2.0-SNAPSHOT
+ 2.1-SNAPSHOT
burpy
burp plugin to run custom python
diff --git a/res/burpyServicePyro3.py b/res/burpyServicePyro3.py
index 07b3ccf..ff8d039 100644
--- a/res/burpyServicePyro3.py
+++ b/res/burpyServicePyro3.py
@@ -34,7 +34,7 @@ def parse_headers(self, s):
def parse_headers_and_body(self,s):
try:
- crlfcrlf = b"\x0d\x0a\x0d\x0a"
+ crlfcrlf = "\r\n\r\n".encode('utf-8')
crlfcrlfIndex = s.find(crlfcrlf)
headers = s[:crlfcrlfIndex + len(crlfcrlf)].decode("utf-8")
body = s[crlfcrlfIndex + len(crlfcrlf):]
@@ -52,7 +52,8 @@ def build(self):
# if(isRequest):
# get headers as dict
newhttp = list()
- newhttp.append(self.first_line)
+ first_line = self.headers.pop("first_line")
+ newhttp.append(first_line)
for k in self.headers.keys():
newhttp.append("{}: {}".format(k,self.headers[k]))
@@ -91,7 +92,7 @@ def get_methods(self):
def invoke_method(self,method_name, data):
data = http(b64d(data))
-
+ data.headers.update({"first_line":data.first_line})
func = getattr(self.burpy, method_name)
if data is None:
return "Parse HTTP data failed"