Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cortex-analyzers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gn4-3-wp8-t3.1 SOC
cortex-analyzers
Commits
a6fd60ee
Commit
a6fd60ee
authored
4 years ago
by
Václav Bartoš
Browse files
Options
Downloads
Patches
Plain Diff
NERD: Added tag translation/filtration, hostname added as artifact
parent
64d0131c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
analyzers/NERD/nerd_analyzer.py
+27
-4
27 additions, 4 deletions
analyzers/NERD/nerd_analyzer.py
with
27 additions
and
4 deletions
analyzers/NERD/nerd_analyzer.py
+
27
−
4
View file @
a6fd60ee
...
@@ -4,6 +4,24 @@
...
@@ -4,6 +4,24 @@
import
requests
import
requests
from
cortexutils.analyzer
import
Analyzer
from
cortexutils.analyzer
import
Analyzer
# Map of tag IDs to (name,level)-tuple used in summary (tags not listed here are not shown)
tag_map
=
{
'
reconscanning
'
:
(
'
Scanner
'
,
'
suspicious
'
),
'
attemptexploit
'
:
(
'
Exploit
'
,
'
malicious
'
),
'
attemptlogin
'
:
(
'
Login
'
,
'
malicious
'
),
'
malware
'
:
(
'
Malware
'
,
'
malicious
'
),
'
availabilitydos
'
:
(
'
DDoS
'
,
'
malicious
'
),
'
researchscanners
'
:
(
'
Research scanner
'
,
'
safe
'
),
'
vpn
'
:
(
'
VPN
'
,
'
info
'
),
'
nat
'
:
(
'
NAT
'
,
'
info
'
),
'
dsl
'
:
(
'
DSL
'
,
'
info
'
),
'
dynamicIP
'
:
(
'
Dynamic IP
'
,
'
info
'
),
'
tor
'
:
(
'
Tor exit node
'
,
'
info
'
),
'
spam
'
:
(
'
Spam
'
,
'
malicious
'
),
'
reserved_ip
'
:
(
'
Reserved IP
'
,
'
info
'
),
}
class
NERDAnalyzer
(
Analyzer
):
class
NERDAnalyzer
(
Analyzer
):
def
__init__
(
self
):
def
__init__
(
self
):
Analyzer
.
__init__
(
self
)
Analyzer
.
__init__
(
self
)
...
@@ -31,14 +49,19 @@ class NERDAnalyzer(Analyzer):
...
@@ -31,14 +49,19 @@ class NERDAnalyzer(Analyzer):
# Tags
# Tags
for
tag
in
raw
[
'
tags
'
]:
for
tag
in
raw
[
'
tags
'
]:
# TODO: filter tags, set different levels
try
:
taxonomies
.
append
(
self
.
build_taxonomy
(
'
info
'
,
'
NERD
'
,
'
Tag
'
,
tag
))
tag_name
,
level
=
tag_map
[
tag
]
except
KeyError
:
continue
taxonomies
.
append
(
self
.
build_taxonomy
(
level
,
'
NERD
'
,
'
Tag
'
,
tag_name
))
return
{
'
taxonomies
'
:
taxonomies
}
return
{
'
taxonomies
'
:
taxonomies
}
def
artifacts
(
self
,
raw
):
def
artifacts
(
self
,
raw
):
"""
Returns a list of indicators extracted from reply (empty in this case)
"""
"""
Returns a list of indicators extracted from reply (only
"
hostname
"
in this case)
"""
return
[]
# TODO add hostname as a new indicator?
if
raw
.
get
(
'
hostname
'
):
return
[{
'
dataType
'
:
'
fqdn
'
,
'
data
'
:
raw
[
'
hostname
'
]}]
return
[]
def
run
(
self
):
def
run
(
self
):
"""
Main function run by Cortex to analyze an observable.
"""
"""
Main function run by Cortex to analyze an observable.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment