|
|
|
@ -6,6 +6,9 @@ import time
@@ -6,6 +6,9 @@ import time
|
|
|
|
|
import os |
|
|
|
|
#import nmap |
|
|
|
|
|
|
|
|
|
script_path = os.path.dirname(os.path.abspath(__file__)) |
|
|
|
|
script_path += '/' |
|
|
|
|
print(script_path) |
|
|
|
|
sqlite_db = sqlite3.connect('/root/firewall.sqlite') |
|
|
|
|
cursor = sqlite_db.cursor() |
|
|
|
|
cursor.execute(''' |
|
|
|
@ -72,9 +75,9 @@ def get_unknown_macs():
@@ -72,9 +75,9 @@ def get_unknown_macs():
|
|
|
|
|
|
|
|
|
|
macs = [] |
|
|
|
|
|
|
|
|
|
cmd = '''/sbin/arp -na | awk '{print $4}' | grep -v incomplete > /root/py-firewall/arp.list''' |
|
|
|
|
cmd = '''/sbin/arp -na | awk '{{print $4}}' | grep -v incomplete > {sc}/arp.list'''.format(sc=script_path) |
|
|
|
|
os.system(cmd) |
|
|
|
|
with open('/root/py-firewall/arp.list') as f: |
|
|
|
|
with open('{}arp.list'.format(script_path)) as f: |
|
|
|
|
for line in f: |
|
|
|
|
for e in entries: |
|
|
|
|
if e[0].lower() == line[:-1].lower(): |
|
|
|
|