ansinject


Nameansinject JSON
Version 0.2.0 PyPI version JSON
download
home_page
SummaryInject network security config xml into an Android APK
upload_time2023-03-25 12:13:48
maintainer
docs_urlNone
author
requires_python>=3.11
licenseThe MIT License (MIT) Copyright (c) 2019 Sebastián Ramírez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords android wireshark injecttion apk security network config xml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ANS INJECT


<img src="https://github.com/xlith/ansinject/raw/main/hero-image.png" width=200>

Image by <a href="https://pixabay.com/users/madartzgraphics-3575871/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1915626">Darwin Laganzon</a> from <a href="https://pixabay.com//?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1915626">Pixabay</a>


## Android Network Security Config Injector

<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/ansinject"> <img alt="PyPI - Implementation" src="https://img.shields.io/pypi/implementation/ansinject"> <img alt="GitHub top language" src="https://img.shields.io/github/languages/top/xlith/ansinject"> <img alt="PyPI - License" src="https://img.shields.io/pypi/l/ansinject"> <img alt="PyPI" src="https://img.shields.io/pypi/v/ansinject"> <img alt="PyPI - Format" src="https://img.shields.io/pypi/format/ansinject"> <img alt="PyPI - Status" src="https://img.shields.io/pypi/status/ansinject">


This tool is simply an easier way to use some collection of other tools which can inject a network security config into an Android APK. Mainly it's sole pupose is making it easier to use the tools in the requirements list below with one line of command.

This is useful when you want to test an app that uses HTTPS but you don't have a valid certificate. This tool will allow you to bypass the certificate check.

## Disclaimer

**This tool is provided as is. I am not responsible for any damage caused by this tool. Use it at your own risk.**

## Requirements

