General

  • Target
    loader.exe
  • Size 1.1MB
  • Sample261122-semqaah15k
  • SHA256 a10a5974695a88242fc7d281f68bda0980db589767ca57e93dfc6f8d7091a81d
  • MD5 SHA1 SHA512 SSDEEP TLSH

Malware Config

Extracted

Path
  • C:\Users\Admin\AppData\Local\Microsoft\Windows\NtProfileIndex\Lib\site-packages\Crypto\Cipher\__pycache__\AES.cpython-312.pyc

Ransom Note
  • � ����,ki:���������������������������U�d�dl�mZ�d�dlZd�dlmZmZmZmZmZm Z �d�dl m Z �d�dl m Z �d�dlmZ�d�dlmZmZmZmZmZ�d�dlmZ�er`d�d lmZ�d�d lmZ�d�d lmZ�d�d lmZ�d�d l m!Z!�d�dl"m#Z#�d�dl$m%Z%�d�dl&m'Z'�d�dl(m)Z)�d�dl*m+Z+�d�dl,m-Z-�d�dl.m/Z/�d�dl0m1Z1�d�dl2m3Z3�d�dl4m5Z5�d�dl6m7Z7�dZ8de9d<���dZ:de9d<���dZ;d e9d!<���d"Z<d#e9d$<���d%Z=d&e9d'<���d(Z>d)e9d*<���d+Z?d,e9d-<���d.Z@d/e9d0<���d1ZAd2e9d3<���d4ZBd5e9d6<���d7ZCd8e9d9<���d:ZDd;e9d<<���d=ZEd>e9d?<���d@ZFdAe9dB<���dCZGdDe9dE<���dFZH�edGeH�������ZIdH��ZJ�eJ��������ZKdI��ZLdJ��ZMe dfdgdL���������ZNe dhdidM���������ZNe dhdjdN���������ZNe �dk � � � � � � � � � � �dldP���������ZNe �dk � � � � � � � � � � �dmdQ���������ZNe dhdndR���������ZNe dhdodS���������ZNe � � � � �dp � � � � � � � � � � � � � � �dqdT���������ZNe dhdrdU���������ZNe dhdsdV���������ZNe � � � �dt � � � � � � � � � � � � �dudW���������ZNe �dk � � � � � � � � � � �dvdX���������ZNe dhdwdY���������ZNe � � � �dt � � � � � � � � � � � � �dxdZ���������ZNe � � � �dt � � � � � � � � � � � � �dyd[���������ZNe dfdzd\���������ZNe dfd{d]���������ZNe � � �dk � � � � � � � � � � �d|d^���������ZNe dKd_�d}d`���������ZNd~da�ZNdCZOdOe9db<���dcZPdde9de<���y)�����)� annotationsN)� TYPE_CHECKING�Any�Literal�Optional�Union�overload)�_create_cipher)�get_random_bytes)� _cpu_features)� SmartPointer� VoidPointer�c_size_t�c_uint8_ptr_len�load_pycryptodome_raw_lib)�Buffer)�CbcMode)�CcmMode)�CfbMode)�CtrMode)�EaxMode)�EcbMode)�GcmMode)� GcmSivMode)�KWMode)�KWPMode)�OcbMode)�OfbMode)� OpenPgpMode)�SivMode)�XtsMode)� CounterParams����� Literal[1]�MODE_ECB����� Literal[2]�MODE_CBC����� Literal[3]�MODE_CFB����� Literal[5]�MODE_OFB����� Literal[6]�MODE_CTR����� Literal[7]� MODE_OPENPGP����� Literal[8]�MODE_CCM� ���� Literal[9]�MODE_EAX� ���� Literal[10]�MODE_SIV� ���� Literal[11]�MODE_GCM� ���� Literal[12]�MODE_OCB� ���� Literal[13]�MODE_KW����� Literal[14]�MODE_KWP����� Literal[15]� MODE_GCM_SIV����� Literal[16]�MODE_XTSa�� int AES_start_operation(const uint8_t key[], size_t key_len, void **pResult); int AES_encrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int AES_decrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int AES_stop_operation(void *state); zCrypto.Cipher._raw_aesc����������������������t��������j��������������������������rd\��}�}nt��������j��������������������������rd\��}�}ny �t��������|�t��������j ������������������d|��������������}t��������||dz����������t��������||dz����������fS�#�t ��������$�r�Y�yw�xY�w)z�Return the (start, stop) functions of the AES implementation with the AES instructions of the CPU (AES-NI on x86, the ARMv8 Cryptography Extensions on AArch64), or None if the CPU does not have them.)zCrypto.Cipher._raw_aesni�AESNI)zCrypto.Cipher._raw_aes_armv8� AES_ARMV8N�AES�_start_operation�_stop_operation)r ���� have_aes_ni�have_aes_armv8r����_cproto�replace�OSError�getattr)�name�prefix�libs��� �dC:\Users\Admin\AppData\Local\Microsoft\Windows\NtProfileIndex\Lib\site-packages\Crypto/Cipher/AES.py� _load_aes_hwr`���^���s������� �� � �"�:� ��f� � %� %� '�B� ��f���'��g�o�o�e�V�.L�M��� �C��"4�4� 5�w�s�F�M^�D^�7_� `�`��� �����s���� A5��5 B��Bc����������������������|�j������������������dd�������} �|�j������������������d�������}t��������|�������t��������vrt ��������dt��������|�������z����������|rt ��������r t ��������\��}}n t��������j������������������}t��������j������������������}t����������������}t��������|�������\��}}�||t��������|�������|j���������������������������������}|rt ��������d|z����������t��������|j��������������������������|�������S�#�t��������$�r �t��������d��������w�xY�w)z}This method instantiates and returns a handle to a low-level base cipher. It will absorb named parameters in the process.� use_aesniT�keyzMissing 'key' parameterz#Incorrect AES key length (%d bytes)z+Error %X while instantiating the AES cipher)�pop�KeyError� TypeError�len�key_size� ValueError� _raw_aes_hw� _raw_aes_lib�AES_start_operation�AES_stop_operationr���r���r���� address_ofr ����get) �dict_parametersrb���rc����start_operation�stop_operation�cipher�key_ptr�key_len�results ��� r_����_create_base_cipherrw���u���s�������� �#�#�K��6�I�3��!�!�%�(��� �3�x�x���>��S��I�J�J��[�*5�'���&�:�:��%�8�8�� �]�F�&�s�+��G�W� �W�h�w�&7��9J�9J�9L� M�F� ��F��O�P�P� �� � � �n� 5�5��#� ��3��1�2�2�3�s ����C"��"C7c�����������������������t��������|��������dk7��r t��������d��������|� t��������d�������}nt��������|�������dk7��r t��������d��������t��������|�dd�t���������������j ������������������|�������}|�dd�||fS�)zrDerive a tuple (r, s, nonce) for a Poly1305 MAC. If nonce is ``None``, a new 16-byte nonce is generated. � ���z(Poly1305 with AES requires a 32-byte keyNrM���z*Poly1305 with AES requires a 16-byte nonce)rg���ri���r ����newr%����encrypt)rc����nonce�ss��� r_����_derive_Poly1305_key_pairr~�������sr������ � �3�x�2�~��C�D�D� �}� ��$�� �U��r� ��E�F�F� �C���H�h��'�'��.�A� �r�s�8�Q�� ������.c�����������������������y��N���rc����moderb���s��� r_���rz���rz��������������JMr���c�����������������������y�r����r�����rc���r�����ivrb���s��� r_���rz���rz��������������fir���c�����������������������y�r����r�����rc���r�����IVrb���s��� r_���rz���rz�������r����r����intc�����������������������y�r����r����)rc���r����r����� segment_sizerb���s��� r_���rz���rz���������������r���c�����������������������y�r����r����)rc���r����r����r����rb���s��� r_���rz���rz�������r����r���c�����������������������y�r����r����r����s��� r_���rz���rz�������r����r���c�����������������������y�r����r����r����s��� r_���rz���rz�������r����r���c�����������������������y�r����r����)rc���r����r|���� initial_value�counterrb����threadss��� r_���rz���rz�������s�������r���c�����������������������y�r����r����r����s��� r_���rz���rz��������������jmr���c�����������������������y�r����r����r����s��� r_���rz���rz�������r����r���c�����������������������y�r����r����)rc���r����r|����mac_len� assoc_lenrb���s��� r_���rz���rz���������������r���c�����������������������y�r����r����)rc���r����r|���r����rb���s��� r_���rz���rz�������r����r���c�����������������������y�r����r����)rc���r����r|���rb���s��� r_���rz���rz�������r����r���c�����������������������y�r����r�����rc���r����r|���r����rb���r����s��� r_���rz���rz�������r����r���c�����������������������y�r����r����r����s��� r_���rz���rz�������r����r���c�����������������������y�r����r����r����s��� r_���rz���rz�����r����r���c�����������������������y�r����r����r����s��� r_���rz���rz�����s������KNr���c�����������������������y�r����r����)rc���r����r|���rb���r����s��� r_���rz���rz��� ��s�������r���)rb���c����������������������y�r����r����)rc���r�����tweakrb���s��� r_���rz���rz�����s������]`r���c�����������������X�����d|d<���t��������t��������j������������������t�����������|�|g|��i�|��S�)a2��Create a new AES cipher. Args: key(bytes/bytearray/memoryview): The secret key to use in the symmetric cipher. It must be 16 (*AES-128)*, 24 (*AES-192*) or 32 (*AES-256*) bytes long. For ``MODE_SIV`` only, it doubles to 32, 48, or 64 bytes. For ``MODE_GCM_SIV`` only, it must be 16 or 32 bytes long. For ``MODE_XTS`` only, it must be 32 or 64 bytes long: two AES-128 or AES-256 keys (concatenated), which must be different. mode (a ``MODE_*`` constant): The chaining mode to use for encryption or decryption. If in doubt, use ``MODE_GCM`` (with a random 12-byte ``nonce``). Keyword Args: iv (bytes/bytearray/memoryview): (Only applicable for ``MODE_CBC``, ``MODE_CFB``, ``MODE_OFB``, and ``MODE_OPENPGP`` modes). The initialization vector to use for encryption or decryption. For ``MODE_CBC``, ``MODE_CFB``, and ``MODE_OFB`` it must be 16 bytes long. For ``MODE_OPENPGP`` mode only, it must be 16 bytes long for encryption and 18 bytes for decryption (in the latter case, it is actually the *encrypted* IV which was prefixed to the ciphertext). If not provided, a random byte string is generated (you must then read its value with the :attr:`iv` attribute). nonce (bytes/bytearray/memoryview): (Only applicable for ``MODE_CCM``, ``MODE_EAX``, ``MODE_GCM``, ``MODE_SIV``, ``MODE_GCM_SIV``, ``MODE_OCB``, and ``MODE_CTR``). A value that must never be reused for any other encryption done with this key (except possibly for ``MODE_SIV`` and ``MODE_GCM_SIV``, see below). For ``MODE_EAX``, ``MODE_GCM`` and ``MODE_SIV`` there are no restrictions on its length (recommended: **16** bytes). For ``MODE_CCM``, its length must be in the range **[7..13]**. Bear in mind that with CCM there is a trade-off between nonce length and maximum message size. Recommendation: **11** bytes. For ``MODE_OCB``, its length must be in the range **[1..15]** (recommended: **15**). For ``MODE_CTR``, its length must be in the range **[0..15]** (recommended: **8**). For ``MODE_SIV``, the nonce is optional, if it is not specified, then no nonce is being used, which renders the encryption deterministic. For ``MODE_GCM_SIV``, it must be **12** bytes long. Reusing a nonce only reveals if the same message was encrypted twice (with the same key, nonce and associated data). If not provided, for modes other than ``MODE_SIV``, a random byte string of the recommended length is used (you must then read its value with the :attr:`nonce` attribute). segment_size (integer): (Only ``MODE_CFB``).The number of **bits** the plaintext and ciphertext are segmented in. It must be a multiple of 8. If not specified, it will be assumed to be 8. mac_len (integer): (Only ``MODE_EAX``, ``MODE_GCM``, ``MODE_OCB``, ``MODE_CCM``) Length of the authentication tag, in bytes. It must be even and in the range **[4..16]**. The recommended value (and the default, if not specified) is **16**. msg_len (integer): (Only ``MODE_CCM``). Length of the message to (de)cipher. If not specified, ``encrypt`` must be called with the entire message. Similarly, ``decrypt`` can only be called once. assoc_len (integer): (Only ``MODE_CCM``). Length of the associated data. If not specified, all associated data is buffered internally, which may represent a problem for very large messages. initial_value (integer or bytes/bytearray/memoryview): (Only ``MODE_CTR``). The initial value for the counter. If not present, the cipher will start counting from 0. The value is incremented by one for each block. The counter number is encoded in big endian mode. counter (object): (Only ``MODE_CTR``). Instance of ``Crypto.Util.Counter``, which allows full customization of the counter block. This parameter is incompatible to both ``nonce`` and ``initial_value``. use_aesni: (boolean): Use the AES instructions of the CPU (default: use if available): AES-NI on x86, or the Cryptography Extensions on 64-bit ARM. threads (integer): (Only ``MODE_CTR``, ``MODE_GCM``, ``MODE_GCM_SIV`` and ``MODE_OCB``). The maximum number of threads used to encrypt or decrypt long data (default: 1, no extra threads). Use 0 for as many threads as the CPU cores available to this process. Each thread processes at least 1 MiB of a single call to ``encrypt()`` or ``decrypt()``: with shorter inputs, fewer threads are used, or none at all. For best results, do not exceed the number of physical cores. The output does not depend on the number of threads. tweak (bytes/bytearray/memoryview): (Only ``MODE_XTS``, where it is mandatory). The value that identifies the data unit, 16 bytes long. For a sector number, use ``number.to_bytes(16, "little")``. Returns: :ref:`A cipher object <aes_modes>`: Its class depends on ``mode``, see the table in :ref:`aes_modes`. T� add_aes_modes)r ����sys�modules�__name__)rc���r�����args�kwargss��� r_���rz���rz�����s1������@�#�F�?�� �#�+�+�h�/��d� L�T� L�V� L�Lr���� block_size)rM�������ry���ztuple[int, int, int]rh���).)rc���r���r����r$���rb����bool�returnr���)..) rc���r���r����r'���r�����Optional[Buffer]rb���r����r����r���) rc���r���r����r'���r����r����rb���r����r����r���)...) rc���r���r����r*���r����r����r����r����rb���r����r����r���) rc���r���r����r*���r����r����r����r����rb���r����r����r���) rc���r���r����r-���r����r����rb���r����r����r���) rc���r���r����r-���r����r����rb���r����r����r���).....)rc���r���r����r0���r|���r����r����zUnion[int, Buffer]r����r"���rb���r����r����r����r����r���) rc���r���r����r3���r����r����rb���r����r����r���) rc���r���r����r3���r����r����rb���r����r����r���)....)rc���r���r����r6���r|���r����r����r����r����r����rb���r����r����r���) rc���r���r����r9���r|���r����r����r����rb���r����r����r���) rc���r���r����r<���r|���r����rb���r����r����r ���)rc���r���r����r?���r|���r����r����r����rb���r����r����r����r����r���)rc���r���r����rB���r|���r����r����r����rb���r����r����r����r����r���)rc���r���r����rE���rb���r����r����r���)rc���r���r����rH���rb���r����r����r���) rc���r���r����rK���r|���r����rb���r����r����r����r����r���) rc���r���r����rN���r����r���rb���r����r����r!���) rc���r���r����r����r����r���r����r���r����r���)Q� __future__r���r�����typingr���r���r���r���r���r ���� Crypto.Cipherr ���� Crypto.Randomr ���� Crypto.Utilr ����Crypto.Util._raw_apir ���r���r���r���r����Crypto.Util._typingr����Crypto.Cipher._mode_cbcr����Crypto.Cipher._mode_ccmr����Crypto.Cipher._mode_cfbr����Crypto.Cipher._mo

