Chkconfig Service Add

Detects the use of the chkconfig binary to manually add a service for management by chkconfig. Threat actors may utilize this technique to maintain persistence on a system. When a new service is added, chkconfig ensures that the service has either a start or a kill entry in every runlevel and when the system is rebooted the service file added will run providing long-term persistence.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2022/07/22"
 3maturity = "production"
 4min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 5min_stack_version = "8.3.0"
 6updated_date = "2023/08/24"
 7integration = ["endpoint"]
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Detects the use of the chkconfig binary to manually add a service for management by chkconfig. Threat actors may utilize
13this technique to maintain persistence on a system. When a new service is added, chkconfig ensures that the service has
14either a start or a kill entry in every runlevel and when the system is rebooted the service file added will run 
15providing long-term persistence.
16"""
17from = "now-9m"
18index = ["logs-endpoint.events.*", "endgame-*"]
19language = "eql"
20license = "Elastic License v2"
21name = "Chkconfig Service Add"
22references = [
23    "https://www.intezer.com/blog/research/lightning-framework-new-linux-threat/"
24]
25risk_score = 47
26rule_id = "b910f25a-2d44-47f2-a873-aabdc0d355e6"
27severity = "medium"
28tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Persistence", "Threat: Lightning Framework", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
29timestamp_override = "event.ingested"
30type = "eql"
31
32query = '''
33process where host.os.type == "linux" and event.action in ("exec", "exec_event") and
34( 
35  (process.executable : "/usr/sbin/chkconfig" and process.args : "--add") or
36  (process.args : "*chkconfig" and process.args : "--add")
37)
38'''
39
40[[rule.threat]]
41framework = "MITRE ATT&CK"
42
43[[rule.threat.technique]]
44id = "T1037"
45name = "Boot or Logon Initialization Scripts"
46reference = "https://attack.mitre.org/techniques/T1037/"
47
48[[rule.threat.technique.subtechnique]]
49id = "T1037.004"
50name = "RC Scripts"
51reference = "https://attack.mitre.org/techniques/T1037/004/"
52
53[rule.threat.tactic]
54id = "TA0003"
55name = "Persistence"
56reference = "https://attack.mitre.org/tactics/TA0003/"

References

Related rules

to-top