Compare commits

..

3 commits
qt ... master

Author SHA1 Message Date
e49836182c oops 2025-02-04 13:43:39 -05:00
Tristan
f3446ebf2e
Update Readme.md 2024-06-09 22:19:08 -04:00
Tristan
724662be42
Merge pull request #1 from ampersandcastles/qt
Qt
2024-06-09 22:18:00 -04:00
7 changed files with 36 additions and 11 deletions

0
.gitignore vendored Executable file → Normal file
View file

9
Readme.md Executable file → Normal file
View file

@ -1,5 +1,7 @@
# IP Reporter
This is currently not functioning on the latest version of Python.
IP Reporter is a Python-based tool for network administrators to monitor and capture IP and MAC addresses of network devices. It provides a simple graphical user interface (GUI) to display and export the captured data. The tool is useful for managing network devices, especially in environments like mining farms where multiple devices need to be tracked. Currently this only works on Antminer machines as it's what I have access to.
## Features
@ -55,7 +57,12 @@ IP Reporter is a Python-based tool for network administrators to monitor and cap
```
3. **GUI Interface**:
or
```sh
python3 qt.py
```
4. **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.

26
array.c Normal file
View file

@ -0,0 +1,26 @@
#include <stdio.h>
main() /* count digits, white space, others */
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c = getchar()) != EOF)
if (c >= '0' && c <= '9')
++ndigit[c - '0'];
else if (c == ' ' || c == '\n' || c == '\t')
++nwhite;
else
++nother;
printf("digits =");
for (i = 0; i < 10; ++i)
printf(" %d", ndigit[i]);
printf("\nwhite space = %d, other = %d\n", nwhite, nother);
}

0
gui.py Executable file → Normal file
View file

0
license Executable file → Normal file
View file

12
qt.py Executable file → Normal file
View file

@ -47,9 +47,6 @@ 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:
@ -64,13 +61,8 @@ class IPReporter(QMainWindow):
udp_destination_port == destination_port):
# Extract the MAC address from the Ethernet layer
source_mac = packet[Ether].src
# 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]))
# 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 Executable file → Normal file
View file