Extracted

Path
  • C:\Users\Admin\AppData\Local\Microsoft\Windows\NtProfileIndex\Lib\site-packages\Crypto\Cipher\AES.py

Ransom Note
  • # # Cipher/AES.py : AES # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to exercise all rights associated with the # contents of this file for any purpose whatsoever. # No rights are reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # =================================================================== from __future__ import annotations import sys from typing import TYPE_CHECKING, Any, Literal, Optional, Union, overload from Crypto.Cipher import _create_cipher from Crypto.Random import get_random_bytes from Crypto.Util import _cpu_features from Crypto.Util._raw_api import ( SmartPointer, VoidPointer, c_size_t, c_uint8_ptr_len, load_pycryptodome_raw_lib, ) from Crypto.Util._typing import Buffer if TYPE_CHECKING: from Crypto.Cipher._mode_cbc import CbcMode from Crypto.Cipher._mode_ccm import CcmMode from Crypto.Cipher._mode_cfb import CfbMode from Crypto.Cipher._mode_ctr import CtrMode from Crypto.Cipher._mode_eax import EaxMode from Crypto.Cipher._mode_ecb import EcbMode from Crypto.Cipher._mode_gcm import GcmMode from Crypto.Cipher._mode_gcm_siv import GcmSivMode from Crypto.Cipher._mode_kw import KWMode from Crypto.Cipher._mode_kwp import KWPMode from Crypto.Cipher._mode_ocb import OcbMode from Crypto.Cipher._mode_ofb import OfbMode from Crypto.Cipher._mode_openpgp import OpenPgpMode from Crypto.Cipher._mode_siv import SivMode from Crypto.Cipher._mode_xts import XtsMode from Crypto.Util.Counter import CounterParams MODE_ECB: Literal[1] = 1 #: Electronic Code Book (:ref:`ecb_mode`) MODE_CBC: Literal[2] = 2 #: Cipher-Block Chaining (:ref:`cbc_mode`) MODE_CFB: Literal[3] = 3 #: Cipher Feedback (:ref:`cfb_mode`) MODE_OFB: Literal[5] = 5 #: Output Feedback (:ref:`ofb_mode`) MODE_CTR: Literal[6] = 6 #: Counter mode (:ref:`ctr_mode`) MODE_OPENPGP: Literal[7] = 7 #: OpenPGP mode (:ref:`openpgp_mode`) MODE_CCM: Literal[8] = 8 #: Counter with CBC-MAC (:ref:`ccm_mode`) MODE_EAX: Literal[9] = 9 #: :ref:`eax_mode` MODE_SIV: Literal[10] = 10 #: Synthetic Initialization Vector (:ref:`siv_mode`) MODE_GCM: Literal[11] = 11 #: Galois Counter Mode (:ref:`gcm_mode`) MODE_OCB: Literal[12] = 12 #: Offset Code Book (:ref:`ocb_mode`) MODE_KW: Literal[13] = 13 #: Key Wrap (:ref:`kw_mode`) MODE_KWP: Literal[14] = 14 #: Key Wrap with Padding (:ref:`kwp_mode`) MODE_GCM_SIV: Literal[15] = 15 #: AES-GCM-SIV (:ref:`gcm_siv_mode`) MODE_XTS: Literal[16] = 16 #: XEX with ciphertext stealing, for storage (:ref:`xts_mode`) _cproto = """ int AES_start_operation(const uint8_t key[], size_t key_len, void **pResult); int AES_encrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int AES_decrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int AES_stop_operation(void *state); """ # Load portable AES _raw_aes_lib = load_pycryptodome_raw_lib("Crypto.Cipher._raw_aes", _cproto) def _load_aes_hw(): """Return the (start, stop) functions of the AES implementation with the AES instructions of the CPU (AES-NI on x86, the ARMv8 Cryptography Extensions on AArch64), or None if the CPU does not have them.""" if _cpu_features.have_aes_ni(): name, prefix = "Crypto.Cipher._raw_aesni", "AESNI" elif _cpu_features.have_aes_armv8(): name, prefix = "Crypto.Cipher._raw_aes_armv8", "AES_ARMV8" else: return None try: lib = load_pycryptodome_raw_lib(name, _cproto.replace("AES", prefix)) # The module may not have been compiled in except OSError: return None return (getattr(lib, prefix + "_start_operation"), getattr(lib, prefix + "_stop_operation")) _raw_aes_hw = _load_aes_hw() def _create_base_cipher(dict_parameters): """This method instantiates and returns a handle to a low-level base cipher. It will absorb named parameters in the process.""" use_aesni = dict_parameters.pop("use_aesni", True) try: key = dict_parameters.pop("key") except KeyError: raise TypeError("Missing 'key' parameter") if len(key) not in key_size: raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) if use_aesni and _raw_aes_hw: start_operation, stop_operation = _raw_aes_hw else: start_operation = _raw_aes_lib.AES_start_operation stop_operation = _raw_aes_lib.AES_stop_operation cipher = VoidPointer() key_ptr, key_len = c_uint8_ptr_len(key) result = start_operation(key_ptr, c_size_t(key_len), cipher.address_of()) if result: raise ValueError("Error %X while instantiating the AES cipher" % result) return SmartPointer(cipher.get(), stop_operation) def _derive_Poly1305_key_pair(key, nonce): """Derive a tuple (r, s, nonce) for a Poly1305 MAC. If nonce is ``None``, a new 16-byte nonce is generated. """ if len(key) != 32: raise ValueError("Poly1305 with AES requires a 32-byte key") if nonce is None: nonce = get_random_bytes(16) elif len(nonce) != 16: raise ValueError("Poly1305 with AES requires a 16-byte nonce") s = new(key[:16], MODE_ECB).encrypt(nonce) return key[16:], s, nonce @overload def new(key: Buffer, mode: Literal[1], use_aesni: bool = ...) -> EcbMode: ... @overload def new(key: Buffer, mode: Literal[2], iv: Optional[Buffer] = ..., use_aesni: bool = ...) -> CbcMode: ... @overload def new(key: Buffer, mode: Literal[2], IV: Optional[Buffer] = ..., use_aesni: bool = ...) -> CbcMode: ... @overload def new( key: Buffer, mode: Literal[3], iv: Optional[Buffer] = ..., segment_size: int = ..., use_aesni: bool = ... ) -> CfbMode: ... @overload def new( key: Buffer, mode: Literal[3], IV: Optional[Buffer] = ..., segment_size: int = ..., use_aesni: bool = ... ) -> CfbMode: ... @overload def new(key: Buffer, mode: Literal[5], iv: Optional[Buffer] = ..., use_aesni: bool = ...) -> OfbMode: ... @overload def new(key: Buffer, mode: Literal[5], IV: Optional[Buffer] = ..., use_aesni: bool = ...) -> OfbMode: ... @overload def new( key: Buffer, mode: Literal[6], nonce: Optional[Buffer] = ..., initial_value: Union[int, Buffer] = ..., counter: CounterParams = ..., use_aesni: bool = ..., threads: int = ..., ) -> CtrMode: ... @overload def new(key: Buffer, mode: Literal[7], iv: Optional[Buffer] = ..., use_aesni: bool = ...) -> OpenPgpMode: ... @overload def new(key: Buffer, mode: Literal[7], IV: Optional[Buffer] = ..., use_aesni: bool = ...) -> OpenPgpMode: ... @overload def new( key: Buffer, mode: Literal[8], nonce: Optional[Buffer] = ..., mac_len: int = ..., assoc_len: int = ..., use_aesni: bool = ..., ) -> CcmMode: ... @overload def new( key: Buffer, mode: Literal[9], nonce: Optional[Buffer] = ..., mac_len: int = ..., use_aesni: bool = ... ) -> EaxMode: ... @overload def new(key: Buffer, mode: Literal[10], nonce: Optional[Buffer] = ..., use_aesni: bool = ...) -> SivMode: ... @overload def new( key: Buffer, mode: Literal[11], nonce: Optional[Buffer] = ..., mac_len: int = ..., use_aesni: bool = ..., threads: int = ..., ) -> GcmMode: ... @overload def new( key: Buffer, mode: Literal[12], nonce: Optional[Buffer] = ..., mac_len: int = ..., use_aesni: bool = ..., threads: int = ..., ) -> OcbMode: ... @overload def new(key: Buffer, mode: Literal[13], use_aesni: bool = ...) -> KWMode: ... @overload def new(key: Buffer, mode: Literal[14], use_aesni: bool = ...) -> KWPMode: ... @overload def new( key: Buffer, mode: Literal[15], nonce: Optional[Buffer] = ..., use_aesni: bool = ..., threads: int = ..., ) -> GcmSivMode: ... @overload def new(key: Buffer, mode: Literal[16], *, tweak: Buffer, use_aesni: bool = ...) -> XtsMode: ... def new(key: Buffer, mode: int, *args: Any, **kwargs: Any) -> Any: """Create a new AES cipher. Args: key(bytes/bytearray/memoryview): The secret key to use in the symmetric cipher. It must be 16 (*AES-128)*, 24 (*AES-192*) or 32 (*AES-256*) bytes long. For ``MODE_SIV`` only, it doubles to 32, 48, or 64 bytes. For ``MODE_GCM_SIV`` only, it must be 16 or 32 bytes long. For ``MODE_XTS`` only, it must be 32 or 64 bytes long: two AES-128 or AES-256 keys (concatenated), which must be different. mode (a ``MODE_*`` constant): The chaining mode to use for encryption or decryption. If in doubt, use ``MODE_GCM`` (with a random 12-byte ``nonce``). Keyword Args: iv (bytes/bytearray/memoryview): (Only applicable for ``MODE_CBC``, ``MODE_CFB``, ``MODE_OFB``, and ``MODE_OPENPGP`` modes). The initialization vector to use for encryption or decryption. For ``MODE_CBC``, ``MODE_CFB``, and ``MODE_OFB`` it must be 16 bytes long. For ``MODE_OPENPGP`` mode only, it must be 16 bytes long for encryption and 18 bytes for decryption (in the latter case, it is actually the *encrypted* IV which was prefixed to the ciphertext). If not provided, a random byte string is generated (you must then read its value with the :attr:`iv` attribute). nonce (bytes/bytearray/memoryview): (Only applicable for ``MODE_CCM``, ``MODE_EAX``, ``MODE_GCM``, ``MODE_SIV``, ``MODE_GCM_SIV``, ``MODE_OCB``, and ``MODE_CTR``). A value that must never be reused for any other encryption done with this key (except possibly for ``MODE_SIV`` and ``MODE_GCM_SIV``, see below). For ``MODE_EAX``, ``MODE_GCM`` and ``MODE_SIV`` there are no restrictions on its length (recommended: **16** bytes). For ``MODE_CCM``, its length must be in the range **[7..13]**. Bear in mind that with CCM there is a trade-off between nonce length and maximum message size. Recommendation: **11** bytes. For ``MODE_OCB``, its length must be in the range **[1..15]** (recommended: **15**). For ``MODE_CTR``, its length must be in the range **[0..15]** (recommended: **8**). For ``MODE_SIV``, the nonce is optional, if it is not specified, then no nonce is being used, which renders the encryption deterministic. For ``MODE_GCM_SIV``, it must be **12** bytes long. Reusing a nonce only reveals if the same message was encrypted twice (with the same key, nonce and associated data). If not provided, for modes other than ``MODE_SIV``, a random byte string of the recommended length is used (you must then read its value with the :attr:`nonce` attribute). segment_size (integer): (Only ``MODE_CFB``).The number of **bits** the plaintext and ciphertext are segmented in. It must be a multiple of 8. If not specified, it will be assumed to be 8. mac_len (integer): (Only ``MODE_EAX``, ``MODE_GCM``, ``MODE_OCB``, ``MODE_CCM``) Length of the authentication tag, in bytes. It must be even and in the range **[4..16]**. The recommended value (and the default, if not specified) is **16**. msg_len (integer): (Only ``MODE_CCM``). Length of the message to (de)cipher. If not specified, ``encrypt`` must be called with the entire message. Similarly, ``decrypt`` can only be called once. assoc_len (integer): (Only ``MODE_CCM``). Length of the associated data. If not specified, all associated data is buffered internally, which may represent a problem for very large messages. initial_value (integer or bytes/bytearray/memoryview): (Only ``MODE_CTR``). The initial value for the counter. If not present, the cipher will start counting from 0. The value is incremented by one for each block. The counter number is encoded in big endian mode. counter (object): (Only ``MODE_CTR``). Instance of ``Crypto.Util.Counter``, which allows full customization of the counter block. This parameter is incompatible to both ``nonce`` and ``initial_value``. use_aesni: (boolean): Use the AES instructions of the CPU (default: use if available): AES-NI on x86, or the Cryptography Extensions on 64-bit ARM. threads (integer): (Only ``MODE_CTR``, ``MODE_GCM``, ``MODE_GCM_SIV`` and ``MODE_OCB``). The maximum number of threads used to encrypt or decrypt long data (default: 1, no extra threads). Use 0 for as many threads as the CPU cores available to this process. Each thread processes at least 1 MiB of a single call to ``encrypt()`` or ``decrypt()``: with shorter inputs, fewer threads are used, or none at all. For best results, do not exceed the number of physical cores. The output does not depend on the number of threads. tweak (bytes/bytearray/memoryview): (Only ``MODE_XTS``, where it is mandatory). The value that identifies the data unit, 16 bytes long. For a sector number, use ``number.to_bytes(16, "little")``. Returns: :ref:`A cipher object <aes_modes>`: Its class depends on ``mode``, see the table in :ref:`aes_modes`. """ kwargs["add_aes_modes"] = True return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) #: Size of a data block (in bytes) block_size: int = 16 #: The valid sizes of a key (in bytes) key_size: tuple[int, int, int] = (16, 24, 32)

