Coder Social home page Coder Social logo

android-injector's Introduction

Android Shared Object Injector

Injecting Shared Object in Android native process using Frida

This code is taken from https://github.com/oleavr/android-inject-custom

I have removed frida-gum dependency as it's not required for injection and have provided build system to build it for different architecture supported by Android NDK.

Prerequisites

Building

$ PATH="$PATH:$HOME/Android/Sdk/ndk/22.0.7026061" make

This will build the injector, the agent, and an example program you can inject the agent into to easily observe the results.

Deploying to Android device

$ PATH="$PATH:$HOME/Android/Sdk/ndk/22.0.7026061" make deploy

Running

Open a terminal and get into adb shell and launch the victim-x86_64 process.

$ adb shell
generic_x86_64:/ # cd /data/local/tmp/injection
generic_x86_64:/data/local/tmp/injection # 
generic_x86_64:/data/local/tmp/injection # ./victim-x86_64
Victim running with PID 7521

Then in another terminal change directory to where the injector-x86_64 binary is and run it.

generic_x86_64:/data/local/tmp/injection # ./injector-x86_64 -l /data/local/tmp/injection/libagent-x86_64.so -e entrypoint -p 7521                                                
                                                                   
	 ██╗███╗   ██╗     ██╗███████╗ ██████╗████████╗ ██████╗ ██████╗  
	 ██║████╗  ██║     ██║██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗ 
	 ██║██╔██╗ ██║     ██║█████╗  ██║        ██║   ██║   ██║██████╔╝ 
	 ██║██║╚██╗██║██   ██║██╔══╝  ██║        ██║   ██║   ██║██╔══██╗ 
	 ██║██║ ╚████║╚█████╔╝███████╗╚██████╗   ██║   ╚██████╔╝██║  ██║ 
	 ╚═╝╚═╝  ╚═══╝ ╚════╝ ╚══════╝ ╚═════╝   ╚═╝    ╚═════╝ ╚═╝  ╚═╝ 
                                                                   
[+] Patching SeLinux policy
[+] Injecting library: /data/local/tmp/injection/libagent-x86_64.so in pid: 7521
[+] Injection completed
1|generic_x86_64:/data/local/tmp/injection #

Note: If entry point is not provided the target process will crash after loading the shared object.

You should now see a message printed by the victim-x86_64 process when the entry point is called.

generic_x86_64:/data/local/tmp/injection # ./victim-x86_64
Victim running with PID 7521
entrypoint() called

android-injector's People

Contributors

hacksysteam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.