Auto-merge PR #780 (Chack Agent)

Co-authored-by: HackTricks PEASS Autoimprover <[email protected]>
This commit is contained in:
SirBroccoliandHackTricks PEASS Autoimprover authored and GitHub committed 2026-10-12 09:52:42 +00:00
1 parent 423089a316
commit 6276944854
2 files changed
+24 -1

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ peas_storages_markup: "peass{STORAGES_HERE}"
storage_line_markup: "peass{STORAGE_PARAMS_HERE}"
storage_line_extra_markup: "peass{STORAGE_PARAMS_EXTRA_HERE}"
storage_template: >
$(printf '%b\n' "peass{STORAGE_PARAMS_HERE}" peass{STORAGE_PARAMS_EXTRA_HERE} | sort | uniq | head -n 70)
$(printf '%b\n' "peass{STORAGE_PARAMS_HERE}" peass{STORAGE_PARAMS_EXTRA_HERE} | sort -u | head -n 70)
int_hidden_files_markup: "peass{INT_HIDDEN_FILES}"
+23
View File
@@ -76,6 +76,29 @@ class LinpeasBuilderTests(unittest.TestCase):
else:
self.assertEqual(found, expected_files, call)
def test_generated_storages_deduplicate_in_sort(self):
"""Every catalog storage should deduplicate without a separate uniq process."""
sys.path.insert(0, str(self.linpeas_dir))
try:
from builder.src.linpeasBuilder import LinpeasBuilder
from builder.src.peasLoaded import PEASLoaded
finally:
sys.path.pop(0)
builder = object.__new__(LinpeasBuilder)
builder.ploaded = PEASLoaded()
builder.hidden_files = set()
builder.bash_find_f_vars = set()
builder.bash_find_d_vars = set()
builder.bash_storages = set()
builder._LinpeasBuilder__get_files_to_search()
builder._LinpeasBuilder__generate_finds()
storages = builder._LinpeasBuilder__generate_storages()
self.assertTrue(storages)
self.assertTrue(all(" | sort -u | head -n 70)" in line for line in storages))
self.assertTrue(all(" | sort | uniq " not in line for line in storages))
def test_small_build_creates_executable(self):
with tempfile.TemporaryDirectory() as tmpdir:
output_path = Path(tmpdir) / "linpeas_small.sh"