The Frida server experienced a crash when attempting to connect with an Android device

I'm attempting to conduct a penetration test and hook into my Android application method using Frida. However, when I execute the command from the Windows command prompt, my application crashes, and the intended method is not executed from the APK.

I am trying to trigger my second activity by hooking and returning true from the Frida script. Can someone assist me in correcting my code or providing a valid solution?

My app code:

package com.g.fridaplay;
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if(check())
            startActivity(new Intent(MainActivity.this,VaultActivity.class));
        else Toast.makeText(MainActivity.this,"Failed access",Toast.LENGTH_LONG).show();

    }

    boolean check(){
        String pass="asdf@123";
        if(pass.equals("asdf"))
            return true;
        else return false;
    }
}

Frida javascript: vault.js

Java.perform(function() {

       var theClass = Java.use("com.g.fridaplay.MainActivity");

       theClass.check.implementation = function(v) {
            console.log("In function check()");
             return true;
         }

       console.log("Exploit Completed.. finished");
})

Frida script command used

//adb
./frida-server-15.1.3-android-x86 &;

//python>script
frida -U --no-pause -l vault.js -f com.g.fridaplay

Command output

C:\Python39\Scripts>frida -U --no-pause -l vault.js -f com.g.fridaplay
     ____
    / _  |   Frida 15.1.3 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at https://frida.re/docs/home/
Spawned `com.g.fridaplay`. Resuming main thread!
[Android::com.g.fridaplay]-> Exploit Completed.. finished
Process crashed: Bad access due to invalid address

***
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Android/vbox86p/vbox86p:7.1.1/NMF26Q/76:userdebug/test-keys'
Revision: '0'
ABI: 'x86'
pid: 1657, tid: 1657, name: re-initialized>  >>> <pre-initialized> <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x80000000
    eax 00000000  ebx 00000679  ecx 00000679  edx 0000000b
    esi ffdea80c  edi ffdea5a0
    xcs 00000023  xds 0000002b  xes 0000002b  xfs 0000006b  xss 0000002b
    eip f49ecbb9  ebp ffdea620  esp ffdea538  flags 00000296

backtrace:
    #00 pc 00000bb9  [vdso:f49ec000] (__kernel_vsyscall+9)
    #01 pc 0007f9d8  /system/bin/linker (__dl_syscall+40)
    #02 pc 000046a1  /system/bin/linker (__dl__ZL24debuggerd_signal_handleriP7siginfoPv+1201)
    #03 pc 0000b7fd  /system/bin/app_process32_xposed (InvokeUserSignalHandler+317)
    #04 pc 000ff441  /system/lib/libart.so (offset 0x10a000)
***
[Android::com.g.fridaplay]->

Thank you for using Frida!

My setup:

  • Emulator: Genymotion Android 7.1 (x86)
  • Frida version 15.1.3
  • Platform: Windows 10
  • APK generated: Arctic Fox 2021

Answer №1

After some troubleshooting, I was able to resolve the issue by changing from an Android 7.1 emulator to an Android 10 Genymotion emulator.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The checkbox linked to a Vector layer in Openlayers 3 seems to have no effect on its visibility

Help me debug my code where I am attempting to connect a checkbox to a vector layer's 'visible' property. I can't seem to figure out what's wrong, can you spot the error? Interestingly, this code successfully works for ol.layer.Ti ...

Dealing with models in Vue.js is proving to be quite a challenge

Why isn't myGame showing as 超級馬力歐 initially and changing when the button is pressed? It just displays {{myGame}} instead. I'm not sure how to fix it, thank you! let myApp = new vue({ el:'myApp', data:{ myGame:&a ...

Displaying only the days that have passed, rather than using vague terms like months or years, can be done using .fromNow()

I am in the process of creating a table that indicates how long it has been since something was last touched. I want to display only the number of days that have passed, without converting it to a less precise unit like months for easier comparison. For in ...

The parameter in a JavaScript for loop

I'm struggling with my Javascript skills. Here is the code snippet I am currently working with: var information = [ {"Column":"","keyw":"","Column_3":"day of march 2011 to someother numeric" ...

Unable to redirect using JQuery Ajax post after receiving an ActionResult from an MVC controller

I'm trying to send data from a method to an MVC controller that gives back an action result, and then have my site automatically navigate to the correct view. Here's the code snippet I'm currently working with: function RedirectFunction(ite ...

What is the most efficient way to restrict multiple input fields, each using v-model, to only accept numeric values in Vue.js without duplicating code for every input field?

I have several input fields in Vue.js that I want to restrict to only accept numbers. I want to prevent users from entering any characters except digits from 0-9. I managed to achieve this successfully with a solution that is resistant to copy-paste: C ...

Pass a byte array from the back-end code to an AJAX request

I have a web method where I am converting HTML to PDF and saving it to a local folder. The goal is for the user to download the file without needing to reload the page. To achieve this, I am attempting to make an AJAX POST call to the web method to retriev ...

Summon the keyboard to appear

How do I make the keyboard appear on my website? I have a javascript function that recognizes keyboard input, but I am struggling to display the keyboard on my mobile device. Is there a way to simulate traditional input and generate key events? I should ...

Spreading an object to remove a key may result in the returned value being

When creating a Radio Button object, each object in the array consists of {value: 1, text: 'Sometext'}. If a radio button is selected, 'selected: true' is added to that specific object and removed from the others. const onChoiceChange ...

Monitoring Twitter bootstrap modal for scrollbar reaching the bottom

Currently, I am working with Twitter Bootstrap modal and facing a challenge in determining how to detect when the scrollbar of the modal reaches the bottom using either JavaScript or jQuery. https://i.stack.imgur.com/0VkqY.png My current approach involve ...

What is the best way to selectively add JavaScript libraries to create-react-app's production build files?

Struggling to incorporate a JavaScript library that is exclusively found in the production build files produced by the create-react-app. Any suggestions on the most effective method to achieve this? In particular, I am attempting to integrate the Rollbar ...

New input has been added: a checkbox element that is void of any value

I am facing an issue when trying to add a new input:checkbox. Even after adding a new input and checking it, I am unable to retrieve the value of the checked input:checkbox when clicking on the button. How can I fix this problem? DEMO: http://jsfiddle.net ...

Creating a new object store in IndexedDB on Windows 8

Encountering issues with creating an object store in IndexedDb while trying to build a Metro app using Javascript. The code snippet below shows my attempt within the 'dbReq.onsuccess' function that is supposed to create the object store upon succ ...

Display options through numerical selection

I have been attempting to construct something, but I'm encountering difficulties. My goal is to create a functionality where entering a number in an input field will generate that many additional input fields. I've attempted to implement this us ...

Placing emphasis on an object that appears following a period of waiting

I'm currently working on enhancing the accessibility of a slider that will be featured on my website. The goal is to create an effect where, after clicking (or pressing enter) on the first slide, the focus shifts to the second slide element, allowing ...

Is the availability of XMLHttpRequest constant?

When using XMLHttpRequest to retrieve data from the server with Javascript, is it necessary to include conditional checks for the specific browser being used? Is the code snippet below considered standard practice when working with XMLHttpRequest? if (w ...

Getting a Next.js error after performing a hard refresh on a page that contains a dynamic query

I have encountered an issue with my Next.js app when I attempt to hard reload it in production mode. The error message I receive is 404 - File or directory not found. Below is the code snippet I am using: import { useRouter } from "next/router"; import ...

It appears that Next.js's useDebouncedCallback function is not effectively delaying the request

I am currently learning Next.js and trying to work through the tutorial. I have hit a roadblock on this particular page: https://nextjs.org/learn/dashboard-app/adding-search-and-pagination Despite conducting an extensive web search, I couldn't find a ...

Employing an array for transmitting parameters to a function

I am wondering about the structure of my code which includes variables x_1, x_2, x_3, …., x_n being passed in an array. Here is how it looks: var x_1 = "something"; var x_2 = "something"; var x_3 = "something"; . . . var x_n = "something"; var parameter ...

When using TypeScript in Angular, the "debugger;" statement may encounter issues in the QA environment

Currently engaged in developing an angular application that involves working with multiple environments, I am encountering difficulties while attempting to set up debugging points using debugger; For compiling node_modules and running the server, I use th ...