omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    mitmproxy possible? (Pythonista 1.6 beta)

    Pythonista
    4
    7
    6927
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tizzy
      Tizzy last edited by

      Is there any reason why mitmproxy can't work with pythonista?

      I was able to download/"install" it using githubget.py (got the github dowloader somewhere in the forums)...it creates the mitmproxy-master folder in the root directory of pythonista. Should the whole folder be moved into site-packages?

      Also if anybody has an alternative recommendation for intercepting an ssl-encrypted value in python, I'd love to know about it.

      (1.6 beta)

      Thanks,
      Tony

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        I don't think it's possible to get this to work in Pythonista at all. From looking at the source code briefly, it seems to require running pfctl with root privileges, which just isn't possible on iOS.

        1 Reply Last reply Reply Quote 0
        • pacco
          pacco last edited by

          What an incredible coincidence! I was just playing with various Python-based http proxies the day before (which also relates to a recent question on this forum about running server apps in the background). I've found several several http (tcp/80) proxies that work ok with Pythonista:

          <blockquote>
          https://evilzone.org/scripting-languages/(python)-proxy-server-19-lines-of-code!/<br>
          http://infomesh.net/2002/bproxy<br>
          http://python-proxy.googlecode.com/svn/trunk/PythonProxy.py<br>
          https://gist.github.com/voorloopnul/415cb75a3e4f766dc590#file-proxy-py<br>
          </blockquote>

          But haven't been able to get any SSL-based ones working either. The one I'm currently looking at is <a href="http://code.google.com/p/proxpy/">proxpy</a> but I suspect it has a dependency on OpenSSL (either the lib or a binary) which clearly is not available in Pythonista. If you make any progress with mitmproxy (or any other) please update this thread -- I'm very interested in this as well.

          Sidenote: One interesting discovery made while playing with the proxy servers -- iOS (8.3 anyway) uses this URL http://mesu.apple.com/assets/com_apple_MobileAsset_SoftwareUpdate/com_apple_MobileAsset_SoftwareUpdate.xml to check if any new OS updates are available. It's also interesting/depressing to see just how many apps on your device call home using various analytic frameworks...

          Edit: Fixed bad markdown for URLs.

          1 Reply Last reply Reply Quote 0
          • Tizzy
            Tizzy last edited by

            Well I'm glad I didn't spend any significant amount of time trying to get it to work then. Thanks OMZ! I'm also curious whether that's an iOS limitation or a python from within iOS limitation?

            Paco- just saw your post. Thanks for your input, might have a go with your suggestions if it turns out ssl can be used, and I'll be sure to report back if I find any solutions.

            1 Reply Last reply Reply Quote 0
            • ccc
              ccc last edited by

              OpenSSL is in Pythonista...

              import ssl
              print(ssl.OPENSSL_VERSION)
              # OpenSSL 1.0.1g 7 Apr 2014 in the current Beta
              
              1 Reply Last reply Reply Quote 0
              • pacco
                pacco last edited by

                @ccc -- you're right, of course. I was thinking of the OpenSSL wrapper module that some of these proxy servers depend on. (I believe it wraps the external openssl binary, which isn't an option for Pythonista for the obvious reasons)<br>

                @Tizzy -- I still haven't gotten proxpy working, but I realized I'd forgotten to install the local proxpy root CA on the iOS device I was testing with. (It installs under Settings app->Profiles, like any other mobileconfig). Will continue messing with it as time allows...

                1 Reply Last reply Reply Quote 0
                • Tizzy
                  Tizzy last edited by

                  @pacco Checking in, any word on proxies in Pythonista since we brought this up quite a while ago? Any Luck?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors