def test_LsarEnumerateAccounts(self):
     dce, rpctransport, policyHandle = self.connect()
     request = lsad.LsarEnumerateAccounts()
     request['PolicyHandle'] = policyHandle
     request['PreferedMaximumLength'] = 0xffffffff
     resp = dce.request(request)
     resp.dump()
Exemplo n.º 2
0
    def test_LsarOpenAccount(self):
        dce, rpctransport, policyHandle = self.connect()
        request = lsad.LsarEnumerateAccounts()
        request['PolicyHandle'] = policyHandle
        request['PreferedMaximumLength'] = 0xffffffff
        resp = dce.request(request)
        resp.dump()

        request = lsad.LsarOpenAccount()
        request['PolicyHandle'] = policyHandle
        request['AccountSid'] = resp['EnumerationBuffer']['Information'][0]['Sid']
        request['DesiredAccess'] = MAXIMUM_ALLOWED
        resp = dce.request(request)
        resp.dump()

        request = lsad.LsarClose()
        request['ObjectHandle'] = resp['AccountHandle']
        resp = dce.request(request)
        resp.dump()