-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathrat_karagany.py
83 lines (71 loc) · 2.7 KB
/
rat_karagany.py
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
80
81
82
83
# Copyright (C) 2019 ditekshen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from lib.cuckoo.common.abstracts import Signature
class KaraganyEventObjects(Signature):
name = "karagany_system_event_objects"
description = "Creates system event objects associated with Karagany/xFrost RAT"
severity = 3
categories = ["rat"]
families = ["Karagany", "xFrost"]
authors = ["ditekshen"]
minimum = "0.5"
evented = True
ttps = ["T1219"] # MITRE v6,7,8
mbcs = ["B0022"]
filter_apinames = set(["NtCreateEvent", "NtCreateEventEx"])
def __init__(self, *args, **kwargs):
Signature.__init__(self, *args, **kwargs)
self.match = False
self.event_objects = [
"__klg__",
"__pickill__",
"__klgkillsoft__",
]
def on_call(self, call, process):
event = self.get_argument(call, "EventName")
if event:
for obj in self.event_objects:
if obj in event:
self.match = True
self.data.append({"system_event_object": event})
if self.pid:
self.mark_call()
def on_complete(self):
return self.match
class KaraganyFiles(Signature):
name = "karagany_files"
description = "Creates files/directories associated with Karagany/xFrost RAT"
severity = 3
categories = ["rat"]
families = ["Karagany", "xFrost"]
authors = ["ditekshen"]
minimum = "0.5"
ttps = ["T1219"] # MITRE v6,7,8
mbcs = ["B0022"]
mbcs += ["OC0001", "C0016"] # micro-behaviour
def on_complete(self):
indicators = (
r".*\\up_stat.txt$",
r".*\\stat_ag.txt$",
r".*\\serv_stat.txt$",
r".*\\svchost\d+\.txt$",
r".*\\Update\\Tmp\\.*",
)
for indicator in indicators:
match = self.check_write_file(patten=indicator, regex=True, all=True)
if match:
self.data.append({"path": match})
return True
return False