mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
security fixes. AMG SECURIITAHHHHHHHHH!
git-svn-id: http://www.observium.org/svn/observer/trunk@305 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,5 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
include_once("Net/IPv6.php");
|
||||||
|
|
||||||
|
function check_ip($ip)
|
||||||
|
{
|
||||||
|
if ($ip == long2ip(ip2long($ip))) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_GET['query']) {
|
||||||
|
$ip = $_GET['query'];
|
||||||
|
if(Net_IPv6::checkIPv6($ip)||check_ip($ip)) {
|
||||||
switch ($_GET[cmd]) {
|
switch ($_GET[cmd]) {
|
||||||
case 'whois':
|
case 'whois':
|
||||||
$output = `/usr/bin/whois $_GET[query] | grep -v \%`;
|
$output = `/usr/bin/whois $_GET[query] | grep -v \%`;
|
||||||
@@ -14,6 +28,9 @@ switch ($_GET[cmd]) {
|
|||||||
$output = `/usr/bin/nmap $_GET[query]`;
|
$output = `/usr/bin/nmap $_GET[query]`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$output = trim($output);
|
$output = trim($output);
|
||||||
echo("<pre>$output</pre>");
|
echo("<pre>$output</pre>");
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
$output = `/usr/bin/whois $_GET[query] | grep -v \%`;
|
|
||||||
|
|
||||||
$output = trim($output);
|
|
||||||
|
|
||||||
echo("<pre>$output</pre>");
|
|
||||||
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user