a message
This commit is contained in:
parent
1281900e2e
commit
0f33502fa9
4 changed files with 168 additions and 145 deletions
296
html/index.html
296
html/index.html
|
@ -1,167 +1,177 @@
|
||||||
<html>
|
<html>
|
||||||
<head >
|
|
||||||
|
<head>
|
||||||
<title>
|
<title>
|
||||||
worst website ever (real)
|
worst website ever (real)
|
||||||
</title>
|
</title>
|
||||||
<link rel="icon" href="/src/kanna.gif" type="image/gif" />
|
<link rel="icon" href="/src/kanna.gif" type="image/gif" />
|
||||||
<script src="/src/bundle.js"></script>
|
<script src="/src/bundle.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
abbr {
|
abbr {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
position: relative
|
position: relative
|
||||||
}
|
}
|
||||||
|
|
||||||
abbr:hover::after {
|
abbr:hover::after {
|
||||||
background: #add8e6;
|
background: #add8e6;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
content: attr(title);
|
content: attr(title);
|
||||||
display: block;
|
display: block;
|
||||||
left: 100%;
|
left: 100%;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
input{
|
input {
|
||||||
background-color: rgba(200,200,200,.5);
|
background-color: rgba(200, 200, 200, .5);
|
||||||
backdrop-filter: blur(5px);
|
backdrop-filter: blur(5px);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border:none;
|
border: none;
|
||||||
}
|
}
|
||||||
body{
|
|
||||||
background-image:linear-gradient(to bottom right,rgba(255,0,0,.5), rgba(255,255,255,1),rgba(255,255,255,1),rgba(255,0,0,.5))
|
body {
|
||||||
}
|
background-image: linear-gradient(to bottom right, rgba(255, 0, 0, .5), rgba(255, 255, 255, 1), rgba(255, 255, 255, 1), rgba(255, 0, 0, .5))
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="load()" style="height: 100%; overflow: hidden;">
|
<body onload="load()" style="height: 100%; overflow: hidden;">
|
||||||
<div id="kanna" onclick="lightsout()"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></div>
|
<div id="kanna" onclick="lightsout()" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
const sid=makeid(20)
|
|
||||||
window.sid=sid
|
|
||||||
function makeid(length) {
|
|
||||||
var result = '';
|
|
||||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
||||||
var charactersLength = characters.length;
|
|
||||||
for ( var i = 0; i < length; i++ ) {
|
|
||||||
result += characters.charAt(Math.floor(Math.random() *
|
|
||||||
charactersLength));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const sid = makeid(20)
|
||||||
function lightsout(){
|
window.sid = sid
|
||||||
document.body.style.backgroundImage=''
|
function makeid(length) {
|
||||||
document.body.innerHTML=""
|
var result = '';
|
||||||
document.body.style.backgroundColor="black"
|
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||||
document.title = "DONT TOUCH KANNA"
|
var charactersLength = characters.length;
|
||||||
setTimeout(()=>{
|
for (var i = 0; i < length; i++) {
|
||||||
document.body.innerHTML='<img style="display:block;"src="src/lights-out.gif" id="gif" width=100% height=100%/>'
|
result += characters.charAt(Math.floor(Math.random() *
|
||||||
setTimeout(()=>{
|
charactersLength));
|
||||||
document.body.innerHTML=''
|
|
||||||
|
|
||||||
},500)
|
|
||||||
|
|
||||||
},700)
|
|
||||||
}
|
|
||||||
function readTextFile(file)
|
|
||||||
{
|
|
||||||
var promise = new Promise((resolve, reject) => {
|
|
||||||
var rawFile = new XMLHttpRequest();
|
|
||||||
rawFile.open("GET", file, false);
|
|
||||||
rawFile.onreadystatechange = function ()
|
|
||||||
{
|
|
||||||
if(rawFile.readyState === 4)
|
|
||||||
{
|
|
||||||
if(rawFile.status === 200 || rawFile.status == 0)
|
|
||||||
{
|
|
||||||
var allText = rawFile.responseText;
|
|
||||||
resolve(allText)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
rawFile.send(null);
|
|
||||||
});
|
|
||||||
return(promise)
|
|
||||||
}
|
|
||||||
let pub = ''
|
|
||||||
function submit(){
|
|
||||||
//{body:{json:boolean,enc:boolean,data:string,sid:keyof keyring}}
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open("POST", window.location.href + 'login/submit', true);
|
|
||||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
||||||
xhr.onreadystatechange = function() {
|
|
||||||
if (xhr.readyState == XMLHttpRequest.DONE) {
|
|
||||||
alert(xhr.responseText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let user = document.getElementById('user').value
|
|
||||||
let pass = document.getElementById('pass').value
|
|
||||||
let out = {}
|
|
||||||
Object.assign(out,{json:true,enc:true,sid:sid},{data:nodersa(pub,'pkcs8-public').encrypt({user:user,pass:pass,date: new Date()},'base64')})
|
|
||||||
|
|
||||||
xhr.send(JSON.stringify(out))
|
|
||||||
}
|
function lightsout() {
|
||||||
function sendenc(location,content){
|
document.body.style.backgroundImage = ''
|
||||||
var xhr = new XMLHttpRequest();
|
document.body.innerHTML = ""
|
||||||
xhr.open("POST", window.location.href + location, true);
|
document.body.style.backgroundColor = "black"
|
||||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
document.title = "DONT TOUCH KANNA"
|
||||||
xhr.onreadystatechange = function() {
|
setTimeout(() => {
|
||||||
if (xhr.readyState == XMLHttpRequest.DONE) {
|
document.body.innerHTML = '<img style="display:block;"src="src/lights-out.gif" id="gif" width=100% height=100%/>'
|
||||||
pub=(xhr.responseText);
|
setTimeout(() => {
|
||||||
|
document.body.innerHTML = ''
|
||||||
|
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
}, 700)
|
||||||
}
|
}
|
||||||
}
|
function readTextFile(file) {
|
||||||
let out = {}
|
var promise = new Promise((resolve, reject) => {
|
||||||
Object.assign(out,{json:true,enc:false},{data:nodersa(pub,'pkcs8-public').encrypt(content,{date: new Date()},'base64')})
|
var rawFile = new XMLHttpRequest();
|
||||||
xhr.send(JSON.stringify(out))
|
rawFile.open("GET", file, false);
|
||||||
}
|
rawFile.onreadystatechange = function () {
|
||||||
function sendnoenc(location,content){
|
if (rawFile.readyState === 4) {
|
||||||
var xhr = new XMLHttpRequest();
|
if (rawFile.status === 200 || rawFile.status == 0) {
|
||||||
xhr.open("POST", window.location.href + location, true);
|
var allText = rawFile.responseText;
|
||||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
resolve(allText)
|
||||||
xhr.onreadystatechange = function() {
|
|
||||||
if (xhr.readyState == XMLHttpRequest.DONE) {
|
}
|
||||||
pub=(xhr.responseText);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
let out = {}
|
|
||||||
Object.assign(out,{json:true,enc:false},content)
|
|
||||||
xhr.send(JSON.stringify(out))
|
|
||||||
}
|
|
||||||
document.onkeypress = function (key) {
|
|
||||||
key = key || window.event;
|
|
||||||
if(key.key=="Enter"){
|
|
||||||
submit()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
async function load(){
|
|
||||||
sendnoenc('pub.key',{sid:sid})
|
|
||||||
readTextFile("kanna.txt").then((kanna)=>{
|
|
||||||
let left = -300;
|
|
||||||
let top = -40;
|
|
||||||
let t = setInterval(()=>{
|
|
||||||
document.getElementById("kanna").innerHTML+="<div style='user-select: none;white-space: nowrap; position:absolute;left:"+left+"px;top:"+top+"%;transform:scale(.5)'><tt><b>"+(kanna.replaceAll("#","</br>").replaceAll(" ","<font style='color:rgba(1,1,1,0)'>_</font>"))+"</b></div></tt></a>"
|
|
||||||
left+=300
|
|
||||||
if (left>=600){
|
|
||||||
clearInterval(t)
|
|
||||||
setTimeout(()=>{
|
|
||||||
document.body.innerHTML+="<tt><div style='position:absolute;bottom:20px;left:50px;font-weight:100;'>login w/ {user:<input placeholder='root' type='text' id='user' name='user'>,pass:<input type='password' id='pass' name='pass'>}</br><sub>will be <abbr title='so that the \"network administrators\"/\"IT people\" cant get in >:) '>encrypted</abbr> dont worry:)<input style='background-color:rgba(80,80,80,.3);border-color:rgba(80,80,80,.1);border:line;border-radius:5px;' type='button' value='submit' onclick='submit()'></sub></div></tt>"
|
|
||||||
document.body.innerHTML+="<div style='position:absolute;bottom:20px;right:50px;user-select: none;cursor:pointer;' onclick=\"location.href='mailto:grantsquires@disroot.org';\"><tt>need a account? contact grantsquires@disroot.org<sub><sub>(click here)</sub></sub></tt></div>"
|
|
||||||
},50)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},80)
|
rawFile.send(null);
|
||||||
|
});
|
||||||
})
|
return (promise)
|
||||||
}
|
}
|
||||||
|
let pub = ''
|
||||||
|
function submit() {
|
||||||
|
//{body:{json:boolean,enc:boolean,data:string,sid:keyof keyring}}
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", window.location.href + 'login/submit', true);
|
||||||
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if (xhr.readyState == XMLHttpRequest.DONE) {
|
||||||
|
alert(xhr.responseText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let user = document.getElementById('user').value
|
||||||
|
let pass = document.getElementById('pass').value
|
||||||
|
let out = {}
|
||||||
|
Object.assign(out, { json: true, enc: true, sid: sid }, { data: nodersa(pub, 'pkcs8-public').encrypt({ user: user, pass: pass, date: new Date() }, 'base64') })
|
||||||
|
|
||||||
|
xhr.send(JSON.stringify(out))
|
||||||
|
}
|
||||||
|
function sendenc(location, content) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", window.location.href + location, true);
|
||||||
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if (xhr.readyState == XMLHttpRequest.DONE) {
|
||||||
|
pub = (xhr.responseText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let out = {}
|
||||||
|
Object.assign(out, { json: true, enc: false }, { data: nodersa(pub, 'pkcs8-public').encrypt(content, { date: new Date() }, 'base64') })
|
||||||
|
xhr.send(JSON.stringify(out))
|
||||||
|
}
|
||||||
|
function sendnoenc(location, content) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", window.location.href + location, true);
|
||||||
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if (xhr.readyState == XMLHttpRequest.DONE) {
|
||||||
|
pub = (xhr.responseText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let out = {}
|
||||||
|
Object.assign(out, { json: true, enc: false }, content)
|
||||||
|
xhr.send(JSON.stringify(out))
|
||||||
|
}
|
||||||
|
document.onkeypress = function (key) {
|
||||||
|
key = key || window.event;
|
||||||
|
if (key.key == "Enter") {
|
||||||
|
submit()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
async function load() {
|
||||||
|
sendnoenc('pub.key', { sid: sid })
|
||||||
|
readTextFile("kanna.txt").then((kanna) => {
|
||||||
|
let left = -300;
|
||||||
|
let top = -40;
|
||||||
|
let t = setInterval(() => {
|
||||||
|
document.getElementById("kanna").innerHTML += "<div style='user-select: none;white-space: nowrap; position:absolute;left:" + left + "px;top:" + top + "%;transform:scale(.5)'><tt><b>" + (kanna.replaceAll("#", "</br>").replaceAll(" ", "<font style='color:rgba(1,1,1,0)'>_</font>")) + "</b></div></tt></a>"
|
||||||
|
left += 300
|
||||||
|
if (left >= 600) {
|
||||||
|
clearInterval(t)
|
||||||
|
setTimeout(() => {
|
||||||
|
/*
|
||||||
|
document.body.innerHTML += "<tt><div style='position:absolute;bottom:20px;left:50px;font-weight:100;'>login w/ {user:<input placeholder='root' type='text' id='user' name='user'>,pass:<input type='password' id='pass' name='pass'>}</br><sub>will be <abbr title='so that the \"network administrators\"/\"IT people\" cant get in >:) '>encrypted</abbr> dont worry:)<input style='background-color:rgba(80,80,80,.3);border-color:rgba(80,80,80,.1);border:line;border-radius:5px;' type='button' value='submit' onclick='submit()'></sub></div></tt>"
|
||||||
|
document.body.innerHTML += "<div style='position:absolute;bottom:20px;right:50px;user-select: none;cursor:pointer;' onclick=\"location.href='mailto:grantsquires@disroot.org';\"><tt>need a account? contact grantsquires@disroot.org<sub><sub>(click here)</sub></sub></tt></div>"
|
||||||
|
*/
|
||||||
|
deg = 10
|
||||||
|
document.body.innerHTML += "<div id='pan' style='position:absolute;bottom:0px;right:0px;width:600px;height:100px;background-color:rgba(150,150,150,0.3);box-shadow: 0px 0px 20px 12px rgba(0,0,0,0.5);backdrop-filter:hue-rotate(10deg) blur(5px);border-radius:10px 0px 0px 0px;'></div>"
|
||||||
|
setInterval(() => {
|
||||||
|
deg += 10
|
||||||
|
|
||||||
|
document.getElementById('pan').style.backdropFilter = "hue-rotate(" + deg + "deg) blur(5px)"
|
||||||
|
}, 500)
|
||||||
|
}, 50)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}, 80)
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</tt>
|
</tt>
|
||||||
|
|
||||||
</html>
|
</html>
|
3
index.ts
3
index.ts
|
@ -8,6 +8,7 @@ const bodyParser = require("body-parser");
|
||||||
app.use(bodyParser.urlencoded({ extended: false }));
|
app.use(bodyParser.urlencoded({ extended: false }));
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json());
|
||||||
const NodeRSA = require('node-rsa');
|
const NodeRSA = require('node-rsa');
|
||||||
|
var ip = require("ip")
|
||||||
//let priv = '';
|
//let priv = '';
|
||||||
|
|
||||||
interface keyring{
|
interface keyring{
|
||||||
|
@ -59,5 +60,5 @@ app.post('/login/submit', async (req:{body:{json:boolean,enc:boolean,data:string
|
||||||
|
|
||||||
|
|
||||||
app.listen(port,'0.0.0.0', () => {
|
app.listen(port,'0.0.0.0', () => {
|
||||||
console.log(`Example app listening on port ${port}`)
|
console.log(`kanna is on http://${ip.address()}:${port} click on me click on me! :3`)
|
||||||
})
|
})
|
11
package-lock.json
generated
11
package-lock.json
generated
|
@ -13,6 +13,7 @@
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"fs": "^0.0.1-security",
|
"fs": "^0.0.1-security",
|
||||||
|
"ip": "^1.1.8",
|
||||||
"node-rsa": "^1.1.1"
|
"node-rsa": "^1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -323,6 +324,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/ip": {
|
||||||
|
"version": "1.1.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
|
||||||
|
"integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg=="
|
||||||
|
},
|
||||||
"node_modules/ipaddr.js": {
|
"node_modules/ipaddr.js": {
|
||||||
"version": "1.9.1",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||||
|
@ -862,6 +868,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
},
|
},
|
||||||
|
"ip": {
|
||||||
|
"version": "1.1.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
|
||||||
|
"integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg=="
|
||||||
|
},
|
||||||
"ipaddr.js": {
|
"ipaddr.js": {
|
||||||
"version": "1.9.1",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start":"ts-node index.ts"
|
"start": "ts-node index.ts"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"fs": "^0.0.1-security",
|
"fs": "^0.0.1-security",
|
||||||
|
"ip": "^1.1.8",
|
||||||
"node-rsa": "^1.1.1"
|
"node-rsa": "^1.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue