Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to support local group definition #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mclbn
Copy link

@mclbn mclbn commented Jul 5, 2021

Hi,

Under a localized Windows (i.e. French), the name of the local admin group might be different (i.e. "Administrateurs").
This PR adds a new "Group" parameters that patches the hardcoded DLL in the script with the specified value.

Cheers.

Marc

Added a new "Group" parameter to specify which local group you want to add the new account.
@jschpp
Copy link

jschpp commented Jul 5, 2021

I'm curious. why not use SIDs to resolve the name of the Administrator Group?
like so:

[System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-544").Translate([System.Security.Principal.NTAccount]).Value

@calebstewart
Copy link
Owner

calebstewart commented Jul 5, 2021

The DLL would need to be updated. Currently, the group name is specified as a literal string constant, which could be modified at runtime before dropping the payload, but couldn't be any longer than the original string (L"Administrators"). If it was separated out into a global variable with some padded space like the user name and password, that would be feasible and less likely to cause some sort of overflow situation in DllMain.

@jschpp
Copy link

jschpp commented Jul 6, 2021

Hmmm... I'd need to test this in my side but I'm pretty sure you could do SID resolution in the DLL itself. Let me get back to you on that

@jschpp
Copy link

jschpp commented Jul 7, 2021

Hmmm... I'd need to test this in my side but I'm pretty sure you could do SID resolution in the DLL itself. Let me get back to you on that

Yeah that doesn't seem to be as easy as I thought oO sooo much LSA stuff I know nothing about^^

If it was separated out into a global variable with some padded space

This should be much much easier. So this gets my vote :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants