Question

I'm trying to use mitmproxy to automate logging into a webpage, the main idea is that;

  • The user requests a webpage
  • The proxy recieves this request;
  • If the targeted webpage is NOT an auto-login page; We'll simply send the request through.
  • Otherwise; We'll send a post request to log into the page, on the users behalf, and return the cookie (with sessionID and such), and the user will be able to browse the page as logged in.

I've been able to get mitmproxy up and running, I can detect the outgoing request, and obviously check whether it matches any url, that is an auto-login one. I can also log into the page, using pythons http.client module, however I can't figure out how to return the logged in http.client cookies and such to the user, through the proxy script, such that the browser will simply bypass the login screen.

That is, I have a valid HTTP Response object, which is 'logged in' (ie. containing the logged in cookie), and I'm wanting to return this, in my mitmproxy script.

Was it helpful?

Solution

Decided to abandon this idea, and use the java library, 'exproxy' instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top