Skip to content

brianandhikap/LookingGlass-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 Looking Glass for Ubuntu

A modern, secure, and mobile-friendly network diagnostic tool built with PHP for Ubuntu servers.

✨ Features

  • βœ… 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

βš™οΈ PHP Backend Highlights

  • βœ… 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));

πŸ§‘β€πŸ’» User Experience

  • βœ… Conditional UI - Dropdown appears only for "Ping"
  • βœ… Clear Feedback - Loading text updates based on ping count
  • βœ… Result Title - Displays how many packets were sent

πŸ”§ How It Works

  1. Select Command β†’ Ping (dropdown appears) or Traceroute (dropdown hidden)
  2. Set Count β†’ Choose 5–10 pings (for Ping only)
  3. Input Target β†’ Enter IP address or hostname
  4. Execute β†’ Command runs with selected parameters

πŸ“‹ Example Usage

  • πŸ”Ή 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

πŸš€ Installation Guide

  1. Navigate to web directory:

    cd /var/www/html
  2. Clone the repository:

    git clone https://github.com/brianandhikap/LookingGlass-PHP.git
  3. Update package list:

    sudo apt update
  4. Install required packages:

    sudo apt install -y apache2 php libapache2-mod-php traceroute iputils-ping
  5. Access via browser:

    http://your-ip/LookingGlass-PHP
    

βœ… Use Cases

  • πŸ” 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.

Releases

No releases published

Packages

No packages published