Giter Site home page Giter Site logo

Comments (9)

itm4n avatar itm4n commented on August 24, 2024

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.

AdrianVollmer avatar AdrianVollmer commented on August 24, 2024

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.

AdrianVollmer avatar AdrianVollmer commented on August 24, 2024

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.

itm4n avatar itm4n commented on August 24, 2024

Could you send me a copy of the exact exception error you get please?

from privesccheck.

AdrianVollmer avatar AdrianVollmer commented on August 24, 2024

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.

itm4n avatar itm4n commented on August 24, 2024

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.

AdrianVollmer avatar AdrianVollmer commented on August 24, 2024

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.

itm4n avatar itm4n commented on August 24, 2024

Feel free to close this issue if you think it is no longer relevant.

from privesccheck.

AdrianVollmer avatar AdrianVollmer commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.