current
All checks were successful
test / build-docs (push) Successful in -19s

This commit is contained in:
2025-07-10 21:03:06 +02:00
parent 11a0aa2d89
commit a692ac8b05
19 changed files with 3931 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env python3.12
#! /usr/bin/env python3
import csv
import errno
@@ -14,7 +14,8 @@ def scan(ip):
arp_request = scapy.ARP(pdst=ip)
broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_request_broadcast = broadcast / arp_request
answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0]
answered_list = scapy.srp(arp_request_broadcast,
timeout=1, verbose=False)[0]
results = []
for element in answered_list:
result = {
@@ -45,7 +46,8 @@ def scan_csv(csvfile=str, colm="hostname"):
for count, row in enumerate(csv_reader, 1):
hostlist.append(row[colm])
else:
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), csvfile)
raise FileNotFoundError(
errno.ENOENT, os.strerror(errno.ENOENT), csvfile)
return tuple(hostlist)
@@ -70,7 +72,8 @@ if __name__ == "__main__":
# if len(sys.argv) == 1:
ip_list = create_ip_list()
man_list = scan_csv(
csvfile=os.path.dirname(os.path.realpath(__file__)) + "/hostname_manuel.csv"
csvfile=os.path.dirname(os.path.realpath(
__file__)) + "/hostname_manuel.csv"
)
output = {
"_meta": {

File diff suppressed because it is too large Load Diff