Miku Miku Beam

repository·main·Indexed 26 days ago

https://github.com/sammwyy/mikumikubeam

A network stress testing tool designed to launch HTTP, TCP, and Minecraft-specific protocol attacks using proxies and multiple threads. It includes a CLI for executing tests, a backend server providing a REST API and Socket.io for real-time statistics, and a web client interface via the MMBClient library.

Tokens
1.7K
Snippets
1
Records
12
Agent score
91%

What's inside mikumikubeam

  1. Quick Start with Miku Miku Beam

    main

    To get Miku Miku Beam running quickly, clone the repository, install dependencies, create the required data files, and build/run the server.

    Prerequisites

    • Go (v1.21 or above)
    • Node.js (v18 or above)
    • npm

    Steps

    1. Clone and setup
    2. Install dependencies
    3. Create required files (data/proxies.txt and data/uas.txt)
    4. Build and run
    5. Access the web interface at http://localhost:3000
    # 1. Clone and setup
    git clone https://github.com/sammwyy/mikumikubeam.git
    cd mikumikubeam
    
    # 2. Install dependencies
    make prepare
    
    # 3. Create required files
    echo "http://proxy1:8080" > data/proxies.txt
    echo "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" > data/uas.txt
    
    # 4. Build and run
    make all && make run-server
    
    # 5. Open http://localhost:3000 in your browser
  2. Run the Miku Miku Beam Server

    main

    The mmb-server is the backend service for the Miku Miku Beam network stresser. It provides a REST API, a Socket.io server for real-time stats, and serves the web client.

    Configuration via Environment Variables

    • LOG_FORMAT: Set to json to enable JSON logging; otherwise, it defaults to human-readable console output.
    • ALLOW_NO_PROXY: Set to true to allow attacks to run even if no proxies are loaded.

    CLI Flags

    • --no-proxy: A flag that allows running the server without proxies (equivalent to setting ALLOW_NO_PROXY=true).
  3. Manage MMB configuration

    main

    You can retrieve and update the server's proxy and User-Agent (UA) configurations using the following methods. Note that the server uses Base64 encoding for these values.

    • getConfiguration(): Returns an object { proxies: string; uas: string } where values are decoded from Base64.
    • setConfiguration(proxies: string, uas: string): Encodes the provided strings to Base64 and sends them to the server via POST.
  4. Socket.io Events for Miku Miku Beam

    main

    The server uses Socket.io to communicate with the web client. The following events are supported:

    Client-to-Server Events

    • startAttack: Triggers a new attack. The payload is a map containing:
      • target (string): The target address/URL.
      • attackMethod (string): The method to use (e.g., httpflood, tcpflood).
      • packetSize (int): Size of packets.
      • duration (int): Duration in seconds.
      • packetDelay (int): Delay in milliseconds.
      • threads (int): Number of concurrent threads.
    • stopAttack: Stops the currently active attack for the client.

    Server-to-Client Events

    • stats: Emits real-time statistics including pps (packets per second), proxies (count), totalPackets, and an optional log message.
    • attackAccepted: Emitted when an attack starts successfully. Payload: { "ok": true, "proxies": <count> }.
    • attackError: Emitted if an attack cannot start. Payload: { "message": <error_string> }.
    • attackEnd: Emitted when an attack finishes or is stopped.
  5. Start and stop attacks via MMBClient

    main

    Use startAttack to initiate a network stress test and stopAttack to terminate it.

    StartAttackPayload Schema:

    • target (string): The target IP or hostname.
    • attackMethod (string): The method to use.
    • packetSize (number): Size of packets in bytes.
    • duration (number): Duration in seconds.
    • packetDelay (number): Delay between packets in milliseconds.
    • threads (number, optional): Number of concurrent threads.
  6. Listen to MMB socket events

    main

    The MMBClient provides several event listeners to handle real-time updates from the server:

    • onStats(cb: (s: StatsMessage) => void): Receives real-time statistics including pps, proxies, totalPackets, and log.
    • onAttackEnd(cb: () => void): Triggered when an attack completes.
    • onAttackAccepted(cb: (info: any) => void): Triggered when an attack request is successfully received.
    • onAttackError(cb: (info: any) => void): Triggered when an attack fails to start.
    • onConnect(cb: () => void): Triggered when the socket connects.
    • onConnectError(cb: (e: any) => void): Triggered on connection failure.
    • onDisconnect(cb: (reason: any) => void): Triggered when the socket disconnects.

    Use offAll() to remove stats and attackEnd listeners.

  7. Miku Miku Beam Server API Reference

    main

    The backend server exposes several HTTP endpoints for managing attacks and configuration:

    HTTP Endpoints

    • GET /attacks: Returns a list of available attack methods.
    • GET /configuration: Retrieves the current proxy and User-Agent lists. The data is returned as Base64 encoded strings.
    • POST /configuration: Updates the proxy and User-Agent lists. The request body must contain Base64 encoded strings for proxies and uas.
    • GET /socket.io/*: The endpoint for Socket.io real-time communication.
    • /: Serves the static web client files (from bin/web-client or web-client/dist).
  8. Launch an attack with the Miku Miku Beam CLI

    main

    Use the attack command to launch a network stress test against a specific target using a chosen method. The command requires two positional arguments: [method] and [target].

    Available Attack Methods:

    • http_flood
    • http_bypass
    • httpslowloris
    • tcp_flood
    • minecraft_ping

    Note on Proxies: By default, the CLI attempts to load proxies from your configuration file. If no proxies are available for the selected method, the command will fail unless you use the --no-proxy flag.

  9. Configure Miku Miku Beam CLI attack flags

    main

    The attack command supports several flags to tune the intensity, duration, and behavior of the stress test.

    FlagTypeDefaultDescription
    --configstring""Path to the TOML configuration file.
    --durationint60Duration of the attack in seconds.
    --delayint500Packet delay in milliseconds.
    --packet-sizeint512Size of each packet.
    --no-proxyboolfalseIf set, allows running the attack without using proxies.
    --threadsint0Number of concurrent threads to use (0 defaults to the number of CPUs).
    --verboseboolfalseEnables detailed attack logs in the output.