mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00: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,6 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
switch ($_GET[cmd]) {
|
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]) {
|
||||||
case 'whois':
|
case 'whois':
|
||||||
$output = `/usr/bin/whois $_GET[query] | grep -v \%`;
|
$output = `/usr/bin/whois $_GET[query] | grep -v \%`;
|
||||||
break;
|
break;
|
||||||
@ -13,7 +27,10 @@ switch ($_GET[cmd]) {
|
|||||||
case 'nmap':
|
case 'nmap':
|
||||||
$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