├── update.sh ├── README.md ├── example.html ├── LICENSE └── booungJS.js /update.sh: -------------------------------------------------------------------------------- 1 | echo "update booungJS.." 2 | git reset --hard HEAD 3 | git pull -v 4 | echo "finish" 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # BooungJS 4 | Vulnerability analysis to javascript using javascript and web debugger 5 | -------------------------------------------------------------------------------- /example.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 하훌(HAHWUL) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /booungJS.js: -------------------------------------------------------------------------------- 1 | // BooungJS v1.0 2 | // This script is security analysis javascript code 3 | // Load a script ! 4 | // [GIT] : https://github.com/hahwul/booungJS 5 | // [AUTHOR] : HAHWUL(www.hahwul.com) 6 | 7 | // $.getScript("http://hahwul.com/1.js"); 8 | // document.write(""); 9 | 10 | var Base64 = { 11 | // private property 12 | _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 13 | // public method for encoding 14 | encode : function (input) { 15 | var output = ""; 16 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 17 | var i = 0; 18 | while (i < input.length) { 19 | chr1 = input.charCodeAt(i++); 20 | chr2 = input.charCodeAt(i++); 21 | chr3 = input.charCodeAt(i++); 22 | enc1 = chr1 >> 2; 23 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 24 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 25 | enc4 = chr3 & 63; 26 | if (isNaN(chr2)) { 27 | enc3 = enc4 = 64; 28 | } else if (isNaN(chr3)) { 29 | enc4 = 64; 30 | } 31 | output = output + 32 | this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + 33 | this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); 34 | } 35 | return output; 36 | }, 37 | // public method for decoding 38 | decode : function (input) 39 | { 40 | var output = ""; 41 | var chr1, chr2, chr3; 42 | var enc1, enc2, enc3, enc4; 43 | var i = 0; 44 | input = input.replace(/[^A-Za-z0-9+/=]/g, ""); 45 | while (i < input.length) 46 | { 47 | enc1 = this._keyStr.indexOf(input.charAt(i++)); 48 | enc2 = this._keyStr.indexOf(input.charAt(i++)); 49 | enc3 = this._keyStr.indexOf(input.charAt(i++)); 50 | enc4 = this._keyStr.indexOf(input.charAt(i++)); 51 | chr1 = (enc1 << 2) | (enc2 >> 4); 52 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 53 | chr3 = ((enc3 & 3) << 6) | enc4; 54 | output = output + String.fromCharCode(chr1); 55 | if (enc3 != 64) { 56 | output = output + String.fromCharCode(chr2); 57 | } 58 | if (enc4 != 64) { 59 | output = output + String.fromCharCode(chr3); 60 | } 61 | } 62 | return output; 63 | } 64 | } 65 | 66 | function booungJS() 67 | { 68 | // init.. 69 | // 70 | this.all_list = document.all; 71 | this.all_count = document.all.length; 72 | this.scr_list = document.scripts; 73 | this.scr_count = document.scripts.length; 74 | this.scr_report = new Array(); 75 | // ------ 76 | this.banner(); 77 | this.scr_buf = []; 78 | this.all_buf = []; 79 | var i=0; 80 | while(i> ["+this.all_count+" HTML object / "+this.scr_count+" JS object] on DOM Area"); 96 | this.help(); 97 | } 98 | booungJS.prototype.banner = function banner() 99 | { 100 | console.log(" , _ , ____ By HAHWUL[www.hahwul.com] _ ____ \n ( o o ) | __ ) ___ ___ _ _ _ __ __ _ | / ___| \n/'` ' `'\\| _ \\ / _ \\ / _ \\| | | | '_ \\ / _` |_ | \\___ \\ \n|'''''''|| |_) | (_) | (_) | |_| | | | | (_| | |_| |___) |\n|\\\\'''//||____/ \\___/ \\___/ \\__,_|_| |_|\\__, |\\___/|____/ \n ''' |___/ \nVulnerability analysis to javascript using javascript and web debugger."); 101 | } 102 | booungJS.prototype.help = function help() 103 | { 104 | console.log('booungJS Command line\n - booung.anlaysis() # analysis HTML/Javascript code\n - booung.search("document.write") # find text\n - booung.base64("ABCD") # encode&decode base64\n - booung.help() # show help\n - booung.banner() # load banner '); 105 | 106 | /* 107 | 108 | - booung.anlaysis() # analysis javascript code 109 | - booung.search("document.write") # find text 110 | - booung.base64("ABCD") # encode&decode base64 111 | - booung.help() # show help 112 | - booung.banner() # load banner 113 | 114 | */ 115 | } 116 | booungJS.prototype.base64 = function base64(data) // Insert to report data function 117 | { 118 | return "\nEncode: "+Base64.encode(data)+"\nDecode: "+Base64.decode(data)+"\n"; 119 | } 120 | booungJS.prototype.rpush = function rpush(type,category,data) // Insert to report data function 121 | { // this.rpush("INF","SEARCH_MODULE","["+searchq+"] : "+result+" line in"+this.scr_list[i].id+"."); 122 | var count = this.scr_report.length; 123 | this.scr_report.push(new Array()); 124 | this.scr_report[count].push(type,category,data); 125 | } 126 | booungJS.prototype.report = function report() // Insert to report data function 127 | { // 128 | console.log("REPORT"); 129 | var buf = "booungJS > Vulnerability&Security risk Analysis report" 130 | for(var i=0;i> Found ["+searchq+"] "+result+" line in"+this.scr_list[i].id+"."); 146 | } 147 | i++; 148 | } 149 | console.log("Complate!"); 150 | }; 151 | booungJS.prototype.analysis = function analysis() 152 | { 153 | var md5_pattern = new RegExp("/^[a-f0-9]{32}$/","i"); 154 | console.log("-script analysis") 155 | var i = 0; 156 | while(i> "+result+" line in"+this.scr_list[i].id+"."); 163 | } 164 | result = this.scr_buf[i].indexOf("sessionStorage"); 165 | if(result != -1) 166 | { 167 | this.rpush("INF","ANALYSIS_MODULE","[sessionStorage] : "+result+" line in"+this.scr_list[i].id+"."); 168 | console.info(" >> "+result+" line in"+this.scr_list[i].id+"."); 169 | } 170 | result = this.scr_buf[i].indexOf("document.write("); 171 | if(result != -1) 172 | { 173 | this.rpush("INF","ANALYSIS_MODULE","[dom write] : "+result+" line in"+this.scr_list[i].id+"."); 174 | console.info(" >> "+result+" line in"+this.scr_list[i].id+"."); 175 | } 176 | result = this.scr_buf[i].indexOf("eval("); 177 | if(result != -1) 178 | { 179 | this.rpush("INF","ANALYSIS_MODULE","[eval function] : "+result+" line in"+this.scr_list[i].id+"."); 180 | console.info(" >> "+result+" line in"+this.scr_list[i].id+"."); 181 | } 182 | i++; 183 | } 184 | i=0; 185 | while(i> "+result+" line in"+this.scr_list[i].id+"."); 192 | } 193 | i++; 194 | } 195 | console.log("Complate!"); 196 | }; 197 | 198 | var booung = new booungJS(); 199 | 200 | --------------------------------------------------------------------------------