MITMProxy how to remove flows so they do not show up in MITMWeb

喜夏-厌秋 提交于 2019-12-13 03:13:56

问题


I'd like to use MITMProxy Python scripting to remove flows that i find useless from the web interface.

Lets say i kill a flow

def request(flow):
        if("ads" in flow.request.url):
                flow.kill()

But also i would like killed connections to not show up in my MITMWeb interface.

An example can be found here: https://imgur.com/a/la0RDmh

I am unable to find a way programatically to delete the requests from the list.

I would only like to see the connections that make it through.

Any ideas?


回答1:


Using filter

It's possible to filter out these requests and they won't appear in interface: https://docs.mitmproxy.org/stable/concepts-filters/

In this case, by applying filter: ! googleadservices

Using ignore_hosts option

Or, using option ignore_hosts to ignore these requests completely. These requests will bypass mitmproxy: https://docs.mitmproxy.org/stable/concepts-options/

In this case, by applying option when starting web interface: mitmweb --set ignore_hosts='www.googleadservices.com'

It's also possible to edit ignore hosts in web interface: Options tab -> Edit options -> find ignore hosts and modify it.



来源:https://stackoverflow.com/questions/52312857/mitmproxy-how-to-remove-flows-so-they-do-not-show-up-in-mitmweb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!