-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathdhcphp.py
More file actions
37 lines (32 loc) · 1.19 KB
/
Copy pathdhcphp.py
File metadata and controls
37 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
__artifacts_v2__ = {
"dhcpHotspotClients": {
"name": "DHCP Hotspot Clients",
"description": "Information about devices that connected to the hotspot",
"author": "@AlexisBrignoni",
"creation_date": "2024-10-29",
"last_update_date": "2026-06-24",
"requirements": "none",
"category": "DHCP",
"notes": "",
"paths": ('*/db/dhcpd_leases*',),
"output_types": "standard",
"artifact_icon": "wifi"
}
}
from scripts.ilapfuncs import artifact_processor
@artifact_processor
def dhcpHotspotClients(context):
data_headers = ('Key Name', 'Value Data', 'Source File')
data_list = []
sources = []
for file_found in context.get_files_found():
file_found = str(file_found)
rel = context.get_relative_path(file_found)
with open(file_found, "r", encoding="utf-8") as filefrom:
for line in filefrom:
cline = line.strip()
if "=" in cline:
splitline = cline.split("=")
data_list.append((splitline[0], splitline[1], rel))
sources.append(rel)
return data_headers, data_list, ', '.join(dict.fromkeys(sources))