Compare commits

..

1 Commits

Author SHA1 Message Date
SirBroccoli
4e556fd594 Fix variable reference when parsing URLs 2025-06-06 00:01:17 +02:00
2 changed files with 9 additions and 16 deletions

View File

@@ -97,7 +97,7 @@ class LinpeasBuilder:
for orig_url in urls:
tar_gz_bin_name = ""
if ",,," in orig_url:
tar_gz_bin_name = url.split(",,,")[1]
tar_gz_bin_name = orig_url.split(",,,")[1]
url = orig_url.split(",,,")[0]
else:
url = orig_url

View File

@@ -106,6 +106,8 @@ def parse_line(line: str):
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):
title = parse_title(line)
@@ -143,23 +145,14 @@ def parse_line(line: 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
JSON_PATH = jsonpath
# Reset globals to avoid data leaking between executions
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():
for line in open(OUTPUT_PATH, 'r', encoding="utf8").readlines():
line = line.strip()
# Remove empty lines or lines containing only color codes
if not line or not clean_colors(line):
if not line or not clean_colors(line): #Remove empty lines or lines just with colors hex
continue
parse_line(line)