Extracted

Path
  • C:\Users\Admin\AppData\Local\Microsoft\Windows\NtProfileIndex\Lib\site-packages\Crypto\Cipher\__pycache__\_mode_siv.cpython-312.pyc

Ransom Note
  • � ����,k�5����������������������������d�Z�ddlmZ�ddlmZ�ddlmZmZmZm Z �dgZ ddl m Z �ddl mZ�ddlmZ�dd lmZ�dd lmZ�dd lmZ�erdd lmZ��G�d ��d�������Zd��Zy)z- Synthetic Initialization Vector (SIV) mode. �����)� annotations)�compare_digest)� TYPE_CHECKING�Optional�Union�overload�SivMode)� unhexlify)�Method)�_S2V)� is_buffer)�Buffer)� bytes_to_long)� ModuleTypec�������������������������e�Zd�ZdZdd�Zd��Zdd�Zdd�Zdd�Zdd�Z dd�Z dd �Z dd �Z e dd ���������Ze � � � � � �dd ���������Z �d � � � � �dd�Ze dd���������Ze � � � � � � � �dd���������Z �d � � � � � � �d d�Zy )!r ���a���Synthetic Initialization Vector (SIV). This is an Authenticated Encryption with Associated Data (`AEAD`_) mode. It provides both confidentiality and authenticity. The header of the message may be left in the clear, if needed, and it will still be subject to authentication. The decryption step tells the receiver if the message comes from a source that really knows the secret key. Additionally, decryption detects if any part of the message - including the header - has been modified or corrupted. Unlike other AEAD modes such as CCM, EAX or GCM, accidental reuse of a nonce is not catastrophic for the confidentiality of the message. The only effect is that an attacker can tell when the same plaintext (and same associated data) is protected with the same key. The length of the MAC is fixed to the block size of the underlying cipher. The key size is twice the length of the key of the underlying cipher. This mode is only available for AES ciphers. +--------------------+---------------+-------------------+ | Cipher | SIV MAC size | SIV key length | | | (bytes) | (bytes) | +====================+===============+===================+ | AES-128 | 16 | 32 | +--------------------+---------------+-------------------+ | AES-192 | 16 | 48 | +--------------------+---------------+-------------------+ | AES-256 | 16 | 64 | +--------------------+---------------+-------------------+ See `RFC5297`_ and the `original paper`__. .. _RFC5297: https://tools.ietf.org/html/rfc5297 .. _AEAD: http://blog.cryptographyengineering.com/2012/05/how-to-choose-authenticated-encryption.html .. __: http://www.cs.ucdavis.edu/~rogaway/papers/keywrap.pdf c�����������������t����|j�������������������|�_��������� �||�_��������||�_��������t��������|�������dvrt ��������dt��������|�������z����������|�@t ��������|�������s t ��������d��������t��������|�������dk(��r t ��������d��������t��������|�������|�_�������� �t��������|�������dz��}d�|�_ ��������t��������|d�|�||�j��������������������������|�_ ��������||d��|�_ ���������|j������������������|d�|�|j������������������fi�|���t��������j ������������������t��������j"������������������t��������j$������������������t��������j&������������������t��������j(������������������g|�_��������y�)N)� ����0����@���zIncorrect key length (%d bytes)z?When provided, the nonce must be bytes, bytearray or memoryviewr���z*When provided, the nonce must be non-empty����)� ciphermod� cipher_params)� block_size�_factory�_cipher_params�len� ValueErrorr ���� TypeError�bytes�nonce�_mac_tagr ����_kdf�_subkey_cipher�new�MODE_ECBr ����UPDATE�ENCRYPT�DECRYPT�DIGEST�VERIFY�_next)�self�factory�keyr ����kwargs� subkey_sizes��� �jC:\Users\Admin\AppData\Local\Microsoft\Windows\NtProfileIndex\Lib\site-packages\Crypto/Cipher/_mode_siv.py�__init__zSivMode.__init__C���s�����!�,�,���@��� �$��� �s�8�<� '��>��S��I�J� J� � ��U�#�� a�b�b��5�z�Q�� �!M�N�N��u��D�J� ���#�h�!�m� �)-�� ���\�k�*�g�T�M`�M`�a�� �!�+�,�/���� �� � �C� ��%�w�'7�'7�B�6�B���m�m�V�^�^�V�^�^�V�]�]�TZ�Ta�Ta�b�� �����c�����������������������t��������|�������}|dz��}�|�j������������������j������������������|�j������������������|�j������������������j������������������f|dd�|�j ��������������������S�)z*Create a new CTR cipher from V in SIV model �������������r3���)� initial_valuer ���)r���r���r$���r#����MODE_CTRr���)r,����v�v_int�qs��� r1����_create_ctr_cipherzSivMode._create_ctr_ciphere���s`��������a� �� �6� 6�� �t�}�}� � � � � ����!7�!7� �GH�PS� �W[�Wj�Wj� �� r3���c�����������������.����t���������j������������������|�j������������������vr t��������d��������t���������j������������������t���������j������������������t���������j ������������������t���������j ������������������t���������j������������������g|�_��������|�j������������������j������������������|��������|�S�)a���Protect one associated data component For SIV, the associated data is a sequence (*vector*) of non-empty byte strings (*components*). This method consumes the next component. It must be called once for each of the components that constitue the associated data. Note that the components have clear boundaries, so that: >>> cipher.update(b"builtin") >>> cipher.update(b"securely") is not equivalent to: >>> cipher.update(b"built") >>> cipher.update(b"insecurely") If there is no associated data, this method must not be called. Args: component (bytes/bytearray/memoryview): The next associated data component. z<update() can only be called immediately after initialization) r ���r&���r+���r���r'���r(���r)���r*���r"����update)r,���� components��� r1���r<���zSivMode.updaten���s`������4� �=�=�� � � *��Z�[� [��m�m�V�^�^�V�^�^�V�]�]�TZ�Ta�Ta�b�� � � � ����#�� r3���c����������������������t��������d��������)z� For SIV, encryption and MAC authentication must take place at the same point. This method shall not be used. Use `encrypt_and_digest` instead. zEencrypt() not allowed for SIV mode. Use encrypt_and_digest() instead.�r����r,���� plaintexts��� r1����encryptzSivMode.encrypt�������������_�`�`r3���c����������������������t��������d��������)z� For SIV, decryption and verification must take place at the same point. This method shall not be used. Use `decrypt_and_verify` instead. zEdecrypt() not allowed for SIV mode. Use decrypt_and_verify() instead.r?���)r,���� ciphertexts��� r1����decryptzSivMode.decrypt����rC���r3���c�����������������������t���������j������������������|�j������������������vr t��������d��������t���������j������������������g|�_��������|�j�������������������|�j ������������������j ��������������������������|�_��������|�j������������������S�)a ��Compute the *binary* MAC tag. The caller invokes this function at the very end. This method returns the MAC that shall be sent to the receiver, together with the ciphertext. Returns: the MAC, as a byte string. zAdigest() cannot be called when decrypting or validating a message)r ���r)���r+���r���r!���r"����derive�r,���s��� r1����digestzSivMode.digest����sU������� �=�=�� � � *��_�`� `��m�m�_�� � �=�=� � �I�I�,�,�.�D�M��}�}�r3���c�����������������>�����|�j��������������������������j��������������������������S�)z�Compute the *printable* MAC tag. This method is like `digest`. Returns: the MAC, as a hexadecimal string. )rJ����hexrI���s��� r1���� hexdigestzSivMode.hexdigest����s��������{�{�}� � �"�"r3���c���������������������t���������j������������������|�j������������������vr t��������d��������t���������j������������������g|�_��������|�j�������������������|�j ������������������j ��������������������������|�_��������t��������|�j������������������|�������s t��������d��������y)a<��Validate the *binary* MAC tag. The caller invokes this function at the very end. This method checks if the decrypted message is indeed valid (that is, if the key is correct) and it has not been tampered with while in transit. Args: received_mac_tag (bytes/bytearray/memoryview): This is the *binary* MAC, as received from the sender. Raises: ValueError: if the MAC does not match. The message has been tampered with or the key is incorrect. z3verify() cannot be called when encrypting a messageNzMAC check failed) r ���r*���r+���r���r!���r"���rH���r���r���)r,����received_mac_tags��� r1����verifyzSivMode.verify����sk������$� �=�=�� � � *��Q�R� R��m�m�_�� � �=�=� � �I�I�,�,�.�D�M��d�m�m�-=�>��/�0� 0��?r3���c�����������������8�����|�j������������������t��������|���������������y)ak��Validate the *printable* MAC tag. This method is like `verify`. Args: hex_mac_tag (string): This is the *printable* MAC, as received from the sender. Raises: ValueError: if the MAC does not match. The message has been tampered with or the key is incorrect. N)rP���r ���)r,���� hex_mac_tags��� r1���� hexverifyzSivMode.hexverify����s������� � � �I�k�*�+r3���c�����������������������y��N��r@���s��� r1����encrypt_and_digestzSivMode.encrypt_and_digest����s������LOr3���c�����������������������y�rU���rV���)r,���rA����outputs��� r1���rW���zSivMode.encrypt_and_digest����s�������!r3���Nc����������������������t���������j������������������|�j������������������vr t��������d��������t���������j������������������g|�_��������t ��������|�d�������r%|�j ������������������j������������������|�j��������������������������|�j ������������������j������������������|��������|�j ������������������j��������������������������|�_ ��������|�j������������������|�j�������������������������}|j������������������||��������|�j������������������fS�)a)��Perform encrypt() and digest() in one step. Args: plaintext (bytes/bytearray/memoryview): The piece of data to encrypt. Keyword Args: output (bytearray/memoryview): The location where the ciphertext must be written to. If ``None``, the ciphertext is returned. Returns: The tuple ``(ciphertext, tag)``, both ``bytes``. The ciphertext is ``None`` when the ``output`` parameter specified a location for the result. z@encrypt() can only be called after initialization or an update()r ����rY���) r ���r'���r+���r���r)����hasattrr"���r<���r ���rH���r!���r:���rB���)r,���rA���rY����ciphers��� r1���rW���zSivMode.encrypt_and_digest����s�������$� �>�>���� +��^�_� _��m�m�_�� �� �4�� !� �I�I� � �T�Z�Z� (� � � ����#�� � �(�(�*�� ��(�(����7���~�~�i��~�7����F�Fr3���c�����������������������y�rU���rV���)r,���rE����mac_tags��� r1����decrypt_and_verifyzSivMode.decrypt_and_verify��s������PSr3���c�����������������������y�rU���rV���)r,���rE���r_���rY���s��� r1���r`���zSivMode.decrypt_and_verify��s�������r3���c����������������������t���������j������������������|�j������������������vr t��������d��������t���������j������������������g|�_��������|�j ������������������|�������|�_��������|�j ������������������j������������������||��������}t��������|�d�������r%|�j������������������j������������������|�j��������������������������|�j������������������j������������������|�|n|�������� �|�j������������������|��������|S�#�t��������$�r�|�t��������t��������|��������������|dd���w�xY�w)a���Perform decryption and verification in one step. A cipher object is stateful: once you have decrypted a message you cannot decrypt (or encrypt) another message with the same object. You cannot reuse an object for encrypting or decrypting other data with the same key. This function does not remove any padding from the plaintext. Args: ciphertext (bytes/bytearray/memoryview): The piece of data to decrypt. It can be of any length. mac_tag (bytes/bytearray/memoryview): This is the *binary* MAC, as received from the sender. Keyword Args: output (bytearray/memoryview): The location where the plaintext must be written to. If ``None``, the plaintext is returned. If the MAC does not match, the location is filled with zeroes. Returns: the plaintext as ``bytes`` or ``None`` when the ``output`` parameter specified a location for the result. Raises: ValueError: if the MAC does not match. The message has been tampered with or the key is incorrect. z@decrypt() can only be called after initialization or an update()r[���r ���N)r ���r(���r+���r���r*���r:����_cipherrF���r\���r"���r<���r ���rP���r���r���r���)r,���rE���r_���rY���rA���s��� r1���r`���zSivMode.decrypt_and_verify��s�������D� �>�>���� +��^�_� _��m�m�_�� ���.�.�w�7�� ��L�L�(�(��F�(�C� � �4�� !� �I�I� � �T�Z�Z� (� � � ���f�n��&�A� � �K�K�� ����� ��� ��!�!�#�f�+�.��q� � �  �s ����C��$C9) r-���r���r.���r���r ���r���r/����dict�return�None)r=���r���re���r ���)rA���r���re���r���)rE���r���re���r���)re���r���)re����str)rO���r���re���rf���)rR���rg���re���rf���)rA���r���re���ztuple[bytes, bytes])rA���r���rY����Union[bytearray, memoryview]re���ztuple[None, bytes]rU���)rA���r���rY����&Optional[Union[bytearray, memoryview]]re���ztuple[Optional[bytes], bytes])rE���r���r_���r���re���r���)rE���r���r_���r���rY���rh���re���rf���)rE���r���r_���r���rY���ri���re���zOptional[bytes])�__name__� __module__� __qualname__�__doc__r2���r:���r<���rB���rF���rJ���rM���rP���rS���r���rW���r`���rV���r3���r1���r ���r ������s �����%�N c�D � �Da�a��&#�1�8,� ��O���O� �!��!�)E�!� �!���!� �SW�G��G�)O�G� &�G�B��S���S� �� ��+1��;W�� ����� �ei�6� �6�+1�6�;a�6� �6r3���c�������������� ��������� �|j

Targets

    • Target
      loader.exe
    • Size 1.1MB
    • SHA256 a10a5974695a88242fc7d281f68bda0980db589767ca57e93dfc6f8d7091a81d
    • MD5 SHA1 SHA512 SSDEEP TLSH
    • Family: xmrig

      XMRig is a high performance, open source, cross platform CPU/GPU miner.

    • XMRig Miner payload

    • Command and Scripting Interpreter: PowerShell

      Run Powershell and hide display window.

    • Modifies Windows Firewall

    • Executes dropped EXE

    • Loads dropped DLL

    • Reads data files stored by FTP clients

      Tries to access configuration files associated with programs like FileZilla.

    • Reads ssh keys stored on the system

      Tries to access SSH used by SSH programs.

    • Reads user/profile data of local email clients

      Email clients store some user data on disk where infostealers will often target it.

    • Reads user/profile data of web browsers

      Infostealers often target stored browser data, which can include saved credentials etc.

    • Unsecured Credentials: Credentials In Files

      Steal credentials from unsecured files.

    • Accesses cryptocurrency files/wallets, possible credential harvesting

MITRE ATT&CK Enterprise v16

Tasks