name: Linux Iptables Firewall Modification id: 309d59dc-1e1b-49b2-9800-7cf18d12f7b7 version: 3 date: '2022-06-03' author: Teoderick Contreras, Splunk status: production type: Anomaly description: This analytic looks for suspicious commandline that modify the iptables firewall setting of a linux machine. This technique was seen in cyclopsblink malware where it modifies the firewall setting of the compromised machine to allow traffic to its tcp port that will be used to communicate with its C2 server. data_source: - Sysmon Event ID 1 search: selection1: CommandLine: '* --dport *' selection2: CommandLine: '*iptables *' selection3: CommandLine: '* ACCEPT*' selection4: CommandLine: '*&>/dev/null*' selection5: CommandLine: '* tcp *' condition: selection1 and selection2 and selection3 and selection4 and selection5 how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name, parent process, and command-line executions from your endpoints. If you are using Sysmon, you can use the Add-on for Linux Sysmon from Splunkbase. known_false_positives: administrator may do this commandline for auditing and testing purposes. In this scenario filter is needed. references: - https://www.ncsc.gov.uk/files/Cyclops-Blink-Malware-Analysis-Report.pdf - https://www.trendmicro.com/en_us/research/22/c/cyclops-blink-sets-sights-on-asus-routers--.html tags: analytic_story: - CyclopsBLink asset_type: Endpoint confidence: 50 impact: 50 message: A commandline $process$ that may modify iptables firewall on $dest$ mitre_attack_id: - T1562.004 - T1562 observable: - name: dest type: Hostname role: - Victim product: - Splunk Enterprise - Splunk Enterprise Security - Splunk Cloud risk_score: 25 security_domain: endpoint tests: - name: True Positive Test attack_data: - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/cyclopsblink/sysmon_linux.log source: Syslog:Linux-Sysmon/Operational sourcetype: sysmon_linux