scapy changes

This commit is contained in:
Kaushik 2022-06-29 19:21:29 +05:30
parent 313d0bab4e
commit 8f67103e85
2 changed files with 16 additions and 7 deletions

11
.gitignore vendored
View File

@ -1,4 +1,13 @@
*.pyc *.pyc
*.pyo *.pyo
*.csv *.csv
*.pcap *.pcap
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

View File

@ -170,20 +170,20 @@ class NetworkMonitor(QMainWindow):
def savePacketsPCAP(self): def savePacketsPCAP(self):
path = QFileDialog.getSaveFileName(self, 'Save File', '', 'pcap(*.pcap)') path = QFileDialog.getSaveFileName(self, 'Save File', '', 'pcap(*.pcap)')
if path[0] is not '': if path[0] != '':
path = str(path[0]) path = str(path[0])
wrpcap(path, self.worker.packetList) wrpcap(path, self.worker.packetList)
def savePacketsBLIP(self): def savePacketsBLIP(self):
path = QFileDialog.getSaveFileName(self, 'Save File', '', 'pcap(*.pcap)') path = QFileDialog.getSaveFileName(self, 'Save File', '', 'pcap(*.pcap)')
if path[0] is not '': if path[0] != '':
path = str(path[0]) path = str(path[0])
wrpcap(path, self.worker.blackListAccess) wrpcap(path, self.worker.blackListAccess)
self.worker.blackListAccess = [] self.worker.blackListAccess = []
def savePacketsCSV(self): def savePacketsCSV(self):
path = QFileDialog.getSaveFileName(self, 'Save File', '', 'CSV(*.csv)') path = QFileDialog.getSaveFileName(self, 'Save File', '', 'CSV(*.csv)')
if path[0] is not '': if path[0] != '':
with open(path[0], 'w') as stream: with open(path[0], 'w') as stream:
writer = csv.writer(stream, lineterminator='\n') writer = csv.writer(stream, lineterminator='\n')
for row in range(self.tableWidget.rowCount()): for row in range(self.tableWidget.rowCount()):
@ -201,8 +201,8 @@ class InterfacePick(QDialog):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__() super().__init__()
self.setWindowTitle('Choose Interface to Monitor') self.setWindowTitle('Choose Interface to Monitor')
self.width = 400 self.width = 600
self.height = 400 self.height = 600
self.setMinimumSize(self.width, self.height) self.setMinimumSize(self.width, self.height)
@ -222,7 +222,7 @@ class InterfacePick(QDialog):
for iface_name in sorted(ifaces.keys()): for iface_name in sorted(ifaces.keys()):
dev = ifaces[iface_name] dev = ifaces[iface_name]
mac = dev.mac mac = dev.mac
if iface_name != LOOPBACK_NAME: if iface_name != conf.loopback_name:
mac = conf.manufdb._resolve_MAC(mac) mac = conf.manufdb._resolve_MAC(mac)
if str(dev.ip) != "None" and not str(dev.name).startswith("VM"): if str(dev.ip) != "None" and not str(dev.name).startswith("VM"):