-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat in net.py: add functionality to enable and disable user accounts #1801
Conversation
Hi @marcobarlottini, thanks for your PR! Been checking it and think there's an issue with the flags being set (both in the _hEnableAccount and _hDisableAccount functions) I think we should be gathering current Also in the Another detail, not strictly related with you PR, is the constant we are using to set the flag in the Line 220 in 0fd9f28
samr.USER_NORMAL_ACCOUNT instead (values are the same, but the other const is the correct one)
Edit |
Hi @gabrielg5, Regarding the last note you added, computer inherits from User but there are fields _create_account_type _enum_account_type Line 227 in 67e1924
I also added command line options to the argparse to have the enable and disable options also for subparser computer for the sake of completeness Let me know if something needs to be changed |
Hey @marcobarlottini, yeah, saw those other properties With your latest changes, however, I'm getting an error when calling with the
Perhaps we can move the call to Thanks! |
hey @gabrielg5 , i don't know if you like it but this is how i solved it, by passing in the call to |
mmm perhaps by calling inside both functions? (it's the same function that is called in user_account_control = samr.hSamrQueryInformationUser2(self._dce, user_handle, samr.USER_INFORMATION_CLASS.UserAllInformation)['Buffer']['All']['UserAccountControl'] That way the uac gathering is kept in same context, and no extra parameters are needed neither in Note: Tried querying less information, but couldn't find a way yet of gathering the uac only |
your solutions seems somewhat cleaner, let me know if you have other improvements! |
Awesome! merging now 🚀 |
Hi,
this PR adds functionality to net.py to enable or disable user accounts