Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote device support #22

Open
zehuanncc opened this issue Apr 2, 2019 · 2 comments
Open

Remote device support #22

zehuanncc opened this issue Apr 2, 2019 · 2 comments

Comments

@zehuanncc
Copy link

I'm not sure if it's by design but House doesn't support remote device (via TCP) yet.

My case was that I had to connect to a phone with Frida server listening on an internal IP address. It may sound weird but the phone was shared for testing and it's not USB connected to my laptop, so I had to modify some codes for a quick workaround:

  1. To register the remote device in device manager: house_global.device_manager.add_remote_device('[Phone_IP]')
    (I just hardcoded the IP). I added this in houseSock.py.

  2. To get the device: replace house_global.device = frida.get_usb_device() with house_global.device = house_global.device_manager.enumerate_devices()[-1] (Yes hardcoding again).

There's definitely a better way to implement this. I just wonder if there's any future plan on supporting the remote devices?

@zehuanncc
Copy link
Author

Diff below:

diff --git a/app.py b/app.py
index fe2480e..6267f43 100644
--- a/app.py
+++ b/app.py
@@ -107,7 +107,7 @@ def hook_clear():
 
 @app.route('/hook', methods=['POST'])
 def hook():
-    house_global.device = frida.get_usb_device()
+    house_global.device = house_global.device_manager.enumerate_devices()[-1]
     class_name = str(request.form.get('classname'))
     method_name = str(request.form.get('methodname')) 
     if (method_name != 'None') & (class_name != 'None'):
@@ -121,7 +121,7 @@ def hook():
 
 @app.route('/load_script', methods=['POST'])
 def loadscript():
-    house_global.device = frida.get_usb_device()
+    house_global.device = house_global.device_manager.enumerate_devices()[-1]
 
     house_global.script_to_load = str(request.form.get('script'))
     load_script()
diff --git a/houseSock.py b/houseSock.py
index 09c905b..0b16237 100644
--- a/houseSock.py
+++ b/houseSock.py
@@ -382,7 +382,7 @@ def dounloadMonitor():
 @authenticated_only
 def doInspect(message):
 
-    house_global.device = frida.get_usb_device()
+    house_global.device = house_global.device_manager.enumerate_devices()[-1]
 
     house_global.onMessageException = ''
     ins_classname = message.get('ins_classname')
diff --git a/houseUtil.py b/houseUtil.py
index a34646f..64c67ec 100644
--- a/houseUtil.py
+++ b/houseUtil.py
@@ -203,6 +203,10 @@ def getDevice():
         print (stylize("[+] Trying to get device..", Info))
         house_global.device_dict = {}
         house_global.device_manager = frida.get_device_manager()
+        try:
+            house_global.device_manager.add_remote_device('192.168.XX.XX')
+        except:
+            pass
         device_list = house_global.device_manager.enumerate_devices()
         if len(device_list) != 0:
             remote_device_list = []

@freeload101
Copy link

Does this still work ? I would like to use NOX app player would it work for this ? it uses the Intel HAXM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants