SlideShare a Scribd company logo
1 of 36
© Fidelis Cybersecurity
BSidesDC 2016
Yet Another YARA Allocution (YAYA)
John Laycock, Threat Systems
Fidelis Cybersecurity
Monty St John
ATX Forensics
© Fidelis Cybersecurity
Introduction
2
John Laycock:
• B.S. Mechanical Engineering from Northern Illinois
University
• Cognitech/Ocean Systems Forensic Video Analyst
• Government Contractor
DC3 – DCFL Forensic Examiner/DCISE/NCIJTF
• General Dynamics/Fidelis Commercial Forensics Team
• Fidelis Threat Research Team
John Laycock
Systems, Threat Research
Email: john.laycock@fidelissecurity.com
© Fidelis Cybersecurity
Introduction
3
Monty St John
Email: monty@atxforensics.com
site: www.atxforensics.com
Monty St John:
• 25 years of security, digital forensics, reverse engineering,
threat intelligence
• Two decades supporting federal, state, and local LE while
in uniform
Forensics and Threat Intelligence
• Last decade acting as a key member of forensic and TI
teams deconstructing, analyzing and providing insights
into threats and how to thwart them
© Fidelis Cybersecurity
Disclaimer
4
This is an introductory level talk to folks that do not necessarily build Yara rules
on a daily basis. Many of the concepts we will be showing you are from a high
level view. You can refer to some of the references in the appendix to drill
down into these concepts in more detail.
TL:DR This is an intro to a deep topic. We’re showing some basic concepts and
sharing some resources that you can hopefully use to build upon.
© Fidelis Cybersecurity
What is YARA?
5
YARA is a tool aimed at (but not limited to) helping threat analysts and malware
researchers to identify and classify malware samples. It can:
● Dissect files
● Use patterns to link files or file fragments
● Perform heuristic tests
● Find out what’s missing in files (that should be there)
© Fidelis Cybersecurity
Basic Layout and Types – Rule Name
6
Let’s start with a rule name.
● It begins with the word “rule” and is followed by the rule name (identifier)
● First character of the rule name can not be a digit.
● Rule names are case sensitive and cannot exceed 128 characters.
● The curly bracket after the rule name is the start of the actual rule.
rule ExampleRule
{
© Fidelis Cybersecurity
Basic Layout and Types - Keywords
7
YARA keywords
all and any ascii at condition contains
entrypoint FALSE filesize fullword for global in
import include int8 int16 int32 int8be int16be
int32be matches meta nocase not or of
private rule strings them TRUE uint8 uint16
uint32 uint8be uint16be uint32be wide
© Fidelis Cybersecurity
Basic Layout and Types - Metadata
8
Add Metadata to provide additional information:
rule ExampleRule {
meta:
description = "This is just an example"
author = “Emil Verban”
Nickname = “Dutch”
© Fidelis Cybersecurity
Basic Layout and Types - Metadata
9
● Use metadata, especially as the number of yara rules increase.
● Metadata can describe the content of rules
● Metadata can help id where a rule is to save you time digging for it
● Useful for metrics, especially when using the include directive
© Fidelis Cybersecurity
Basic Layout and Types
10
Rules consist of two sections: strings and a condition. The strings section is
optional, but the condition section is always required.
rule Example
{
strings:
$my_text_string = ”play ball"
$my_hex_string = {BA 5E BA 11}
condition:
$my_text_string or $my_hex_string
}
© Fidelis Cybersecurity
Basic Layout and Types - Strings
11
● Each string has an identifier ($) followed by a sequence of alphanumeric
characters and underscores.
● Strings can be defined in ascii or unicode forms. Text strings are enclosed
on double quotes. Identify unicode with the “wide” keyword, like below:
$my_text_string = “play ball”
$my_unicode_string = “play ball” wide
© Fidelis Cybersecurity
Basic Layout and Types - Keywords
12
YARA keywords
all and any ascii at condition contains
entrypoint FALSE filesize fullword for global in
import include int8 int16 int32 int8be int16be
int32be matches meta nocase not or of
private rule strings them TRUE uint8 uint16
uint32 uint8be uint16be uint32be wide
© Fidelis Cybersecurity
Basic Layout and Types - Strings
13
● If a word boundary exists before and after the word, use the keyword
“fullword”, like below:
$my_fullword_string = “baseball” fullword
For example the string “baseball”, if defined as fullword, won’t match
www.onebaseball.com but it matches www.baseball-reference.com and
www.baseball.com.
© Fidelis Cybersecurity
Basic Layout and Types - Strings
14
● Hex strings are enclosed by curly brackets. Decimal numbers are not
allowed in hex strings.
$my_hex_string = {BA 5E BA 11 23}
● Hexadecimal strings allow three special constructions that make them more
flexible: wild-cards, jumps, and alternatives. Wild-cards (?) are placeholders
to indicate some bytes are unknown and they should match anything.
$my_hex_string = {BA ?? BA ?? 11 23}
© Fidelis Cybersecurity
Basic Layout and Types - Strings
15
● You can also define strings with chunks of variable content and length. In
those situations you can use jumps instead of wild-cards:
$my_hex_string = {BA 5E BA [2-4] 11 23}
© Fidelis Cybersecurity
Basic Layout and Types - Strings
16
● Alternatives can also be expressed by enclosing them in a parenthesis and
use a pipe for separation:
$my_hex_string = {BA ( 5E BA | 5E BB) 11 23}
The above would return on BA 5E BA 11 23 or BA 5E BB 11 23
● Regular expressions can be used and are enclosed in forward slashes.
$re1 = /md5: [0-9a-fA-F]{32}/
The regex above would return on return on a 32 character alpha numeric value
© Fidelis Cybersecurity
Basic Layout and Types - Conditions
17
The condition section is where the logic of the rule resides. This section
contains the logic that satisfies the rule or not. The condition section can
contain boolean operators (and, or and not), like below:
condition:
$my_text_string or $my_hex_string
© Fidelis Cybersecurity
Basic Layout and Types - Conditions
18
● Relational operators (>=, <=, <, >, == and !=) and counting (#):
condition:
#my_text_string == 3 or ( #my_hex_string <= 7 and #re_1 >=2 )
● Other rule names can be used as a part of its logic, employing the same
logical operators.
condition:
Ghost-rule and $my_hex_string
Note: Any rule you reference must have already been processed before
you reference it.
© Fidelis Cybersecurity
Basic Layout and Types - Conditions
19
● Sets of strings can be used in conditions
rule baseball
{
strings:
$a = "Chicago"
$b = "Cubs"
$c = "Baseball"
condition:
2 of ($a,$b,$c)
}
© Fidelis Cybersecurity
Basic Layout and Types –Include Files
20
YARA provides the include directive. The following example will include the
content of other.yar into the current file:
include "other.yar”
The base path will be the same directory where the Yara file resides. You
can also specify relative paths and absolute paths to the include file.
© Fidelis Cybersecurity
Any Questions so far?
© Fidelis Cybersecurity
Rule Organization
22
Organize rules into groups
Include groups of rules you want into your main rule file
using the include directive, e.g. include “other.yar”
Maintain a single, primary rule file and include groups of
rules as you want and exclude those you don’t
© Fidelis Cybersecurity
Rule Organization
23
© Fidelis Cybersecurity
Rule Organization
24
Rule order within a single yar file can also be leveraged.
Preceding rules can be referenced in the condition line of
rules that follow
Great place to employ private rules that contain elements of
interest but you do not want to alert on within more
context.
Similar to Global rules but only apply to the rules you employ
them as a condition
© Fidelis Cybersecurity
Rule Organization
25
This type of organization lets you perform rudimentary
IF...THEN logic with your rules
IF Rule 1 THEN
IF Rule 1 AND Rule 2 THEN
IF Rule 1 AND Rule 2 AND Rule 3 THEN
© Fidelis Cybersecurity
Rule Organization
26
© Fidelis Cybersecurity
Rule Organization
27
Or like this:
IF Rule 1 THEN
IF Rule 1 AND NOT Rule 2 THEN
IF Rule 1 AND NOT Rule 2 AND NOT Rule 3 THEN
© Fidelis Cybersecurity
Rule Organization
28
© Fidelis Cybersecurity
Yara in Action
29
© Fidelis Cybersecurity
Yara in Action
30
© Fidelis Cybersecurity
Tools / Resources - yarGen
31
A Rule Generator for Yara Rules - written by Florian Roth
What does YarGen do?
● Create yara rules from strings found in files while removing strings that also
appear in goodware files.
● Uses naive-bayes-classifier to classify strings and detect useful words instead of
compression/encryption garbage.
● Can extract opcode elements from .text sections of PE files
● Supports Binarly to let you search on arbitrary byte patterns to create better
rules
© Fidelis Cybersecurity
Tools / Resources – Yara Exchange
32
Yara-Exchange Google Group (by invitation only)
http://www.deependresearch.org/2012/08/yara-signature-
exchange-google-group.html
© Fidelis Cybersecurity
Tools / Resources – Fidelis Yara
33
We have a publicly available page on github with various indicators,
yara rules etc.
Yara specific
https://github.com/fideliscyber/indicators
© Fidelis Cybersecurity
References
34
The following are a series of links to references and tools we have found useful.
Many are beyond the scope of a short talk but we have included them for
future reference.
● https://github.com/Yara-Rules
● https://github.com/Neo23x0/yarGen
● http://resources.infosecinstitute.com/yara-simple-effective-way-dissecting-
malware/
● https://bruteforce.gr/yara-a-beginners-guide.html
● https://github.com/BayshoreNetworks/yextend
● https://github.com/plusvic/yara
© Fidelis Cybersecurity
References
35
● https://github.com/kevthehermit/YaraManager
● https://www.bsk-consulting.de/2015/02/16/write-simple-sound-yara-rules/
● https://gist.github.com/Neo23x0/e3d4e316d7441d9143c7 (Yara Guide)
● http://yara.readthedocs.io/en/v3.5.0/writingrules.html
● https://github.com/Neo23x0/yarAnalyzer
● https://gist.github.com/wxsBSD/019740e83faa7a7206f4
● https://gist.github.com/williballenthin/3abc9577bede0aeef25526b2017322
46
● http://www.binar.ly/search
© Fidelis Cybersecurity
Questions & Thank You!
John Laycock / john.laycock@fidelissecurity.com
Monty St John/monty@atxforensics.com

More Related Content

What's hot

Security by Design: An Introduction to Drupal Security
Security by Design: An Introduction to Drupal SecuritySecurity by Design: An Introduction to Drupal Security
Security by Design: An Introduction to Drupal SecurityTara Arnold
 
MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...
MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...
MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...MITRE - ATT&CKcon
 
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...NoNameCon
 
임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판
임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판
임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판Minseok(Jacky) Cha
 
MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...
MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...
MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...MITRE - ATT&CKcon
 
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.Stefano Maccaglia
 
MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...
MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...
MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...MITRE - ATT&CKcon
 
2014: Mid-Year Threat Review
2014: Mid-Year Threat Review2014: Mid-Year Threat Review
2014: Mid-Year Threat ReviewESET
 
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016grecsl
 
Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...
Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...
Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...Adam Pennington
 
vodQA(Pune) 2018 - QAing the security way
vodQA(Pune) 2018 - QAing the security wayvodQA(Pune) 2018 - QAing the security way
vodQA(Pune) 2018 - QAing the security wayvodQA
 
Putting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You ArePutting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You AreKatie Nickels
 
BSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status Quo
BSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status QuoBSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status Quo
BSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status QuoKatie Nickels
 
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...Minseok(Jacky) Cha
 
Helping Small Companies Leverage CTI with an Open Source Threat Mapping
Helping Small Companies Leverage CTI with an Open Source Threat MappingHelping Small Companies Leverage CTI with an Open Source Threat Mapping
Helping Small Companies Leverage CTI with an Open Source Threat MappingMITRE - ATT&CKcon
 
QAing the security way!
QAing the security way!QAing the security way!
QAing the security way!Amit Gundiyal
 
Cybereason - behind the HackingTeam infection server
Cybereason - behind the HackingTeam infection serverCybereason - behind the HackingTeam infection server
Cybereason - behind the HackingTeam infection serverAmit Serper
 
Oh... that's ransomware and... look behind you a three-headed Monkey
Oh... that's ransomware and... look behind you a three-headed MonkeyOh... that's ransomware and... look behind you a three-headed Monkey
Oh... that's ransomware and... look behind you a three-headed MonkeyStefano Maccaglia
 
Practical White Hat Hacker Training - Passive Information Gathering(OSINT)
Practical White Hat Hacker Training -  Passive Information Gathering(OSINT)Practical White Hat Hacker Training -  Passive Information Gathering(OSINT)
Practical White Hat Hacker Training - Passive Information Gathering(OSINT)PRISMA CSI
 
MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...
MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...
MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...MITRE - ATT&CKcon
 

What's hot (20)

Security by Design: An Introduction to Drupal Security
Security by Design: An Introduction to Drupal SecuritySecurity by Design: An Introduction to Drupal Security
Security by Design: An Introduction to Drupal Security
 
MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...
MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...
MITRE ATT&CKcon 2018: Sofacy 2018 and the Adversary Playbook, Robert Falcone,...
 
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
 
임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판
임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판
임베디드 리눅스 악성코드로 본 사물인터넷 보안 차민석 20150406_코드게이트 발표판
 
MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...
MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...
MITRE ATT&CKcon 2.0: Flashback with ATT&CK: Exploring Malware History with AT...
 
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
 
MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...
MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...
MITRE ATT&CKcon 2018: Playing Devil’s Advocate to Security Initiatives with A...
 
2014: Mid-Year Threat Review
2014: Mid-Year Threat Review2014: Mid-Year Threat Review
2014: Mid-Year Threat Review
 
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
 
Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...
Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...
Anomali Detect 19 - Nickels & Pennington - Turning Intelligence into Action w...
 
vodQA(Pune) 2018 - QAing the security way
vodQA(Pune) 2018 - QAing the security wayvodQA(Pune) 2018 - QAing the security way
vodQA(Pune) 2018 - QAing the security way
 
Putting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You ArePutting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You Are
 
BSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status Quo
BSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status QuoBSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status Quo
BSidesLV 2018 - Katie Nickels and John Wunder - ATT&CKing the Status Quo
 
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
 
Helping Small Companies Leverage CTI with an Open Source Threat Mapping
Helping Small Companies Leverage CTI with an Open Source Threat MappingHelping Small Companies Leverage CTI with an Open Source Threat Mapping
Helping Small Companies Leverage CTI with an Open Source Threat Mapping
 
QAing the security way!
QAing the security way!QAing the security way!
QAing the security way!
 
Cybereason - behind the HackingTeam infection server
Cybereason - behind the HackingTeam infection serverCybereason - behind the HackingTeam infection server
Cybereason - behind the HackingTeam infection server
 
Oh... that's ransomware and... look behind you a three-headed Monkey
Oh... that's ransomware and... look behind you a three-headed MonkeyOh... that's ransomware and... look behind you a three-headed Monkey
Oh... that's ransomware and... look behind you a three-headed Monkey
 
Practical White Hat Hacker Training - Passive Information Gathering(OSINT)
Practical White Hat Hacker Training -  Passive Information Gathering(OSINT)Practical White Hat Hacker Training -  Passive Information Gathering(OSINT)
Practical White Hat Hacker Training - Passive Information Gathering(OSINT)
 
MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...
MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...
MITRE ATT&CKcon 2.0: Prioritizing ATT&CK Informed Defenses the CIS Way; Phili...
 

Similar to Yet Another YARA Allocution (YAYA)

COIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docx
COIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docxCOIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docx
COIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docxmary772
 
Why haven't we stamped out SQL injection and XSS yet
Why haven't we stamped out SQL injection and XSS yetWhy haven't we stamped out SQL injection and XSS yet
Why haven't we stamped out SQL injection and XSS yetRomain Gaucher
 
Solve Big Data Security Issues
Solve Big Data Security IssuesSolve Big Data Security Issues
Solve Big Data Security IssuesEditor IJCATR
 
What Is MISRA and how to Cook It
What Is MISRA and how to Cook ItWhat Is MISRA and how to Cook It
What Is MISRA and how to Cook ItAndrey Karpov
 
Gluecon 2017: Metadata is the Glue
Gluecon 2017: Metadata is the GlueGluecon 2017: Metadata is the Glue
Gluecon 2017: Metadata is the GlueMuleSoft
 
Cisco cybersecurity essentials chapter 4
Cisco cybersecurity essentials chapter 4Cisco cybersecurity essentials chapter 4
Cisco cybersecurity essentials chapter 4Mukesh Chinta
 
Netwitness RT - Don’t scratch that patch.pptx
Netwitness RT - Don’t scratch that patch.pptxNetwitness RT - Don’t scratch that patch.pptx
Netwitness RT - Don’t scratch that patch.pptxStefano Maccaglia
 
Proofpoint Emerging Threats Suricata 5.0 Webinar
Proofpoint Emerging Threats Suricata 5.0 WebinarProofpoint Emerging Threats Suricata 5.0 Webinar
Proofpoint Emerging Threats Suricata 5.0 WebinarJason Williams
 
The static code analysis rules for diagnosing potentially unsafe construction...
The static code analysis rules for diagnosing potentially unsafe construction...The static code analysis rules for diagnosing potentially unsafe construction...
The static code analysis rules for diagnosing potentially unsafe construction...Sergey Vasilyev
 
Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxsaiproject
 
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirementsMySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirementsOlivier DASINI
 
Identity and the quest for Self-Sovereign Identity - Daniel Hardman
Identity and the quest for Self-Sovereign Identity - Daniel HardmanIdentity and the quest for Self-Sovereign Identity - Daniel Hardman
Identity and the quest for Self-Sovereign Identity - Daniel HardmanSSIMeetup
 
AWS Cloud Based Encryption Decryption System
AWS Cloud Based Encryption Decryption SystemAWS Cloud Based Encryption Decryption System
AWS Cloud Based Encryption Decryption SystemIRJET Journal
 
IRJET- Secure File Storage on Cloud using Cryptography
IRJET-  	  Secure File Storage on Cloud using CryptographyIRJET-  	  Secure File Storage on Cloud using Cryptography
IRJET- Secure File Storage on Cloud using CryptographyIRJET Journal
 
stackArmor - FedRAMP and 800-171 compliant cloud solutions
stackArmor - FedRAMP and 800-171 compliant cloud solutionsstackArmor - FedRAMP and 800-171 compliant cloud solutions
stackArmor - FedRAMP and 800-171 compliant cloud solutionsGaurav "GP" Pal
 
Get full visibility and find hidden security issues
Get full visibility and find hidden security issuesGet full visibility and find hidden security issues
Get full visibility and find hidden security issuesElasticsearch
 
IRJET- Ensuring Security in Cloud Computing Cryptography using Cryptography
IRJET-  	  Ensuring Security in Cloud Computing Cryptography using CryptographyIRJET-  	  Ensuring Security in Cloud Computing Cryptography using Cryptography
IRJET- Ensuring Security in Cloud Computing Cryptography using CryptographyIRJET Journal
 
[Cisco Connect 2018 - Vietnam] Anh duc le building a secure data center
[Cisco Connect 2018 - Vietnam] Anh duc le   building a secure data center[Cisco Connect 2018 - Vietnam] Anh duc le   building a secure data center
[Cisco Connect 2018 - Vietnam] Anh duc le building a secure data centerNur Shiqim Chok
 

Similar to Yet Another YARA Allocution (YAYA) (20)

COIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docx
COIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docxCOIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docx
COIT20262 Assignment 2 Questions Term 2, 2018 Advanced Net.docx
 
Why haven't we stamped out SQL injection and XSS yet
Why haven't we stamped out SQL injection and XSS yetWhy haven't we stamped out SQL injection and XSS yet
Why haven't we stamped out SQL injection and XSS yet
 
Solve Big Data Security Issues
Solve Big Data Security IssuesSolve Big Data Security Issues
Solve Big Data Security Issues
 
What Is MISRA and how to Cook It
What Is MISRA and how to Cook ItWhat Is MISRA and how to Cook It
What Is MISRA and how to Cook It
 
Gluecon 2017: Metadata is the Glue
Gluecon 2017: Metadata is the GlueGluecon 2017: Metadata is the Glue
Gluecon 2017: Metadata is the Glue
 
Cisco cybersecurity essentials chapter 4
Cisco cybersecurity essentials chapter 4Cisco cybersecurity essentials chapter 4
Cisco cybersecurity essentials chapter 4
 
Netwitness RT - Don’t scratch that patch.pptx
Netwitness RT - Don’t scratch that patch.pptxNetwitness RT - Don’t scratch that patch.pptx
Netwitness RT - Don’t scratch that patch.pptx
 
Proofpoint Emerging Threats Suricata 5.0 Webinar
Proofpoint Emerging Threats Suricata 5.0 WebinarProofpoint Emerging Threats Suricata 5.0 Webinar
Proofpoint Emerging Threats Suricata 5.0 Webinar
 
The static code analysis rules for diagnosing potentially unsafe construction...
The static code analysis rules for diagnosing potentially unsafe construction...The static code analysis rules for diagnosing potentially unsafe construction...
The static code analysis rules for diagnosing potentially unsafe construction...
 
Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptx
 
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirementsMySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
MySQL Day Paris 2018 - MySQL & GDPR; Privacy and Security requirements
 
Identity and the quest for Self-Sovereign Identity - Daniel Hardman
Identity and the quest for Self-Sovereign Identity - Daniel HardmanIdentity and the quest for Self-Sovereign Identity - Daniel Hardman
Identity and the quest for Self-Sovereign Identity - Daniel Hardman
 
AWS Cloud Based Encryption Decryption System
AWS Cloud Based Encryption Decryption SystemAWS Cloud Based Encryption Decryption System
AWS Cloud Based Encryption Decryption System
 
IRJET- Secure File Storage on Cloud using Cryptography
IRJET-  	  Secure File Storage on Cloud using CryptographyIRJET-  	  Secure File Storage on Cloud using Cryptography
IRJET- Secure File Storage on Cloud using Cryptography
 
stackArmor - FedRAMP and 800-171 compliant cloud solutions
stackArmor - FedRAMP and 800-171 compliant cloud solutionsstackArmor - FedRAMP and 800-171 compliant cloud solutions
stackArmor - FedRAMP and 800-171 compliant cloud solutions
 
Get full visibility and find hidden security issues
Get full visibility and find hidden security issuesGet full visibility and find hidden security issues
Get full visibility and find hidden security issues
 
Code Coverage
Code CoverageCode Coverage
Code Coverage
 
IRJET- Ensuring Security in Cloud Computing Cryptography using Cryptography
IRJET-  	  Ensuring Security in Cloud Computing Cryptography using CryptographyIRJET-  	  Ensuring Security in Cloud Computing Cryptography using Cryptography
IRJET- Ensuring Security in Cloud Computing Cryptography using Cryptography
 
Introducing an Encryption Algorithm based on IDEA
Introducing an Encryption Algorithm based on IDEAIntroducing an Encryption Algorithm based on IDEA
Introducing an Encryption Algorithm based on IDEA
 
[Cisco Connect 2018 - Vietnam] Anh duc le building a secure data center
[Cisco Connect 2018 - Vietnam] Anh duc le   building a secure data center[Cisco Connect 2018 - Vietnam] Anh duc le   building a secure data center
[Cisco Connect 2018 - Vietnam] Anh duc le building a secure data center
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Yet Another YARA Allocution (YAYA)

  • 1. © Fidelis Cybersecurity BSidesDC 2016 Yet Another YARA Allocution (YAYA) John Laycock, Threat Systems Fidelis Cybersecurity Monty St John ATX Forensics
  • 2. © Fidelis Cybersecurity Introduction 2 John Laycock: • B.S. Mechanical Engineering from Northern Illinois University • Cognitech/Ocean Systems Forensic Video Analyst • Government Contractor DC3 – DCFL Forensic Examiner/DCISE/NCIJTF • General Dynamics/Fidelis Commercial Forensics Team • Fidelis Threat Research Team John Laycock Systems, Threat Research Email: john.laycock@fidelissecurity.com
  • 3. © Fidelis Cybersecurity Introduction 3 Monty St John Email: monty@atxforensics.com site: www.atxforensics.com Monty St John: • 25 years of security, digital forensics, reverse engineering, threat intelligence • Two decades supporting federal, state, and local LE while in uniform Forensics and Threat Intelligence • Last decade acting as a key member of forensic and TI teams deconstructing, analyzing and providing insights into threats and how to thwart them
  • 4. © Fidelis Cybersecurity Disclaimer 4 This is an introductory level talk to folks that do not necessarily build Yara rules on a daily basis. Many of the concepts we will be showing you are from a high level view. You can refer to some of the references in the appendix to drill down into these concepts in more detail. TL:DR This is an intro to a deep topic. We’re showing some basic concepts and sharing some resources that you can hopefully use to build upon.
  • 5. © Fidelis Cybersecurity What is YARA? 5 YARA is a tool aimed at (but not limited to) helping threat analysts and malware researchers to identify and classify malware samples. It can: ● Dissect files ● Use patterns to link files or file fragments ● Perform heuristic tests ● Find out what’s missing in files (that should be there)
  • 6. © Fidelis Cybersecurity Basic Layout and Types – Rule Name 6 Let’s start with a rule name. ● It begins with the word “rule” and is followed by the rule name (identifier) ● First character of the rule name can not be a digit. ● Rule names are case sensitive and cannot exceed 128 characters. ● The curly bracket after the rule name is the start of the actual rule. rule ExampleRule {
  • 7. © Fidelis Cybersecurity Basic Layout and Types - Keywords 7 YARA keywords all and any ascii at condition contains entrypoint FALSE filesize fullword for global in import include int8 int16 int32 int8be int16be int32be matches meta nocase not or of private rule strings them TRUE uint8 uint16 uint32 uint8be uint16be uint32be wide
  • 8. © Fidelis Cybersecurity Basic Layout and Types - Metadata 8 Add Metadata to provide additional information: rule ExampleRule { meta: description = "This is just an example" author = “Emil Verban” Nickname = “Dutch”
  • 9. © Fidelis Cybersecurity Basic Layout and Types - Metadata 9 ● Use metadata, especially as the number of yara rules increase. ● Metadata can describe the content of rules ● Metadata can help id where a rule is to save you time digging for it ● Useful for metrics, especially when using the include directive
  • 10. © Fidelis Cybersecurity Basic Layout and Types 10 Rules consist of two sections: strings and a condition. The strings section is optional, but the condition section is always required. rule Example { strings: $my_text_string = ”play ball" $my_hex_string = {BA 5E BA 11} condition: $my_text_string or $my_hex_string }
  • 11. © Fidelis Cybersecurity Basic Layout and Types - Strings 11 ● Each string has an identifier ($) followed by a sequence of alphanumeric characters and underscores. ● Strings can be defined in ascii or unicode forms. Text strings are enclosed on double quotes. Identify unicode with the “wide” keyword, like below: $my_text_string = “play ball” $my_unicode_string = “play ball” wide
  • 12. © Fidelis Cybersecurity Basic Layout and Types - Keywords 12 YARA keywords all and any ascii at condition contains entrypoint FALSE filesize fullword for global in import include int8 int16 int32 int8be int16be int32be matches meta nocase not or of private rule strings them TRUE uint8 uint16 uint32 uint8be uint16be uint32be wide
  • 13. © Fidelis Cybersecurity Basic Layout and Types - Strings 13 ● If a word boundary exists before and after the word, use the keyword “fullword”, like below: $my_fullword_string = “baseball” fullword For example the string “baseball”, if defined as fullword, won’t match www.onebaseball.com but it matches www.baseball-reference.com and www.baseball.com.
  • 14. © Fidelis Cybersecurity Basic Layout and Types - Strings 14 ● Hex strings are enclosed by curly brackets. Decimal numbers are not allowed in hex strings. $my_hex_string = {BA 5E BA 11 23} ● Hexadecimal strings allow three special constructions that make them more flexible: wild-cards, jumps, and alternatives. Wild-cards (?) are placeholders to indicate some bytes are unknown and they should match anything. $my_hex_string = {BA ?? BA ?? 11 23}
  • 15. © Fidelis Cybersecurity Basic Layout and Types - Strings 15 ● You can also define strings with chunks of variable content and length. In those situations you can use jumps instead of wild-cards: $my_hex_string = {BA 5E BA [2-4] 11 23}
  • 16. © Fidelis Cybersecurity Basic Layout and Types - Strings 16 ● Alternatives can also be expressed by enclosing them in a parenthesis and use a pipe for separation: $my_hex_string = {BA ( 5E BA | 5E BB) 11 23} The above would return on BA 5E BA 11 23 or BA 5E BB 11 23 ● Regular expressions can be used and are enclosed in forward slashes. $re1 = /md5: [0-9a-fA-F]{32}/ The regex above would return on return on a 32 character alpha numeric value
  • 17. © Fidelis Cybersecurity Basic Layout and Types - Conditions 17 The condition section is where the logic of the rule resides. This section contains the logic that satisfies the rule or not. The condition section can contain boolean operators (and, or and not), like below: condition: $my_text_string or $my_hex_string
  • 18. © Fidelis Cybersecurity Basic Layout and Types - Conditions 18 ● Relational operators (>=, <=, <, >, == and !=) and counting (#): condition: #my_text_string == 3 or ( #my_hex_string <= 7 and #re_1 >=2 ) ● Other rule names can be used as a part of its logic, employing the same logical operators. condition: Ghost-rule and $my_hex_string Note: Any rule you reference must have already been processed before you reference it.
  • 19. © Fidelis Cybersecurity Basic Layout and Types - Conditions 19 ● Sets of strings can be used in conditions rule baseball { strings: $a = "Chicago" $b = "Cubs" $c = "Baseball" condition: 2 of ($a,$b,$c) }
  • 20. © Fidelis Cybersecurity Basic Layout and Types –Include Files 20 YARA provides the include directive. The following example will include the content of other.yar into the current file: include "other.yar” The base path will be the same directory where the Yara file resides. You can also specify relative paths and absolute paths to the include file.
  • 21. © Fidelis Cybersecurity Any Questions so far?
  • 22. © Fidelis Cybersecurity Rule Organization 22 Organize rules into groups Include groups of rules you want into your main rule file using the include directive, e.g. include “other.yar” Maintain a single, primary rule file and include groups of rules as you want and exclude those you don’t
  • 23. © Fidelis Cybersecurity Rule Organization 23
  • 24. © Fidelis Cybersecurity Rule Organization 24 Rule order within a single yar file can also be leveraged. Preceding rules can be referenced in the condition line of rules that follow Great place to employ private rules that contain elements of interest but you do not want to alert on within more context. Similar to Global rules but only apply to the rules you employ them as a condition
  • 25. © Fidelis Cybersecurity Rule Organization 25 This type of organization lets you perform rudimentary IF...THEN logic with your rules IF Rule 1 THEN IF Rule 1 AND Rule 2 THEN IF Rule 1 AND Rule 2 AND Rule 3 THEN
  • 26. © Fidelis Cybersecurity Rule Organization 26
  • 27. © Fidelis Cybersecurity Rule Organization 27 Or like this: IF Rule 1 THEN IF Rule 1 AND NOT Rule 2 THEN IF Rule 1 AND NOT Rule 2 AND NOT Rule 3 THEN
  • 28. © Fidelis Cybersecurity Rule Organization 28
  • 31. © Fidelis Cybersecurity Tools / Resources - yarGen 31 A Rule Generator for Yara Rules - written by Florian Roth What does YarGen do? ● Create yara rules from strings found in files while removing strings that also appear in goodware files. ● Uses naive-bayes-classifier to classify strings and detect useful words instead of compression/encryption garbage. ● Can extract opcode elements from .text sections of PE files ● Supports Binarly to let you search on arbitrary byte patterns to create better rules
  • 32. © Fidelis Cybersecurity Tools / Resources – Yara Exchange 32 Yara-Exchange Google Group (by invitation only) http://www.deependresearch.org/2012/08/yara-signature- exchange-google-group.html
  • 33. © Fidelis Cybersecurity Tools / Resources – Fidelis Yara 33 We have a publicly available page on github with various indicators, yara rules etc. Yara specific https://github.com/fideliscyber/indicators
  • 34. © Fidelis Cybersecurity References 34 The following are a series of links to references and tools we have found useful. Many are beyond the scope of a short talk but we have included them for future reference. ● https://github.com/Yara-Rules ● https://github.com/Neo23x0/yarGen ● http://resources.infosecinstitute.com/yara-simple-effective-way-dissecting- malware/ ● https://bruteforce.gr/yara-a-beginners-guide.html ● https://github.com/BayshoreNetworks/yextend ● https://github.com/plusvic/yara
  • 35. © Fidelis Cybersecurity References 35 ● https://github.com/kevthehermit/YaraManager ● https://www.bsk-consulting.de/2015/02/16/write-simple-sound-yara-rules/ ● https://gist.github.com/Neo23x0/e3d4e316d7441d9143c7 (Yara Guide) ● http://yara.readthedocs.io/en/v3.5.0/writingrules.html ● https://github.com/Neo23x0/yarAnalyzer ● https://gist.github.com/wxsBSD/019740e83faa7a7206f4 ● https://gist.github.com/williballenthin/3abc9577bede0aeef25526b2017322 46 ● http://www.binar.ly/search
  • 36. © Fidelis Cybersecurity Questions & Thank You! John Laycock / john.laycock@fidelissecurity.com Monty St John/monty@atxforensics.com