Looking into using mitmproxy for a filtering script for a few locations.
I was wondering if there is a way to program mitmproxy to block images from loading on a webpage? I did look at the examples and saw one that flip images around, but I was not able to get this script to work. I have been able to get others to work and I am currently writing a new one already.
Next question would be how do I get the user_agent? I like to know if the data traffic is coming a mobile device or a desktop computer (windows, mac, linxus, etc)
Last question, is there a way to get the IP or maybe link the flow to a connection/user so we may limit or open permissions base off the connection? We may already have a way to read the packets and pull some information off the packets to assign user permission level access, but need a way to link said information to the IP that is talking.
Thank you so much! Got it all working on this part.
One more question, is there a way to add to the ignore list while on the fly? We’re making a web portal for easy access. From there, I am allowing users on the fly control of the proxy. That part is working - but not sure if you have a “safe” expose way to add items to the ignore list on the fly for example for hsts certificate pinning locations?
With the next release you’ll hopefully be able to just add entries to options.ignore_hosts, but I don’t think we expose functionality for this yet. If it doesn’t work with 3.0, you are welcome to file an issue for this on GitHub!