Skip to content

Commit 0d5ac4e

Browse files
committed
fix find/replace nonsense
1 parent 45e1f08 commit 0d5ac4e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

nxc/modules/security-questions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def on_admin_login(self, context, connection):
4949

5050
def getSAMRResetInfo(self, context):
5151
string_binding = f"ncacn_np:{self.__targetIp}[\\pipe\\samr]"
52-
rpc_transport = transport.DCErpc_transportFactory(string_binding)
52+
rpc_transport = transport.DCERPCTransportFactory(string_binding)
5353
rpc_transport.set_dport(445)
5454
rpc_transport.setRemoteHost(self.__targetIp)
5555

@@ -66,24 +66,24 @@ def getSAMRResetInfo(self, context):
6666

6767
# obtain server handle for samr connection
6868
resp = samr.hSamrConnect(dce)
69-
server_handle = resp["server_handle"]
69+
server_handle = resp["ServerHandle"]
7070

7171
resp = samr.hSamrEnumerateDomainsInSamServer(dce, server_handle)
7272
domains = resp["Buffer"]["Buffer"]
7373

7474
resp = samr.hSamrLookupDomainInSamServer(dce, server_handle, domains[0]["Name"])
7575

7676
# obtain domain handle for samr connection
77-
resp = samr.hSamrOpenDomain(dce, server_handle=server_handle, domainId=resp["DomainId"])
78-
domain_handle = resp["domain_handle"]
77+
resp = samr.hSamrOpenDomain(dce, serverHandle=server_handle, domainId=resp["DomainId"])
78+
domain_handle = resp["DomainHandle"]
7979

8080
status = STATUS_MORE_ENTRIES
8181
enumeration_context = 0
8282

8383
# try to iterate through users in domain entries for connection
8484
while status == STATUS_MORE_ENTRIES:
8585
try:
86-
resp = samr.hSamrEnumerateUsersInDomain(dce, domain_handle, enumeration_context=enumeration_context)
86+
resp = samr.hSamrEnumerateUsersInDomain(dce, domain_handle, enumerationContext=enumeration_context)
8787
except DCERPCException as e:
8888
if str(e).find("STATUS_MORE_ENTRIES") < 0:
8989
raise
@@ -95,7 +95,7 @@ def getSAMRResetInfo(self, context):
9595
r = samr.hSamrOpenUser(dce, domain_handle, samr.MAXIMUM_ALLOWED, user["RelativeId"])
9696
info = samr.hSamrQueryInformationUser2(dce, r["UserHandle"], samr.USER_INFORMATION_CLASS.UserResetInformation)
9797

98-
reset_data = info["Buffer"]["Reset"]["reset_data"]
98+
reset_data = info["Buffer"]["Reset"]["ResetData"]
9999
if reset_data == b"":
100100
break
101101
reset_data = loads(reset_data)
@@ -110,7 +110,7 @@ def getSAMRResetInfo(self, context):
110110
context.log.highlight(f"{user['Name']} - {question}: {answer}")
111111

112112
samr.hSamrCloseHandle(dce, r["UserHandle"])
113-
enumeration_context = resp["enumeration_context"]
113+
enumeration_context = resp["EnumerationContext"]
114114
status = resp["ErrorCode"]
115115

116116
except Exception as e:

0 commit comments

Comments
 (0)