标签:
page.onAlert = function (message) {
if(message == xss_mark) {
xss_exists = 1;
ret = "Success, xss exists";
phantom_exit(ret);
}
console.log(‘Alert: ‘ + message);
return true;
};
function check_dom_xss_vul(){
return document.getElementsByTagName(dom_xss_mark).length;
}
<?php
echo $_GET[‘test‘];
?>
<?php
$click = $_GET[‘test‘];
echo "<div onclick=$click></div>";
?>
var nodes = document.all;
for(var i=0;i<nodes.length;i++){
var attrs = nodes[i].attributes;
for(var j=0;j<attrs.length;j++){
attr_name = attrs[j].nodeName;
attr_value = attrs[j].nodeValue;
if(attr_name.substr(0,2) == "on"){
console.log(attrs[j].nodeName + ‘ : ‘ + attr_value);
eval(attr_value);
}
}
}
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="link-area"></div>
<?php
echo ‘<script>$("#image").click(function(){$(".link-area").html("‘.$_GET[‘test‘].‘")});</script>‘;
?>
// phantom_finish.js
var evt = document.createEvent(‘CustomEvent‘);
evt.initCustomEvent(click, true, true, null);
document.getElementsByTagName("div")[0].dispatchEvent(evt);
// phantom_init.js
_addEventListener = Element.prototype.addEventListener
Element.prototype.addEventListener = function(a,b,c) {
save_event_dom(this, a); // 将所有的绑定事件节点信息存储起来
_addEventListener.apply(this, arguments);
};
标签:
原文地址:http://www.cnblogs.com/kuoaidebb/p/5787109.html