vfsfitvnm / intruducer

A Rust crate to load a shared library into a Linux process without using ptrace.
MIT License
123 stars 14 forks source link

Android caveat #2

Open ChrisMcMStone opened 10 months ago

ChrisMcMStone commented 10 months ago

Hello! Thank you for sharing this cool project.

I'm interested in understanding the following caveat you mention about Android:

When targeting an Android application, both library and second payload binary blob will be copied to its native library directory - changing the security context to u:object_r:apk_data_file:s0 is not enough for the library file.

Specifically, do you think copying the lib to the native library directory could cause problems in terms for breaking app integrity? Or if not, why exactly is this caveat a caveat? Thanks very much!

vfsfitvnm commented 10 months ago

Hi :smile:

The following are January 2022 findings of mine mixed to what I read online - I don't know the details and they might be outdated!

I don't think it breaks the app integrity as it's a reversible operation - but yes - copying the target library overwrites any existing file with the same name - so make sure there is no clash between file names.

This is probably a workaround rather than a caveat, but I can already imagine it won't be feasible anymore in future Android versions. Moreover, an application could simply check for intruders in its native library directory :smiley_cat: