Merge pull request #424 from 0danteh/patch-1
Refactor peasLoaded.py for Improved Efficiency
This commit is contained in:
commit
55326d29cc
@ -6,26 +6,24 @@ class PEASLoaded:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
to_search = YAML_LOADED["search"]
|
to_search = YAML_LOADED["search"]
|
||||||
self.peasrecords = []
|
self.peasrecords = []
|
||||||
|
|
||||||
for record in to_search:
|
for record in to_search:
|
||||||
record_value = record["value"]
|
record_value = record["value"]
|
||||||
if "linpeas" in str(record_value["config"].get("disable","")).lower():
|
config = record_value.get("config", {})
|
||||||
|
|
||||||
|
if "linpeas" in config.get("disable", "").lower():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
filerecords = []
|
filerecords = [
|
||||||
for filerecord in record_value["files"]:
|
FileRecord(regex=filerecord["name"], **filerecord["value"])
|
||||||
filerecords.append(
|
for filerecord in record_value["files"]
|
||||||
FileRecord(
|
]
|
||||||
regex=filerecord["name"],
|
|
||||||
**filerecord["value"]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
name = record["name"]
|
|
||||||
self.peasrecords.append(
|
self.peasrecords.append(
|
||||||
PEASRecord(
|
PEASRecord(
|
||||||
name=name,
|
name=record["name"],
|
||||||
auto_check=record_value["config"]["auto_check"],
|
auto_check=config.get("auto_check", DEFAULTS["auto_check"]),
|
||||||
exec=record_value["config"].get("exec", DEFAULTS["exec"]),
|
exec=config.get("exec", DEFAULTS["exec"]),
|
||||||
filerecords=filerecords
|
filerecords=filerecords
|
||||||
)
|
)
|
||||||
)
|
)
|
Loading…
Reference in New Issue
Block a user