2

I want to detect any files uploaded from my computer to any website.

I was not able to find anything where I can directly detect any files uploaded from my computer to any website.

I hear that proxy server can redirect all the traffic received from my computer to the requested server.So by intercepting my browser Can it also detect the exact files which I am uploading to the website?

If no, are there any other ways that I can use to solve this?

Note: I want to implement it myself.

  • Can you elaborate a bit on what you want to do? Do you want to implement something yourself or use an existing program? Do you want to intercept traffic from your browser (in which you can configure proxy settings), or of any program? – Sjoerd Jun 12 '17 at 9:07
  • @Sjoerd sorry if i was not informative. Basically i want to know if any user leaks any data by uploading it on the cloud. I want to implement it myself by creating it from scratch. – Harry B Jun 12 '17 at 9:09
  • Walkthrough of building a proxy in python: null-byte.wonderhowto.com/how-to/… , you could look for multi part data and then try to determine the file. Note that any https connection will stop working when you mitm it with your proxy. – iainpb Jun 12 '17 at 9:25
2

A web proxy is a service that sits between the client and the website and forwards all requests and responses between them. This includes files uploaded to a website.

A proxy with the intent to inspect or modify traffic is called an intercepting proxy. ZAP and Burp are examples of intercepting proxies. You can try one of them to show your file upload.

A proxy is typically only used if it is configured in the browser. It is sometimes possible to use a transparent proxy, where no client configuration is needed.

Whether a proxy can intercept all data, including file uploads, depends on the details of the SSL connection. If the website uses plaintext HTTP instead of HTTPS, everything can be intercepted. If the website uses HTTPS, there are two options:

  1. The browser performs a CONNECT request to the proxy. The proxy sets up a tunnel between the client and the website and only sees encrypted traffic. This way, the proxy can not intercept any traffic, because it is encrypted.
  2. The browser performs a CONNECT request, but the proxy sets up separate connections to the browser and the website. Now the proxy is a man-in-the-middle attacker that decrypts and re-encrypts any data is passed through. The proxy can intercept all data.

The problem with option 2 is that the SSL connection is intercepted, so your browser will complain that it is not connected to the right host, or that the certificate is invalid.

If you would want to implement a proxy in Python, I think you would start with a TCPServer. Implement one that listens on a port, configure your browser to use that port as proxy server, and watch what request is done.

Another project which can help you is mitmproxy, an intercepting proxy written in Python.

  • I am specially worried about people uploading files to Google Drive and Google uses HTTPS. In that case i should put the browser and server connection different so that i don't intercept encrypted traffic? – Harry B Jun 12 '17 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.