mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2025-12-09 10:31:27 +00:00
Compare commits
5 Commits
20250526-1
...
codex/modi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64a6bb0ff6 | ||
|
|
c3a93a57fe | ||
|
|
f62d9fc550 | ||
|
|
11e9b8dde6 | ||
|
|
b9a9ad5ddf |
@@ -13,4 +13,4 @@
|
|||||||
# Small linpeas: 1
|
# Small linpeas: 1
|
||||||
|
|
||||||
|
|
||||||
NoEnvVars="LESS_TERMCAP|JOURNAL_STREAM|XDG_SESSION|DBUS_SESSION|systemd\/sessions|systemd_exec|MEMORY_PRESSURE_WATCH|RELEVANT*|FIND*|^VERSION=|dbuslistG|mygroups|ldsoconfdG|pwd_inside_history|kernelDCW_Ubuntu_Precise|kernelDCW_Ubuntu_Trusty|kernelDCW_Ubuntu_Xenial|kernelDCW_Rhel|^sudovB=|^rootcommon=|^mounted=|^mountG=|^notmounted=|^mountpermsB=|^mountpermsG=|^kernelB=|^C=|^RED=|^GREEN=|^Y=|^B=|^NC=|TIMEOUT=|groupsB=|groupsVB=|knw_grps=|sidG|sidB=|sidVB=|sidVB2=|sudoB=|sudoG=|sudoVB=|timersG=|capsB=|notExtensions=|Wfolders=|writeB=|writeVB=|_usrs=|compiler=|LS_COLORS=|pathshG=|notBackup=|processesDump|processesB|commonrootdirs|USEFUL_SOFTWARE|PSTORAGE_"
|
NoEnvVars="LESS_TERMCAP|JOURNAL_STREAM|XDG_SESSION|DBUS_SESSION|systemd\/sessions|systemd_exec|MEMORY_PRESSURE_WATCH|RELEVANT*|FIND*|^VERSION=|dbuslistG|mygroups|ldsoconfdG|pwd_inside_history|kernelDCW_Ubuntu_Precise|kernelDCW_Ubuntu_Trusty|kernelDCW_Ubuntu_Xenial|kernelDCW_Rhel|^sudovB=|^rootcommon=|^mounted=|^mountG=|^notmounted=|^mountpermsB=|^mountpermsG=|^kernelB=|^C=|^RED=|^GREEN=|^Y=|^B=|^NC=|TIMEOUT=|groupsB=|groupsVB=|knw_grps=|sidG|sidB=|sidVB=|sidVB2=|sudoB=|sudoG=|sudoVB=|timersG=|capsB=|notExtensions=|Wfolders=|writeB=|writeVB=|_usrs=|compiler=|LS_COLORS=|pathshG=|notBackup=|processesDump|processesB|commonrootdirs|USEFUL_SOFTWARE|PSTORAGE_|^PATH=|^INVOCATION_ID=|^WATCHDOG_PID=|^LISTEN_PID="
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace winPEAS.Helpers
|
|||||||
/---------------------------------------------------------------------------------\
|
/---------------------------------------------------------------------------------\
|
||||||
| {1}Do you like PEASS?{0} |
|
| {1}Do you like PEASS?{0} |
|
||||||
|---------------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------------|
|
||||||
| {3}Learn Cloud Hacking{0} : {2}training.hacktricks.xyz {0} |
|
| {3}Learn Cloud Hacking{0} : {2}training.hacktricks.xyz {0} |
|
||||||
| {3}Follow on Twitter{0} : {2}@hacktricks_live{0} |
|
| {3}Follow on Twitter{0} : {2}@hacktricks_live{0} |
|
||||||
| {3}Respect on HTB{0} : {2}SirBroccoli {0} |
|
| {3}Respect on HTB{0} : {2}SirBroccoli {0} |
|
||||||
|---------------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------------|
|
||||||
|
|||||||
@@ -195,11 +195,11 @@ namespace winPEAS.Info.ProcessInfo
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
List<string> permsFile = PermissionsHelper.GetPermissionsFile(sFilePath, Checks.Checks.CurrentUserSiDs, PermissionType.WRITEABLE_OR_EQUIVALENT);
|
List<string> permsFile = PermissionsHelper.GetPermissionsFile(sFilePath, Checks.Checks.CurrentUserSiDs, PermissionType.WRITEABLE_OR_EQUIVALENT);
|
||||||
|
IdentityReference sid = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.Security.AccessControl.FileSecurity fs = System.IO.File.GetAccessControl(sFilePath);
|
System.Security.AccessControl.FileSecurity fs = System.IO.File.GetAccessControl(sFilePath);
|
||||||
IdentityReference sid = fs.GetOwner(typeof(SecurityIdentifier));
|
sid = fs.GetOwner(typeof(SecurityIdentifier));
|
||||||
string ownerName = sid.Translate(typeof(NTAccount)).ToString();
|
|
||||||
|
|
||||||
// If current user already have permissions over that file or the proc belongs to the owner of the file,
|
// If current user already have permissions over that file or the proc belongs to the owner of the file,
|
||||||
// handler not interesting to elevate privs
|
// handler not interesting to elevate privs
|
||||||
@@ -207,6 +207,8 @@ namespace winPEAS.Info.ProcessInfo
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
to_add["File Path"] = sFilePath;
|
to_add["File Path"] = sFilePath;
|
||||||
|
|
||||||
|
string ownerName = sid.Translate(typeof(NTAccount)).ToString();
|
||||||
to_add["File Owner"] = ownerName;
|
to_add["File Owner"] = ownerName;
|
||||||
}
|
}
|
||||||
catch (System.IO.FileNotFoundException)
|
catch (System.IO.FileNotFoundException)
|
||||||
@@ -218,7 +220,10 @@ namespace winPEAS.Info.ProcessInfo
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
catch (System.Security.Principal.IdentityNotMappedException)
|
||||||
|
{
|
||||||
|
to_add["File Owner"] = sid.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (typeName == "key")
|
else if (typeName == "key")
|
||||||
|
|||||||
Reference in New Issue
Block a user