2024-10-17 10:24:18 -04:00
|
|
|
<!Doctype html>
|
|
|
|
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>@ztimson/utils sandbox</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<script type="module">
|
2024-11-29 17:26:07 -05:00
|
|
|
import {ArgParser} from './dist/index.mjs';
|
2024-10-17 10:24:18 -04:00
|
|
|
|
2024-11-29 17:26:07 -05:00
|
|
|
const hostname = 'test';
|
|
|
|
const argParser = new ArgParser('botnet-manager.js', 'Connect & manage a network of servers to launch distributed attacks.', [
|
|
|
|
new ArgParser('copy', 'Copy file & dependencies to botnet', [
|
|
|
|
{name: 'file', desc: 'File to copy', default: false},
|
|
|
|
{name: 'control', desc: 'Copy to master server', flags: ['-c', '--control'], default: false},
|
|
|
|
{name: 'noDeps', desc: 'Skip copying dependencies', flags: ['-d', '--no-deps'], default: false},
|
|
|
|
{name: 'slave', desc: 'Copy to slave servers', flags: ['-s', '--slave'], default: false},
|
|
|
|
]),
|
|
|
|
new ArgParser('join', 'Connect server as a botnet slave', [
|
|
|
|
{name: 'device', desc: 'Device to connect, defaults to the current machine', optional: true, default: hostname}
|
|
|
|
]),
|
|
|
|
new ArgParser('kill', 'Kill any scripts running on the botnet'),
|
|
|
|
new ArgParser('leave', 'Disconnect worker node from swarm', [
|
|
|
|
{name: 'device', desc: 'Device to disconnect, defaults to the current machine', optional: true, default: hostname}
|
|
|
|
]),
|
|
|
|
new ArgParser('run', 'Copy & run script on the botnet', [
|
|
|
|
{name: 'script', desc: 'Script to copy & execute', type: 'string'},
|
|
|
|
{name: 'args', desc: 'Arguments for script. Forward the current target with: {{TARGET}}', optional: true, extras: true},
|
|
|
|
]),
|
|
|
|
new ArgParser('start', 'Start this server as the botnet manager'),
|
|
|
|
{name: 'silent', desc: 'Suppress program output', flags: ['-s', '--silent'], default: false},
|
|
|
|
]);
|
|
|
|
console.log(argParser.help({}));
|
2024-10-17 10:24:18 -04:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|