-
Notifications
You must be signed in to change notification settings - Fork 167
/
Copy pathencrypt-data-using-rc4-ksa.yml
58 lines (58 loc) · 1.86 KB
/
encrypt-data-using-rc4-ksa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
rule:
meta:
name: encrypt data using RC4 KSA
namespace: data-manipulation/encryption/rc4
authors:
- moritz.raabe@mandiant.com
scopes:
static: function
dynamic: unsupported # requires characteristic, mnemonic, Not features
att&ck:
- Defense Evasion::Obfuscated Files or Information [T1027]
mbc:
- Cryptography::Encrypt Data::RC4 [C0027.009]
- Cryptography::Encryption Key::RC4 KSA [C0028.002]
examples:
- 34404A3FB9804977C6AB86CB991FB130:0x403D40
- 9324D1A8AE37A36AE560C37448C9705A:0x404950
- 2B8BEC5BCB1777EAA155D832F7AFC797:0x405C42
- 73CE04892E5F39EC82B00C02FC04C70F:0x40646E
features:
- or:
- and:
- basic block:
- and:
- description: initialize S
# misses if regular loop is used,
# however we cannot model that a loop contains a certain number
- characteristic: tight loop
- or:
- number: 0xFF
- number: 0x100
- or:
- description: modulo 256
- match: calculate modulo 256 via x86 assembly
- basic block:
- and:
- description: modulo via zero-extended mov from 8-bit register
- count(mnemonic(movzx)): 2 or more
# avoid false positives; filter out unexpected instructions
- not:
- or:
- mnemonic: shl
- mnemonic: rol
- characteristic: nzxor
- or:
- description: modulo key length
- mnemonic: div
- mnemonic: idiv
- and:
- description: write DWORDs instead of bytes
- or:
- number: 0x03020100
- number: 0xFFFEFDFC
- instruction:
- or:
- mnemonic: add
- mnemonic: sub
- number: 0x04040404