AndroidManifestExplorer 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: AndroidManifestExplorer
3
+ Version: 1.0.0
4
+ Summary: A professional tool to automate attack surface detection in Android applications by parsing Manifest files.
5
+ Home-page: https://github.com/mateofumis/AndroidManifestExplorer
6
+ Author: Mateo Fumis
7
+ Author-email: mateofumis@mfumis.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Security
12
+ Classifier: Intended Audience :: Information Technology
13
+ Classifier: Environment :: Console
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: colorama>=0.4.4
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # **📲 AndroidManifestExplorer**
28
+
29
+ A high-performance static analysis utility designed to automate the discovery of attack surfaces in Android applications. By parsing decompiled `AndroidManifest.xml` files, this tool identifies exposed components, security misconfigurations, and deep-link vectors, providing ready-to-use `adb` payloads for immediate dynamic verification.
30
+
31
+ ## **🎯 Security Objectives**
32
+
33
+ * **Attack Surface Mapping**: Identify all exported Activities, Services, Broadcast Receivers, and Content Providers.
34
+ * **Implicit Export Detection**: Flag components that are exported by default due to the presence of intent-filters without explicit `android:exported="false"` attributes.
35
+ * **Deep Link Analysis**: Extract URI schemes and hosts to facilitate intent-fuzzing and unauthorized navigation testing.
36
+ * **Permission Audit**: Highlight unprotected components and evaluate the strength of defined custom permissions.
37
+ * **Config Analysis**: Detect high-risk flags such as `debuggable="true"`, `allowBackup="true"`, and `testOnly="true"`.
38
+
39
+ ## **🚀 Installation**
40
+
41
+ ### Prerequisites
42
+ - Python 3.6+
43
+ - [apktool](https://apktool.org/) (for decompiling binary XML)
44
+
45
+ ### **Setup**
46
+
47
+ 1. Clone the repository and install the dependencies:
48
+
49
+ ```bash
50
+ $: git clone https://github.com/mateofumis/AndroidManifestExplorer.git
51
+ $: cd AndroidManifestExplorer
52
+ $: pip install .
53
+ ```
54
+
55
+ - Alternatively, install the requirements directly:
56
+
57
+ ```bash
58
+ $: pip install -r requirements.txt
59
+ ```
60
+
61
+ 1. Using PyPI (Available for `pip` or `pipx`)
62
+
63
+ ```bash
64
+ # with pip/pip3
65
+ $: pip install AndroidManifestExplorer
66
+ # or pipx
67
+ $: pipx install AndroidManifestExplorer
68
+ ```
69
+
70
+ ## **🛠 Usage Workflow**
71
+
72
+ ### **1. Decompile Target APK**
73
+
74
+ The tool operates on the plain-text XML output of `apktool`.
75
+
76
+ ```bash
77
+ $: apktool d target_app.apk -o output_dir
78
+ ```
79
+
80
+ ### **2. Execute Scan**
81
+
82
+ Run the explorer against the generated manifest:
83
+
84
+ ```bash
85
+ $: AndroidManifestExplorer -f output_dir/AndroidManifest.xml
86
+ ```
87
+
88
+ If running the script directly without installation:
89
+
90
+ ```bash
91
+ $: python3 AndroidManifestExplorer.py -f output_dir/AndroidManifest.xml
92
+ ```
93
+
94
+ ## **📊 Technical Output Overview**
95
+
96
+ The tool categorizes findings by risk and generates specific `adb` commands:
97
+
98
+ * **Activities**: Generates `am start` commands.
99
+ * **Services**: Generates `am start-service` commands.
100
+ * **Receivers**: Generates `am broadcast` commands.
101
+ * **Providers**: Generates `content query` commands with a default SQLi test payload (`--where "1=1"`).
102
+
103
+ ### **Example Result:**
104
+
105
+ ```
106
+ [+] ACTIVITY EXPORTED: com.package.name.InternalActivity
107
+ [!] NO PERMISSION REQUIRED (High Risk)
108
+ [>] ADB: adb shell am start -n com.package.name/com.package.name.InternalActivity
109
+ [★] DEEP LINK DETECTED: secret-app://debug_panel
110
+ [>] Attack: adb shell am start -W -a android.intent.action.VIEW -d "secret-app://debug_panel" com.package.name
111
+ ```
112
+ ## **⚖️ Disclaimer**
113
+
114
+ This tool is intended for professional security research and authorized penetration testing only. Unauthorized use against systems without prior written consent is strictly prohibited and may violate local and international laws. The developer assumes no liability for misuse or damage caused by this utility.
@@ -0,0 +1,9 @@
1
+ AndroidManifestExplorer.py
2
+ README.md
3
+ setup.py
4
+ AndroidManifestExplorer.egg-info/PKG-INFO
5
+ AndroidManifestExplorer.egg-info/SOURCES.txt
6
+ AndroidManifestExplorer.egg-info/dependency_links.txt
7
+ AndroidManifestExplorer.egg-info/entry_points.txt
8
+ AndroidManifestExplorer.egg-info/requires.txt
9
+ AndroidManifestExplorer.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ AndroidManifestExplorer = AndroidManifestExplorer:main
@@ -0,0 +1 @@
1
+ AndroidManifestExplorer
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env python3
2
+ # Author: Mateo Fumis (hackermater) - linkedin.com/in/mateo-gabriel-fumis
3
+ import xml.etree.ElementTree as ET
4
+ import argparse
5
+ import sys
6
+ from colorama import init, Fore, Style
7
+
8
+ init(autoreset=True)
9
+
10
+ ANDROID_NS = '{http://schemas.android.com/apk/res/android}'
11
+
12
+ def get_attr(element, attr_name):
13
+ """Helper to get attributes handling the namespace"""
14
+ return element.get(f"{ANDROID_NS}{attr_name}")
15
+
16
+ def analyze_deep_links(activity_node, full_name, package_name):
17
+ """Extracts schemes and hosts to build Deep Link attacks"""
18
+ found_uris = set()
19
+
20
+ for intent in activity_node.findall('intent-filter'):
21
+ data_tags = intent.findall('data')
22
+
23
+ for data in data_tags:
24
+ scheme = get_attr(data, 'scheme')
25
+ host = get_attr(data, 'host')
26
+
27
+ if scheme:
28
+ uri = f"{scheme}://"
29
+
30
+ if host: uri += host
31
+ found_uris.add(uri)
32
+
33
+ for uri in sorted(found_uris):
34
+ print(f"{Fore.LIGHTGREEN_EX} [★] DEEP LINK DETECTED: {uri}")
35
+ print(f"{Fore.WHITE} [>] Attack: adb shell am start -W -a android.intent.action.VIEW -d \"{uri}\" {package_name}")
36
+
37
+ def analyze_manifest(manifest_path):
38
+ try:
39
+ tree = ET.parse(manifest_path)
40
+ root = tree.getroot()
41
+ package_name = root.get('package')
42
+
43
+ print(f"{Fore.CYAN}{'='*70}")
44
+ print(f"{Fore.CYAN}{Style.BRIGHT}[*] AndroidManifestExplorer - Analyzing: {package_name}")
45
+ print(f"{Fore.CYAN}{'='*70}")
46
+
47
+ app_tag = root.find('application')
48
+
49
+ if app_tag is not None:
50
+ debuggable = get_attr(app_tag, 'debuggable')
51
+ allow_backup = get_attr(app_tag, 'allowBackup')
52
+ test_only = get_attr(app_tag, 'testOnly')
53
+
54
+ if debuggable == 'true':
55
+ print(f"{Fore.RED}[CRITICAL] debuggable='true' -> Potential data extraction and RCE.")
56
+
57
+ if allow_backup == 'true':
58
+ print(f"{Fore.YELLOW}[WARN] allowBackup='true' -> Potential data theft via 'adb backup'.")
59
+ print(f"{Fore.WHITE} Command: adb backup {package_name}")
60
+
61
+ if test_only == 'true':
62
+ print(f"{Fore.YELLOW}[INFO] testOnly='true' -> Test/Debug APK.")
63
+
64
+ print(f"\n{Fore.CYAN}[*] Attack Surface Detected:{Style.RESET_ALL}\n")
65
+
66
+ components = {
67
+ 'activity': {'cmd': 'am start -n', 'color': Fore.GREEN},
68
+ 'receiver': {'cmd': 'am broadcast -n', 'color': Fore.MAGENTA},
69
+ 'service': {'cmd': 'am start-service -n', 'color': Fore.BLUE},
70
+ 'provider': {'cmd': 'content query --uri', 'color': Fore.RED}
71
+ }
72
+
73
+ if app_tag is not None:
74
+ for comp_type, info in components.items():
75
+ for node in app_tag.findall(comp_type):
76
+ name = get_attr(node, 'name')
77
+ exported = get_attr(node, 'exported')
78
+ permission = get_attr(node, 'permission')
79
+
80
+ if not name: continue
81
+
82
+ if name.startswith('.'):
83
+ full_name = f"{package_name}{name}"
84
+ elif '.' not in name:
85
+ full_name = f"{package_name}.{name}"
86
+ else:
87
+ full_name = name
88
+
89
+ has_intent_filter = node.find('intent-filter') is not None
90
+ is_vuln = exported == 'true' or (exported is None and has_intent_filter)
91
+
92
+ if is_vuln:
93
+ print(f"{info['color']}[+] {comp_type.upper()} EXPORTED: {full_name}")
94
+
95
+ if permission:
96
+ print(f"{Fore.YELLOW} [!] Requires permission: {permission} (Check if custom/weak)")
97
+ else:
98
+ print(f"{Fore.RED} [!] NO PERMISSION REQUIRED (High Risk)")
99
+
100
+ if comp_type == 'provider':
101
+ authority = get_attr(node, 'authorities')
102
+ if authority:
103
+ auth_clean = authority.split(';')[0]
104
+ print(f"{Fore.WHITE} [>] ADB: adb shell {info['cmd']} content://{auth_clean}/")
105
+ print(f"{Fore.WHITE} [>] SQLi Test: adb shell {info['cmd']} content://{auth_clean}/ --where \"1=1\"")
106
+ else:
107
+ print(f"{Fore.WHITE} [>] ADB: adb shell {info['cmd']} {package_name}/{full_name}")
108
+
109
+ if comp_type == 'activity' and has_intent_filter:
110
+ analyze_deep_links(node, full_name, package_name)
111
+
112
+ print("-" * 50)
113
+
114
+ except FileNotFoundError:
115
+ print(f"{Fore.RED}[!] Error: File not found at {manifest_path}")
116
+ except ET.ParseError:
117
+ print(f"{Fore.RED}[!] Error: File is not a valid XML. Did you decompile it with APKtool?")
118
+ except Exception as e:
119
+ print(f"{Fore.RED}[!] Unexpected error: {e}")
120
+
121
+ def main():
122
+ """Main entry point for console_scripts"""
123
+ parser = argparse.ArgumentParser(description='AndroidManifestExplorer - Mobile Security Tool')
124
+ parser.add_argument('-f', '--file', required=True, help='Path to AndroidManifest.xml (Decompiled with APKtool/Jadx)')
125
+ args = parser.parse_args()
126
+
127
+ analyze_manifest(args.file)
128
+
129
+ if __name__ == "__main__":
130
+ main()
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: AndroidManifestExplorer
3
+ Version: 1.0.0
4
+ Summary: A professional tool to automate attack surface detection in Android applications by parsing Manifest files.
5
+ Home-page: https://github.com/mateofumis/AndroidManifestExplorer
6
+ Author: Mateo Fumis
7
+ Author-email: mateofumis@mfumis.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Security
12
+ Classifier: Intended Audience :: Information Technology
13
+ Classifier: Environment :: Console
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: colorama>=0.4.4
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # **📲 AndroidManifestExplorer**
28
+
29
+ A high-performance static analysis utility designed to automate the discovery of attack surfaces in Android applications. By parsing decompiled `AndroidManifest.xml` files, this tool identifies exposed components, security misconfigurations, and deep-link vectors, providing ready-to-use `adb` payloads for immediate dynamic verification.
30
+
31
+ ## **🎯 Security Objectives**
32
+
33
+ * **Attack Surface Mapping**: Identify all exported Activities, Services, Broadcast Receivers, and Content Providers.
34
+ * **Implicit Export Detection**: Flag components that are exported by default due to the presence of intent-filters without explicit `android:exported="false"` attributes.
35
+ * **Deep Link Analysis**: Extract URI schemes and hosts to facilitate intent-fuzzing and unauthorized navigation testing.
36
+ * **Permission Audit**: Highlight unprotected components and evaluate the strength of defined custom permissions.
37
+ * **Config Analysis**: Detect high-risk flags such as `debuggable="true"`, `allowBackup="true"`, and `testOnly="true"`.
38
+
39
+ ## **🚀 Installation**
40
+
41
+ ### Prerequisites
42
+ - Python 3.6+
43
+ - [apktool](https://apktool.org/) (for decompiling binary XML)
44
+
45
+ ### **Setup**
46
+
47
+ 1. Clone the repository and install the dependencies:
48
+
49
+ ```bash
50
+ $: git clone https://github.com/mateofumis/AndroidManifestExplorer.git
51
+ $: cd AndroidManifestExplorer
52
+ $: pip install .
53
+ ```
54
+
55
+ - Alternatively, install the requirements directly:
56
+
57
+ ```bash
58
+ $: pip install -r requirements.txt
59
+ ```
60
+
61
+ 1. Using PyPI (Available for `pip` or `pipx`)
62
+
63
+ ```bash
64
+ # with pip/pip3
65
+ $: pip install AndroidManifestExplorer
66
+ # or pipx
67
+ $: pipx install AndroidManifestExplorer
68
+ ```
69
+
70
+ ## **🛠 Usage Workflow**
71
+
72
+ ### **1. Decompile Target APK**
73
+
74
+ The tool operates on the plain-text XML output of `apktool`.
75
+
76
+ ```bash
77
+ $: apktool d target_app.apk -o output_dir
78
+ ```
79
+
80
+ ### **2. Execute Scan**
81
+
82
+ Run the explorer against the generated manifest:
83
+
84
+ ```bash
85
+ $: AndroidManifestExplorer -f output_dir/AndroidManifest.xml
86
+ ```
87
+
88
+ If running the script directly without installation:
89
+
90
+ ```bash
91
+ $: python3 AndroidManifestExplorer.py -f output_dir/AndroidManifest.xml
92
+ ```
93
+
94
+ ## **📊 Technical Output Overview**
95
+
96
+ The tool categorizes findings by risk and generates specific `adb` commands:
97
+
98
+ * **Activities**: Generates `am start` commands.
99
+ * **Services**: Generates `am start-service` commands.
100
+ * **Receivers**: Generates `am broadcast` commands.
101
+ * **Providers**: Generates `content query` commands with a default SQLi test payload (`--where "1=1"`).
102
+
103
+ ### **Example Result:**
104
+
105
+ ```
106
+ [+] ACTIVITY EXPORTED: com.package.name.InternalActivity
107
+ [!] NO PERMISSION REQUIRED (High Risk)
108
+ [>] ADB: adb shell am start -n com.package.name/com.package.name.InternalActivity
109
+ [★] DEEP LINK DETECTED: secret-app://debug_panel
110
+ [>] Attack: adb shell am start -W -a android.intent.action.VIEW -d "secret-app://debug_panel" com.package.name
111
+ ```
112
+ ## **⚖️ Disclaimer**
113
+
114
+ This tool is intended for professional security research and authorized penetration testing only. Unauthorized use against systems without prior written consent is strictly prohibited and may violate local and international laws. The developer assumes no liability for misuse or damage caused by this utility.
@@ -0,0 +1,88 @@
1
+ # **📲 AndroidManifestExplorer**
2
+
3
+ A high-performance static analysis utility designed to automate the discovery of attack surfaces in Android applications. By parsing decompiled `AndroidManifest.xml` files, this tool identifies exposed components, security misconfigurations, and deep-link vectors, providing ready-to-use `adb` payloads for immediate dynamic verification.
4
+
5
+ ## **🎯 Security Objectives**
6
+
7
+ * **Attack Surface Mapping**: Identify all exported Activities, Services, Broadcast Receivers, and Content Providers.
8
+ * **Implicit Export Detection**: Flag components that are exported by default due to the presence of intent-filters without explicit `android:exported="false"` attributes.
9
+ * **Deep Link Analysis**: Extract URI schemes and hosts to facilitate intent-fuzzing and unauthorized navigation testing.
10
+ * **Permission Audit**: Highlight unprotected components and evaluate the strength of defined custom permissions.
11
+ * **Config Analysis**: Detect high-risk flags such as `debuggable="true"`, `allowBackup="true"`, and `testOnly="true"`.
12
+
13
+ ## **🚀 Installation**
14
+
15
+ ### Prerequisites
16
+ - Python 3.6+
17
+ - [apktool](https://apktool.org/) (for decompiling binary XML)
18
+
19
+ ### **Setup**
20
+
21
+ 1. Clone the repository and install the dependencies:
22
+
23
+ ```bash
24
+ $: git clone https://github.com/mateofumis/AndroidManifestExplorer.git
25
+ $: cd AndroidManifestExplorer
26
+ $: pip install .
27
+ ```
28
+
29
+ - Alternatively, install the requirements directly:
30
+
31
+ ```bash
32
+ $: pip install -r requirements.txt
33
+ ```
34
+
35
+ 1. Using PyPI (Available for `pip` or `pipx`)
36
+
37
+ ```bash
38
+ # with pip/pip3
39
+ $: pip install AndroidManifestExplorer
40
+ # or pipx
41
+ $: pipx install AndroidManifestExplorer
42
+ ```
43
+
44
+ ## **🛠 Usage Workflow**
45
+
46
+ ### **1. Decompile Target APK**
47
+
48
+ The tool operates on the plain-text XML output of `apktool`.
49
+
50
+ ```bash
51
+ $: apktool d target_app.apk -o output_dir
52
+ ```
53
+
54
+ ### **2. Execute Scan**
55
+
56
+ Run the explorer against the generated manifest:
57
+
58
+ ```bash
59
+ $: AndroidManifestExplorer -f output_dir/AndroidManifest.xml
60
+ ```
61
+
62
+ If running the script directly without installation:
63
+
64
+ ```bash
65
+ $: python3 AndroidManifestExplorer.py -f output_dir/AndroidManifest.xml
66
+ ```
67
+
68
+ ## **📊 Technical Output Overview**
69
+
70
+ The tool categorizes findings by risk and generates specific `adb` commands:
71
+
72
+ * **Activities**: Generates `am start` commands.
73
+ * **Services**: Generates `am start-service` commands.
74
+ * **Receivers**: Generates `am broadcast` commands.
75
+ * **Providers**: Generates `content query` commands with a default SQLi test payload (`--where "1=1"`).
76
+
77
+ ### **Example Result:**
78
+
79
+ ```
80
+ [+] ACTIVITY EXPORTED: com.package.name.InternalActivity
81
+ [!] NO PERMISSION REQUIRED (High Risk)
82
+ [>] ADB: adb shell am start -n com.package.name/com.package.name.InternalActivity
83
+ [★] DEEP LINK DETECTED: secret-app://debug_panel
84
+ [>] Attack: adb shell am start -W -a android.intent.action.VIEW -d "secret-app://debug_panel" com.package.name
85
+ ```
86
+ ## **⚖️ Disclaimer**
87
+
88
+ This tool is intended for professional security research and authorized penetration testing only. Unauthorized use against systems without prior written consent is strictly prohibited and may violate local and international laws. The developer assumes no liability for misuse or damage caused by this utility.
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,31 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="AndroidManifestExplorer",
5
+ version="1.0.0",
6
+ author="Mateo Fumis",
7
+ author_email="mateofumis@mfumis.com",
8
+ description="A professional tool to automate attack surface detection in Android applications by parsing Manifest files.",
9
+ long_description=open("README.md", encoding="utf-8").read(),
10
+ long_description_content_type="text/markdown",
11
+ url="https://github.com/mateofumis/AndroidManifestExplorer",
12
+ packages=find_packages(),
13
+ py_modules=["AndroidManifestExplorer"],
14
+ install_requires=[
15
+ "colorama>=0.4.4",
16
+ ],
17
+ entry_points={
18
+ "console_scripts": [
19
+ "AndroidManifestExplorer=AndroidManifestExplorer:main",
20
+ ],
21
+ },
22
+ classifiers=[
23
+ "Programming Language :: Python :: 3",
24
+ "License :: OSI Approved :: Apache Software License",
25
+ "Operating System :: OS Independent",
26
+ "Topic :: Security",
27
+ "Intended Audience :: Information Technology",
28
+ "Environment :: Console",
29
+ ],
30
+ python_requires=">=3.6",
31
+ )