Skip to main content

Hi All,

I want you guys to review the below rule:

Rule Name: Possible Outbreak Excessive connections

rule possible_outbreak_excessive_connections
{
meta:
subject = "possible outbreak excessive connections"
description = "Identifies a local host performing port sweep or scan against external network. Possibly this could be local host infection and it is acting as bot to scan external network as per instructions from command-and-control server."
tactic = "Command and Control"
technique = "Application Layer Protocol"
tool = ""
datasource = "Network Traffic"
category = ""
product = ""
logsource = "EDR, Netflow, NGFW, Windows Events, Firewall"
actor = ""
malware = ""
vulnerability = ""
custom = "SIEM use cases"
confidence = "Medium"
severity = "Medium"
falsePositives = "None"
externalSubject = "0"
externalMITRE = "0"

events:
$e.metadata.event_type = "NETWORK_CONNECTION" //All netwrok traffic events from all type of devices will be normalized to the event type: NETWORK_CONNECTION
$e.metadata.product_name != "AWS VPC Flow" //Its temporary exclusion as it is causing a lot of falsePositives
//Capturing variables for event correlation
$e.principal.ip = $principal_ip
$e.target.ip = $target_ip
$e.target.port = $target_port
//Exclusions
$e.target.port !=443 and $e.target.port !=80 //Excluding standard web access ports as it triggers signal on regular web browsing

match:
$principal_ip over 1h
condition:
(#target_port >= 10 and #target_ip=1) or (#target_ip>=10 and #target_port=1)
}

Note: We are getting events for this rule correctly but for the loopback IP address. Pasting the screenshot of the events generated.

Thanks,
Neha.H

Could you remove principal ip and look for a hostname field? 


 


Consider adding a line in the rule like principal.ip != “127.0.0.1”


because ip is a repeated field another thing to test would be the use of any and all prepended to that field. 


any and all look thru the repeated values and return a true false if all the ip do not match the criteria or any do match.


syntax for that would look like all principal.ip != “127.0.0.1”


you will need to use the test rule as you tune this rule to ensure you get the output you expect.


Could you remove principal ip and look for a hostname field? 


 


Hi @dnehoda ,

Thank you will try doing that and update you whether its working fine or not.

Thanks,

Neha.H


Consider adding a line in the rule like principal.ip != “127.0.0.1”


because ip is a repeated field another thing to test would be the use of any and all prepended to that field. 


any and all look thru the repeated values and return a true false if all the ip do not match the criteria or any do match.


syntax for that would look like all principal.ip != “127.0.0.1”


you will need to use the test rule as you tune this rule to ensure you get the output you expect.


Hi @jstoner,

Sure, got it will try this as well by adding that syntax.

Can i ask one more thing- Will that be ok if the above parameter mentioned by @dnehoda for adding hostname field in the same rule will work?

Thanks,

Neha.H


Hi @jstoner,

Sure, got it will try this as well by adding that syntax.

Can i ask one more thing- Will that be ok if the above parameter mentioned by @dnehoda for adding hostname field in the same rule will work?

Thanks,

Neha.H


Hi @jstoner ,

I tried but its not working. Can you please make changes and reshare the rule , let me try pasting the same in my environment.

Thanks,

Neha.H


Hi @jstoner ,

I tried but its not working. Can you please make changes and reshare the rule , let me try pasting the same in my environment.

Thanks,

Neha.H


You can use whatever fields are available in your events.  You may want to use something different to  create alerts.  You don’t have to just look at an IP you can look at hostnames too.  If you want it work as John suggested you would need to follow his recommendation.  


I just tested your rule in my instance and the following line in my instance removed the detection from the loopback. Perhaps the autoformat on quotes caused some issue.



$e.principal.ip != "127.0.0.1"


Reply