-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathyara.yar
79 lines (69 loc) · 2.7 KB
/
yara.yar
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
rule webshell_jsp_converge : Webshell
{
meta:
author = "[email protected]"
description = "File upload webshell observed in incident involving compromise of Confluence server."
date = "2022-06-01"
memory_suitable = 1
license = "See license at https://github.com/volexity/threat-intel/blob/main/LICENSE.txt"
strings:
$s1 = "if (request.getParameter(\"name\")!=null && request.getParameter(\"name\").length()!=0){" ascii
condition:
$s1
}
rule general_jsp_possible_tiny_fileuploader : General Webshells
{
meta:
author = "[email protected]"
description = "Detects small .jsp files which have possible file upload utility."
date = "2022-06-01"
hash1 = "4addb9bc9e5e1af8fda63589f6b3fc038ccfd651230fa3fa61814ad080e95a12"
memory_suitable = 0
license = "See license at https://github.com/volexity/threat-intel/blob/main/LICENSE.txt"
strings:
// read a req parameter of some sort
$required1 = "request." ascii
// write a file
$required2 = "java.io.FileOutputStream" ascii
$required3 = ".write" ascii
// do some form of decoding.
$encoding1 = "java.util.Base64" ascii
$encoding2 = "crypto.Cipher" ascii
$encoding3 = ".misc.BASE64Decoder" ascii
condition:
(
filesize < 4KB and
all of ($required*) and
any of ($encoding*)
)
or
(
filesize < 600 and
all of ($required*)
)
}
rule webshell_java_realcmd : Commodity Webshells
{
meta:
author = "[email protected]"
description = "Detects the RealCMD webshell, one of the payloads for BEHINDER."
date = "2022-06-01"
hash1 = "a9a30455d6f3a0a8cd0274ae954aa41674b6fd52877fafc84a9cb833fd8858f6"
reference = "https://github.com/Freakboy/Behinder/blob/master/src/main/java/vip/youwe/sheller/payload/java/RealCMD.java"
memory_suitable = 1
license = "See license at https://github.com/volexity/threat-intel/blob/main/LICENSE.txt"
strings:
$fn1 = "runCmd" wide ascii fullword
$fn2 = "RealCMD" ascii wide fullword
$fn3 = "buildJson" ascii wide fullword
$fn4 = "Encrypt" ascii wide fullword
$s1 = "AES/ECB/PKCS5Padding" ascii wide
$s2 = "python -c 'import pty; pty.spawn" ascii wide
$s3 = "status" ascii wide
$s4 = "success" ascii wide
$s5 = "sun.jnu.encoding" ascii wide
$s6 = "java.util.Base64" ascii wide
condition:
all of ($fn*) or
all of ($s*)
}