Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 49 lines (46 sloc) 2.65 KB
"THE BEER-WARE LICENSE" (Revision 42):
<> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. Debasish Mandal
This JS code should be used for generating a python dict. of element attributes of different HTML elements.
In case of dynamic fuzzer, its usually generated on the fly, since its a static fuzzer you need to pre define html elements and their attributes to your test case.
Other wise you can use a list of well known attributes. It's completely your choice, how you write your test case.
function getEleAttributes(ele){
buff = "['"
for( var p in ele ){
buff += p + "','";
buff = buff.slice(0, -2) + "]";
return buff
function generate() {
Add your element list in this here and open this html in IE.
main_buff = "ele_dict = {"
for (ele in elements){
var id_0 = document.createElement( elements[ele] );
all_props = getEleAttributes(id_0)
main_buff += "'"+elements[ele]
main_buff += "':"
main_buff += all_props
main_buff += ","
main_buff = main_buff.slice(0,-1)
main_buff += "}"
document.getElementById('result').innerHTML = main_buff;
<body onload='generate();'>
<b>Output : (Copy paste following python dictionary to your testcase generator script and fuzz using them )</b></br><textarea id="result" rows="100" cols="200"></textarea>