From fba00126906d4af3c0db94228e021515add09066 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 19 Aug 2023 21:03:05 +0200 Subject: [PATCH] Removed some easter eggs, to prevent SVR.JS version fingerprinting... --- config.json | 2 +- svr.js | 49 +++++++++---------------------------------------- 2 files changed, 10 insertions(+), 41 deletions(-) diff --git a/config.json b/config.json index 558cdb5..4b83518 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "port": 80, "pubport": 80, "page404": "404.html", - "timestamp": 1692394031580, + "timestamp": 1692471768431, "blacklist": [], "nonStandardCodes": [], "enableCompression": true, diff --git a/svr.js b/svr.js index ec8e9a6..7187138 100644 --- a/svr.js +++ b/svr.js @@ -3602,21 +3602,10 @@ if (!cluster.isPrimary) { return; } - if (href == "/invoke500.svr" || (os.platform() == "win32" && href.toLowerCase() == "/invoke500.svr")) { - if (version.indexOf("Nightly-") === 0 && uobject.query.crash !== undefined) throw new Error("Intentionally crashed"); + if (version.indexOf("Nightly-") === 0 && (href == "/invoke500.svr" || (os.platform() == "win32" && href.toLowerCase() == "/invoke500.svr"))) { + if (uobject.query.crash !== undefined) throw new Error("Intentionally crashed"); try { - if (uobject.query.aprilfools === undefined) throw new Error("This page is intended to return 500 code."); - var hdhds = getCustomHeaders(); - hdhds["Content-Type"] = "text/html; charset=utf-8"; - if (uobject.query.activate === undefined) { - res.writeHead(599, "You may be a victim of software counterfeiting.", hdhds); - res.end("Directory traversal prevention is not working.
  X  
Directory traversal prevention is not working.
You may be a victim of software
counterfeiting.


To use all DorianTech SVR.JS features, such as all
directory traversal protections; use server-side JS;
and recieve product support, your copy of DorianTech
SVR.JS must be validated as genuine.

Go online and resolve now

Close
This copy of SVR.JS is not genuine."); - serverconsole.resmessage("You may be a victim of software counterfeiting."); - } else { - res.writeHead(200, "OK", hdhds); - res.end("\n\n\n\nSVR.JS Genuine Advantage\n\n\n

Activate SVR.JS

\nYou will then be able to use all of SVR.JS features through SVR.JS Genuine Advantage!\n\n

Wait...

\n\n\n\nThis copy of SVR.JS is not genuine."); - } - return; + throw new Error("This page is intended to return 500 code."); } catch (err) { callServerError(500, undefined, generateErrorStack(err)); return; @@ -3632,35 +3621,15 @@ if (!cluster.isPrimary) { res.writeHead(200, "OK", hdhds); res.end((head == "" ? "SVR.JS status" + (request.headers.host == undefined ? "" : " for " + String(req.headers.host).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")) + "" : head.replace(//i, "SVR.JS status" + (request.headers.host == undefined ? "" : " for " + String(req.headers.host).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")) + "")) + "

SVR.JS status" + (request.headers.host == undefined ? "" : " for " + String(req.headers.host).replace(/&/g, "&").replace(//g, ">")) + "

Server version: " + (exposeServerVersion ? "SVR.JS/" + version + " (" + getOS() + "; " + (process.isBun ? ("Bun/v" + process.versions.bun + "; like Node.JS/" + process.version) : ("Node.JS/" + process.version)) + ")" : "SVR.JS") + "

Current time: " + new Date().toString() + "
Thread start time: " + new Date(new Date() - (process.uptime() * 1000)).toString() + "
Thread uptime: " + formatRelativeTime(Math.floor(process.uptime())) + "
OS uptime: " + formatRelativeTime(os.uptime()) + "
Total request count: " + reqcounter + "
Average request rate: " + (Math.round((reqcounter / process.uptime()) * 100) / 100) + " requests/s" + (process.memoryUsage ? ("
Memory usage of thread: " + sizify(process.memoryUsage().rss) + "B") : "") + (process.cpuUsage ? ("
Total CPU usage by thread: u" + (process.cpuUsage().user / 1000) + "ms s" + (process.cpuUsage().system / 1000) + "ms - " + (Math.round((((process.cpuUsage().user + process.cpuUsage().system) / 1000000) / process.uptime()) * 1000) / 1000) + "%") : "") + "
Thread PID: " + process.pid + "
" + (foot == "" ? "" : foot)); return; - } else if (href == "/zsoiebook.svr" || (os.platform() == "win32" && href.toLowerCase() == "/zsoiebook.svr")) { - var hdhds = getCustomHeaders(); - hdhds["Content-Type"] = "text/html; charset=utf-8"; - res.writeHead(200, "OK", hdhds); - if (typeof uobject.query.summary !== "undefined") { - res.end("\n\n \n The Summary of Book of ZSOiE\n \n \n \n \n \n
\n

And Satan created Mammon. His work won people from all over the school. When people abandoned them through the Piracy Window, so Satan went back in time and created the Server to continue to wreak havoc all over the school.

\n

from The Summary of Book of ZSOiE

\n
\n \n"); - return; - } - var randomValue = Math.random(); - if (randomValue > 0.85714) { - res.end("\n\n\n\n \n The Book of ZSOiE, 7:28\n \n \n \n \n \n
\n

The Server continues to cultivate it's Dafa. The Author found the Robot and asked him for help. Then the Robot started to help the Author to improve his Server. And the Author tries to create yet another server without using the main node...

\n

from The Book of ZSOiE, 7:28

\n
\n \n"); - } else if (randomValue > 0.71429) { - res.end("\n\n\n\n \n The Book of ZSOiE, 7:16\n \n \n \n \n \n
\n

The Server is still going. But the Author commanded to the Server: \"thou shalt you split to two branches.\". And the Server did split it's Dafa. One of two branches stopped serving on old and rusty node. Other one is still serving on that, but it will later vanish... \"Mammon will get confused\" - said the Author.

\n

from The Book of ZSOiE, 7:16

\n
\n \n"); - } else if (randomValue > 0.57143) { - res.end("\n\n\n\n \n The Book of ZSOiE, 7:2\n \n \n \n \n \n
\n

The old Server forces died. The all-powerful new Server rosen from ashes of old Server like phoenix followed the ways of Durability-Ease-Reliability and cultivated his Dafa. Then, the Author and Whyvn appeared on best former Mammon's disciples paper.

\n

from The Book of ZSOiE, 7:2

\n
\n \n"); - } else if (randomValue > 0.42857) { - res.end("\n\n\n\n \n The Book of ZSOiE, 6:24\n \n \n \n \n \n
\n

Mammon had enough karmic retribution. The Author tried it's Server on main node's substitute. Then, the Author saw, that Server's Dafa is good, and that main node, it's substitute, and older Mammon are good. Meanwhile the Author, Whyvn, and Snovbyn rejoiced even more from their success over older Mammon.

\n

from The Book of ZSOiE, 6:24

\n
\n \n"); - } else if (randomValue > 0.32143) { - res.end("\n\n\n\n \n The Book of ZSOiE, 6:6\n \n \n \n \n \n
\n

And the Server is about to come. The Author along with Whyvn and Snovbyn passing the Mammon's test rejoiced their success over older Mammon.

\n

from The Book of ZSOiE, 6:6

\n
\n \n"); - } else if (randomValue > 0.14286) { - res.end("\n\n\n\n \n The Book of ZSOiE, 5:25\n \n \n \n \n \n
\n

The twins of Mammon quarrelled. The Author with it's Server and it's main node plunged the Mammon's servers into darkness. Meanwhile Whyvn and Snovbyn helped him to break Mammon's servers.

\n

from The Book of ZSOiE, 5:25

\n
\n \n"); - } else { - res.end("\n\n\n\n \n The Book of ZSOiE, 3:16\n \n \n \n \n \n
\n

Mammon slept. Meanwhile, the Author, Whyvn and Snovbyn being in very skill-requiring challenge casted tcpdump and mongodb on him.

\n

from The Book of ZSOiE, 3:16

\n
\n \n"); - } - return; } else if (version.indexOf("Nightly-") === 0 && (href == "/crash.svr" || (os.platform() == "win32" && href.toLowerCase() == "/crash.svr"))) { throw new Error("Intentionally crashed"); } - + + ///////////////////////////////////////////// + ////THERE IS NO MORE "THE BOOK OF ZSOIE"!//// + //// But it's in easteregg.tar.gz mod... //// + ///////////////////////////////////////////// + var pth = decodeURIComponent(href).replace(/\/+/g, "/").substr(1); var readFrom = "./" + pth; fs.stat(readFrom, function (err, stats) {