-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpinfo.php
More file actions
186 lines (170 loc) · 5.71 KB
/
phpinfo.php
File metadata and controls
186 lines (170 loc) · 5.71 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
$access_password = "123456";
$wrong_pwd = (!empty($_POST["password"]) &&
$_POST["password"] != $access_password);
if (!empty($_POST["password"]) && !$wrong_pwd) {
phpinfo();
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Password required!</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
a, button {
cursor: pointer;
}
*[disabled] {
cursor: not-allowed !important;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a[href] {
color: blue;
}
.recommended {
background:rgba(12, 218, 173, 0.3);
}
form label {
cursor: pointer;
}
.mydialog {
position: fixed;
left: 0;
top: 0;
z-index: 10;
background: white;
border: 1px solid #cccccc;
padding: 5px 5px;
}
.mydialog dialog-title {
font-weight: bold;
padding: 10px 10px;
background: #e9e9e9;
border: 1px solid #dddddd;
display: block;
cursor: default;
user-select: none;
-webkit-user-select: none;
}
.mydialog dialog-title .btn {
cursor: pointer;
}
.mydialog dialog-title .btn.close {
font-family: 'Consolas', serif, sans-serif;
position: absolute;
right: 0;
transform: translate(-100%, 0);
}
#pwd_form {
border: 1px solid gray;
padding: 10px 10px;
}
#show_pswd {
user-select: none;
-webkit-user-select: none;
}
.PASSWORD_ERROR_PROMPT {
margin-top: 8px;
padding: 4px 4px;
background: rgba(220, 32, 32, 0.9);
color: #ffffff;
}
</style>
</head>
<body>
<main>
<div id="main_div_dialog" class="mydialog" hidden>
<dialog-title>phpinfo.php
<button class="btn close" title="Close" disabled>x</button>
</dialog-title>
<h1>Password required!</h1>
<h3>You must <a href="##" id="input_pwd_btn_1">input password</a>
to access php and native information.</h3>
<br />
<form id="pwd_form" action="" method="post">
<div><label style="display:flex">
Password: <input style="flex:1"
type="password" name="password"
id="pwd" required autofocus />
<label> <button type="button" id="show_pswd">
Show Password</button></label>
</label></div>
<?php
if ($wrong_pwd) {
echo '<div class="PASSWORD_ERROR_PROMPT">'.
'Password is incorrect. Please <a '.
'href="javascript:void pwd.focus()" '.
'style="color: white;">retry</a>.'.
'</div>';
}
?>
<br />
<div style="display: flex; text-align: center;">
<button type="submit" flex="1"
class="btn recommended"
style="font-size: larger;flex: 1;">
Submit
</button>
<button type="reset" flex="1" disabled
class="btn" style="font-size: larger;">
Reset
</button>
<button type="button" flex="1" disabled
style="font-size: larger;" id="btn_close">
Close
</button>
</div>
</form>
</div>
</main>
<script>
(function () {
var mdd = document.querySelector('#main_div_dialog');
mdd.hidden = false;
var mdd_resize = function () {
mdd.style.left =
document.documentElement.clientWidth / 2
- (mdd.clientWidth/2) + 'px';
mdd.style.top =
document.documentElement.clientHeight / 2
- (mdd.clientHeight/2) + 'px';
}
window.addEventListener('resize', mdd_resize)
mdd_resize();
input_pwd_btn_1.onclick = function (event) {
(event || window.event).preventDefault();
pwd.focus();
return false;
}
mdd.querySelector('dialog-title button.close').onclick =
btn_close.onclick = function () {
mdd.remove();
var w = window.open('', '_self');
w.document.open();
w.document.write("It is safe to close this page now.");
w.document.close();
w.opener = window.opener = null;
window.close();
w.close();
}
show_pswd.onmousedown = show_pswd.onkeypress =
show_pswd.ontouchstart = function () {
pwd.type = "text";
}; show_pswd.onmouseup = function () {
pwd.type = "password";
pwd.focus();
}; show_pswd.onkeyup = show_pswd.ontouchend = function () {
pwd.type = "password";
}; show_pswd.oncontextmenu = function () { return false };
})()
</script>
</body>
</html>