Frida Installation and Use on Android Termux #2411
Replies: 8 comments 14 replies
-
I managed to follow all the steps and installed the latest Frida in Termux. How is it supposed to be used? I get
|
Beta Was this translation helpful? Give feedback.
-
You probably forgot to run frida-server as root |
Beta Was this translation helpful? Give feedback.
-
Hi. I'm trying to run Frida on Termux on my device. I have managed to install it, but when I try to run it I get the following error: Failed to load the Frida native extension: dlopen failed: cannot locate symbol "__atomic_is_lock_free" referenced by "data/data/com. termux/files/usr/lib/python3.11/site-packages/_frida.abi3.so... Please ensure that the extension was compiled correctly. I'm running it on a Samsung Galaxy Tab 3 10.1 with custom Lineage OS 14.1 on Android 7.1.2. It's x86 system. Any suggestions please? |
Beta Was this translation helpful? Give feedback.
-
Try To Use Old Versions of python like Version 3.10 or 3.9
OR Use Pc to install it on Termux
…On Sun, Jul 23, 2023, 12:01 AM black8855 ***@***.***> wrote:
Hi. I'm trying to run Frida on Termux on my device. I have managed to
install it, but when I try to run it I get the following error:
Failed to load the Frida native extension: dlopen failed: cannot locate
symbol "__atomic_is_lock_free" referenced by "data/data/com.
termux/files/usr/lib/python3.11/site-packages/_frida.abi3.so... Please
ensure that the extension was compiled correctly.
I'm running it on a Samsung Galaxy Tab 3 10.1 with custom Lineage OS 14.1
on Android 7.1.2. It's x86 system.
Any suggestions please?
—
Reply to this email directly, view it on GitHub
<#2411 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3TZGBUZPRZ2TGMQFXNOE4DXRQ5UBANCNFSM6AAAAAAUZIYL4A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
can someone tell me how to fix this |
Beta Was this translation helpful? Give feedback.
-
Can you make a tutorial about how to install it on an emulator, like Bluestacks or Nox? |
Beta Was this translation helpful? Give feedback.
-
can't install frida tools on my device as well as android emulator. followed every step however upon installing frida-tools i get this issue :
note: This error originates from a subprocess, and is likely not a problem with pip. |
Beta Was this translation helpful? Give feedback.
-
Where do I extract the frida server archive if I don't have the directory |
Beta Was this translation helpful? Give feedback.
-
---------------------------------------------------Installation Part-----------------------------------------------------------------
Step 1 : Update your termux to latest version. Don't install from play store.
use from f-droid ( https://f-droid.org/repo/com.termux_118.apk) or
github release ( https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_universal.apk ) or beta
https://github.com/termux/termux-app/releases/download/v0.119.0-beta.1/termux-app_v0.119.0-beta.1+apt-android-7-github-debug_universal.apk
Step 2 : Give storage permission to termux manually
long click on icon -> select App Info -> permission and give storage permission.
Alternatively go to android settings -> installed apps -> search for termux -> permission and give storage permission.
Step 3 : Update dependency in termux
Step 3: Install necessary tools needed for frida or (radare2 if you want) installation.
At this point we can proceed with new installation method. Just execute following command
wget https://maglit.me/frida-python && bash frida-python
and It will download devkit and install frida with modified build tools as latest frida doesn't support building thing on termux out of the box. At this step you are ready to use frida.
If you get any error after executing above script you can try below command to fix frida-tools
while if needed to install it manually instead of script, its straight forward to execute these commands
if you want to follow older installation method which can install frida <= 16.2.2 then keep reading below
Step 4 : Download Frida Core DevKit according to device architecture from
https://github.com/frida/frida/releases
As of writing this, 16.0.19 is the latest frida version -
for arm device - https://github.com/frida/frida/releases/download/16.0.19/frida-core-devkit-16.0.19-android-arm.tar.xz
for arm64 device - https://github.com/frida/frida/releases/download/16.0.19/frida-core-devkit-16.0.19-android-arm64.tar.xz
for 32 bit emulator/device - https://github.com/frida/frida/releases/download/16.0.19/frida-core-devkit-16.0.19-android-x86.tar.xz
for 64 bit emulators/device - https://github.com/frida/frida/releases/download/16.0.19/frida-core-devkit-16.0.19-android-x86_64.tar.xz
Step 5 : Extract it on internal storage ( don't extract it in /data/local/tmp ). for demo purpose I extracted it into
folder. It should have 4 files -
frida-core-example.c
frida-core.h
frida-core.gir
libfrida-core.a
Step 6: Set proper environment variables, in this case type
export FRIDA_CORE_DEVKIT=/sdcard/devkit/
if you extracted it on some other location, use that path.
make sure you run above command without root/su.
Step 7: Install frida and its commandline tools from pip
Now Frida is available to use from commandline
---------------------------------------------------Installation Part End-----------------------------------------------------------------
---------------------------------------------------Frida-Server Setup-----------------------------------------------------------------
Step 1: Download appropriate frida server according to your device architecture.
https://github.com/frida/frida/releases
As of writing this, 16.0.19 is the latest frida version -
for arm device - https://github.com/frida/frida/releases/download/16.0.19/frida-server-16.0.19-android-arm.xz
for arm64 device - https://github.com/frida/frida/releases/download/16.0.19/frida-server-16.0.19-android-arm64.xz
for 32 bit emulator/device - https://github.com/frida/frida/releases/download/16.0.19/frida-server-16.0.19-android-x86.xz
for 64 bit emulator/device - https://github.com/frida/frida/releases/download/16.0.19/frida-server-16.0.19-android-x86_64.xz
Step 2: Extract this archive into /data/local/tmp/ (Remember - Extract it , Don't copy/move it there, Some guys just move it to tmp folder and try to execute it so they get error like Not executable: Magic FD37)
Step 3: Rename it to frida-server without any extension. (You can pick any name but some guys later complain that ./frida-server command is not working so remeber the name whatever you choosen).
Step 4: Give executable permission to frida-server. Follow below step if you don't know how to do it.
3. Now click on modify in front of Permissions
---------------------------------------------------Frida-Server Setup End-----------------------------------------------------------------
How to use Frida in Termux
Step 1: Start Termux and type
Step 2: type
cd /data/local/tmp
Step 3: type
like this picture
Step 4: Left swipe on termux and start a new session
Step 5: type
cd /data/local/tmp
Step 6: type following command to spawn app with frida with your script
If you want to run frida-trace then also similar command will work.
Note - Don't try to run frida-trace when you are in tmp directory as it will create handler folder and due to permission it will throw error. So we navigate to home directory to run it
How to use Frida Inject in Termux
Step 1: Download appropriate Frida Inject Binary according to your device architecture.
https://github.com/frida/frida/releases
As of writing this, 16.0.19 is the latest frida version -
for arm device - https://github.com/frida/frida/releases/download/16.0.19/frida-inject-16.0.19-android-arm.xz
for arm64 device - https://github.com/frida/frida/releases/download/16.0.19/frida-inject-16.0.19-android-arm64.xz
for 32 bit emulator/device - https://github.com/frida/frida/releases/download/16.0.19/frida-inject-16.0.19-android-x86.xz
for 64 bit emulator/device - https://github.com/frida/frida/releases/download/16.0.19/frida-inject-16.0.19-android-x86_64.xz
Step 2:
Extract this archive into /data/local/tmp/ (Remember - Extract it , Don't copy/move it there, Some guys just move it to tmp folder and try to execute it so they get error like Not executable: Magic FD37)
Step 3: Rename it to frida without any extension. (You can pick any name but some guys later complain that ./frida- command is not working so remeber the name whatever you choosen).
Here is a screenshot of device when a guy try to run frida without downloading anything( come on man, You are a frida user , have some common sense).
To avoid such issue, make sure you download frida inject first and keep following steps.
Step 4: Make it executable, read this whole discussion to find out how to do it.
Step 5: Copy/Move your script to /data/local/tmp. It is not mandatory to have this path but then some guy will come and complain that script.js is not found
Step 6: Use frida as usual
su cd /data/local/tmp ./frida -f com.app -s script.js
------------------------------------------------FAQ------------------------------------------------------------------------
Q1. I am getting error with --no-pause command with frida
A1. --no-pause command is removed from frida in 16.x so don't use it.
Q2. What is alternative to --no-pause
A2. as --no-pause is removed and new command --pause is introduced, don't mix it uses.
--no-pause == don't pause the process and directly run the script.
--pause == pause the process and let you decide when to resume with %resume command
Q3. frida command is not found
A3. You not have frida installed from pip. Follow above guide to install it properly
Q4. frida-ps command is not working.
A4. frida-ps require frida-server so start the server in tmp folder with
su cd /data/local/tmp ./frida-server -l 127.0.0.1
and then
etc commands will work.
Beta Was this translation helpful? Give feedback.
All reactions