wannacry DLL ops
a guest May 13th, 2017 7,814 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- *** DLL operations ***
- 1] Checks to see if task already running by attempting to open mutex with name MsWinZonesCacheCounterMutexA
- If already exists, app exits
- 2] Obtains name of current directory.
- 3] Reads 780 bytes of information from c.wnry which it expects in current directory. This has
- bitcoin and TOR info.
- 4] Checks if running as LocalSystem. Sets a flag used later when running @wanadecryptor@.exe
- 5] Resolves api from advapi32.dll
- 6] Resolves api from kernel32.dll
- 7] Initializes names of files
- 00000000.res - C2 communications
- 00000000.pky - Public key used by the ransomware to encrypt the generated AES keys that are used to encrypt the user’s files
- 00000000.eky - Encryption key for the t.wnry file which stores the actual file encryption component used by the ransomware.
- It is encrypted using the public key that belongs to a private key embedded inside the ransomware.
- 8] creates mutex with name MsWinZonesCacheCounterMutexA and sets the security
- ACL to allow EVERYONE full access
- 9] tries to open 00000000.dky. if available, will import key into Crypto API object.
- presumably this would be decryption key from the authors of ransomware..
- 10] if cannot open *.dky file, will generate new RSA key pair of 2048-bits.
- Public key is exported as blob and saved to 00000000.pky
- Private key is exported as blob and encrypted with ransomware public key before being saved to 00000000.eky
- The RSA public key used to encrypt the users RSA key pair is embedded inside the DLL.
- unsigned char wc_key1 =
- 0x06, 0x02, 0x00, 0x00, 0x00, 0xA4, 0x00, 0x00, 0x52, 0x53,
- 0x41, 0x31, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
- 0x75, 0x97, 0x4C, 0x3B, 0x84, 0x46, 0xDE, 0x2C, 0x2A, 0xF4,
- 0x95, 0xA8, 0x5D, 0xC0, 0xCD, 0x6D, 0xDA, 0xD7, 0xD4, 0x92,
- 0x1E, 0x13, 0x82, 0x34, 0x6A, 0x70, 0x8D, 0x8F, 0x7C, 0xF7,
- 0x04, 0x92, 0x55, 0x7F, 0xF1, 0xA2, 0x27, 0xB2, 0x9E, 0x41,
- 0xAC, 0x90, 0x80, 0x91, 0x18, 0x93, 0xC2, 0xB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D9, 0x3B, 0xFB, 0xE5, 0x9D, 0x30, 0x11,
- 0x69, 0x92, 0xCD, 0x60, 0x2B, 0xE2, 0xD5, 0x46, 0x3C, 0x28,
- 0xCF, 0x9D, 0x30, 0x4A, 0xF7, 0xAD, 0xB9, 0xFB, 0x0F, 0x91,
- 0xFE, 0x2E, 0xBE, 0x18, 0xF1, 0xCE
- The AES-128 key generated for each file is derived from CryptGenRandom which
- is cryptographically secure and is not known to have any weakness.
- The AES keys are encrypted using the users public key in *.pky.
- In order to decrypt, we need the users private key which is
- encrypted using a public key owned by the ransomware authors.
- Presumably what authors do is decrypt the users private key in *.eky file
- using their private key and then send the user a *.dky file
- to decrypt files.
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Get 40% OFF on Pastebin PRO accounts!