- [adb](https://developer.android.com/studio/command-line/adb) (Part of the Android SDK)
- [zipalign](https://developer.android.com/studio/command-line/zipalign) (Part of the Android SDK)
- [jarsigner](https://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html) (Part of the JDK)
- [keytool](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html) (Part of the JDK)
- [apktool](https://ibotpeaches.github.io/Apktool/) (Need to be installed manually)

## Installation

```bash
pip install ansinject
```

## Usage

```bash
ansinject --help
```

```bash
ansinject inject [input_apk] [output_apk] --temp-dir [temp_dir]
```

Basicly the script will do the following:

1. Extract the APK
2. Copy the following network security config onto `/res/xml/network_security_config.xml`

```xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
            <certificates src="user" />
        </trust-anchors>
    </base-config>
</network-security-config>
```

3. Rebuild the APK
4. Generate a keystore in order to sign the APK
5. Sign the APK
6. Align the output


## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgements

* [stackoverflow - Capturing mobile phone traffic on wireshark](https://stackoverflow.com/questions/9555403/capturing-mobile-phone-traffic-on-wireshark)
* [gist - unoexperto - How to patch Android app to sniff its HTTPS traffic with self-signed certificate](https://gist.github.com/unoexperto/80694ccaed6dadc304ad5b8196cbbd2c#how-to-patch-android-app-to-sniff-its-https-traffic-with-self-signed-certificate)
* [exandroid - Capture all android network traffic](https://www.exandroid.dev/2021/03/21/capture-all-android-network-traffic/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ansinject",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "android,wireshark,injecttion,apk,security,network,config,xml",
    "author": "",
    "author_email": "Civan Yavuzsen <civanyavuzsen@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/56/1f/0102c08ce941efce347f90a50cae5faba140fa8333d6a291a7e6a954030e/ansinject-0.2.0.tar.gz",
    "platform": null,
    "description": "# ANS INJECT\n\n\n<img src=\"https://github.com/xlith/ansinject/raw/main/hero-image.png\" width=200>\n\nImage by <a href=\"https://pixabay.com/users/madartzgraphics-3575871/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1915626\">Darwin Laganzon</a> from <a href=\"https://pixabay.com//?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1915626\">Pixabay</a>\n\n\n## Android Network Security Config Injector\n\n<img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/ansinject\"> <img alt=\"PyPI - Implementation\" src=\"https://img.shields.io/pypi/implementation/ansinject\"> <img alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/xlith/ansinject\"> <img alt=\"PyPI - License\" src=\"https://img.shields.io/pypi/l/ansinject\"> <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/ansinject\"> <img alt=\"PyPI - Format\" src=\"https://img.shields.io/pypi/format/ansinject\"> <img alt=\"PyPI - Status\" src=\"https://img.shields.io/pypi/status/ansinject\">\n\n\nThis tool is simply an easier way to use some collection of other tools which can inject a network security config into an Android APK. Mainly it's sole pupose is making it easier to use the tools in the requirements list below with one line of command.\n\nThis is useful when you want to test an app that uses HTTPS but you don't have a valid certificate. This tool will allow you to bypass the certificate check.\n\n## Disclaimer\n\n**This tool is provided as is. I am not responsible for any damage caused by this tool. Use it at your own risk.**\n\n## Requirements\n\n- [adb](https://developer.android.com/studio/command-line/adb) (Part of the Android SDK)\n- [zipalign](https://developer.android.com/studio/command-line/zipalign) (Part of the Android SDK)\n- [jarsigner](https://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html) (Part of the JDK)\n- [keytool](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html) (Part of the JDK)\n- [apktool](https://ibotpeaches.github.io/Apktool/) (Need to be installed manually)\n\n## Installation\n\n```bash\npip install ansinject\n```\n\n## Usage\n\n```bash\nansinject --help\n```\n\n```bash\nansinject inject [input_apk] [output_apk] --temp-dir [temp_dir]\n```\n\nBasicly the script will do the following:\n\n1. Extract the APK\n2. Copy the following network security config onto `/res/xml/network_security_config.xml`\n\n```xml\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config>\n    <base-config cleartextTrafficPermitted=\"true\">\n        <trust-anchors>\n            <certificates src=\"system\" />\n            <certificates src=\"user\" />\n        </trust-anchors>\n    </base-config>\n</network-security-config>\n```\n\n3. Rebuild the APK\n4. Generate a keystore in order to sign the APK\n5. Sign the APK\n6. Align the output\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgements\n\n* [stackoverflow - Capturing mobile phone traffic on wireshark](https://stackoverflow.com/questions/9555403/capturing-mobile-phone-traffic-on-wireshark)\n* [gist - unoexperto - How to patch Android app to sniff its HTTPS traffic with self-signed certificate](https://gist.github.com/unoexperto/80694ccaed6dadc304ad5b8196cbbd2c#how-to-patch-android-app-to-sniff-its-https-traffic-with-self-signed-certificate)\n* [exandroid - Capture all android network traffic](https://www.exandroid.dev/2021/03/21/capture-all-android-network-traffic/)\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2019 Sebasti\u00e1n Ram\u00edrez  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Inject network security config xml into an Android APK",
    "version": "0.2.0",
    "split_keywords": [
        "android",
        "wireshark",
        "injecttion",
        "apk",
        "security",
        "network",
        "config",
        "xml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "988b496b5be04e108fc5b1dcf6494f260d0f59fa8955cda5ac77147ae310ec97",
                "md5": "5822ab1d753827f198ebf69617747643",
                "sha256": "90a963654bccc1b93166e74055552ae795fe9e759a1d635c953d8e9ad3f71c44"
            },
            "downloads": -1,
            "filename": "ansinject-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5822ab1d753827f198ebf69617747643",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 10656,
            "upload_time": "2023-03-25T12:13:46",
            "upload_time_iso_8601": "2023-03-25T12:13:46.672496Z",
            "url": "https://files.pythonhosted.org/packages/98/8b/496b5be04e108fc5b1dcf6494f260d0f59fa8955cda5ac77147ae310ec97/ansinject-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "561f0102c08ce941efce347f90a50cae5faba140fa8333d6a291a7e6a954030e",
                "md5": "4e972f527afa5ee492997039e6ac893c",
                "sha256": "5780d68d8eced6746395de06f8b8ccf0bea7fc874b84b44b68f3c6b30470f2cd"
            },
            "downloads": -1,
            "filename": "ansinject-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4e972f527afa5ee492997039e6ac893c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 11105,
            "upload_time": "2023-03-25T12:13:48",
            "upload_time_iso_8601": "2023-03-25T12:13:48.346546Z",
            "url": "https://files.pythonhosted.org/packages/56/1f/0102c08ce941efce347f90a50cae5faba140fa8333d6a291a7e6a954030e/ansinject-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-25 12:13:48",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "ansinject"
}
        
Elapsed time: 0.05107s