Skip to content

zahidaz/frida_web

Repository files navigation

Frida Web (Experimental POC)

Browser-compatible Frida client using WebSocket D-Bus communication.

Why

Frida traditionally requires D-Bus, which depends on operating system sockets that are not available in browser environments. While proxy-based workarounds exist, they introduce unnecessary complexity since Frida already expects D-Bus messages over WebSocket.

Frida Web removes that barrier by sending and receiving marshalled D-Bus messages directly over WebSocket, making it possible to control a running Frida instance straight from the browser.

Go to https://zahidaz.github.io/frida_web/ and try it for yourself.

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-web

CDN

<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 build

Usage

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 mode

Requirements

  • 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

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

Frida Web is a Frida client that runs entirely in the browser with no external dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published