{ "info": { "author": "Louis Abraham", "author_email": "louis.abraham@yahoo.fr", "bugtrack_url": null, "classifiers": [ "Topic :: Internet :: Proxy Servers", "Topic :: Internet :: WWW/HTTP", "Topic :: Security" ], "description": "FRida In The Middle\n===================\n\n``fritm`` is a minimalist, cross-platform (tested on macOS and Windows)\nnetwork reverse engineering framework written in Python.\n\n``fritm-hook`` allows you to easily hook the\n```connect()`` `__\nfunction with ```frida`` `__ to redirect all\ntraffic from a target application.\n\nYou can then use the builtin server written in Python to initiate a\n`Man-in-the-middle\nattack `__.\n\nEven if you don\u2019t want to use Python, you can use the ``fritm-hook``\ncommand to redirect the traffic to your application and implement the\nsimple lecture of the ``HTTP CONNECT`` header.\n\nInstallation\n============\n\n.. code:: bash\n\n pip install fritm\n\nUsage\n=====\n\nHook the process:\n\n.. code:: bash\n\n fritm-hook PROCESS_NAME_OR_PID -p PORT # (default 8080)\n\nOr create a new one:\n\n.. code:: bash\n\n fritm-spawn PATH_TO_COMMAND -p PORT # (default 8080)\n\nLaunch a proxy server in Python:\n\n.. code:: python\n\n import select\n\n from fritm import start_proxy_server\n\n\n def dumb_callback(soClient, soServer):\n \"\"\"Forwards all the traffic between the two sockets\n \"\"\"\n conns = [soClient, soServer]\n other = {soClient: soServer, soServer: soClient}\n active = True\n try:\n while active:\n rlist, wlist, xlist = select.select(conns, [], conns)\n if xlist or not rlist:\n break\n for r in rlist:\n data = r.recv(8192)\n if not data:\n active = False\n break\n other[r].sendall(data)\n finally:\n for c in conns:\n c.close()\n\n httpd = start_proxy_server(dumb_callback)\n\nNow, all the traffic will go through your application. You can modify\nanything on the fly.\n\nHow does it work?\n=================\n\nHooking with ``fritm.hook(process, port)``\n------------------------------------------\n\n1. attach to the target process\n2. intercept the calls to\n ```connect()`` `__\n3. replace the target IP address by 127.0.0.1 and the port with the\n chosen one\n4. execute the ``connect()`` function with the local IP\n5. just before returning, send the `HTTP CONNECT\n method `__\n with the original IP and port\n\n``fritm.spawn_and_hook(process, port)`` launches the process and ensures\nit is hooked from the beginning.\n\nMITM with ``fritm.start_proxy_server(callback, port)``\n------------------------------------------------------\n\n1. Launch a local server that listens for connections on the given port\n2. Upon receiving a new connection from the hooked client, read the IP\n and port of the server from the HTTP CONNECT header\n3. Open a new socket to the server\n4. Call ``callback(socket_to_client, socket_to_server)``\n\nDifferences with `mitmproxy `__\n=======================================================\n\n- mitmproxy doesn\u2019t use function hooking, it intercepts all the traffic\n from your browser or computer\n- mitmproxy only works for HTTP traffic, whereas fritm works with any\n TCP traffic.\n\nDifferences with `proxychains `__ / `proxychains-ng `__\n======================================================================================================================================\n\n- ``fritm-spawn`` is intented as simplified and cross-platform version\n of proxychains.\n- ``fritm-hook`` can attach to an already running process.\n- proxychains is not cross-platform and hard to install, whereas fritm\n is cross-platform and simple to install.\n- proxychains uses a config file whereas ``fritm-spawn`` only takes two\n arguments\n- fritm includes a HTTP proxy server (that is also able to communicate\n with proxychains)\n- proxychains can handle a lot of different proxy types (SOCKS4,\n SOCKS5, HTTPS) with a lot of options (e.g.\u00a0for authentification)\n- proxychains can chain multiple proxies\n- proxychains handles any proxy address whereas ``fritm-spawn``\n defaults to localhost. However, if anyone needs it for remote\n addresses, post an issue and I\u2019ll implement it.\n\nCurrent limitations\n===================\n\n- Some Windows user faced issues that I couldn\u2019t reproduce\n- fritm will fail on IPv6 addresses, but it should not be hard to fix\n (I just don\u2019t happen to have any application that uses an IPv6\n address to test).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/louisabraham/fritm", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "fritm", "package_url": "https://pypi.org/project/fritm/", "platform": "", "project_url": "https://pypi.org/project/fritm/", "project_urls": { "Homepage": "https://github.com/louisabraham/fritm" }, "release_url": "https://pypi.org/project/fritm/0.3.0/", "requires_dist": [ "frida", "click" ], "requires_python": ">=3.5", "summary": "Minimalist and cross-platform network reverse engineering framework", "version": "0.3.0" }, "last_serial": 5315961, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c21c6a1ac51074314e669ca1e3039aa6", "sha256": "dd4d8740144e658dd1b345752a5403a39927ed093c94aa71666e5f47902f34aa" }, "downloads": -1, "filename": "fritm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c21c6a1ac51074314e669ca1e3039aa6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6064, "upload_time": "2019-05-23T15:04:43", "url": "https://files.pythonhosted.org/packages/8d/60/e0dea47a1ed6b818675aa8e44fbc3996cec34bad37ad9bd8413f159e75df/fritm-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5614c8fc5c445ea0e7d4654e1e4e3265", "sha256": "45a21a7ded837efc69db05fb1cff07f977c557dd4ccc6f6d7af71c631a4c98b5" }, "downloads": -1, "filename": "fritm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5614c8fc5c445ea0e7d4654e1e4e3265", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4756, "upload_time": "2019-05-23T15:04:45", "url": "https://files.pythonhosted.org/packages/f7/b4/7207eabb90ec07d373edefd9e97fbedb431065a21209a510c43930d7ca80/fritm-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f887fd61ee6c2e3d99ab94c806b37139", "sha256": "c13ca495779fe011e4afd650e4c38c27336cc1e6076216cb0931114df1b634f5" }, "downloads": -1, "filename": "fritm-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f887fd61ee6c2e3d99ab94c806b37139", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6134, "upload_time": "2019-05-24T13:51:13", "url": "https://files.pythonhosted.org/packages/33/46/5c40befe888ccbf14b7bcadc32b5cca07584d32de6a76b25d2b07f19ea86/fritm-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9bf69e7afb7f0f48c8ac395173b94df9", "sha256": "dd77b623e127570dbf91680668ebcafeaedd098c7edc32eae60625c774f7a030" }, "downloads": -1, "filename": "fritm-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9bf69e7afb7f0f48c8ac395173b94df9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4777, "upload_time": "2019-05-24T13:51:15", "url": "https://files.pythonhosted.org/packages/3d/d4/ea7c0ef6887cc1342a0825d53af0c038c92c6f31cbe0e2d22fe7bc7abd16/fritm-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "972736cf087a5e94e99014ae4702d69b", "sha256": "788425f0f6df6bd9471534f470b1bcb5ee025b91e3d0247a6f581557b1169549" }, "downloads": -1, "filename": "fritm-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "972736cf087a5e94e99014ae4702d69b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6133, "upload_time": "2019-05-24T13:52:45", "url": "https://files.pythonhosted.org/packages/01/7a/8e737109a5a76b36ded0b6b5bce6a98f11ee2bdd6c2de96183cae4c4711c/fritm-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "44866c91e5cef7a8c9ac882381a58e93", "sha256": "e2da90f1bb55fdc86aa08d17b757827a4a13ac3f082032c1f1a0209112710ddc" }, "downloads": -1, "filename": "fritm-0.2.1.tar.gz", "has_sig": false, "md5_digest": "44866c91e5cef7a8c9ac882381a58e93", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4776, "upload_time": "2019-05-24T13:52:46", "url": "https://files.pythonhosted.org/packages/12/cc/bcc6aa2396e6d35490e4dd0ce2c9bbadbc1621dcae5a4a6cca1c433848f7/fritm-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "81c52984bc72c33c2a33f23d33e8671e", "sha256": "0f2a43d16d527628816a943aaa0b186fb5d9863efb6af9745c8e0abeb28423e0" }, "downloads": -1, "filename": "fritm-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "81c52984bc72c33c2a33f23d33e8671e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6299, "upload_time": "2019-05-25T09:08:59", "url": "https://files.pythonhosted.org/packages/df/d0/566757bf88e28074fb62f66c7ca68673f6fa9a26d116da58a5741c1d81f1/fritm-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0d0d08642ac805fa2de3176d26ba7b70", "sha256": "358dfa5fbe651b4a5b23f4c1584f6bb42da25ab17339de508987853d45984977" }, "downloads": -1, "filename": "fritm-0.3.0.tar.gz", "has_sig": false, "md5_digest": "0d0d08642ac805fa2de3176d26ba7b70", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4951, "upload_time": "2019-05-25T09:09:01", "url": "https://files.pythonhosted.org/packages/79/48/4068affd7e2dee407139b895e97b3ca2567a5ddb5b059eab7de82aef0784/fritm-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "81c52984bc72c33c2a33f23d33e8671e", "sha256": "0f2a43d16d527628816a943aaa0b186fb5d9863efb6af9745c8e0abeb28423e0" }, "downloads": -1, "filename": "fritm-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "81c52984bc72c33c2a33f23d33e8671e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6299, "upload_time": "2019-05-25T09:08:59", "url": "https://files.pythonhosted.org/packages/df/d0/566757bf88e28074fb62f66c7ca68673f6fa9a26d116da58a5741c1d81f1/fritm-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0d0d08642ac805fa2de3176d26ba7b70", "sha256": "358dfa5fbe651b4a5b23f4c1584f6bb42da25ab17339de508987853d45984977" }, "downloads": -1, "filename": "fritm-0.3.0.tar.gz", "has_sig": false, "md5_digest": "0d0d08642ac805fa2de3176d26ba7b70", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4951, "upload_time": "2019-05-25T09:09:01", "url": "https://files.pythonhosted.org/packages/79/48/4068affd7e2dee407139b895e97b3ca2567a5ddb5b059eab7de82aef0784/fritm-0.3.0.tar.gz" } ] }