Comments (9)
Hello,
Thanks for reporting this issue. However, I cannot reproduce it.
Could you provide more information about the way you run the script, and about the context (Windows version, PowerShell version)?
from privesccheck.
Windows Version 10.0.19042
Power Shell 5
I load the script over the network with Net.WebClient and execute it in memory with Invoke-Expression
.
I also tracked it down some more: the line return ($Module.GetType($FullName)
returns NULL if $FullName
equals WinApiModule.WTS_CONNECTSTATE_CLASS
.
from privesccheck.
I believe that the type simply does not exist on this system. It's hard to tell what causes this, but I assume this is not the only system where this is the case. I propose that $WTS_CONNECTSTATE_CLASS
will only be added to $WTS_SESSION_INFO_1W
if it is not null, otherwise maybe throw a warning. Sure, this risks that user enumeration will then fail, but that's better than not being able to load the entire script.
from privesccheck.
Could you send me a copy of the exact exception error you get please?
from privesccheck.
The error message was this:
Invoke-Expression : Das Argument kann nicht an den Parameter "Type" gebunden werden, da es NULL ist.
In Zeile:103 Zeichen:14
+ $AllScript | Invoke-Expression
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Expression], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.InvokeExpressionCommand
because this is not helpful, I applied the change I mentioned in my first post in parenthesis. Then I get this:
New-StructureField : Das Argument kann nicht an den Parameter "Type" gebunden werden, da es NULL ist.
In Zeile:1052 Zeichen:34
+ State = New-StructureField 1 $WTS_CONNECTSTATE_CLASS
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-StructureField], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,New-StructureField
However, I just tried to reproduce this in a fresh powershell session and everything works as expected, so ... yeah.
from privesccheck.
Yeah, this error does not make any sense to me. I cannot see what is going wrong here. This is not the only place where I use this kind of structure and enumeration definition. I do not understand why there would be an error for WTS_CONNECTSTATE_CLASS
but not for other types that are defined the exact same way.
from privesccheck.
For what it's worth, WinPEAS is showing the exact same error, except only in the relevant section. All other tests run fine. So it's more likely to be an issue of this particular system (or even this particular shell instance).
from privesccheck.
Feel free to close this issue if you think it is no longer relevant.
from privesccheck.
This particular issues is at least not specific to this repo, so I'm closing.
However, I guess it would make sense if the code was modularized more such that the rest of the script runs fine if only one check fails due to an exception. But since that's probably a non-trivial task, I leave the decision up to you ;) thanks for the quick response anyway!
from privesccheck.
Related Issues (20)
- Wifi Airstrike Attack (CVE-2021-28316) already mitigated Apr 13, 2021 HOT 2
- Cannot find process with ID for UDP Endpoints HOT 2
- Specified cast is not valid HOT 9
- Windows 11 detected as Windows 10 HOT 3
- Scheduled Task: Binary Exploitation no detection HOT 2
- Empty WinLogon credentials HOT 1
- Check for vulnerable WPAD configuration? HOT 2
- Report Improvement Suggestion HOT 2
- [Improvement] Check for vulnerable drivers HOT 1
- SERVICES > Unquoted Path not work as expected HOT 3
- Credential Guard HOT 3
- [Feature Request] Readd Compliance Field HOT 4
- Getting erros when trying to run it HOT 2
- Get-HotFixList misses updates HOT 2
- LapsV2 is not being checked? HOT 3
- Check SMB signing required HOT 5
- Service binary permissions false positive HOT 1
- List ASR rules HOT 2
- Bug in Find-SccmCacheFileCredentials? HOT 2
- Detect Defender exclusions rules and ASR rules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from privesccheck.