How to use the mitmproxy.controller.handler function in mitmproxy

To help you get started, we’ve selected a few mitmproxy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mitmproxy / mitmproxy / mitmproxy / flow.py View on Github external
    @controller.handler
    def tcp_open(self, flow):
        # TODO: This would break mitmproxy currently.
        # self.state.add_flow(flow)
        self.active_flows.add(flow)
        self.run_script_hook("tcp_open", flow)
github mitmproxy / mitmproxy / examples / complex / flowbasic.py View on Github external
    @controller.handler
    def response(self, f):
        print("response", f)
github Esser420 / EvilTwinFramework / core / MITMCore / etfitm.py View on Github external
    @controller.handler
    def requestheaders(self, flow):
        for p in self.plugins:
            try:
                p.requestheaders(flow)
            except Exception:
                pass
github mitmproxy / mitmproxy / mitmproxy / flow.py View on Github external
    @controller.handler
    def serverconnect(self, server_conn):
        self.run_script_hook("serverconnect", server_conn)
github mitmproxy / mitmproxy / mitmproxy / flow.py View on Github external
    @controller.handler
    def clientconnect(self, root_layer):
        self.run_script_hook("clientconnect", root_layer)
github P0cL4bs / WiFi-Pumpkin / core / servers / proxy / http / controller / handler.py View on Github external
    @controller.handler
    def request(self, flow):
        '''
        print "-- request --"
        print flow.__dict__
        print flow.request.__dict__
        print flow.request.headers.__dict__
        print "--------------"
        print
        '''
        try:
            for p in self.plugins:
                p.request(flow)
        except Exception:
            pass
github mitmproxy / mitmproxy / mitmproxy / flow.py View on Github external
    @controller.handler
    def tcp_message(self, flow):
        self.run_script_hook("tcp_message", flow)
        message = flow.messages[-1]
        direction = "->" if message.from_client else "<-"
        self.add_event("{client} {direction} tcp {direction} {server}".format(
            client=repr(flow.client_conn.address),
            server=repr(flow.server_conn.address),
            direction=direction,
        ), "info")
        self.add_event(clean_bin(message.content), "debug")
github mitmproxy / mitmproxy / mitmproxy / flow.py View on Github external
    @controller.handler
    def clientdisconnect(self, root_layer):
        self.run_script_hook("clientdisconnect", root_layer)