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

SAMR: rephrased error message to account for non-relayed users #1857

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions impacket/dcerpc/v5/samr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Impacket - Collection of Python classes for working with network protocols.
#
# Copyright Fortra, LLC and its affiliated companies
# Copyright Fortra, LLC and its affiliated companies
#
# All rights reserved.
#
Expand Down Expand Up @@ -2590,11 +2590,11 @@ def hSamrCreateUser2InDomain(dce, domainHandle, name, accountType=USER_NORMAL_AC
return dce.request(request)
except DCERPCSessionError as e:
if e.error_code == 0xc0000022:
raise Exception("Relayed user doesn't have right to create a machine account!")
raise Exception("Authenticating account doesn't have the right to create a new machine account!")
elif e.error_code == 0xc00002e7:
raise Exception("Relayed user machine quota exceeded!")
raise Exception("Authenticating account's machine account quota exceeded!")
elif e.error_code == 0xc0000062:
raise Exception("Account name not accepted, maybe the '$' at the end is missing ?")
raise Exception("Account name not accepted, maybe the '$' at the end is missing?")
else:
raise e

Expand Down
Loading