Esempio n. 1
0
 def default(self, line):
     if line.startswith('*'):
         line = line[1:]
     command = (line.strip('\n')+'\x00').encode('utf-16le')
     command = ARC4.new(self.key).encrypt(command)
     resp = mimilib.hMimiCommand(self.dce, self.pHandle, command)
     cipherText = b''.join(resp['encResult'])
     cipher = ARC4.new(self.key)
     print(cipher.decrypt(cipherText).decode('utf-16le'))
Esempio n. 2
0
 def default(self, line):
     if line.startswith('*'):
         line = line[1:]
     command = (line.strip('\n')+'\x00').encode('utf-16le')
     command = ARC4.new(self.key).encrypt(command)
     resp = mimilib.hMimiCommand(self.dce, self.pHandle, command)
     cipherText = b''.join(resp['encResult'])
     cipher = ARC4.new(self.key)
     print(cipher.decrypt(cipherText).decode('utf-16le'))
Esempio n. 3
0
    def test_hMimiCommand(self):
        dce, rpc_transport = self.connect()
        pHandle, key = self.get_handle_key(dce)

        cipher = ARC4.new(key[::-1])
        command = cipher.encrypt("{}\x00".format(self.mimikatz_command).encode('utf-16le'))
        resp = mimilib.hMimiCommand(dce, pHandle, command)
        self.assertEqual(resp["ErrorCode"], 0)
        self.assertEqual(len(resp["encResult"]), resp["szEncResult"])

        dce.disconnect()
        rpc_transport.disconnect()