webserver detecteren
Net nieuw op dit forum :P.
Ik had gelijk ook een vraagje, Ik ben bezig met een project voor mezelf. En ik ben van plan om een detectie te maken die detecteert welke webserver het script detecteert, zoals:
if($_SERVER['SERVER_SOFTWARE'] === 'Nginx')
{
echo "Deze webserver draait op Nginx!";
} elseif($_SERVER['SERVER_SOFTWARE'] === 'Apache2')
{
echo "Deze webserver draait op Apache2!";
}
Alleen nu het ding is dat ik dit geprobeerd heb, And it didn't work helaas.. Hebben jullie een idee hoe ik dit zou moeten oppakken? Internet afgezocht en niets gezien, alleen maar dat het niet kan etc etc. Hoop dat ik hier een antwoord op kan krijgen! :)
greetings,
Toevoeging op 09/04/2022 18:44:07:
Code (php)
Nog eleganter.
Code (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
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
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
<style>
code {color: red;}
</style>
<hr>
<p>done met xml (@php_uname)</p>
<hr>
<?php
echo "Hostname (n) : <code>" . @php_uname(n) . "</code><br />\n";
if (function_exists( 'shell_exec' )) {
echo "Hostname : <code>" . @gethostbyname(trim(`hostname`)) . "</code><br />\n";
}
else {
echo "Server IP : <code>". $_SERVER['SERVER_ADDR'] . "</code><br />\n";
}
echo "Platform (s) : <code>" . @php_uname(s) . "</code>, (r) : <code>" . @php_uname(r) . "</code>, (v) : <code>" . @php_uname(v) . "</code><br />\n";
echo "Architecture (m) : <code>" . @php_uname(m) . "</code><br />\n";
echo "Username : <code>" . get_current_user () . "</code> ( UiD: <code>" . getmyuid() . "</code>, GiD: <code>" . getmygid() . "</code> )<br />\n";
echo "Curent Path (getcwd) : <code>" . getcwd () . "</code><br />\n";
echo "--FILE-- : <code>" . __FILE__ . "</code><br />\n";
echo "dirname FILE : <code>" . dirname(__FILE__) . "</code><br />\n";
echo "basename FILE : <code>" . basename(__FILE__) . "</code><br />\n";
echo "dirname SCRIPT_NAME : <code>" . dirname($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "basename SCRIPT_NAME : <code>" . basename($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "<hr>";
$path_parts = pathinfo(__FILE__);
echo '$path_parts = <code>pathinfo(__FILE__)</code><br />' . "\n";
echo '$path_parts[' . "'dirname']'" . "<br />\n";
echo "dirname : <code>" . $path_parts['dirname'], "</code><br />\n";
echo "basename : <code>" . $path_parts['basename'], "</code><br />\n";
echo "extension : <code>" . $path_parts['extension'], "</code><br />\n";
echo "filename : <code>" . $path_parts['filename'], "</code><br />\n"; // since PHP 5.2.0
echo "<hr>";
echo '<p>All names have prefix <b>$_SERVER["name"]</b></p>';
echo "USER " . " : <code>" . $_SERVER["USER"] . "</code><br />\n";
echo "HOME " . " : <code>" . $_SERVER["HOME"] . "</code><br />\n";
echo "FCGI_ROLE " . " : <code>" . $_SERVER["FCGI_ROLE"] . "</code><br />\n";
echo "REDIRECT_MOD_X_SENDFILE_ENABLED" . " : <code>" . $_SERVER["REDIRECT_MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "REDIRECT_HANDLER " . " : <code>" . $_SERVER["REDIRECT_HANDLER"] . "</code><br />\n";
echo "REDIRECT_STATUS " . " : <code>" . $_SERVER["REDIRECT_STATUS"] . "</code><br />\n";
echo "MOD_X_SENDFILE_ENABLED " . " : <code>" . $_SERVER["MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "HTTP_HOST " . " : <code>" . $_SERVER["HTTP_HOST"] . "</code><br />\n";
echo "HTTP_USER_AGENT " . " : <code>" . $_SERVER["HTTP_USER_AGENT"] . "</code><br />\n";
echo "HTTP_ACCEPT " . " : <code>" . $_SERVER["HTTP_ACCEPT"] . "</code><br />\n";
echo "HTTP_ACCEPT_LANGUAGE " . " : <code>" . $_SERVER["HTTP_ACCEPT_LANGUAGE"] . "</code><br />\n";
echo "HTTP_ACCEPT_ENCODING " . " : <code>" . $_SERVER["HTTP_ACCEPT_ENCODING"] . "</code><br />\n";
echo "HTTP_CONNECTION " . " : <code>" . $_SERVER["HTTP_CONNECTION"] . "</code><br />\n";
echo "PATH " . " : <code>" . $_SERVER["PATH"] . "</code><br />\n";
echo "SERVER_SIGNATURE " . " : <code>" . $_SERVER["SERVER_SIGNATURE"] . "</code><br />\n";
echo "SERVER_SOFTWARE " . " : <code>" . $_SERVER["SERVER_SOFTWARE"] . "</code><br />\n";
echo "SERVER_NAME " . " : <code>" . $_SERVER["SERVER_NAME"] . "</code><br />\n";
$ip_server = $_SERVER["SERVER_ADDR"];
if (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_server_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_server_echo = "is a valid IPv4 address";
}
echo "SERVER_ADDR " . " : <code>" . $_SERVER["SERVER_ADDR"] . "</code> $ip_server_echo<br />\n";
echo "SERVER_PORT " . " : <code>" . $_SERVER["SERVER_PORT"] . "</code><br />\n";
$ip_remote = $_SERVER["REMOTE_ADDR"];
if (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_remote_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_remote_echo = "is a valid IPv4 address";
}
echo "REMOTE_ADDR " . " : <code>" . $_SERVER["REMOTE_ADDR"] . "</code> $ip_remote_echo<br />\n";
echo "DOCUMENT_ROOT " . " : <code>" . $_SERVER["DOCUMENT_ROOT"] . "</code><br />\n";
echo "SERVER_ADMIN " . " : <code>" . $_SERVER["SERVER_ADMIN"] . "</code><br />\n";
echo "SCRIPT_FILENAME " . " : <code>" . $_SERVER["SCRIPT_FILENAME"] . "</code><br />\n";
echo "REMOTE_PORT " . " : <code>" . $_SERVER["REMOTE_PORT"] . "</code><br />\n";
echo "REDIRECT_URL " . " : <code>" . $_SERVER["REDIRECT_URL"] . "</code><br />\n";
echo "GATEWAY_INTERFACE " . " : <code>" . $_SERVER["GATEWAY_INTERFACE"] . "</code><br />\n";
echo "SERVER_PROTOCOL " . " : <code>" . $_SERVER["SERVER_PROTOCOL"] . "</code><br />\n";
echo "REQUEST_METHOD " . " : <code>" . $_SERVER["REQUEST_METHOD"] . "</code><br />\n";
echo "QUERY_STRING " . " : <code>" . $_SERVER["QUERY_STRING"] . "</code><br />\n";
echo "REQUEST_URI " . " : <code>" . $_SERVER["REQUEST_URI"] . "</code><br />\n";
echo "SCRIPT_NAME " . " : <code>" . $_SERVER["SCRIPT_NAME"] . "</code><br />\n";
echo "ORIG_SCRIPT_FILENAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_FILENAME"] . "</code><br />\n";
echo "ORIG_PATH_INFO " . " : <code>" . $_SERVER["ORIG_PATH_INFO"] . "</code><br />\n";
echo "ORIG_PATH_TRANSLATED " . " : <code>" . $_SERVER["ORIG_PATH_TRANSLATED"] . "</code><br />\n";
echo "ORIG_SCRIPT_NAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_NAME"] . "</code><br />\n";
echo "PHP_SELF " . " : <code>" . $_SERVER["PHP_SELF"] . "</code><br />\n";
echo "REQUEST_TIME_FLOAT " . " : <code>" . $_SERVER["REQUEST_TIME_FLOAT"] . "</code><br />\n";
echo "REQUEST_TIME " . " : <code>" . $_SERVER["REQUEST_TIME"] . "</code><br />\n";
?>
code {color: red;}
</style>
<hr>
<p>done met xml (@php_uname)</p>
<hr>
<?php
echo "Hostname (n) : <code>" . @php_uname(n) . "</code><br />\n";
if (function_exists( 'shell_exec' )) {
echo "Hostname : <code>" . @gethostbyname(trim(`hostname`)) . "</code><br />\n";
}
else {
echo "Server IP : <code>". $_SERVER['SERVER_ADDR'] . "</code><br />\n";
}
echo "Platform (s) : <code>" . @php_uname(s) . "</code>, (r) : <code>" . @php_uname(r) . "</code>, (v) : <code>" . @php_uname(v) . "</code><br />\n";
echo "Architecture (m) : <code>" . @php_uname(m) . "</code><br />\n";
echo "Username : <code>" . get_current_user () . "</code> ( UiD: <code>" . getmyuid() . "</code>, GiD: <code>" . getmygid() . "</code> )<br />\n";
echo "Curent Path (getcwd) : <code>" . getcwd () . "</code><br />\n";
echo "--FILE-- : <code>" . __FILE__ . "</code><br />\n";
echo "dirname FILE : <code>" . dirname(__FILE__) . "</code><br />\n";
echo "basename FILE : <code>" . basename(__FILE__) . "</code><br />\n";
echo "dirname SCRIPT_NAME : <code>" . dirname($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "basename SCRIPT_NAME : <code>" . basename($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "<hr>";
$path_parts = pathinfo(__FILE__);
echo '$path_parts = <code>pathinfo(__FILE__)</code><br />' . "\n";
echo '$path_parts[' . "'dirname']'" . "<br />\n";
echo "dirname : <code>" . $path_parts['dirname'], "</code><br />\n";
echo "basename : <code>" . $path_parts['basename'], "</code><br />\n";
echo "extension : <code>" . $path_parts['extension'], "</code><br />\n";
echo "filename : <code>" . $path_parts['filename'], "</code><br />\n"; // since PHP 5.2.0
echo "<hr>";
echo '<p>All names have prefix <b>$_SERVER["name"]</b></p>';
echo "USER " . " : <code>" . $_SERVER["USER"] . "</code><br />\n";
echo "HOME " . " : <code>" . $_SERVER["HOME"] . "</code><br />\n";
echo "FCGI_ROLE " . " : <code>" . $_SERVER["FCGI_ROLE"] . "</code><br />\n";
echo "REDIRECT_MOD_X_SENDFILE_ENABLED" . " : <code>" . $_SERVER["REDIRECT_MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "REDIRECT_HANDLER " . " : <code>" . $_SERVER["REDIRECT_HANDLER"] . "</code><br />\n";
echo "REDIRECT_STATUS " . " : <code>" . $_SERVER["REDIRECT_STATUS"] . "</code><br />\n";
echo "MOD_X_SENDFILE_ENABLED " . " : <code>" . $_SERVER["MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "HTTP_HOST " . " : <code>" . $_SERVER["HTTP_HOST"] . "</code><br />\n";
echo "HTTP_USER_AGENT " . " : <code>" . $_SERVER["HTTP_USER_AGENT"] . "</code><br />\n";
echo "HTTP_ACCEPT " . " : <code>" . $_SERVER["HTTP_ACCEPT"] . "</code><br />\n";
echo "HTTP_ACCEPT_LANGUAGE " . " : <code>" . $_SERVER["HTTP_ACCEPT_LANGUAGE"] . "</code><br />\n";
echo "HTTP_ACCEPT_ENCODING " . " : <code>" . $_SERVER["HTTP_ACCEPT_ENCODING"] . "</code><br />\n";
echo "HTTP_CONNECTION " . " : <code>" . $_SERVER["HTTP_CONNECTION"] . "</code><br />\n";
echo "PATH " . " : <code>" . $_SERVER["PATH"] . "</code><br />\n";
echo "SERVER_SIGNATURE " . " : <code>" . $_SERVER["SERVER_SIGNATURE"] . "</code><br />\n";
echo "SERVER_SOFTWARE " . " : <code>" . $_SERVER["SERVER_SOFTWARE"] . "</code><br />\n";
echo "SERVER_NAME " . " : <code>" . $_SERVER["SERVER_NAME"] . "</code><br />\n";
$ip_server = $_SERVER["SERVER_ADDR"];
if (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_server_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_server_echo = "is a valid IPv4 address";
}
echo "SERVER_ADDR " . " : <code>" . $_SERVER["SERVER_ADDR"] . "</code> $ip_server_echo<br />\n";
echo "SERVER_PORT " . " : <code>" . $_SERVER["SERVER_PORT"] . "</code><br />\n";
$ip_remote = $_SERVER["REMOTE_ADDR"];
if (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_remote_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_remote_echo = "is a valid IPv4 address";
}
echo "REMOTE_ADDR " . " : <code>" . $_SERVER["REMOTE_ADDR"] . "</code> $ip_remote_echo<br />\n";
echo "DOCUMENT_ROOT " . " : <code>" . $_SERVER["DOCUMENT_ROOT"] . "</code><br />\n";
echo "SERVER_ADMIN " . " : <code>" . $_SERVER["SERVER_ADMIN"] . "</code><br />\n";
echo "SCRIPT_FILENAME " . " : <code>" . $_SERVER["SCRIPT_FILENAME"] . "</code><br />\n";
echo "REMOTE_PORT " . " : <code>" . $_SERVER["REMOTE_PORT"] . "</code><br />\n";
echo "REDIRECT_URL " . " : <code>" . $_SERVER["REDIRECT_URL"] . "</code><br />\n";
echo "GATEWAY_INTERFACE " . " : <code>" . $_SERVER["GATEWAY_INTERFACE"] . "</code><br />\n";
echo "SERVER_PROTOCOL " . " : <code>" . $_SERVER["SERVER_PROTOCOL"] . "</code><br />\n";
echo "REQUEST_METHOD " . " : <code>" . $_SERVER["REQUEST_METHOD"] . "</code><br />\n";
echo "QUERY_STRING " . " : <code>" . $_SERVER["QUERY_STRING"] . "</code><br />\n";
echo "REQUEST_URI " . " : <code>" . $_SERVER["REQUEST_URI"] . "</code><br />\n";
echo "SCRIPT_NAME " . " : <code>" . $_SERVER["SCRIPT_NAME"] . "</code><br />\n";
echo "ORIG_SCRIPT_FILENAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_FILENAME"] . "</code><br />\n";
echo "ORIG_PATH_INFO " . " : <code>" . $_SERVER["ORIG_PATH_INFO"] . "</code><br />\n";
echo "ORIG_PATH_TRANSLATED " . " : <code>" . $_SERVER["ORIG_PATH_TRANSLATED"] . "</code><br />\n";
echo "ORIG_SCRIPT_NAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_NAME"] . "</code><br />\n";
echo "PHP_SELF " . " : <code>" . $_SERVER["PHP_SELF"] . "</code><br />\n";
echo "REQUEST_TIME_FLOAT " . " : <code>" . $_SERVER["REQUEST_TIME_FLOAT"] . "</code><br />\n";
echo "REQUEST_TIME " . " : <code>" . $_SERVER["REQUEST_TIME"] . "</code><br />\n";
?>
Cocotj bos op 09/04/2022 18:22:23:
Ik had gelijk ook een vraagje, Ik ben bezig met een project voor mezelf. En ik ben van plan om een detectie te maken die detecteert welke webserver het script detecteert, zoals:
Vergeef me dat ik dit niet begrijp. maar je weet toch wel op welke software je eigen webserver draait? Of is het zo dat je de webserver die je benadert wil detecteren?
Gewijzigd op 09/04/2022 20:44:42 door Aad B
- Ariën - op 09/04/2022 18:32:32:
Haii, ja heb de mijne gedebugged kreeg niks op mn scherm, ik ga dit is even uitproberen, zat ik net ook te bedenken bedankt! :)
Toevoeging op 09/04/2022 23:14:11:
Aad B op 09/04/2022 20:42:59:
Vergeef me dat ik dit niet begrijp. maar je weet toch wel op welke software je eigen webserver draait? Of is het zo dat je de webserver die je benadert wil detecteren?
Cocotj bos op 09/04/2022 18:22:23:
Ik had gelijk ook een vraagje, Ik ben bezig met een project voor mezelf. En ik ben van plan om een detectie te maken die detecteert welke webserver het script detecteert, zoals:
Vergeef me dat ik dit niet begrijp. maar je weet toch wel op welke software je eigen webserver draait? Of is het zo dat je de webserver die je benadert wil detecteren?
hoihoi, jaaa tuurlijk weet ik welk soort webserver software ik gebruik, gebruik momenteel nu Nginx, heb heel lang met apache gewerkt, maar wilde wat nieuws dus ja :P
Toevoeging op 09/04/2022 23:14:43:
Adoptive Solution op 09/04/2022 19:04:14:
Hier een zwik code om server info te verkrijgen.
Code (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
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
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
<style>
code {color: red;}
</style>
<hr>
<p>done met xml (@php_uname)</p>
<hr>
<?php
echo "Hostname (n) : <code>" . @php_uname(n) . "</code><br />\n";
if (function_exists( 'shell_exec' )) {
echo "Hostname : <code>" . @gethostbyname(trim(`hostname`)) . "</code><br />\n";
}
else {
echo "Server IP : <code>". $_SERVER['SERVER_ADDR'] . "</code><br />\n";
}
echo "Platform (s) : <code>" . @php_uname(s) . "</code>, (r) : <code>" . @php_uname(r) . "</code>, (v) : <code>" . @php_uname(v) . "</code><br />\n";
echo "Architecture (m) : <code>" . @php_uname(m) . "</code><br />\n";
echo "Username : <code>" . get_current_user () . "</code> ( UiD: <code>" . getmyuid() . "</code>, GiD: <code>" . getmygid() . "</code> )<br />\n";
echo "Curent Path (getcwd) : <code>" . getcwd () . "</code><br />\n";
echo "--FILE-- : <code>" . __FILE__ . "</code><br />\n";
echo "dirname FILE : <code>" . dirname(__FILE__) . "</code><br />\n";
echo "basename FILE : <code>" . basename(__FILE__) . "</code><br />\n";
echo "dirname SCRIPT_NAME : <code>" . dirname($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "basename SCRIPT_NAME : <code>" . basename($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "<hr>";
$path_parts = pathinfo(__FILE__);
echo '$path_parts = <code>pathinfo(__FILE__)</code><br />' . "\n";
echo '$path_parts[' . "'dirname']'" . "<br />\n";
echo "dirname : <code>" . $path_parts['dirname'], "</code><br />\n";
echo "basename : <code>" . $path_parts['basename'], "</code><br />\n";
echo "extension : <code>" . $path_parts['extension'], "</code><br />\n";
echo "filename : <code>" . $path_parts['filename'], "</code><br />\n"; // since PHP 5.2.0
echo "<hr>";
echo '<p>All names have prefix <b>$_SERVER["name"]</b></p>';
echo "USER " . " : <code>" . $_SERVER["USER"] . "</code><br />\n";
echo "HOME " . " : <code>" . $_SERVER["HOME"] . "</code><br />\n";
echo "FCGI_ROLE " . " : <code>" . $_SERVER["FCGI_ROLE"] . "</code><br />\n";
echo "REDIRECT_MOD_X_SENDFILE_ENABLED" . " : <code>" . $_SERVER["REDIRECT_MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "REDIRECT_HANDLER " . " : <code>" . $_SERVER["REDIRECT_HANDLER"] . "</code><br />\n";
echo "REDIRECT_STATUS " . " : <code>" . $_SERVER["REDIRECT_STATUS"] . "</code><br />\n";
echo "MOD_X_SENDFILE_ENABLED " . " : <code>" . $_SERVER["MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "HTTP_HOST " . " : <code>" . $_SERVER["HTTP_HOST"] . "</code><br />\n";
echo "HTTP_USER_AGENT " . " : <code>" . $_SERVER["HTTP_USER_AGENT"] . "</code><br />\n";
echo "HTTP_ACCEPT " . " : <code>" . $_SERVER["HTTP_ACCEPT"] . "</code><br />\n";
echo "HTTP_ACCEPT_LANGUAGE " . " : <code>" . $_SERVER["HTTP_ACCEPT_LANGUAGE"] . "</code><br />\n";
echo "HTTP_ACCEPT_ENCODING " . " : <code>" . $_SERVER["HTTP_ACCEPT_ENCODING"] . "</code><br />\n";
echo "HTTP_CONNECTION " . " : <code>" . $_SERVER["HTTP_CONNECTION"] . "</code><br />\n";
echo "PATH " . " : <code>" . $_SERVER["PATH"] . "</code><br />\n";
echo "SERVER_SIGNATURE " . " : <code>" . $_SERVER["SERVER_SIGNATURE"] . "</code><br />\n";
echo "SERVER_SOFTWARE " . " : <code>" . $_SERVER["SERVER_SOFTWARE"] . "</code><br />\n";
echo "SERVER_NAME " . " : <code>" . $_SERVER["SERVER_NAME"] . "</code><br />\n";
$ip_server = $_SERVER["SERVER_ADDR"];
if (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_server_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_server_echo = "is a valid IPv4 address";
}
echo "SERVER_ADDR " . " : <code>" . $_SERVER["SERVER_ADDR"] . "</code> $ip_server_echo<br />\n";
echo "SERVER_PORT " . " : <code>" . $_SERVER["SERVER_PORT"] . "</code><br />\n";
$ip_remote = $_SERVER["REMOTE_ADDR"];
if (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_remote_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_remote_echo = "is a valid IPv4 address";
}
echo "REMOTE_ADDR " . " : <code>" . $_SERVER["REMOTE_ADDR"] . "</code> $ip_remote_echo<br />\n";
echo "DOCUMENT_ROOT " . " : <code>" . $_SERVER["DOCUMENT_ROOT"] . "</code><br />\n";
echo "SERVER_ADMIN " . " : <code>" . $_SERVER["SERVER_ADMIN"] . "</code><br />\n";
echo "SCRIPT_FILENAME " . " : <code>" . $_SERVER["SCRIPT_FILENAME"] . "</code><br />\n";
echo "REMOTE_PORT " . " : <code>" . $_SERVER["REMOTE_PORT"] . "</code><br />\n";
echo "REDIRECT_URL " . " : <code>" . $_SERVER["REDIRECT_URL"] . "</code><br />\n";
echo "GATEWAY_INTERFACE " . " : <code>" . $_SERVER["GATEWAY_INTERFACE"] . "</code><br />\n";
echo "SERVER_PROTOCOL " . " : <code>" . $_SERVER["SERVER_PROTOCOL"] . "</code><br />\n";
echo "REQUEST_METHOD " . " : <code>" . $_SERVER["REQUEST_METHOD"] . "</code><br />\n";
echo "QUERY_STRING " . " : <code>" . $_SERVER["QUERY_STRING"] . "</code><br />\n";
echo "REQUEST_URI " . " : <code>" . $_SERVER["REQUEST_URI"] . "</code><br />\n";
echo "SCRIPT_NAME " . " : <code>" . $_SERVER["SCRIPT_NAME"] . "</code><br />\n";
echo "ORIG_SCRIPT_FILENAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_FILENAME"] . "</code><br />\n";
echo "ORIG_PATH_INFO " . " : <code>" . $_SERVER["ORIG_PATH_INFO"] . "</code><br />\n";
echo "ORIG_PATH_TRANSLATED " . " : <code>" . $_SERVER["ORIG_PATH_TRANSLATED"] . "</code><br />\n";
echo "ORIG_SCRIPT_NAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_NAME"] . "</code><br />\n";
echo "PHP_SELF " . " : <code>" . $_SERVER["PHP_SELF"] . "</code><br />\n";
echo "REQUEST_TIME_FLOAT " . " : <code>" . $_SERVER["REQUEST_TIME_FLOAT"] . "</code><br />\n";
echo "REQUEST_TIME " . " : <code>" . $_SERVER["REQUEST_TIME"] . "</code><br />\n";
?>
code {color: red;}
</style>
<hr>
<p>done met xml (@php_uname)</p>
<hr>
<?php
echo "Hostname (n) : <code>" . @php_uname(n) . "</code><br />\n";
if (function_exists( 'shell_exec' )) {
echo "Hostname : <code>" . @gethostbyname(trim(`hostname`)) . "</code><br />\n";
}
else {
echo "Server IP : <code>". $_SERVER['SERVER_ADDR'] . "</code><br />\n";
}
echo "Platform (s) : <code>" . @php_uname(s) . "</code>, (r) : <code>" . @php_uname(r) . "</code>, (v) : <code>" . @php_uname(v) . "</code><br />\n";
echo "Architecture (m) : <code>" . @php_uname(m) . "</code><br />\n";
echo "Username : <code>" . get_current_user () . "</code> ( UiD: <code>" . getmyuid() . "</code>, GiD: <code>" . getmygid() . "</code> )<br />\n";
echo "Curent Path (getcwd) : <code>" . getcwd () . "</code><br />\n";
echo "--FILE-- : <code>" . __FILE__ . "</code><br />\n";
echo "dirname FILE : <code>" . dirname(__FILE__) . "</code><br />\n";
echo "basename FILE : <code>" . basename(__FILE__) . "</code><br />\n";
echo "dirname SCRIPT_NAME : <code>" . dirname($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "basename SCRIPT_NAME : <code>" . basename($_SERVER["SCRIPT_NAME"]) . "</code><br />\n";
echo "<hr>";
$path_parts = pathinfo(__FILE__);
echo '$path_parts = <code>pathinfo(__FILE__)</code><br />' . "\n";
echo '$path_parts[' . "'dirname']'" . "<br />\n";
echo "dirname : <code>" . $path_parts['dirname'], "</code><br />\n";
echo "basename : <code>" . $path_parts['basename'], "</code><br />\n";
echo "extension : <code>" . $path_parts['extension'], "</code><br />\n";
echo "filename : <code>" . $path_parts['filename'], "</code><br />\n"; // since PHP 5.2.0
echo "<hr>";
echo '<p>All names have prefix <b>$_SERVER["name"]</b></p>';
echo "USER " . " : <code>" . $_SERVER["USER"] . "</code><br />\n";
echo "HOME " . " : <code>" . $_SERVER["HOME"] . "</code><br />\n";
echo "FCGI_ROLE " . " : <code>" . $_SERVER["FCGI_ROLE"] . "</code><br />\n";
echo "REDIRECT_MOD_X_SENDFILE_ENABLED" . " : <code>" . $_SERVER["REDIRECT_MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "REDIRECT_HANDLER " . " : <code>" . $_SERVER["REDIRECT_HANDLER"] . "</code><br />\n";
echo "REDIRECT_STATUS " . " : <code>" . $_SERVER["REDIRECT_STATUS"] . "</code><br />\n";
echo "MOD_X_SENDFILE_ENABLED " . " : <code>" . $_SERVER["MOD_X_SENDFILE_ENABLED"] . "</code><br />\n";
echo "HTTP_HOST " . " : <code>" . $_SERVER["HTTP_HOST"] . "</code><br />\n";
echo "HTTP_USER_AGENT " . " : <code>" . $_SERVER["HTTP_USER_AGENT"] . "</code><br />\n";
echo "HTTP_ACCEPT " . " : <code>" . $_SERVER["HTTP_ACCEPT"] . "</code><br />\n";
echo "HTTP_ACCEPT_LANGUAGE " . " : <code>" . $_SERVER["HTTP_ACCEPT_LANGUAGE"] . "</code><br />\n";
echo "HTTP_ACCEPT_ENCODING " . " : <code>" . $_SERVER["HTTP_ACCEPT_ENCODING"] . "</code><br />\n";
echo "HTTP_CONNECTION " . " : <code>" . $_SERVER["HTTP_CONNECTION"] . "</code><br />\n";
echo "PATH " . " : <code>" . $_SERVER["PATH"] . "</code><br />\n";
echo "SERVER_SIGNATURE " . " : <code>" . $_SERVER["SERVER_SIGNATURE"] . "</code><br />\n";
echo "SERVER_SOFTWARE " . " : <code>" . $_SERVER["SERVER_SOFTWARE"] . "</code><br />\n";
echo "SERVER_NAME " . " : <code>" . $_SERVER["SERVER_NAME"] . "</code><br />\n";
$ip_server = $_SERVER["SERVER_ADDR"];
if (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_server_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_server, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_server_echo = "is a valid IPv4 address";
}
echo "SERVER_ADDR " . " : <code>" . $_SERVER["SERVER_ADDR"] . "</code> $ip_server_echo<br />\n";
echo "SERVER_PORT " . " : <code>" . $_SERVER["SERVER_PORT"] . "</code><br />\n";
$ip_remote = $_SERVER["REMOTE_ADDR"];
if (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip_remote_echo = "is a valid IPv6 address";
} elseif (!filter_var($ip_remote, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$ip_remote_echo = "is a valid IPv4 address";
}
echo "REMOTE_ADDR " . " : <code>" . $_SERVER["REMOTE_ADDR"] . "</code> $ip_remote_echo<br />\n";
echo "DOCUMENT_ROOT " . " : <code>" . $_SERVER["DOCUMENT_ROOT"] . "</code><br />\n";
echo "SERVER_ADMIN " . " : <code>" . $_SERVER["SERVER_ADMIN"] . "</code><br />\n";
echo "SCRIPT_FILENAME " . " : <code>" . $_SERVER["SCRIPT_FILENAME"] . "</code><br />\n";
echo "REMOTE_PORT " . " : <code>" . $_SERVER["REMOTE_PORT"] . "</code><br />\n";
echo "REDIRECT_URL " . " : <code>" . $_SERVER["REDIRECT_URL"] . "</code><br />\n";
echo "GATEWAY_INTERFACE " . " : <code>" . $_SERVER["GATEWAY_INTERFACE"] . "</code><br />\n";
echo "SERVER_PROTOCOL " . " : <code>" . $_SERVER["SERVER_PROTOCOL"] . "</code><br />\n";
echo "REQUEST_METHOD " . " : <code>" . $_SERVER["REQUEST_METHOD"] . "</code><br />\n";
echo "QUERY_STRING " . " : <code>" . $_SERVER["QUERY_STRING"] . "</code><br />\n";
echo "REQUEST_URI " . " : <code>" . $_SERVER["REQUEST_URI"] . "</code><br />\n";
echo "SCRIPT_NAME " . " : <code>" . $_SERVER["SCRIPT_NAME"] . "</code><br />\n";
echo "ORIG_SCRIPT_FILENAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_FILENAME"] . "</code><br />\n";
echo "ORIG_PATH_INFO " . " : <code>" . $_SERVER["ORIG_PATH_INFO"] . "</code><br />\n";
echo "ORIG_PATH_TRANSLATED " . " : <code>" . $_SERVER["ORIG_PATH_TRANSLATED"] . "</code><br />\n";
echo "ORIG_SCRIPT_NAME " . " : <code>" . $_SERVER["ORIG_SCRIPT_NAME"] . "</code><br />\n";
echo "PHP_SELF " . " : <code>" . $_SERVER["PHP_SELF"] . "</code><br />\n";
echo "REQUEST_TIME_FLOAT " . " : <code>" . $_SERVER["REQUEST_TIME_FLOAT"] . "</code><br />\n";
echo "REQUEST_TIME " . " : <code>" . $_SERVER["REQUEST_TIME"] . "</code><br />\n";
?>
Waardeer de moeite heel erg, danku :)