Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Part of HTTP Toolkit: powerful tools for building, testing & debugging HTTP(S)
Pure-JS bindings to control Frida from node.js & browsers.
This module provides access to Frida, without bundling Frida itself. That means no native binaries included, no compilation required, and no heavyweight files (the entire library is under 10KB). This works by making WebSocket connections (supported in Frida v15+) directly to an existing Frida instance elsewhere.
This is particularly useful in mobile device scenarios, as you can now run Frida purely on the device (as an Android/iOS Frida server instance, or using Frida-Gadget embedded in a specific application) and connect to it through using this library as a tiny client in Node.js or a browser elsewhere.
npm install frida-js
First, you'll need a Frida instance to connect to. For now Frida-JS supports local Frida servers only, but remote device support is coming imminently.
If you don't have this already, you'll want to download, extract & run the frida-server
release for your platform from https://github.com/frida/frida/releases/latest. In future Frida-JS will provide an API to do this automatically on demand.
To use Frida-JS, first call the exported connect()
method and wait for the returned promise to get a FridaClient, and then call the methods there to query the available targets and hook them (full API listing below). For example:
import { connect } from 'frida-js';
const fridaClient = await connect();
await fridaClient.spawnWithScript(
'/usr/bin/your-target-bin',
['some', 'arguments'],
`
const targetFn = DebugSymbol.fromName('a_target_function');
// Hook the target function and replace the argument
Interceptor.attach(ptr(targetFn.address), {
onEnter(args) {
// Modify your target functions args
},
onLeave(retval) {
// Or return value
}
});
`
);
See the full API reference below for more details of the Frida APIs exposed, or see the test suite for a selection of working examples, and fixtures to test against.
There are a few general Frida issues you might commonly run into while using this library, documented here for easier troubleshooting:
ptrace_scope
to 0
. You can do so with this command:
sudo sysctl kernel.yama.ptrace_scope=0
docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined <...>
Alternatively, in some scenarios you might want to just set --privileged
instead.FridaJS.connect()
Connects to a local Frida server, and returns a promise for a FridaClient.
FridaClient.enumateProcesses()
Returns a promise for an array of [pid: number, processName: string]
pairs. You can use this to query the currently running processes that can be targeted on your local machine.
FridaClient.injectIntoProcess(pid: number, script: string)
Injects a given Frida script into a target process, specified by PID. Returns a promise that will resolve once the script has been successfully injected.
FridaClient.injectIntoNodeJSProcess(pid: number, script: string)
Injects real JavaScript into Node.JS processes specifically. Rather than requiring a full Frida script, this takes any normal JS script, and conveniently wraps it with a script to inject it into the V8 event loop for you, so you can just write JS and run it in a target directly.
FridaClient.spawnWithScript(command: string, args: string[], script: string)
Takes a command to run and arguments, launches the process via Frida, injects the given Frida script before it starts, and then resumes the process.
FAQs
Pure-JS bindings to control Frida from node.js & browsers.
The npm package frida-js receives a total of 8 weekly downloads. As such, frida-js popularity was classified as not popular.
We found that frida-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.