-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
61 lines (51 loc) · 2.21 KB
/
index.php
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
<!DOCTYPE html>
<html>
<head>
<title>Basic Csp Playground </title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
</head>
<body>
<div class="bg-success p-2 text-dark bg-opacity-25">
<h1>Basic Csp Playground</h1>
<input class="btn btn-primary" type="submit" name="submit" value="TEST" onclick="javascript:doTest()" />
<br>
<br>
<a href='https://report-uri.com/home/generate' target='_blank'>To build CSP directive with UI</a>
<script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function reload() {
await sleep(1000);
clickTagInIframe("violationframe", "reload")
}
function clickTagInIframe(iframeRef, tagRef) {
var frame = document.getElementById(iframeRef);
var MyIFrameDoc = (frame.contentWindow || frame.contentDocument);
if (MyIFrameDoc.document) MyIFrameDoc = MyIFrameDoc.document;
MyIFrameDoc.getElementById(tagRef).click();
}
function submitFormInFrame(iframeRef, tagForm) {
var frame = document.getElementById(iframeRef);
var MyIFrameDoc = (frame.contentWindow || frame.contentDocument);
if (MyIFrameDoc.document) MyIFrameDoc = MyIFrameDoc.document;
MyIFrameDoc.getElementById(tagForm).submit();
}
function doTest() {
submitFormInFrame("testframe", "form")
reload();
}
</script>
</div>
<div class="container m-0">
<div class="row" >
<div class="col-7">
<iframe style='height:700px;' width="100%" id="testframe" src="http://0.0.0.0:8080/test.php"></iframe>
</div>
<div class="col">
<iframe style='height:700px' width="100%" id="violationframe" src="http://0.0.0.0:8080/getViolations.php"></iframe>
</div>
</div>
</div>
</body>
</html>