mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-03-12 04:35:49 -07:00
Added a plugin system to Net-Creds so you can now add your own parsers, api hook names might change between now and the offcial release (will submit a PR to the original repo once completed) The main MITM HTTP Proxy now uses mitmproxy which is a big deal, cuts the code down by an insane amount, no more twisted! yay! Basic plugin have been re-wrote for the new proxy engine Since we are using mitmproxy we have out of the box support for SSL/TLS!
23 lines
897 B
Python
23 lines
897 B
Python
import cStringIO
|
|
from PIL import Image
|
|
from libmproxy.models import decoded
|
|
from plugins.plugin import Plugin
|
|
|
|
class Upsidedownternet(Plugin):
|
|
name = 'Upsidedownternet'
|
|
optname = 'upsidedownternet'
|
|
desc = 'Flips images 180 degrees'
|
|
version = '1.0'
|
|
|
|
def response(self, context, flow):
|
|
if flow.response.headers.get("content-type", "").startswith("image"):
|
|
with decoded(flow.response): # automatically decode gzipped responses.
|
|
try:
|
|
s = cStringIO.StringIO(flow.response.content)
|
|
img = Image.open(s).rotate(180)
|
|
s2 = cStringIO.StringIO()
|
|
img.save(s2, "png")
|
|
flow.response.content = s2.getvalue()
|
|
flow.response.headers["content-type"] = "image/png"
|
|
except: # Unknown image types etc.
|
|
pass |