mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2025-12-08 01:51:28 +00:00
Compare commits
1 Commits
codex/find
...
codex/upda
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4af321d138 |
@@ -402,9 +402,9 @@ class LinpeasBuilder:
|
|||||||
|
|
||||||
|
|
||||||
def __replace_mark(self, mark: str, find_calls: list, join_char: str):
|
def __replace_mark(self, mark: str, find_calls: list, join_char: str):
|
||||||
"""Substitude the markup with the actual code"""
|
"""Substitute the markup with the actual code"""
|
||||||
|
|
||||||
self.linpeas_sh = self.linpeas_sh.replace(mark, join_char.join(find_calls)) #New line char is't needed
|
self.linpeas_sh = self.linpeas_sh.replace(mark, join_char.join(find_calls)) #New line char isn't needed
|
||||||
|
|
||||||
def write_linpeas(self, path):
|
def write_linpeas(self, path):
|
||||||
"""Write on disk the final linpeas"""
|
"""Write on disk the final linpeas"""
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ def parse_line(line: str):
|
|||||||
|
|
||||||
global FINAL_JSON, C_SECTION, C_MAIN_SECTION, C_2_SECTION, C_3_SECTION
|
global FINAL_JSON, C_SECTION, C_MAIN_SECTION, C_2_SECTION, C_3_SECTION
|
||||||
|
|
||||||
|
if "Cron jobs" in line:
|
||||||
|
a=1
|
||||||
|
|
||||||
if is_section(line, TITLE1_PATTERN):
|
if is_section(line, TITLE1_PATTERN):
|
||||||
title = parse_title(line)
|
title = parse_title(line)
|
||||||
@@ -143,23 +145,14 @@ def parse_line(line: str):
|
|||||||
|
|
||||||
|
|
||||||
def parse_peass(outputpath: str, jsonpath: str = ""):
|
def parse_peass(outputpath: str, jsonpath: str = ""):
|
||||||
global OUTPUT_PATH, JSON_PATH, FINAL_JSON, C_SECTION, C_MAIN_SECTION, C_2_SECTION, C_3_SECTION
|
global OUTPUT_PATH, JSON_PATH
|
||||||
|
|
||||||
OUTPUT_PATH = outputpath
|
OUTPUT_PATH = outputpath
|
||||||
JSON_PATH = jsonpath
|
JSON_PATH = jsonpath
|
||||||
|
|
||||||
# Reset globals to avoid data leaking between executions
|
for line in open(OUTPUT_PATH, 'r', encoding="utf8").readlines():
|
||||||
FINAL_JSON = {}
|
|
||||||
C_SECTION = FINAL_JSON
|
|
||||||
C_MAIN_SECTION = FINAL_JSON
|
|
||||||
C_2_SECTION = FINAL_JSON
|
|
||||||
C_3_SECTION = FINAL_JSON
|
|
||||||
|
|
||||||
with open(OUTPUT_PATH, 'r', encoding="utf8") as f:
|
|
||||||
for line in f.readlines():
|
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
# Remove empty lines or lines containing only color codes
|
if not line or not clean_colors(line): #Remove empty lines or lines just with colors hex
|
||||||
if not line or not clean_colors(line):
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
parse_line(line)
|
parse_line(line)
|
||||||
|
|||||||
Reference in New Issue
Block a user