AndroidFridaManager 1.7.9__py3-none-any.whl → 1.8.2__py3-none-any.whl
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.
- AndroidFridaManager/FridaManager.py +18 -12
- AndroidFridaManager/about.py +1 -1
- AndroidFridaManager/job.py +1 -1
- AndroidFridaManager/job_manager.py +5 -3
- {AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info}/METADATA +15 -3
- androidfridamanager-1.8.2.dist-info/RECORD +11 -0
- {AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info}/WHEEL +1 -1
- AndroidFridaManager-1.7.9.dist-info/RECORD +0 -11
- {AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info}/entry_points.txt +0 -0
- {AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info/licenses}/LICENSE +0 -0
- {AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info}/top_level.txt +0 -0
|
@@ -15,8 +15,6 @@ from shutil import copyfile
|
|
|
15
15
|
import tempfile
|
|
16
16
|
import argparse
|
|
17
17
|
|
|
18
|
-
warnings.filterwarnings("error")
|
|
19
|
-
|
|
20
18
|
# some parts are taken from ttps://github.com/Mind0xP/Frida-Python-Binding/
|
|
21
19
|
|
|
22
20
|
class FridaManager():
|
|
@@ -44,7 +42,7 @@ class FridaManager():
|
|
|
44
42
|
self.logger = logging.getLogger(__name__)
|
|
45
43
|
|
|
46
44
|
if self.is_remote:
|
|
47
|
-
frida.get_device_manager().add_remote_device(self.
|
|
45
|
+
frida.get_device_manager().add_remote_device(self.device_socket)
|
|
48
46
|
|
|
49
47
|
|
|
50
48
|
def _setup_logging(self):
|
|
@@ -77,6 +75,12 @@ class FridaManager():
|
|
|
77
75
|
|
|
78
76
|
|
|
79
77
|
def run_frida_server(self, frida_server_path="/data/local/tmp/"):
|
|
78
|
+
# Check if frida-server is already running
|
|
79
|
+
if self.is_frida_server_running():
|
|
80
|
+
if self.verbose:
|
|
81
|
+
self.logger.info("[*] frida-server is already running, skipping start")
|
|
82
|
+
return
|
|
83
|
+
|
|
80
84
|
if frida_server_path is self.run_frida_server.__defaults__[0]:
|
|
81
85
|
cmd = self.frida_install_dst + "frida-server &"
|
|
82
86
|
else:
|
|
@@ -225,13 +229,15 @@ class FridaManager():
|
|
|
225
229
|
try:
|
|
226
230
|
res = requests.get(url)
|
|
227
231
|
except requests.exceptions.RequestException as e:
|
|
228
|
-
self.logger.error("
|
|
229
|
-
|
|
232
|
+
self.logger.error(f"Error making request to {url}: {e}")
|
|
233
|
+
raise RuntimeError(f"Failed to fetch Frida release information: {e}")
|
|
230
234
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
with warnings.catch_warnings():
|
|
236
|
+
warnings.simplefilter("ignore", SyntaxWarning)
|
|
237
|
+
try:
|
|
238
|
+
frida_server_path = re.findall(r'\/download\/\d+\.\d+\.\d+\/frida\-server\-\d+\.\d+\.\d+\-android\-'+arch+'\.xz',res.text)
|
|
239
|
+
except SyntaxWarning:
|
|
240
|
+
frida_server_path = re.findall(r'/download/\d+\.\d+\.\d+/frida-server-\d+\.\d+\.\d+-android-' + arch + r'\.xz', res.text)
|
|
235
241
|
|
|
236
242
|
final_url = frida_download_prefix + frida_server_path[0]
|
|
237
243
|
|
|
@@ -245,7 +251,7 @@ class FridaManager():
|
|
|
245
251
|
return final_url
|
|
246
252
|
|
|
247
253
|
|
|
248
|
-
def make_frida_server_executable(self, frida_server_path="/data/
|
|
254
|
+
def make_frida_server_executable(self, frida_server_path="/data/local/tmp/"):
|
|
249
255
|
if frida_server_path is self.make_frida_server_executable.__defaults__[0]:
|
|
250
256
|
cmd = self.frida_install_dst + "frida-server"
|
|
251
257
|
else:
|
|
@@ -264,8 +270,8 @@ class FridaManager():
|
|
|
264
270
|
|
|
265
271
|
def run_adb_command_as_root(self,command):
|
|
266
272
|
if self.adb_check_root() == False:
|
|
267
|
-
self.logger.error("
|
|
268
|
-
|
|
273
|
+
self.logger.error("Device is not rooted. Please root it before using FridaAndroidManager and ensure that you are able to run commands with the su-binary.")
|
|
274
|
+
raise RuntimeError("Device not rooted or su binary not accessible")
|
|
269
275
|
|
|
270
276
|
if self.is_magisk_mode:
|
|
271
277
|
output = subprocess.run(['adb', 'shell','su -c '+command], capture_output=True, text=True)
|
AndroidFridaManager/about.py
CHANGED
AndroidFridaManager/job.py
CHANGED
|
@@ -45,7 +45,7 @@ class Job:
|
|
|
45
45
|
self.script.on("message", self.wrap_custom_hooking_handler_with_job_id(self.custom_hooking_handler))
|
|
46
46
|
self.script.load()
|
|
47
47
|
self.state = "running"
|
|
48
|
-
print("[+] hooks
|
|
48
|
+
print("[+] hooks successfully loaded")
|
|
49
49
|
|
|
50
50
|
#if self.is_running_as_thread:
|
|
51
51
|
# Keep the thread alive to handle messages until stop_event is set
|
|
@@ -256,7 +256,7 @@ class JobManager(object):
|
|
|
256
256
|
if job_id in self.jobs:
|
|
257
257
|
return self.jobs[job_id]
|
|
258
258
|
else:
|
|
259
|
-
raise ValueError(f"Job
|
|
259
|
+
raise ValueError(f"Job with ID {job_id} not found.")
|
|
260
260
|
|
|
261
261
|
|
|
262
262
|
def detach_from_app(self):
|
|
@@ -299,13 +299,15 @@ class JobManager(object):
|
|
|
299
299
|
# to handle forks
|
|
300
300
|
def on_child_added(child):
|
|
301
301
|
print(f"Attached to child process with pid {child.pid}")
|
|
302
|
-
self.first_instrumenation_script
|
|
302
|
+
if callable(self.first_instrumenation_script):
|
|
303
|
+
self.first_instrumenation_script(device.attach(child.pid))
|
|
303
304
|
device.resume(child.pid)
|
|
304
305
|
|
|
305
306
|
# if the target process is starting another process
|
|
306
307
|
def on_spawn_added(spawn):
|
|
307
308
|
print(f"Process spawned with pid {spawn.pid}. Name: {spawn.identifier}")
|
|
308
|
-
self.first_instrumenation_script
|
|
309
|
+
if callable(self.first_instrumenation_script):
|
|
310
|
+
self.first_instrumenation_script(device.attach(spawn.pid))
|
|
309
311
|
device.resume(spawn.pid)
|
|
310
312
|
|
|
311
313
|
device.on("child_added", on_child_added)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: AndroidFridaManager
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.2
|
|
4
4
|
Summary: A python API in order to install and run the frida-server on an Android device.
|
|
5
5
|
Home-page: https://github.com/fkie-cad/AndroidFridaManager
|
|
6
6
|
Author: Daniel Baier
|
|
@@ -17,9 +17,21 @@ Classifier: Topic :: Software Development :: Debuggers
|
|
|
17
17
|
Requires-Python: >=3.6
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: frida
|
|
20
|
+
Requires-Dist: frida>=15.0.0
|
|
21
21
|
Requires-Dist: colorlog
|
|
22
22
|
Requires-Dist: requests
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: author-email
|
|
25
|
+
Dynamic: classifier
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: home-page
|
|
29
|
+
Dynamic: keywords
|
|
30
|
+
Dynamic: license
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
Dynamic: requires-dist
|
|
33
|
+
Dynamic: requires-python
|
|
34
|
+
Dynamic: summary
|
|
23
35
|
|
|
24
36
|
[](https://badge.fury.io/py/AndroidFridaManager)
|
|
25
37
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
AndroidFridaManager/FridaManager.py,sha256=tuDTZQ9maNBkobw2-qJtWPM3bhUQZH7eKPXG5XAKPks,13837
|
|
2
|
+
AndroidFridaManager/__init__.py,sha256=T6AKtrGSLQ9M5bJoWDQcsRTJbSEbksdgrx3AAAdozRI,171
|
|
3
|
+
AndroidFridaManager/about.py,sha256=z1dlTh519qWYEK_J_iuyx6_2eEzRI_pdKsVpVgi_DLA,98
|
|
4
|
+
AndroidFridaManager/job.py,sha256=QTSNjdV7XqawSTV19HQt53aiwoT3UaQeQw2K4AWPxY8,3265
|
|
5
|
+
AndroidFridaManager/job_manager.py,sha256=icdNlfqorEM3XVw4h_83IcoupEFDlkzb29VhEZ6dxrQ,12294
|
|
6
|
+
androidfridamanager-1.8.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
+
androidfridamanager-1.8.2.dist-info/METADATA,sha256=serVQrmt0u7xH5F8wYqBQ1NOMMRqT4g_cvn5vnxT8mc,4886
|
|
8
|
+
androidfridamanager-1.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
androidfridamanager-1.8.2.dist-info/entry_points.txt,sha256=GmNngu2fDNCxUcquFRegBa7GWknPKG1jsM4lvWeyKnY,64
|
|
10
|
+
androidfridamanager-1.8.2.dist-info/top_level.txt,sha256=oH2lVMSRlghmt-_tVrOEUqvY462P9hd5Ktgp5-1qF3o,20
|
|
11
|
+
androidfridamanager-1.8.2.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
AndroidFridaManager/FridaManager.py,sha256=jxoqFGUwkBTYee7DEYAxo_-qk06DCQa8U9i9OZxAc5M,13381
|
|
2
|
-
AndroidFridaManager/__init__.py,sha256=T6AKtrGSLQ9M5bJoWDQcsRTJbSEbksdgrx3AAAdozRI,171
|
|
3
|
-
AndroidFridaManager/about.py,sha256=_5RG2s3Y8tV5jnC9LpY8sCOQuLsL8NxR2vl90rx4c3s,97
|
|
4
|
-
AndroidFridaManager/job.py,sha256=NWgU7RzheNfEazL8CcmAIoVwylTdEDNbTPqmiAY7ZhY,3264
|
|
5
|
-
AndroidFridaManager/job_manager.py,sha256=f4ByEiAU8I6JUz7eNrdk8hnaD9VUJW3D-dtX79eEu68,12164
|
|
6
|
-
AndroidFridaManager-1.7.9.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
-
AndroidFridaManager-1.7.9.dist-info/METADATA,sha256=AEvdZVQXypMKZfhsBEmBPVHFS-44BEEJp5BJMqUHWRM,4633
|
|
8
|
-
AndroidFridaManager-1.7.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
9
|
-
AndroidFridaManager-1.7.9.dist-info/entry_points.txt,sha256=GmNngu2fDNCxUcquFRegBa7GWknPKG1jsM4lvWeyKnY,64
|
|
10
|
-
AndroidFridaManager-1.7.9.dist-info/top_level.txt,sha256=oH2lVMSRlghmt-_tVrOEUqvY462P9hd5Ktgp5-1qF3o,20
|
|
11
|
-
AndroidFridaManager-1.7.9.dist-info/RECORD,,
|
{AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{AndroidFridaManager-1.7.9.dist-info → androidfridamanager-1.8.2.dist-info/licenses}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|