Compare commits

..

2 commits
master ... qt

Author SHA1 Message Date
Tristan Smith
53d13e77ae tea 2024-06-20 01:27:03 -04:00
Tristan Smith
8a57c7d020 fixed redundency reports 2024-06-10 10:20:08 -04:00
6 changed files with 11 additions and 8 deletions

0
.gitignore vendored Normal file → Executable file
View file

7
Readme.md Normal file → Executable file
View file

@ -55,12 +55,7 @@ IP Reporter is a Python-based tool for network administrators to monitor and cap
```
or
```sh
python3 qt.py
```
4. **GUI Interface**:
3. **GUI Interface**:
- Click "Start" to begin packet sniffing.
- Captured IP and MAC addresses will be displayed in the table.
- Double-click on an IP address to open it in your default web browser.

0
gui.py Normal file → Executable file
View file

0
license Normal file → Executable file
View file

12
qt.py Normal file → Executable file
View file

@ -47,6 +47,9 @@ class IPReporter(QMainWindow):
self.listening = False
# Set to keep track of unique IP addresses
self.unique_ips = set()
def extract_packet_info(self, packet):
# Check if the packet is an IP packet with UDP layer
if IP in packet and UDP in packet:
@ -61,8 +64,13 @@ class IPReporter(QMainWindow):
udp_destination_port == destination_port):
# Extract the MAC address from the Ethernet layer
source_mac = packet[Ether].src
# Display the information in the tree view
self.tree.addTopLevelItem(QTreeWidgetItem([source_ip, source_mac]))
# Check if the IP address is already in the set
if source_ip not in self.unique_ips:
# Add the IP address to the set
self.unique_ips.add(source_ip)
# Display the information in the tree view
self.tree.addTopLevelItem(QTreeWidgetItem([source_ip, source_mac]))
def listen_for_packets(self):
sniff(prn=self.extract_packet_info, filter="udp and ip", store=0)

0
reporter.py Normal file → Executable file
View file