I am trying to create custom rules in my VB OS Ubuntu 22.04 and Suricata 6.0.9.
here is my cat /etc/suricata/rules/testAttempt.rules
#alert dns $HOME_NET any -> $EXTERNAL_NET 53 (msg: "PayPal phishing is possibly detected ..."; dns_query; content:"paypal.com"; nocase; isdataat:1,relative; sid:1000001; rev:1;)
#alert dns $HOME_NET any -> $EXTERNAL_NET 53 (msg: "PayPal phishing is possibly detected ..."; dns_query; content:"paypal.com"; nocase; isdataat:1,relative; sid:1000002; rev:1;)
#alert dns any any -> any any (msg:"DNS LOOKUP for put my dnsName.com"; dns.query; content:"www.bing.com"; nocase; sid:1000003;)
alert dns any any -> any any (msg:"DNS Lookup for www.bing.com with update"; dns.query; content:"www.bing.com"; nocase; sid:1000004; rev:2;)
and here is cat /etc/suricata/suricata.yaml
#default-rule-path: /var/lib/suricata/rules
default-rule-path: /var/lib/suricata/rules
rule-files:
- suricata.rules
- /etc/suricata/rules/testAttempt.rules
I am running this command I got the following errors: suricata -r ~/Downloads/path/to.pcap -s /etc/suricata/rules/testAttempt.rules -k none
<Error> - [ERRCODE: SC_ERR_DUPLICATE_SIG(176)] - Duplicate signature "alert dns any any -> any any (msg:"DNS Lookup for www.bing.com with update"; dns.query; content:"www.bing.com"; nocase; sid:1000004; rev:2;)"
10/2/2023 -- 04:55:40 - <Error> - [ERRCODE: SC_ERR_INVALID_SIGNATURE(39)] - error parsing signature "alert dns any any -> any any (msg:"DNS Lookup for www.bing.com with update"; dns.query; content:"www.bing.com"; nocase; sid:1000004; rev:2;)" from file /etc/suricata/rules/testAttempt.rules at line 11
I am using pcap from here workshop-part-05-04.pcap
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:
1 - how to get remove duplicate signature error?
I tried to comment out / change the uid and the rev but still getting this error
2 - How to fix the parsing signature error?