A modern, secure, and mobile-friendly network diagnostic tool built with PHP for Ubuntu servers.
- β Ping - Test network connectivity
- β Dropdown "Jumlah Ping" - Select 5 to 10 ping count
- β Traceroute - Display the path packets take
- β Security - Input validation to prevent command injection
- β Modern UI - Glassmorphism design
- β Real-time - Live command execution via PHP
- β Mobile Friendly - Responsive layout
- β Smart UI - Count dropdown only appears when "Ping" is selected
- β Default 8x Ping - Reasonable default for diagnostics
- β Dynamic Loading Text - Shows selected ping count in loading message
- β Parameter Validation - Count must be between 5 and 10
- β Security Check - Sanitized and validated inputs
- β Fallback Value - Default to 8 if invalid input is detected
- β
Updated Ping Command -
ping -c [count] -W 5 target
// PHP Validation
$count = intval($count);
if ($count < 5 || $count > 10) {
$count = 8; // fallback
}
// Secure command execution
$command = sprintf('ping -c %d -W 5 %s 2>&1', $count, escapeshellarg($target));
- β Conditional UI - Dropdown appears only for "Ping"
- β Clear Feedback - Loading text updates based on ping count
- β Result Title - Displays how many packets were sent
- Select Command β Ping (dropdown appears) or Traceroute (dropdown hidden)
- Set Count β Choose 5β10 pings (for Ping only)
- Input Target β Enter IP address or hostname
- Execute β Command runs with selected parameters
-
πΉ
Ping google.com
with 5 pings:ping -c 5 -W 5 google.com
-
πΉ
Ping 8.8.8.8
with 10 pings:ping -c 10 -W 5 8.8.8.8
-
πΉ
Traceroute example.com
:traceroute example.com
-
Navigate to web directory:
cd /var/www/html
-
Clone the repository:
git clone https://github.com/brianandhikap/LookingGlass-PHP.git
-
Update package list:
sudo apt update
-
Install required packages:
sudo apt install -y apache2 php libapache2-mod-php traceroute iputils-ping
-
Access via browser:
http://your-ip/LookingGlass-PHP
- π Light testing β 5 pings for quick checks
- π Standard testing β 8 pings (default)
- π§ͺ Thorough analysis β 10 pings for detailed diagnostics
π‘ This tool is production-ready and includes robust security measures to prevent command injection and misuse.