> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/sammwyy/mikuMikuBeam/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /attacks

> Retrieve list of available attack methods

## Endpoint

```
GET /attacks
```

Returns a list of all registered attack methods available on the server.

## Request

No parameters required.

### Headers

<ParamField header="Content-Type" type="string">
  Not required for GET requests
</ParamField>

## Response

<ResponseField name="attacks" type="string[]" required>
  Array of available attack method identifiers
</ResponseField>

### Attack Method Types

The response includes these attack methods registered in the engine:

<ResponseField name="http_flood" type="string">
  Standard HTTP flood attack - sends rapid HTTP requests to overwhelm the target
</ResponseField>

<ResponseField name="http_bypass" type="string">
  HTTP flood with bypass techniques - includes various headers and techniques to bypass protection
</ResponseField>

<ResponseField name="http_slowloris" type="string">
  Slowloris connection exhaustion attack - keeps connections open with slow requests
</ResponseField>

<ResponseField name="tcp_flood" type="string">
  Raw TCP packet flood - sends TCP packets directly to the target
</ResponseField>

<ResponseField name="minecraft_ping" type="string">
  Minecraft server ping flood - targets Minecraft servers with ping packets
</ResponseField>

## Example Request

```bash theme={null}
curl http://localhost:8080/attacks
```

## Example Response

```json theme={null}
{
  "attacks": [
    "http_flood",
    "http_bypass",
    "http_slowloris",
    "tcp_flood",
    "minecraft_ping"
  ]
}
```

## Using Attack Methods

Once you've retrieved the list of available attacks, you can use any of these identifiers when starting an attack via Socket.IO:

```javascript theme={null}
import { io } from 'socket.io-client';

const socket = io('http://localhost:8080');

// First, get available attacks
fetch('http://localhost:8080/attacks')
  .then(res => res.json())
  .then(data => {
    console.log('Available attacks:', data.attacks);
    
    // Start an attack using one of the methods
    socket.emit('startAttack', {
      target: 'http://example.com',
      attackMethod: data.attacks[0], // e.g., 'http_flood'
      duration: 60,
      packetDelay: 100,
      packetSize: 1024,
      threads: 4
    });
  });
```

## Implementation Details

The attacks endpoint is implemented in `/cmd/mmb-server/main.go:70-77`:

```go theme={null}
e.GET("/attacks", func(c echo.Context) error {
    kinds := reg.ListKinds()
    out := make([]string, 0, len(kinds))
    for _, k := range kinds {
        out = append(out, string(k))
    }
    return c.JSON(http.StatusOK, map[string]any{"attacks": out})
})
```

The attack methods are registered in the engine registry during server initialization:

```go theme={null}
reg := engine.NewRegistry()
reg.Register(engine.AttackHTTPFlood, httpA.NewFloodWorker())
reg.Register(engine.AttackHTTPBypass, httpA.NewBypassWorker())
reg.Register(engine.AttackHTTPSlowloris, httpA.NewSlowlorisWorker())
reg.Register(engine.AttackTCPFlood, tcpA.NewFloodWorker())
reg.Register(engine.AttackMinecraftPing, mc.NewPingWorker())
```

## Notes

<Note>
  The list of available attacks is determined at server startup and does not change during runtime. If you need to add custom attack methods, you must modify the server code and restart.
</Note>

<Tip>
  Use this endpoint to dynamically populate attack method selectors in your client application, ensuring compatibility with the server's capabilities.
</Tip>
