endpwn3/monitor.html
2018-05-20 07:55:58 -04:00

99 lines
No EOL
4.2 KiB
HTML

<!--
EndPwn3 Stage 1 Payload
Copyright 2018 EndPwn Project
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
https://github.com/endpwn/
-->
<html>
<head>
<script>
try {
// grab stage 2
fetch('https://endpwn.github.io/endpwn3/stage2.js?_=' + Date.now()).then(x => x.text()).then(stage2 =>
// grab shared
fetch('https://endpwn.github.io/endpwn3/shared.js?_=' + Date.now()).then(x => x.text()).then(shared => {
// the monitor gets node integration; no silly DiscordNative bullshit
var fs = require('original-fs');
var electron = require('electron').remote;
// find the main window
var win = electron.BrowserWindow.getAllWindows().filter(x => x.getURL().indexOf('monitor') == -1)[0];
// inject stage 2 once Discord is done loading
win.webContents.on('dom-ready', () => {
win.webContents.executeJavaScript(shared);
win.webContents.executeJavaScript(stage2);
});
// get the data path
var data = electron.app.getPath('userData');
function load() {
var branch = require('path').basename(data).substr(7);
//if (branch != 'canary')
win.loadURL('https://' + (branch && branch != 'development' ? branch + '.' : '') + 'discordapp.com/channels/@me');
//else
//win.loadURL('https://dr1ft.xyz/channels/@me?branch=canary&build=15523'); // emergency, ugly, temp fix
}
// dont update EPAPI/CRISPR if DONTUPDATE exists
if (!fs.existsSync(data + '/DONTUPDATE')) {
// update EPAPI
fetch('https://endpwn.github.io/epapi/epapi.js?_=' + Date.now())
.then(r => r.text())
.then(epapi => {
fs.writeFileSync(data + '/epapi.js', epapi);
// update CRISPR
fetch('https://endpwn.github.io/crispr/crispr.js?_=' + Date.now())
.then(r => r.text())
.then(epapi => {
fs.writeFileSync(data + '/crispr.js', epapi);
setTimeout(load, 1000);
});
});
}
else {
setTimeout(load, 1000);
}
})
);
}
catch (e) {
console.error(e);
alert(`The monitor encountered an error:\n\n${e}\n\nDiscord may stall here.`, 'EndPwn3: Monitor failure');
load();
}
</script>
</head>
<body>
<!-- i wrote this haiku as an easteregg, but since the source is getting pushed to GitHub it won't be as much of a secret anymore -->
quietly i watch
<br> waiting for the right moment
<br> i ignite the flame
</body>
</html>