frida-web
v1.0.3
Published
Browser-compatible Frida web client using WebSocket D-Bus communication
Maintainers
Readme
Frida Web
Browser-compatible Frida client using WebSocket D-Bus communication.
Features
- Browser Compatible - Works in modern browsers without Node.js dependencies
- WebSocket D-Bus - Communicates with Frida server over WebSocket using D-Bus protocol
- Lightweight - Minimal dependencies, optimized bundle size
Installation
NPM
npm install frida-webCDN
<script type="module">
import { Client } from 'https://unpkg.com/frida-web/dist/frida-web.js';
</script>Git
git clone https://github.com/yourusername/frida-web.git
cd frida-web
npm install
npm run buildUsage
Basic Example
import { Client } from 'frida-web';
const client = new Client('localhost:27042');
// Get system information
const systemInfo = await client.querySystemParameters();
console.log(systemInfo);
// List processes
const processes = await client.enumerateProcesses();
console.log(processes);
// Attach to process
const session = await client.attach(1234);Browser Usage
<!DOCTYPE html>
<html>
<head>
<title>Frida Web Client</title>
</head>
<body>
<script type="module">
import { Client } from 'https://unpkg.com/frida-web/dist/frida-web.js';
async function init() {
try {
const info = await client.querySystemParameters();
console.log('System Info:', info);
const processes = await client.enumerateProcesses();
console.log('Processes:', processes);
} catch (error) {
console.error('Error:', error);
}
}
init();
</script>
</body>
</html>Node.js Usage
// ES Modules
import { Client } from 'frida-web';
// CommonJS
const { Client } = require('frida-web');
const client = new Client('localhost:27042');API Reference
Client
Constructor
new Client(host: string, options?: ClientOptions)host- Frida server host and port (e.g., 'localhost:27042')options- Optional configuration object
Methods
querySystemParameters()
querySystemParameters(): Promise<any>Returns system information from the Frida server.
enumerateProcesses(options?)
enumerateProcesses(options?: ProcessQueryOptions): Promise<Process[]>Lists all processes visible to Frida.
attach(pid, options?)
attach(pid: number, options?: SessionOptions): Promise<Session>Attaches to a process and returns a session for script injection.
Types
interface Process {
pid: number;
name: string;
parameters: VariantDict;
}
interface ClientOptions {
tls?: 'auto' | 'enabled' | 'disabled';
token?: string;
}
interface ProcessQueryOptions {
pids?: number[];
scope?: 'minimal' | 'metadata' | 'full';
}Building
# Install dependencies
npm install
# Build all formats
npm run build
# Build specific formats
npm run build:esm # ES modules
npm run build:cjs # CommonJS
npm run build:browser # Browser bundle
npm run build:types # TypeScript declarations
# Development
npm run dev # Watch modeRequirements
- Modern browser with ES2020 support
- Frida server with WebSocket D-Bus endpoint
- Node.js 16+ (for development)
Acknowledgments
Special thanks to @clebert for the excellent d-bus-message-protocol library that makes this browser-compatible D-Bus communication possible.
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
