Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash Nmap License

image

image

🔍 Lyarinet Bash Script Network Scanner Result Viewer With Browser

This project provides a clean and responsive HTML interface to view network scan results exported as scan_results.json.

✅ Features

  • 📊 Clean, modern table layout
  • 📱 Responsive design with hover effects
  • ⚡ Automatically loads JSON data via JavaScript

📁 Files

  • netscan.sh – The scan Bash script
  • index.html – The HTML page for viewing
  • scan_results.json – The scan data generated by your Bash script
  • scan_results.csv – The scan data generated by your Bash script

🚀 How to Use

1. run bash

chmod +x netscan.sh
./netscan.sh

Follow the on-screen prompts:

  1. Choose Network Interface(s): Select one or more interfaces to scan. You can pick a specific interface by its number or choose all to scan across all detected interfaces.
    [1] eth0
    [2] wlan0
    [3] all
    Choose interface [1-2 or all]: all
    
  2. Choose Scan Type:
    • 1) Standard (ping + nbstat): This is the default comprehensive scan, ideal for general network discovery.
    • 2) UDP port scan (top 1000): Focuses on scanning common UDP ports on discovered hosts.
    • 3) Listen for UDP multicast: Enters a sniffing mode to capture multicast traffic for a specified duration.
    Choose scan type:
    1) Standard (ping + nbstat)
    2) UDP port scan (top 1000)
    3) Listen for UDP multicast
    Choice [1-3]: 1
    

Upon completion, standard and UDP scans will generate two files in the script's directory:

  • scan_results.csv: A comma-separated values file, easily viewable in spreadsheets.
  • scan_results.json: A JSON array of objects, suitable for programmatic parsing.

Multicast scans will generate multicast_<interface_name>.log files.

Important Notes

  • Root Privileges: The script requires sudo because nmap, tcpdump, and smbclient often need elevated permissions for raw socket access and certain operations.
  • DHCP Leases: The script attempts to find hostnames from /var/lib/dhcp/dhcpd.leases. This path is hardcoded and may vary on different Linux distributions. If hostnames aren't appearing, verify this path.
  • Security: Be mindful when running network scanning tools. Ensure you have permission to scan the network you are targeting.

2. Generate your scan results:

Make sure your Bash scanner script outputs scan_results.json in the same folder as the HTML file.

3. Open in your browser:

firefox index.html

Or with any modern browser: Chrome, Edge, Brave, etc.

4. Optional – Serve it locally:

python3 -m http.server

Then open http://localhost:8000 in your browser.

🌟 Optional Features

  • 🖼 Dark Mode: Ask to enable a dark theme
  • 📦 Self-contained HTML: Embed JSON results directly in the HTML
  • 🌍 Web Dashboard: Host on a server (Apache, Nginx, etc.) to access remotely

💡 Tip

Use the CSV file (scan_results.csv) for spreadsheet apps, and the JSON/HTML view for quick, portable browsing.


MIT License | © 2025 Asif Agaria

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages