frida-fusion 0.1.24__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.
- frida_fusion-0.1.24/LICENSE +25 -0
- frida_fusion-0.1.24/PKG-INFO +192 -0
- frida_fusion-0.1.24/README.md +157 -0
- frida_fusion-0.1.24/frida_fusion/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/__main__.py +7 -0
- frida_fusion-0.1.24/frida_fusion/__meta__.py +9 -0
- frida_fusion-0.1.24/frida_fusion/args.py +186 -0
- frida_fusion-0.1.24/frida_fusion/config.py +282 -0
- frida_fusion-0.1.24/frida_fusion/exceptions.py +19 -0
- frida_fusion-0.1.24/frida_fusion/fusion.py +827 -0
- frida_fusion-0.1.24/frida_fusion/libs/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/libs/color.py +141 -0
- frida_fusion-0.1.24/frida_fusion/libs/database.py +389 -0
- frida_fusion-0.1.24/frida_fusion/libs/helpers.js +533 -0
- frida_fusion-0.1.24/frida_fusion/libs/logger.py +225 -0
- frida_fusion-0.1.24/frida_fusion/libs/scriptlocation.py +39 -0
- frida_fusion-0.1.24/frida_fusion/module.py +357 -0
- frida_fusion-0.1.24/frida_fusion/modules/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/android_setings/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/android_setings/settings.js +172 -0
- frida_fusion-0.1.24/frida_fusion/modules/android_setings/settings.py +110 -0
- frida_fusion-0.1.24/frida_fusion/modules/crypto/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/crypto/crypto.js +701 -0
- frida_fusion-0.1.24/frida_fusion/modules/crypto/crypto.py +600 -0
- frida_fusion-0.1.24/frida_fusion/modules/hermes_injector/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/hermes_injector/hermes_hook.js +36 -0
- frida_fusion-0.1.24/frida_fusion/modules/hermes_injector/hermes_injector.js +191 -0
- frida_fusion-0.1.24/frida_fusion/modules/hermes_injector/hermes_injector.py +89 -0
- frida_fusion-0.1.24/frida_fusion/modules/log/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/log/log.js +83 -0
- frida_fusion-0.1.24/frida_fusion/modules/log/log.py +75 -0
- frida_fusion-0.1.24/frida_fusion/modules/okhttp_logging/okhttp-logging.js +1584 -0
- frida_fusion-0.1.24/frida_fusion/modules/okhttp_logging/okhttp-logging.py +134 -0
- frida_fusion-0.1.24/frida_fusion/modules/reflection/reflection-stalker.js +293 -0
- frida_fusion-0.1.24/frida_fusion/modules/reflection/reflection-stalker.py +206 -0
- frida_fusion-0.1.24/frida_fusion/modules/shared_preferences/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/shared_preferences/shared_preferences.js +448 -0
- frida_fusion-0.1.24/frida_fusion/modules/shared_preferences/shared_preferences.py +179 -0
- frida_fusion-0.1.24/frida_fusion/modules/tls_unpinning/__init__.py +0 -0
- frida_fusion-0.1.24/frida_fusion/modules/tls_unpinning/frida_multiple_unpinning.py +61 -0
- frida_fusion-0.1.24/frida_fusion.egg-info/PKG-INFO +192 -0
- frida_fusion-0.1.24/frida_fusion.egg-info/SOURCES.txt +47 -0
- frida_fusion-0.1.24/frida_fusion.egg-info/dependency_links.txt +1 -0
- frida_fusion-0.1.24/frida_fusion.egg-info/entry_points.txt +3 -0
- frida_fusion-0.1.24/frida_fusion.egg-info/requires.txt +4 -0
- frida_fusion-0.1.24/frida_fusion.egg-info/top_level.txt +1 -0
- frida_fusion-0.1.24/pyproject.toml +77 -0
- frida_fusion-0.1.24/setup.cfg +4 -0
- frida_fusion-0.1.24/setup.py +7 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022, Helvio Junior
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: frida-fusion
|
|
3
|
+
Version: 0.1.24
|
|
4
|
+
Summary: Hook your mobile tests with Frida
|
|
5
|
+
Author-email: "Helvio Junior (M4v3r1ck)" <helvio_junior@hotmail.com>
|
|
6
|
+
Maintainer-email: "Helvio Junior (M4v3r1ck)" <helvio_junior@hotmail.com>
|
|
7
|
+
Project-URL: Documentation, https://github.com/helviojunior/frida-fusion
|
|
8
|
+
Project-URL: Source, https://github.com/helviojunior/frida-fusion
|
|
9
|
+
Project-URL: Tracker, https://github.com/helviojunior/frida-fusion
|
|
10
|
+
Project-URL: Author, https://github.com/helviojunior
|
|
11
|
+
Keywords: Frida Fusion,Frida,Frida Scripts,development,red team
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
25
|
+
Classifier: Topic :: Security
|
|
26
|
+
Classifier: Topic :: Utilities
|
|
27
|
+
Requires-Python: <4,>=3.9
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: colorama
|
|
31
|
+
Requires-Dist: requests>=2.23.0
|
|
32
|
+
Requires-Dist: frida>=15.1.17
|
|
33
|
+
Requires-Dist: frida-tools>=10.8.0
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# Frida Fusion
|
|
37
|
+
<img src="./fusion_logo.svg" alt="Frida Fusion logo" align="right" width="20%"/>
|
|
38
|
+
|
|
39
|
+
Hook your mobile tests with Frida.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
[ FRIDA ]—o—( FUSION )—o—[ MOBILE TESTS ] // v0.1.0
|
|
43
|
+
> hook your mobile tests with Frida
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
optional arguments:
|
|
47
|
+
-h, --help show this help message and exit
|
|
48
|
+
|
|
49
|
+
Device selector:
|
|
50
|
+
-D [ID], --device [ID] Connect to device with the given ID
|
|
51
|
+
-U, --usb Connect to USB device
|
|
52
|
+
-R, --remote Connect to remote frida-server
|
|
53
|
+
-H [HOST], --host [HOST] Connect to remote frida-server on HOS
|
|
54
|
+
|
|
55
|
+
Application selector:
|
|
56
|
+
-f [APP ID], --package [APP ID] Spawn application ID
|
|
57
|
+
-p [PID], --attach-pid [PID] Spawn application ID
|
|
58
|
+
|
|
59
|
+
General Setting:
|
|
60
|
+
-s [path], --script-path [path] JS File path or directory with Frida script
|
|
61
|
+
--delay-injection Delay script injection
|
|
62
|
+
--show-time Display time
|
|
63
|
+
-o [output file] Save output to disk (default: none)
|
|
64
|
+
-l [level], --min-level [level] Minimum log level to be displayed (V,D,I,W,E,F) (default: I)
|
|
65
|
+
|
|
66
|
+
Modules:
|
|
67
|
+
--list-modules List available modules
|
|
68
|
+
-m ENABLED_MODULES, --module ENABLED_MODULES Enabled module by name. You can specify multiple values repeating the flag.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Install
|
|
72
|
+
|
|
73
|
+
### Via PIPX
|
|
74
|
+
|
|
75
|
+
> We recommend install using PIPX
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
sudo apt install pipx
|
|
79
|
+
|
|
80
|
+
pipx install frida-fusion
|
|
81
|
+
pipx inject frida-fusion frida==15.1.17 frida-tools==10.8.0
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> Note: If you face the error `unable to communicate with remote frida-server; please ensure that major versions match and that the remote Frida has the feature you are trying to use` try to adjust the frida version
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Regular instalation
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
pip3 install frida-fusion
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Custom Frida script
|
|
94
|
+
|
|
95
|
+
You must provide a custom Frida script as usual. To do this you must provide `-s/--script-path` parameter.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Just one file
|
|
99
|
+
frida-fusion -f [app_id] -U --script-path mytest.js
|
|
100
|
+
|
|
101
|
+
# A entire directory
|
|
102
|
+
frida-fusion -f [app_id] -U --script-path /tmp/scripts
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Exposed JavaScript (frida) functions
|
|
106
|
+
|
|
107
|
+
The Frida Fusion define/expose several functions to be used at frida scripts. Follows the typedef of these functions.
|
|
108
|
+
|
|
109
|
+
```java
|
|
110
|
+
# Send message/data to Frida-Fusion
|
|
111
|
+
void fusion_sendMessage(String level, String message);
|
|
112
|
+
void fusion_sendError(Error error);
|
|
113
|
+
void fusion_sendMessageWithTrace(String level, String message);
|
|
114
|
+
void fusion_sendKeyValueData(String module, Object items);
|
|
115
|
+
|
|
116
|
+
# Print StackTrace
|
|
117
|
+
void fusion_printStackTrace();
|
|
118
|
+
|
|
119
|
+
# Print all methods of class 'name'
|
|
120
|
+
void fusion_printMethods(String name);
|
|
121
|
+
|
|
122
|
+
# Get value of a field inside an class instance
|
|
123
|
+
Object fusion_getFieldValue(Object obj, String fieldName);
|
|
124
|
+
|
|
125
|
+
# Wait until the class 'name' exists in memory to execute the callback function
|
|
126
|
+
void fusion_waitForClass(String name, CallbackFunction onReady)
|
|
127
|
+
|
|
128
|
+
# Conversions
|
|
129
|
+
String fusion_stringToBase64(String message);
|
|
130
|
+
String fusion_bytesToBase64(byte[] byteArray);
|
|
131
|
+
String fusion_encodeHex(byte[] byteArray);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Module engine
|
|
135
|
+
|
|
136
|
+
You can check available modules with `frida-fusion --list-modules` command.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
frida-fusion --list-modules
|
|
140
|
+
|
|
141
|
+
[ FRIDA ]—o—( FUSION )—o—[ MOBILE TESTS ] // v0.1.4
|
|
142
|
+
> hook your mobile tests with Frida
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
Available modules
|
|
146
|
+
Module Name : Description
|
|
147
|
+
Crypto : Hook cryptography/hashing functions
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### External modules
|
|
151
|
+
|
|
152
|
+
You can develop or download community modules and load into frida-fusion.
|
|
153
|
+
|
|
154
|
+
To pass to the Frida Fusion the external module path you can use the environment variable `FUSION_MODULES` with the full path of modules
|
|
155
|
+
|
|
156
|
+
At linux:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
export FUSION_MODULES=/tmp/modules
|
|
160
|
+
|
|
161
|
+
# List all modules
|
|
162
|
+
frida-fusion --list-modules
|
|
163
|
+
|
|
164
|
+
# Using available module
|
|
165
|
+
frida-fusion -f [app_id] -U --script-path mytest.js -m [module_name]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
At windows:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
$env:FUSION_MODULES = "C:\extra_mods"
|
|
172
|
+
|
|
173
|
+
# List all modules
|
|
174
|
+
frida-fusion --list-modules
|
|
175
|
+
|
|
176
|
+
# Using available module
|
|
177
|
+
frida-fusion -f [app_id] -U --script-path mytest.js -m [module_name]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Community modules
|
|
181
|
+
|
|
182
|
+
You can also use one of community developed modules
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
cd /opt/
|
|
186
|
+
git clone https://github.com/helviojunior/frida-fusion-community-modules
|
|
187
|
+
export FUSION_MODULES=/opt/frida-fusion-community-modules
|
|
188
|
+
|
|
189
|
+
# List all modules
|
|
190
|
+
frida-fusion --list-modules
|
|
191
|
+
```
|
|
192
|
+
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Frida Fusion
|
|
2
|
+
<img src="./fusion_logo.svg" alt="Frida Fusion logo" align="right" width="20%"/>
|
|
3
|
+
|
|
4
|
+
Hook your mobile tests with Frida.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
[ FRIDA ]—o—( FUSION )—o—[ MOBILE TESTS ] // v0.1.0
|
|
8
|
+
> hook your mobile tests with Frida
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
optional arguments:
|
|
12
|
+
-h, --help show this help message and exit
|
|
13
|
+
|
|
14
|
+
Device selector:
|
|
15
|
+
-D [ID], --device [ID] Connect to device with the given ID
|
|
16
|
+
-U, --usb Connect to USB device
|
|
17
|
+
-R, --remote Connect to remote frida-server
|
|
18
|
+
-H [HOST], --host [HOST] Connect to remote frida-server on HOS
|
|
19
|
+
|
|
20
|
+
Application selector:
|
|
21
|
+
-f [APP ID], --package [APP ID] Spawn application ID
|
|
22
|
+
-p [PID], --attach-pid [PID] Spawn application ID
|
|
23
|
+
|
|
24
|
+
General Setting:
|
|
25
|
+
-s [path], --script-path [path] JS File path or directory with Frida script
|
|
26
|
+
--delay-injection Delay script injection
|
|
27
|
+
--show-time Display time
|
|
28
|
+
-o [output file] Save output to disk (default: none)
|
|
29
|
+
-l [level], --min-level [level] Minimum log level to be displayed (V,D,I,W,E,F) (default: I)
|
|
30
|
+
|
|
31
|
+
Modules:
|
|
32
|
+
--list-modules List available modules
|
|
33
|
+
-m ENABLED_MODULES, --module ENABLED_MODULES Enabled module by name. You can specify multiple values repeating the flag.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
### Via PIPX
|
|
39
|
+
|
|
40
|
+
> We recommend install using PIPX
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
sudo apt install pipx
|
|
44
|
+
|
|
45
|
+
pipx install frida-fusion
|
|
46
|
+
pipx inject frida-fusion frida==15.1.17 frida-tools==10.8.0
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> Note: If you face the error `unable to communicate with remote frida-server; please ensure that major versions match and that the remote Frida has the feature you are trying to use` try to adjust the frida version
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Regular instalation
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
pip3 install frida-fusion
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Custom Frida script
|
|
59
|
+
|
|
60
|
+
You must provide a custom Frida script as usual. To do this you must provide `-s/--script-path` parameter.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Just one file
|
|
64
|
+
frida-fusion -f [app_id] -U --script-path mytest.js
|
|
65
|
+
|
|
66
|
+
# A entire directory
|
|
67
|
+
frida-fusion -f [app_id] -U --script-path /tmp/scripts
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Exposed JavaScript (frida) functions
|
|
71
|
+
|
|
72
|
+
The Frida Fusion define/expose several functions to be used at frida scripts. Follows the typedef of these functions.
|
|
73
|
+
|
|
74
|
+
```java
|
|
75
|
+
# Send message/data to Frida-Fusion
|
|
76
|
+
void fusion_sendMessage(String level, String message);
|
|
77
|
+
void fusion_sendError(Error error);
|
|
78
|
+
void fusion_sendMessageWithTrace(String level, String message);
|
|
79
|
+
void fusion_sendKeyValueData(String module, Object items);
|
|
80
|
+
|
|
81
|
+
# Print StackTrace
|
|
82
|
+
void fusion_printStackTrace();
|
|
83
|
+
|
|
84
|
+
# Print all methods of class 'name'
|
|
85
|
+
void fusion_printMethods(String name);
|
|
86
|
+
|
|
87
|
+
# Get value of a field inside an class instance
|
|
88
|
+
Object fusion_getFieldValue(Object obj, String fieldName);
|
|
89
|
+
|
|
90
|
+
# Wait until the class 'name' exists in memory to execute the callback function
|
|
91
|
+
void fusion_waitForClass(String name, CallbackFunction onReady)
|
|
92
|
+
|
|
93
|
+
# Conversions
|
|
94
|
+
String fusion_stringToBase64(String message);
|
|
95
|
+
String fusion_bytesToBase64(byte[] byteArray);
|
|
96
|
+
String fusion_encodeHex(byte[] byteArray);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Module engine
|
|
100
|
+
|
|
101
|
+
You can check available modules with `frida-fusion --list-modules` command.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
frida-fusion --list-modules
|
|
105
|
+
|
|
106
|
+
[ FRIDA ]—o—( FUSION )—o—[ MOBILE TESTS ] // v0.1.4
|
|
107
|
+
> hook your mobile tests with Frida
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Available modules
|
|
111
|
+
Module Name : Description
|
|
112
|
+
Crypto : Hook cryptography/hashing functions
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### External modules
|
|
116
|
+
|
|
117
|
+
You can develop or download community modules and load into frida-fusion.
|
|
118
|
+
|
|
119
|
+
To pass to the Frida Fusion the external module path you can use the environment variable `FUSION_MODULES` with the full path of modules
|
|
120
|
+
|
|
121
|
+
At linux:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
export FUSION_MODULES=/tmp/modules
|
|
125
|
+
|
|
126
|
+
# List all modules
|
|
127
|
+
frida-fusion --list-modules
|
|
128
|
+
|
|
129
|
+
# Using available module
|
|
130
|
+
frida-fusion -f [app_id] -U --script-path mytest.js -m [module_name]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
At windows:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
$env:FUSION_MODULES = "C:\extra_mods"
|
|
137
|
+
|
|
138
|
+
# List all modules
|
|
139
|
+
frida-fusion --list-modules
|
|
140
|
+
|
|
141
|
+
# Using available module
|
|
142
|
+
frida-fusion -f [app_id] -U --script-path mytest.js -m [module_name]
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Community modules
|
|
146
|
+
|
|
147
|
+
You can also use one of community developed modules
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
cd /opt/
|
|
151
|
+
git clone https://github.com/helviojunior/frida-fusion-community-modules
|
|
152
|
+
export FUSION_MODULES=/opt/frida-fusion-community-modules
|
|
153
|
+
|
|
154
|
+
# List all modules
|
|
155
|
+
frida-fusion --list-modules
|
|
156
|
+
```
|
|
157
|
+
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
__version__ = '0.1.24'
|
|
2
|
+
__title__ = "Frida Fusion"
|
|
3
|
+
__description__ = "📱 frida-fusion - runtime mobile exploration"
|
|
4
|
+
__url__ = "https://github.com/helviojunior/frida-fusion"
|
|
5
|
+
__build__ = 0xf971bfd
|
|
6
|
+
__author__ = "Helvio Junior (M4v3r1ck)"
|
|
7
|
+
__author_email__ = "helvio_junior@hotmail.com"
|
|
8
|
+
__license__ = "GPL-3.0"
|
|
9
|
+
__copyright__ = "Copyright Helvio Junior"
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
# -*- coding: UTF-8 -*-
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
from .libs.color import Color
|
|
8
|
+
from .__meta__ import __description__
|
|
9
|
+
from .module import ModuleManager
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Arguments(object):
|
|
13
|
+
''' Holds arguments used by the Frida Fusion '''
|
|
14
|
+
restore = False
|
|
15
|
+
|
|
16
|
+
def __init__(self, custom_args=''):
|
|
17
|
+
self.verbose = any(['-v' in word for word in sys.argv])
|
|
18
|
+
self.restore = any(['-R' in word for word in sys.argv])
|
|
19
|
+
self.args = self.get_arguments(custom_args)
|
|
20
|
+
|
|
21
|
+
def _verbose(self, msg):
|
|
22
|
+
if self.verbose:
|
|
23
|
+
return Color.s(msg)
|
|
24
|
+
else:
|
|
25
|
+
return argparse.SUPPRESS
|
|
26
|
+
|
|
27
|
+
def get_arguments(self, custom_args=''):
|
|
28
|
+
''' Returns parser.args() containing all program arguments '''
|
|
29
|
+
|
|
30
|
+
parser = argparse.ArgumentParser(
|
|
31
|
+
usage=argparse.SUPPRESS,
|
|
32
|
+
formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=80,
|
|
33
|
+
width=130)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
device_group = parser.add_argument_group('Device selector')
|
|
37
|
+
self._add_device_args(device_group)
|
|
38
|
+
|
|
39
|
+
app_group = parser.add_argument_group('Application selector')
|
|
40
|
+
self._add_app_args(app_group)
|
|
41
|
+
|
|
42
|
+
glob = parser.add_argument_group('General Setting')
|
|
43
|
+
self._add_global_args(glob)
|
|
44
|
+
|
|
45
|
+
modules_group = parser.add_argument_group('Modules')
|
|
46
|
+
self._add_modules_args(modules_group)
|
|
47
|
+
|
|
48
|
+
# Add module args
|
|
49
|
+
for mod in self._get_requested_module_list():
|
|
50
|
+
flags = parser.add_argument_group(f'{mod.name} Flags')
|
|
51
|
+
mod.create_instance().add_params(flags)
|
|
52
|
+
|
|
53
|
+
return parser.parse_args()
|
|
54
|
+
|
|
55
|
+
def _get_requested_module_list(self):
|
|
56
|
+
mods = ModuleManager.list_modules()
|
|
57
|
+
parser = argparse.ArgumentParser()
|
|
58
|
+
parser.add_argument('-m',
|
|
59
|
+
'--module',
|
|
60
|
+
action='append',
|
|
61
|
+
dest='enabled_modules')
|
|
62
|
+
|
|
63
|
+
t_args, _ = parser.parse_known_args([
|
|
64
|
+
word
|
|
65
|
+
for word in sys.argv
|
|
66
|
+
if word != "-h" and word != "--list-modules"
|
|
67
|
+
])
|
|
68
|
+
if t_args is None or t_args.enabled_modules is None:
|
|
69
|
+
return []
|
|
70
|
+
return [
|
|
71
|
+
m
|
|
72
|
+
for md in t_args.enabled_modules
|
|
73
|
+
for mn in md.split(",")
|
|
74
|
+
if mn.strip() != ""
|
|
75
|
+
for _, m in mods.items()
|
|
76
|
+
if m.safe_name() == mn.lower()
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
def _add_app_args(self, app):
|
|
80
|
+
app.add_argument('-f',
|
|
81
|
+
'--package',
|
|
82
|
+
dest='app_id',
|
|
83
|
+
metavar='[APP ID]',
|
|
84
|
+
required=False,
|
|
85
|
+
default=None,
|
|
86
|
+
help='Spawn application ID')
|
|
87
|
+
|
|
88
|
+
app.add_argument('-p',
|
|
89
|
+
'--attach-pid',
|
|
90
|
+
dest='pid',
|
|
91
|
+
metavar='[PID]',
|
|
92
|
+
default=0,
|
|
93
|
+
required=False,
|
|
94
|
+
type=int,
|
|
95
|
+
help='Spawn application ID')
|
|
96
|
+
|
|
97
|
+
def _add_device_args(self, device):
|
|
98
|
+
device.add_argument('-D',
|
|
99
|
+
'--device',
|
|
100
|
+
dest='device_id',
|
|
101
|
+
metavar='[ID]',
|
|
102
|
+
type=str,
|
|
103
|
+
required=False,
|
|
104
|
+
default=None,
|
|
105
|
+
help='Connect to device with the given ID')
|
|
106
|
+
|
|
107
|
+
device.add_argument('-U',
|
|
108
|
+
'--usb',
|
|
109
|
+
action='store_true',
|
|
110
|
+
dest='use_usb',
|
|
111
|
+
default=False,
|
|
112
|
+
required=False,
|
|
113
|
+
help='Connect to USB device')
|
|
114
|
+
|
|
115
|
+
device.add_argument('-R',
|
|
116
|
+
'--remote',
|
|
117
|
+
action='store_true',
|
|
118
|
+
dest='use_remote',
|
|
119
|
+
default=False,
|
|
120
|
+
required=False,
|
|
121
|
+
help='Connect to remote frida-server')
|
|
122
|
+
|
|
123
|
+
device.add_argument('-H',
|
|
124
|
+
'--host',
|
|
125
|
+
dest='remote_host',
|
|
126
|
+
metavar='[HOST]',
|
|
127
|
+
type=str,
|
|
128
|
+
required=False,
|
|
129
|
+
default=None,
|
|
130
|
+
help='Connect to remote frida-server on HOS')
|
|
131
|
+
|
|
132
|
+
def _add_global_args(self, glob):
|
|
133
|
+
glob.add_argument('-s',
|
|
134
|
+
'--script-path',
|
|
135
|
+
dest='frida_scripts',
|
|
136
|
+
default=None,
|
|
137
|
+
metavar='[path]',
|
|
138
|
+
type=str,
|
|
139
|
+
help='JS File path or directory with Frida script')
|
|
140
|
+
|
|
141
|
+
glob.add_argument('--delay-injection',
|
|
142
|
+
action='store_true',
|
|
143
|
+
dest='delay',
|
|
144
|
+
default=False,
|
|
145
|
+
help='Delay script injection')
|
|
146
|
+
|
|
147
|
+
glob.add_argument('--show-time',
|
|
148
|
+
action='store_true',
|
|
149
|
+
dest='show_time',
|
|
150
|
+
default=False,
|
|
151
|
+
help='Display time')
|
|
152
|
+
|
|
153
|
+
glob.add_argument('-o',
|
|
154
|
+
action='store',
|
|
155
|
+
dest='out_file',
|
|
156
|
+
metavar='[output file]',
|
|
157
|
+
type=str,
|
|
158
|
+
help=Color.s('Save output to disk (default: {G}none{W})'))
|
|
159
|
+
|
|
160
|
+
glob.add_argument('-l',
|
|
161
|
+
'--min-level',
|
|
162
|
+
action='store',
|
|
163
|
+
dest='debug_level',
|
|
164
|
+
metavar='[level]',
|
|
165
|
+
type=str,
|
|
166
|
+
default='I',
|
|
167
|
+
help=Color.s('Minimum log level to be displayed (V,D,I,W,E,F) (default: {G}I{W})'))
|
|
168
|
+
|
|
169
|
+
def _add_modules_args(self, modules):
|
|
170
|
+
modules.add_argument('--list-modules',
|
|
171
|
+
action='store_true',
|
|
172
|
+
default=False,
|
|
173
|
+
dest='list_modules',
|
|
174
|
+
help=Color.s('List available modules'))
|
|
175
|
+
|
|
176
|
+
modules.add_argument('-m',
|
|
177
|
+
'--module',
|
|
178
|
+
action='append',
|
|
179
|
+
dest='enabled_modules',
|
|
180
|
+
help='Enabled module by name. You can specify multiple values repeating the flag.')
|
|
181
|
+
|
|
182
|
+
modules.add_argument('--silence-module-messages',
|
|
183
|
+
action='append',
|
|
184
|
+
dest='ignore_messages_modules',
|
|
185
|
+
help='Silence messages becaming from module by name. You can specify multiple values repeating the flag.')
|
|
186
|
+
|