I am trying to create a rule in my OS Ubuntu 22.04 and Suricata 7.0.6.
Here is my rule /var/lib/suricata/rules/CommandInjection.rules
alert http any any -> any any (msg:"Possible Command Injection Detected";flow:established, to_server;content:"chmod 777"; http_uri;classtype:trojan-activity;sid:1000002;rev:1;)
and here is /etc/suricata/suricata.yaml
default-rule-path: /var/lib/suricata/rules
rule-files:
#- suricata.rules
- CommandInjection.rules
I am running this command
suricata -r /etc/suricata/tdp/TDP_exploit_CVETEST.pcap -c /etc/suricata/suricata.yaml -s /var/lib/suricata/rules/CommandInjection.rules
I got the following errors
i: suricata: This is Suricata version 7.0.6 RELEASE running in USER mode
E: detect-parse: Duplicate signature "alert http any any -> any any (msg:"Possible Command Injection Detected";flow:established, to_server;content:"chmod 777"; http_uri;classtype:trojan-activity;sid:1000002;rev:1;)"
E: detect: error parsing signature "alert http any any -> any any (msg:"Possible Command Injection Detected";flow:established, to_server;content:"chmod 777"; http_uri;classtype:trojan-activity;sid:1000002;rev:1;)" from file /var/lib/suricata/rules/CommandInjection.rules at line 1
i: threads: Threads created -> RX: 1 W: 4 FM: 1 FR: 1 Engine started.
i: suricata: Signal Received. Stopping engine.
i: pcap: read 1 file, 12 packets, 5056 bytes
I looked here which seems to be same issue that am having and tried to corrected following the suggestions but still getting the same error.
My questions are as follow:
- How to get remove duplicate signature error?
- How to fix the parsing signature error?