endpwn3/monitor.htm

96 lines
4 KiB
HTML
Raw Normal View History

2018-04-18 02:14:17 +00:00
<!--
EndPwn3 Stage 1 Payload
2018-04-19 11:20:17 +00:00
Copyright 2018 EndPwn Project
2018-04-18 02:14:17 +00:00
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.
2018-04-19 04:07:13 +00:00
https://github.com/endpwn/
2018-04-18 02:14:17 +00:00
-->
<html>
<head>
<script>
try {
// grab stage 2
2018-04-22 10:41:50 +00:00
fetch('https://endpwn.github.io/endpwn3/stage2.js?_=' + Date.now()).then(x => x.text()).then(stage2 =>
2018-04-22 04:17:26 +00:00
// grab shared
2018-04-22 10:41:50 +00:00
fetch('https://endpwn.github.io/endpwn3/shared.js?_=' + Date.now()).then(x => x.text()).then(shared => {
2018-04-22 04:17:26 +00:00
// 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', () => {
2018-04-22 10:41:50 +00:00
win.webContents.executeJavaScript(shared);
2018-04-22 09:41:55 +00:00
win.webContents.executeJavaScript(stage2);
2018-04-22 04:17:26 +00:00
});
2018-05-03 17:28:57 +00:00
// get the data path
var data = electron.app.getPath('userData');
2018-04-22 04:17:26 +00:00
function load() {
2018-05-03 17:28:57 +00:00
var branch = require('path').basename(data).substr(7);
2018-05-03 02:13:03 +00:00
win.loadURL('https://' + (branch ? branch + '.' : '') + 'discordapp.com/channels/@me');
2018-04-22 04:17:26 +00:00
}
// dont update EPAPI/CRISPR if DONTUPDATE exists
2018-04-22 04:17:26 +00:00
if (!fs.existsSync(data + '/DONTUPDATE')) {
// update EPAPI
2018-04-22 04:17:26 +00:00
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);
});
2018-04-22 04:17:26 +00:00
});
}
else {
setTimeout(load, 1000);
}
2018-04-22 10:41:50 +00:00
})
2018-04-22 04:25:49 +00:00
2018-04-22 10:41:50 +00:00
);
2018-04-18 02:14:17 +00:00
}
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>