mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2025-12-07 17:41:29 +00:00
Compare commits
1 Commits
codex/upda
...
codex/modi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64a6bb0ff6 |
@@ -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):
|
||||||
"""Substitute the markup with the actual code"""
|
"""Substitude the markup with the actual code"""
|
||||||
|
|
||||||
self.linpeas_sh = self.linpeas_sh.replace(mark, join_char.join(find_calls)) #New line char isn't needed
|
self.linpeas_sh = self.linpeas_sh.replace(mark, join_char.join(find_calls)) #New line char is't needed
|
||||||
|
|
||||||
def write_linpeas(self, path):
|
def write_linpeas(self, path):
|
||||||
"""Write on disk the final linpeas"""
|
"""Write on disk the final linpeas"""
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace winPEAS.Tests
|
namespace winPEAS.Tests
|
||||||
{
|
{
|
||||||
@@ -25,17 +26,28 @@ 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