Files
NetAlertX/front/php/server/traceroute.php
jokob-sk c0c685c561 FE code disclaimers
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-08-29 08:09:29 +10:00

52 lines
1.8 KiB
PHP
Executable File

<?php
###################################################################################
# NetAlertX #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# traceroute.php # Front module. Server side. System Information #
###################################################################################
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob-sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
###################################################################################
// 🔺----- API ENDPOINTS SUPERSEDED -----🔺
// check server/api_server/api_server_start.py for equivalents
// equivalent: /nettools
// 🔺----- API ENDPOINTS SUPERSEDED -----🔺
// Get init.php
require dirname(__FILE__).'/../server/init.php';
//------------------------------------------------------------------------------
// check if authenticated
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
// NEW ENDPOINT EQUIVALENT: /nettools/traceroute
// Get IP
$ip = $_GET['ip'];
// Check if IP is valid
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
// Error message
$output = lang('DevDetail_Tab_Tools_Traceroute_Error');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Test with the "Traceroute" command
$output = shell_exec("traceroute $ip");
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
?>