mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2025-12-08 10:01:29 +00:00
Compare commits
1 Commits
codex/modi
...
codex/find
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39066f6867 |
@@ -106,8 +106,6 @@ 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)
|
||||||
@@ -145,17 +143,26 @@ def parse_line(line: str):
|
|||||||
|
|
||||||
|
|
||||||
def parse_peass(outputpath: str, jsonpath: str = ""):
|
def parse_peass(outputpath: str, jsonpath: str = ""):
|
||||||
global OUTPUT_PATH, JSON_PATH
|
global OUTPUT_PATH, JSON_PATH, FINAL_JSON, C_SECTION, C_MAIN_SECTION, C_2_SECTION, C_3_SECTION
|
||||||
|
|
||||||
OUTPUT_PATH = outputpath
|
OUTPUT_PATH = outputpath
|
||||||
JSON_PATH = jsonpath
|
JSON_PATH = jsonpath
|
||||||
|
|
||||||
for line in open(OUTPUT_PATH, 'r', encoding="utf8").readlines():
|
# Reset globals to avoid data leaking between executions
|
||||||
line = line.strip()
|
FINAL_JSON = {}
|
||||||
if not line or not clean_colors(line): #Remove empty lines or lines just with colors hex
|
C_SECTION = FINAL_JSON
|
||||||
continue
|
C_MAIN_SECTION = FINAL_JSON
|
||||||
|
C_2_SECTION = FINAL_JSON
|
||||||
|
C_3_SECTION = FINAL_JSON
|
||||||
|
|
||||||
parse_line(line)
|
with open(OUTPUT_PATH, 'r', encoding="utf8") as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
line = line.strip()
|
||||||
|
# Remove empty lines or lines containing only color codes
|
||||||
|
if not line or not clean_colors(line):
|
||||||
|
continue
|
||||||
|
|
||||||
|
parse_line(line)
|
||||||
|
|
||||||
if JSON_PATH:
|
if JSON_PATH:
|
||||||
with open(JSON_PATH, "w") as f:
|
with open(JSON_PATH, "w") as f:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace winPEAS.Tests
|
namespace winPEAS.Tests
|
||||||
{
|
{
|
||||||
@@ -26,28 +25,17 @@ namespace winPEAS.Tests
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void ShouldDisplayHelp()
|
public void ShouldDisplayHelp()
|
||||||
{
|
{
|
||||||
var originalOut = Console.Out;
|
|
||||||
var sw = new StringWriter();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.SetOut(sw);
|
|
||||||
string[] args = new string[] {
|
string[] args = new string[] {
|
||||||
"help",
|
"help",
|
||||||
};
|
};
|
||||||
Program.Main(args);
|
Program.Main(args);
|
||||||
|
|
||||||
string output = sw.ToString();
|
|
||||||
Assert.IsTrue(output.Contains("WinPEAS is a binary"),
|
|
||||||
"Help output did not contain expected text.");
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Assert.Fail($"Exception thrown: {e.Message}");
|
Assert.Fail($"Exception thrown: {e.Message}");
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
Console.SetOut(originalOut);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user