Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add regression tests for mitmproxy support #124

Open
msridhar opened this issue Dec 5, 2016 · 16 comments
Open

add regression tests for mitmproxy support #124

msridhar opened this issue Dec 5, 2016 · 16 comments

Comments

@msridhar
Copy link
Contributor

msridhar commented Dec 5, 2016

We need regression tests for our mitmproxy support that run on Travis. Ideally this support would also test the certificate installation process. Not sure if this is possible.

@csujedihy
Copy link

mitmproxy crash when accessing mtalk.google.com. Just a heads up.

@msridhar
Copy link
Contributor Author

msridhar commented Dec 5, 2016

@csujedihy can you try with the latest installation instructions in the README? In particular, you should use mitmproxy version 0.11.3. Before trying, please do pip uninstall mitmproxy and rm -rf ~/.mitmproxy. You should also remove any mitmproxy certificates you placed in the Keychain (if on Mac, otherwise the appropriate Linux thing) and reinstall freshly-generated certificates.

@csujedihy
Copy link

My mitmdump's version is 0.18.2.

@csujedihy
Copy link

I got it. You modified the README recently.

@msridhar
Copy link
Contributor Author

msridhar commented Dec 5, 2016

Yes, just this morning 😄 mitmproxy 0.17 might work, 0.18.2 definitely doesn't. This is the motivation for this issue

@msridhar
Copy link
Contributor Author

msridhar commented Dec 7, 2016

I have confirmed that jalangi2analyses do not work out of the box with mitmproxy 0.17 installed. This may just be updating which APIs get invoked, but I also see various errors in the console about the client not trusting the proxy's certificate. So there may be a mitmproxy problem here.

@msridhar
Copy link
Contributor Author

msridhar commented Dec 7, 2016

@christofferqa have you gotten mitmproxy 0.17 to work with HTTPS sites on Mac?

@christofferqa
Copy link
Contributor

Yes. Have you marked the mitmproxy certificate as trusted in Keychain Access?

@csujedihy
Copy link

0.17-0.18.2 will crash when visiting mtalk.google.com via HTTPS.

@msridhar msridhar changed the title regression tests for mitmproxy find working mitmproxy version / add regression tests Dec 9, 2016
@msridhar
Copy link
Contributor Author

msridhar commented Dec 9, 2016

@csujedihy does 0.11.3 work on mtalk.google.com? Maybe we should report this one upstream.

@christofferqa
Copy link
Contributor

I don't experience the problems you are having with 0.17.1 (https://github.com/mitmproxy/mitmproxy/tree/v0.17.1). My steps were as follows (assuming mitmproxy has been installed properly).

  1. Start mitmproxy.

    mitmdump --quiet --anticache -s "scripts/proxy.py --inlineIID --inlineSource --analysis src/js/sample_analyses/ChainedAnalyses.js --analysis src/js/runtime/analysisCallbackTemplate.js"
    
  2. Open Google Chrome with the proper proxy flags.

    Mac OS:

    open -a 'Google Chrome' --args --proxy-server="127.0.0.1:8080" --proxy-bypass-list=""
    

    Ubuntu:

    google-chrome-stable --proxy-server="127.0.0.1:8080" --proxy-bypass-list=""
    
  3. Open https://hangouts.google.com. (I tried opening mtalk.google.com, but it is not reachable for me.)

Below is a screenshot of Jalangi2 running on Google Hangouts (on HTTPS). (Uploaded to http://users-cs.au.dk/cqa/jalangi2/hangouts.png.)

Jalangi2 on Google Hangouts

Below is a screenshot of Google Hangouts (on HTTPS), when visited using mitmproxy 0.17.1, but without the Jalangi2 instrumentation. (Uploaded to http://users-cs.au.dk/cqa/jalangi2/hangouts-no-instr.png.)

Jalangi2 on Google Hangouts

@msridhar
Copy link
Contributor Author

msridhar commented Dec 11, 2016 via email

@christofferqa
Copy link
Contributor

Yes, but I'll need access to a Mac, where mitmproxy has not previously been installed, to be sure that I don't have some hidden dependency installed. It may take a few days.

@msridhar
Copy link
Contributor Author

msridhar commented Dec 14, 2016 via email

@christofferqa
Copy link
Contributor

Complete jalangi2 install instructions for OS X 10.10. Tested on an entirely fresh virtual machine, installed from the recovery partition of my Mac (see http://cs.au.dk/~cqa/jalangi2/vm.png).

  1. Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install git, node 4.x, python
$ brew install git
$ brew install node@4
$ brew install python
  1. Update pip and install mitmproxy 0.17
$ pip install --upgrade pip
$ pip install mitmproxy==0.17
  1. Install Google Chrome from https://www.google.com/chrome

  2. Install mitmproxy certificates

    A. Start mitmproxy and open http://mitm.it/ in Chrome, with the proper proxy flags (make sure not to have a running instance of Chrome!)

    $ mitmdump -p 8081
    $ open -a 'Google Chrome' --args http://mitm.it/ --proxy-server="127.0.0.1:8081" --proxy-bypass-list=""
    

    B. Click on the Apple icon in order to download "mitmproxy-ca-cert.pem", and then open "mitmproxy-ca-cert.pem" to install the certificate

    C. Open Keychain Access, go to the "Certificates" menu, right-click on the "mitmproxy" certificate and select "Get Info". In the window that opens, click on the "Trust" item, and set "When using this certificate:" to "Always Trust".

  3. Clone jalangi2 and install dependencies

$ git clone https://github.com/Samsung/jalangi2.git
$ (cd jalangi2; npm install)
  1. Start jalangi2
$ cd jalangi2
$ mitmdump -p 8081 --quiet --anticache -s "scripts/proxy.py --inlineIID --inlineSource --analysis src/js/sample_analyses/ChainedAnalyses.js --analysis src/js/runtime/analysisCallbackTemplate.js"
  1. Open Chrome with the proper proxy flags (make sure not to have a running instance of Chrome!), and visit your favorite HTTPS website
$ open -a 'Google Chrome' --args --proxy-server="127.0.0.1:8081" --proxy-bypass-list=""

@msridhar msridhar changed the title find working mitmproxy version / add regression tests add regression tests for mitmproxy support Jan 7, 2022
@msridhar
Copy link
Contributor Author

msridhar commented Jan 7, 2022

FWIW, mitmproxy is now known to work using the master branch, and we've updated the relevant documentation. We still need regression tests; renamed the issue accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants