This website uses cookies. By clicking OK, you consent to the use of cookies. Click Here to learn more about how we use cookies.
OK
  • RSA.com
  • Products
    • Archer®
      • Archer®
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Ideas
      • Knowledge Base
      • Archer® Exchange
      • Training
      • Upcoming Events
      • Videos
    • RSA® Fraud & Risk Intelligence Suite
      • RSA® Fraud & Risk Intelligence Suite
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® FraudAction Services
      • RSA® Web Threat Detection
      • Upcoming Events
      • Videos
    • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication Cloud
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Events
      • Ideas
      • Knowledge Base
      • Training
      • Upcoming Patch Content
      • Videos
    • RSA® Adaptive Authentication Mobile SDK
      • RSA® Adaptive Authentication Mobile SDK
      • Advisories
      • Events
      • Ideas
      • Knowledge Base
      • Request Access
      • Training
    • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Events
      • Ideas
      • Knowledge Base
      • Training
      • Videos
    • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Events
      • Ideas
      • Knowledge Base
      • Training
      • Videos
    • RSA® Adaptive Authentication for eCommerce
      • RSA® Adaptive Authentication for eCommerce
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Ideas
      • Knowledge Base
      • Training
      • Videos
    • RSA® FraudAction Services
      • RSA® FraudAction Services
      • Advisories
      • Discussions
      • Documentation
      • Ideas
      • Videos
    • RSA® Web Threat Detection
      • RSA® Web Threat Detection
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Ideas
      • Knowledge Base
      • Videos
    • RSA NetWitness® Platform
      • RSA NetWitness® Platform
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Ideas
      • Integrations
      • Knowledge Base
      • Training
      • Upcoming Events
      • Videos
    • RSA NetWitness® Detect AI
      • RSA NetWitness® Detect AI
      • Documentation
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
    • RSA NetWitness® Investigator
      • RSA NetWitness® Investigator
      • Documentation
      • Download the Client
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
    • RSA NetWitness® Orchestrator
      • RSA NetWitness® Orchestrator
      • Overview
      • Documentation
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
    • RSA SecurID® Suite
      • RSA SecurID® Suite
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Knowledge Base
      • Ideas
      • Integrations
      • Training
      • Videos
    • RSA® Identity Governance & Lifecycle
      • RSA® Identity Governance & Lifecycle
      • Advisories
      • Blog
      • Community Exchange
      • Discussions
      • Documentation
      • Downloads
      • Ideas
      • Knowledge Base
      • Training
      • Upcoming Events
      • Videos
    • RSA SecurID® Access
      • RSA SecurID® Access
      • Advisories
      • Blog
      • Discussions
      • Documentation
      • Downloads
      • Ideas
      • Integrations
      • Knowledge Base
      • Training
      • Upcoming Events
      • Videos
    • Other RSA® Products
      • Other RSA® Products
      • RSA® Access Manager
      • RSA® Data Loss Prevention
      • RSA® Digital Certificate Solutions
      • RSA enVision®
      • RSA® Federated Identity Manager
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
      •  
  • Resources
    • Advisories
      • Product Advisories on RSA Link
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication Hosted
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® FraudAction Services
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Product Advisories
    • Blogs
      • Blogs on RSA Link
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Blogs on RSA Link
    • Discussion Forums
      • Discussion Forums
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® FraudAction Services
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Discussion Forums on RSA Link
    • Documentation
      • Product Documentation
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication Mobile SDK
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® FraudAction Services
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Documentation on RSA Link
    • Downloads
      • Product Downloads
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Downloads on RSA Link
    • Ideas
      • Idea Exchange
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication Mobile SDK
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® FraudAction Services
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Documentation on RSA Link
    • Knowledge Base
      • Knowledge Base
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication Mobile SDK
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Knowledge Base Pages on RSA Link
    • Upcoming Events on RSA Link
      • Upcoming Events
    • Videos
      • Videos on RSA Link
      • Archer®
      • RSA® Adaptive Authentication Cloud
      • RSA® Adaptive Authentication On-Premise
      • RSA® Adaptive Authentication On-Premise (Cassandra)
      • RSA® Adaptive Authentication for eCommerce
      • RSA® Identity Governance & Lifecycle
      • RSA NetWitness® Platform
      • RSA SecurID® Access
      • RSA® Web Threat Detection
      • All Videos on RSA Link
  • Support
    • RSA Link Support
      • RSA Link Support
      • News & Announcements
      • Getting Started
      • Support Forum
      • Support Knowledge Base
      • Ideas & Suggestions
    • RSA Product Support
      • RSA Product Support
      • General Security Advisories and Statements
      • Product Life Cycle
      • Support Information
      •  
      •  
      •  
      •  
      •  
  • RSA Ready
  • RSA University
    • Certification Program
      • Certification Program
    • Course Catalogs
      • Course Catalogs
      • Archer®
      • RSA NetWitness® Platform
      • RSA SecurID® Suite
    • On-Demand Subscriptions
      • On-Demand Subscriptions
      • Archer®
      • RSA NetWitness® Platform
      • RSA SecurID® Suite
    • Product Training
      • Product Training
      • Archer®
      • RSA® Fraud & Risk Intelligence Suite
      • RSA® Identity Governance & Lifecycle
      • RSA NeWitness® Platform
      • RSA SecurID® Access
    • Student Resources
      • Student Resources
      • Access On-Demand Learning
      • Access Virtual Labs
      • Contact RSA University
      • Enrollments & Transcripts
      • Frequently Asked Questions
      • Getting Started
      • Learning Modalities
      • Payments & Cancellations
      • Private Training
      • Training Center Locations
      • Training Credits
      • YouTube Channel
    • Upcoming Events
      • Upcoming Events
      • Full Calendar
      • Conferences
      • Live Classroom Training
      • Live Virtual Classroom Training
      • Webinars
Sign In Register Now
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Search instead for 
Did you mean: 
Announcements

Visit the Known Issues dashboard if you are experiencing issues on RSA Link

View Dashboard

RSA NetWitness® Platform Discussions

Discussions about the RSA NetWitness Platform.
  • RSA Link
  • :
  • Products
  • :
  • RSA NetWitness Platform
  • :
  • Discussions
  • :
  • ESA Rule to Detect DNS Exfiltration
  • Options
    • Subscribe to RSS Feed
    • Mark Topic as New
    • Mark Topic as Read
    • Float this Topic for Current User
    • Bookmark
    • Subscribe
    • Mute
    • Printer Friendly Page
DavidWaugh1
Employee DavidWaugh1
Employee
‎2016-02-08 09:50 AM
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

ESA Rule to Detect DNS Exfiltration

The following is a sample ESA Rule to detect when a large amount of data is going to a destination. Its meant as an example and there are probably other better ways of doing this.

 

The two rules below:

  1. Keeps a track of the number of transmitted bytes from a client going to a destination and adds them up
  2. Only counts up the bytes if the client has made a DNS request in the last two minutes, or if a packet has been sent to the destination in the last two minutes. If a client has not made a request in the last two minutes then we reset the total for this client. This reduces the memory usage of the rule on ESA.
  3. Puts detected ip_src into a watchlist and then alerts on future DNS traffic from this client once the threshold have been met.
  4. Puts detected ip_dst into a watchlist and then alerts on future DNS traffic going to this destination once the threshold has been met.
  5. Only look at the size of the DNS packets and don't make assumptions on which part of the DNS Packet is used to exfiltrate the information.

 

Here are the two rules to paste into the Query Section of an advanced rule. To detect slower exfiltatrion increase the time between DNS packets from a source from 120 seconds upwards. Please note though, that the higher the value the more memory will be used and potentially more false positives could be created.

 

Further improvements could be:

  1. Only looking at DNS traffic that matches risk.suspicious meta
  2. Incorporating whitelists of known trusted DNS Servers

 

Rule to Detect over 5MB of traffic going to an IP Address over DNS with at most 120 Seconds between packets

 

module Module_6f32d5a7_da8e_45a4_b918_e57d9d718ead;

 

create window DNSsum3.win:time(86400 seconds) as select ip_dst, txbytes,esa_time from Event; //86400 seconds

// Create a Sliding window of 24 hours

 

// When an Event Arrives Update our DNSSum3 Windows with the current values

on Event(service =53 AND ip_dst is not NULL AND txbytes is not NULL  ) as myevent

merge DNSsum3 dns

where dns.ip_dst=myevent.ip_dst

when matched

   then update set txbytes = txbytes +myevent.txbytes, esa_time=myevent.esa_time

when not matched

   then insert select ip_dst,txbytes,esa_time;

 

//If the Last Time we had an event for a particular IP Dest was longer than  a certain period of time ago then we delete that record from the table. In this case the period of time is 120000 milliseconds =120 seconds

 

on Event(service =53 AND ip_dst is not NULL AND txbytes is not NULL  ) as myevent

delete from DNSsum3 dns

where dns.esa_time +120000 < myevent.esa_time ;

 

create window DNSWatchlist3.win:time(60 seconds) as select ip_dst from DNSsum3;

insert into DNSWatchlist3(ip_dst) select ip_dst from DNSsum3 group by ip_dst having sum(txbytes)>5000000;

     

        @Name('Module_6f32d5a7_da8e_45a4_b918_e57d9d718ead_Alert')

        @Description('')

        @RSAAlert(oneInSeconds=0)

        @RSAPersist

 

select * from  Event(service =53 AND ip_dst is not NULL AND txbytes is not NULL AND ip_dst IN (select ip_dst FROM DNSWatchlist3)).std:groupwin(ip_dst).win:time(60 seconds).std:firstunique(ip_dst) retain-intersection ;    

                 

;

 

Rule to Detect over 5MB of traffic going from an IP Address over DNS with at most 120 Seconds between packets

 

module Module_6f32d5a7_da8e_45a4_b918_e57d9d718eac;

 

 

create window DNSsum2.win:time(86400 seconds) as select ip_src, txbytes,esa_time from Event; //86400 seconds

// Create a Sliding window of 24 hours

 

 

// When an Event Arrives Update our DNSSum2 Windows with the current values

on Event(service =53 AND ip_src is not NULL AND txbytes is not NULL  ) as myevent

merge DNSsum2 dns

where dns.ip_src=myevent.ip_src

when matched

   then update set txbytes = txbytes +myevent.txbytes, esa_time=myevent.esa_time

when not matched

   then insert select ip_src,txbytes,esa_time;

 

 

//If the Last Time we had an event for a particular IP Source was longer than  a certain period of time ago then we delete that record from the table. In this case the period of time is 120000 milliseconds = 60 seconds

 

 

on Event(service =53 AND ip_src is not NULL AND txbytes is not NULL  ) as myevent

delete from DNSsum2 dns

where dns.esa_time +120000 < myevent.esa_time ;

 

create window DNSWatchlist2.win:time(60 seconds) as select ip_src from DNSsum2;

insert into DNSWatchlist2(ip_src) select ip_src from DNSsum2 group by ip_src having sum(txbytes)>5000000;

     

        @Name('Module_6f32d5a7_da8e_45a4_b918_e57d9d718eac_Alert')

        @Description('')

        @RSAAlert(oneInSeconds=0)

        @RSAPersist

 

 

select * from  Event(service =53 AND ip_src is not NULL AND txbytes is not NULL AND ip_src IN (select ip_src FROM DNSWatchlist2)).std:groupwin(ip_src).win:time(60 seconds).std:firstunique(ip_src) retain-intersection ;    

                 

  • Tags:
  • Community Thread
  • Discussion
  • ESA Rule
  • Esper
  • Forum Thread
  • NetWitness
  • NW
  • NWP
  • RSA NetWitness
  • RSA NetWitness Platform
3 Likes
Share
Reply
  • All forum topics
  • Previous Topic
  • Next Topic
1 Reply
DavidWaugh1
Employee DavidWaugh1
Employee
‎2016-02-12 07:27 AM
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

If you want to whitelist some traffic then change the line the following

 

on Event(service =53 AND ip_dst is not NULL AND txbytes is not NULL  ) as myevent

 

to

on Event(service =53 AND ip_dst is not NULL AND txbytes is not NULL and safe_traffic is NULL ) as myevent

 

This means that if the metakey safe_traffic is populated then the traffic will be ignore.

 

See the KB Article on how you can set up App Rules to tag some meta as safe.

https://rsaportal.force.com/customer/articles/How_To/How-to-refine-the-Investigation-view-to-exclude...

 

2 Likes
Share
Reply
Powered by Khoros
  • Products
  • Resources
  • Solutions
  • RSA University
  • Support
  • RSA Labs
  • RSA Ready
  • About RSA Link
  • Terms & Conditions
  • Privacy Statement
  • Provide Feedback
© 2020 RSA Security LLC or its affiliates.
All rights reserved.