Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rules
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
rules
Commits
b850f389
Commit
b850f389
authored
Jun 12, 2017
by
Michal Ambroz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add eml context to given rules to avoid matching these for every single file
parent
050520f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
attachment.yar
email/attachment.yar
+8
-1
image.yar
email/image.yar
+13
-4
urls.yar
email/urls.yar
+10
-0
No files found.
email/attachment.yar
View file @
b850f389
...
...
@@ -21,7 +21,14 @@ rule without_attachments : mail {
reference = "http://laboratorio.blogs.hispasec.com/"
description = "Rule to detect the no presence of any attachment"
strings:
$eml_01 = "From:"
$eml_02 = "To:"
$eml_03 = "Subject:"
$attachment_id = "X-Attachment-Id"
$mime_type = "Content-Type: multipart/mixed"
condition:
not $attachment_id
all of ( $eml_* ) and
not $attachment_id and
not $mime_type
}
email/image.yar
View file @
b850f389
...
...
@@ -9,11 +9,15 @@ rule with_images : mail {
reference = "http://laboratorio.blogs.hispasec.com/"
description = "Rule to detect the presence of an or several images"
strings:
$a = ".jpg" nocase
$b = ".png" nocase
$c = ".bmp" nocase
$eml_01 = "From:"
$eml_02 = "To:"
$eml_03 = "Subject:"
$img_a = ".jpg" nocase
$img_b = ".png" nocase
$img_c = ".bmp" nocase
condition:
any of them
all of ( $eml_* ) and
any of ( $img_* )
}
rule without_images : mail {
...
...
@@ -22,9 +26,14 @@ rule without_images : mail {
reference = "http://laboratorio.blogs.hispasec.com/"
description = "Rule to detect the no presence of any image"
strings:
$eml_01 = "From:"
$eml_02 = "To:"
$eml_03 = "Subject:"
$a = ".jpg" nocase
$b = ".png" nocase
$c = ".bmp" nocase
condition:
all of ( $eml_* ) and
not $a and not $b and not $c
}
email/urls.yar
View file @
b850f389
...
...
@@ -9,8 +9,13 @@ rule with_urls : mail {
reference = "http://laboratorio.blogs.hispasec.com/"
description = "Rule to detect the presence of an or several urls"
strings:
$eml_01 = "From:"
$eml_02 = "To:"
$eml_03 = "Subject:"
$url_regex = /https?:\/\/([\w\.-]+)([\/\w \.-]*)/
condition:
all of ( $eml_* ) and
all of them
}
...
...
@@ -20,7 +25,12 @@ rule without_urls : mail {
reference = "http://laboratorio.blogs.hispasec.com/"
description = "Rule to detect the no presence of any url"
strings:
$eml_01 = "From:"
$eml_02 = "To:"
$eml_03 = "Subject:"
$url_regex = /https?:\/\/([\w\.-]+)([\/\w \.-]*)/
condition:
all of ( $eml_* ) and
not $url_regex
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment