This project is a network scanner built with Fiber, a web framework for
Go. It serves static files from the public
directory and performs network scans using
concurrent ping sweeps and nmap
.
- Prerequisites
- Installation
- Building the Project
- Running the Server
- Usage
- Project Structure
- API Endpoints
- Development Plan
- Contributing
- License
-
Clone the repository:
git clone https://github.com/yourusername/network-scanner.git cd network-scanner
-
Install the required Go packages:
go get github.com/gofiber/fiber/v2 go get github.com/gofiber/websocket/v2 go get github.com/google/gopacket/pcap go get github.com/spf13/pflag
To build the project, run:
go build -o network-scanner src/main/network_scanner.go
To start the Fiber server, run:
sudo ./network-scanner -i <interface>
Replace <interface>
with the network interface you want to scan, e.g., eth0
, wlan0
, etc. The sudo
command is necessary to ensure the scanner has the required permissions to perform network scans.
The server will start on port by default 5234
.
The server will serve all static files from the public
directory. Open the link provided by
Fiber to open your browser and see the scan.
The server performs network scans by running concurrent ping requests to all possible ips inside
the network. Then nmap
is used to get more details of the devices encountered. Make sure
nmap
is
installed
and accessible from your system's PATH.
Each scan is executed hourly until the software is stopped. This interval can be modified by changing the value in server.go
at line 100:
// Delay between scans
time.Sleep(1 * time.Hour) // Modify this value to change the scan interval
project/
│
├── public/ # Directory for static files
│ └── static/
│ ├── index.html # Main HTML file
│ ├── reset.css # CSS reset file
│ ├── script.js # JavaScript file
│ └── styles.css # CSS file
├── src/ # Source directory for other Go packages
│ ├── main/
│ │ └── network_scanner.go # Main application file
│ ├── network/
│ │ └── network.go # Network utility functions
│ ├── nmaputil/
│ │ └── nmaputil.go # Network mapping utilities
│ └── server/
│ └── server.go # Server functions and configurations
└── README.md # Project README file
Serves the index.html
file and all static files in the public
directory.
WebSocket endpoint for real-time communication.
-
AI Integration for Alerts:
- Implement basic AI to monitor network traffic and detect suspicious connections.
- Send push notifications to email or phone numbers when suspicious activity is detected.
-
Customizable Scan Intervals:
- Allow users to configure the scan interval through command-line flags.
-
Additional Nmap Flags:
- Provide more customization options by supporting additional nmap flags.
-
Improved UI:
- Enhance the user interface for better usability and visual appeal.
-
Cross-Platform Support:
- Ensure compatibility and testing on Windows systems.
-
Logging and Reporting:
- Add detailed logging and reporting features to keep track of scan results and alerts.
-
Containerization:
- Create Docker images for easy deployment and management.
-
Performance Optimization:
- Optimize the scanning process to handle large networks more efficiently.
-
Documentation:
- Improve and expand documentation, including usage guides and API references.
-
Web Authentication:
- Authentication will be added to access information through the website.
All notable changes to this project are documented in the CHANGELOG.md file.
- Ideas and Suggestions: Open an issue to discuss new features or enhancements.
- Bug Reports: Report bugs via the issue tracker, providing as much detail as possible.
- Code Contributions: Fork the repository, create a new branch, make changes, and open a pull request.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Make your changes.
- Commit your changes:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature-name
. - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.