a message

This commit is contained in:
grant-kun 2022-10-03 14:06:52 -05:00
parent 1281900e2e
commit 0f33502fa9
4 changed files with 168 additions and 145 deletions

View file

@ -1,5 +1,6 @@
<html>
<head >
<head>
<title>
worst website ever (real)
</title>
@ -8,160 +9,169 @@
<style>
abbr {
font-style: italic;
position: relative
}
font-style: italic;
position: relative
}
abbr:hover::after {
background: #add8e6;
border-radius: 4px;
bottom: 100%;
content: attr(title);
display: block;
left: 100%;
padding: 1em;
position: absolute;
width: 280px;
z-index: 1;
}
abbr:hover::after {
background: #add8e6;
border-radius: 4px;
bottom: 100%;
content: attr(title);
display: block;
left: 100%;
padding: 1em;
position: absolute;
width: 280px;
z-index: 1;
}
input{
background-color: rgba(200,200,200,.5);
backdrop-filter: blur(5px);
border-radius: 5px;
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))
}
input {
background-color: rgba(200, 200, 200, .5);
backdrop-filter: blur(5px);
border-radius: 5px;
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))
}
</style>
</head>
<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>
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;
}
function lightsout(){
document.body.style.backgroundImage=''
document.body.innerHTML=""
document.body.style.backgroundColor="black"
document.title = "DONT TOUCH KANNA"
setTimeout(()=>{
document.body.innerHTML='<img style="display:block;"src="src/lights-out.gif" id="gif" width=100% height=100%/>'
setTimeout(()=>{
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)
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;
}
}
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>"
},50)
function lightsout() {
document.body.style.backgroundImage = ''
document.body.innerHTML = ""
document.body.style.backgroundColor = "black"
document.title = "DONT TOUCH KANNA"
setTimeout(() => {
document.body.innerHTML = '<img style="display:block;"src="src/lights-out.gif" id="gif" width=100% height=100%/>'
setTimeout(() => {
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)
}
}
}
},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>
</body>
</tt>
</html>

View file

@ -8,6 +8,7 @@ const bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
const NodeRSA = require('node-rsa');
var ip = require("ip")
//let priv = '';
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', () => {
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
View file

@ -13,6 +13,7 @@
"crypto": "^1.0.1",
"express": "^4.18.1",
"fs": "^0.0.1-security",
"ip": "^1.1.8",
"node-rsa": "^1.1.1"
}
},
@ -323,6 +324,11 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"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": {
"version": "1.9.1",
"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",
"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": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",

View file

@ -4,7 +4,7 @@
"description": "",
"main": "index.ts",
"scripts": {
"start":"ts-node index.ts"
"start": "ts-node index.ts"
},
"repository": {
"type": "git",
@ -22,6 +22,7 @@
"crypto": "^1.0.1",
"express": "^4.18.1",
"fs": "^0.0.1-security",
"ip": "^1.1.8",
"node-rsa": "^1.1.1"
}
}