Initial commit.
This commit is contained in:
parent
a9c913c9a7
commit
317e1b4e10
13 changed files with 260 additions and 0 deletions
29
whois/whois.php
Normal file
29
whois/whois.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
permalink: /cgi/whois/
|
||||
_note: https://www.w3docs.com/snippets/php/how-to-get-the-client-ip-address-in-php.html
|
||||
---
|
||||
|
||||
<?php
|
||||
if (!empty($_GET["host"]) and empty($_POST["host"])) {
|
||||
$host = $_GET["host"];
|
||||
} elseif (!empty($_POST["host"]) and empty($_GET["host"])) {
|
||||
$host = $_POST["host"];
|
||||
} else {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
//ip from share internet
|
||||
$host = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
//ip pass from proxy
|
||||
$host = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$host = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
}
|
||||
|
||||
$cmd = 'whois ' . $host;
|
||||
|
||||
$whois = shell_exec($cmd);
|
||||
|
||||
header('Content-Type: text/plain');
|
||||
echo($whois);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue