frida.TransportError: the connection is closed









up vote
0
down vote

favorite












I ran Python 1.py I got the following error:



Traceback (most recent call last):
File "1.py", line 5, in
pid = device.spawn(["com.example.a11x256.frida_test"])
File "/usr/local/lib/python2.7/dist-packages/frida/core.py", line 98, in spawn
return self._impl.spawn(program, argv, envp, env, cwd, stdio, aux_options)
frida.TransportError: the connection is closed


And I have mentioned the result of adb devices in the following:



List of devices attached
emulator-5554 device
192.168.56.101:5555 device


And frida-PS -you is coming in the following



PID Name 
55 adbd
6051 android.process.acore
5968 android.process.media
5877 com.android.browser
5472 com.android.deskclock
6025 com.android.dialer
4386 com.android.inputmethod.latin
4440 com.android.launcher
4423 com.android.phone
6134 com.android.sharedstoragebackup
4529 com.android.smspush
4236 com.android.systemui
5926 com.android.vending
5709 com.example.a11x256.frida_test
6076 com.google.android.gm
4681 com.google.android.gms
.
.
.


The frida works fine but I have some trouble when using automation with Python
and my Python is 2.7 and when I have used python3 with 1.py I got this following error
Traceback (most recent call last):
File "1.py", line 2, in
import frida
ModuleNotFoundError: No module named 'frida'



And my 1.py file is in the following too



#python code
import frida
import time
device = frida.get_usb_device(1)
pid = device.spawn(["com.example.a11x256.frida_test"])
device.resume(pid)
time.sleep(1) #Without it Java.perform silently fails
session = device.attach(pid)
script = session.create_script(open("s1.js").read())
script.load()

#prevent the python script from terminating
raw_input()


Is there any solution?










share|improve this question



























    up vote
    0
    down vote

    favorite












    I ran Python 1.py I got the following error:



    Traceback (most recent call last):
    File "1.py", line 5, in
    pid = device.spawn(["com.example.a11x256.frida_test"])
    File "/usr/local/lib/python2.7/dist-packages/frida/core.py", line 98, in spawn
    return self._impl.spawn(program, argv, envp, env, cwd, stdio, aux_options)
    frida.TransportError: the connection is closed


    And I have mentioned the result of adb devices in the following:



    List of devices attached
    emulator-5554 device
    192.168.56.101:5555 device


    And frida-PS -you is coming in the following



    PID Name 
    55 adbd
    6051 android.process.acore
    5968 android.process.media
    5877 com.android.browser
    5472 com.android.deskclock
    6025 com.android.dialer
    4386 com.android.inputmethod.latin
    4440 com.android.launcher
    4423 com.android.phone
    6134 com.android.sharedstoragebackup
    4529 com.android.smspush
    4236 com.android.systemui
    5926 com.android.vending
    5709 com.example.a11x256.frida_test
    6076 com.google.android.gm
    4681 com.google.android.gms
    .
    .
    .


    The frida works fine but I have some trouble when using automation with Python
    and my Python is 2.7 and when I have used python3 with 1.py I got this following error
    Traceback (most recent call last):
    File "1.py", line 2, in
    import frida
    ModuleNotFoundError: No module named 'frida'



    And my 1.py file is in the following too



    #python code
    import frida
    import time
    device = frida.get_usb_device(1)
    pid = device.spawn(["com.example.a11x256.frida_test"])
    device.resume(pid)
    time.sleep(1) #Without it Java.perform silently fails
    session = device.attach(pid)
    script = session.create_script(open("s1.js").read())
    script.load()

    #prevent the python script from terminating
    raw_input()


    Is there any solution?










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I ran Python 1.py I got the following error:



      Traceback (most recent call last):
      File "1.py", line 5, in
      pid = device.spawn(["com.example.a11x256.frida_test"])
      File "/usr/local/lib/python2.7/dist-packages/frida/core.py", line 98, in spawn
      return self._impl.spawn(program, argv, envp, env, cwd, stdio, aux_options)
      frida.TransportError: the connection is closed


      And I have mentioned the result of adb devices in the following:



      List of devices attached
      emulator-5554 device
      192.168.56.101:5555 device


      And frida-PS -you is coming in the following



      PID Name 
      55 adbd
      6051 android.process.acore
      5968 android.process.media
      5877 com.android.browser
      5472 com.android.deskclock
      6025 com.android.dialer
      4386 com.android.inputmethod.latin
      4440 com.android.launcher
      4423 com.android.phone
      6134 com.android.sharedstoragebackup
      4529 com.android.smspush
      4236 com.android.systemui
      5926 com.android.vending
      5709 com.example.a11x256.frida_test
      6076 com.google.android.gm
      4681 com.google.android.gms
      .
      .
      .


      The frida works fine but I have some trouble when using automation with Python
      and my Python is 2.7 and when I have used python3 with 1.py I got this following error
      Traceback (most recent call last):
      File "1.py", line 2, in
      import frida
      ModuleNotFoundError: No module named 'frida'



      And my 1.py file is in the following too



      #python code
      import frida
      import time
      device = frida.get_usb_device(1)
      pid = device.spawn(["com.example.a11x256.frida_test"])
      device.resume(pid)
      time.sleep(1) #Without it Java.perform silently fails
      session = device.attach(pid)
      script = session.create_script(open("s1.js").read())
      script.load()

      #prevent the python script from terminating
      raw_input()


      Is there any solution?










      share|improve this question















      I ran Python 1.py I got the following error:



      Traceback (most recent call last):
      File "1.py", line 5, in
      pid = device.spawn(["com.example.a11x256.frida_test"])
      File "/usr/local/lib/python2.7/dist-packages/frida/core.py", line 98, in spawn
      return self._impl.spawn(program, argv, envp, env, cwd, stdio, aux_options)
      frida.TransportError: the connection is closed


      And I have mentioned the result of adb devices in the following:



      List of devices attached
      emulator-5554 device
      192.168.56.101:5555 device


      And frida-PS -you is coming in the following



      PID Name 
      55 adbd
      6051 android.process.acore
      5968 android.process.media
      5877 com.android.browser
      5472 com.android.deskclock
      6025 com.android.dialer
      4386 com.android.inputmethod.latin
      4440 com.android.launcher
      4423 com.android.phone
      6134 com.android.sharedstoragebackup
      4529 com.android.smspush
      4236 com.android.systemui
      5926 com.android.vending
      5709 com.example.a11x256.frida_test
      6076 com.google.android.gm
      4681 com.google.android.gms
      .
      .
      .


      The frida works fine but I have some trouble when using automation with Python
      and my Python is 2.7 and when I have used python3 with 1.py I got this following error
      Traceback (most recent call last):
      File "1.py", line 2, in
      import frida
      ModuleNotFoundError: No module named 'frida'



      And my 1.py file is in the following too



      #python code
      import frida
      import time
      device = frida.get_usb_device(1)
      pid = device.spawn(["com.example.a11x256.frida_test"])
      device.resume(pid)
      time.sleep(1) #Without it Java.perform silently fails
      session = device.attach(pid)
      script = session.create_script(open("s1.js").read())
      script.load()

      #prevent the python script from terminating
      raw_input()


      Is there any solution?







      android python malware frida






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 20:13









      K.Dᴀᴠɪs

      5,796102140




      5,796102140










      asked Nov 9 at 19:25









      rebwar karimi

      64




      64



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232116%2ffrida-transporterror-the-connection-is-closed%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232116%2ffrida-transporterror-the-connection-is-closed%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo