Compare commits
61 Commits
Author | SHA1 | Date |
---|---|---|
Alexandre Dulaunoy | 0a01b382f4 | |
Andreas Muehlemann | 85af573a74 | |
Alexandre Dulaunoy | 53d4cb3860 | |
Alexandre Dulaunoy | eaebba2912 | |
Alexandre Dulaunoy | ea071519b2 | |
Alexandre Dulaunoy | e8cb47a8c7 | |
Christian Studer | e18ac776bb | |
Christian Studer | 5526c2c195 | |
Christian Studer | 8e97bf9938 | |
Christian Studer | 38a6dc810e | |
Christian Studer | b964b5e2a6 | |
Christian Studer | 3db8fa63db | |
Christian Studer | a93b382f1f | |
Christian Studer | 27673d0516 | |
Christian Studer | 5376993ba9 | |
Christian Studer | 153ca8d3d4 | |
Christian Studer | 98031beeae | |
Alexandre Dulaunoy | 1c963d3482 | |
Christian Studer | baa52f5ab9 | |
Christian Studer | 8b12b811a8 | |
Christian Studer | 7c74d2b600 | |
Christian Studer | f5cb8d0f57 | |
Andreas Muehlemann | 8d240e3541 | |
Christian Studer | 81375e1628 | |
Alexandre Dulaunoy | 9e07b6a0e5 | |
Rambatla Venkat Rao | d00fee3ba0 | |
Rambatla Venkat Rao | 66eb82cf1a | |
Alexandre Dulaunoy | 4a0c8cdccb | |
Nik Mohamad Aizuddin | ce3918ddba | |
Jakub Onderka | fa0c7fe630 | |
Jakub Onderka | 90c64c68b3 | |
Alexandre Dulaunoy | b1759e1e8e | |
Alexandre Dulaunoy | 0277b8f8d8 | |
Jeroen Pinoy | 340b9c0954 | |
szopin | 79e067188e | |
Alexandre Dulaunoy | 7d06740579 | |
szopin | e10826aafc | |
Alexandre Dulaunoy | de69ae3474 | |
Alexandre Dulaunoy | c3ca851ed6 | |
Alexandre Dulaunoy | e5c1d75b2f | |
Alexandre Dulaunoy | 2c218d273c | |
Rambatla Venkat Rao | 03af649d06 | |
Rambatla Venkat Rao | 543a8c0aad | |
Rambatla Venkat Rao | fcfdd36fd4 | |
Rambatla Venkat Rao | f3b2ea7c41 | |
Rambatla Venkat Rao | 7d26d11378 | |
Rambatla Venkat Rao | 3f2ac6d78a | |
Rambatla Venkat Rao | 3afcd825b9 | |
Sami Mokaddem | a6930be862 | |
Sami Mokaddem | 1c184040e6 | |
Sami Mokaddem | 9efed339a7 | |
Sami Mokaddem | b620446d37 | |
Alexandre Dulaunoy | a614689287 | |
Benni0 | de1687c11a | |
Christian Studer | 71d8745b91 | |
chrisr3d | 90a1644c8c | |
Alexandre Dulaunoy | cbaa1e6e93 | |
Robert Nixon | a86ac9d715 | |
Robert Nixon | a4426727f4 | |
Steve Clement | af1739cec5 | |
Steve Clement | 70543820eb |
4
Pipfile
|
@ -55,7 +55,6 @@ pandas_ods_reader = "==0.1.2"
|
||||||
pdftotext = "*"
|
pdftotext = "*"
|
||||||
lxml = "*"
|
lxml = "*"
|
||||||
xlrd = "*"
|
xlrd = "*"
|
||||||
idna-ssl = { markers = "python_version < '3.7'" }
|
|
||||||
jbxapi = "*"
|
jbxapi = "*"
|
||||||
geoip2 = "*"
|
geoip2 = "*"
|
||||||
apiosintDS = "*"
|
apiosintDS = "*"
|
||||||
|
@ -73,6 +72,9 @@ crowdstrike-falconpy = "0.9.0"
|
||||||
censys = "2.0.9"
|
censys = "2.0.9"
|
||||||
mwdblib = "3.4.1"
|
mwdblib = "3.4.1"
|
||||||
ndjson = "0.3.1"
|
ndjson = "0.3.1"
|
||||||
|
Jinja2 = "3.1.2"
|
||||||
|
mattermostdriver = "7.3.2"
|
||||||
|
openpyxl = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.7"
|
python_version = "3.7"
|
||||||
|
|
|
@ -47,6 +47,7 @@ For more information: [Extending MISP with Python modules](https://www.misp-proj
|
||||||
* [hashdd](misp_modules/modules/expansion/hashdd.py) - a hover module to check file hashes against [hashdd.com](http://www.hashdd.com) including NSLR dataset.
|
* [hashdd](misp_modules/modules/expansion/hashdd.py) - a hover module to check file hashes against [hashdd.com](http://www.hashdd.com) including NSLR dataset.
|
||||||
* [hibp](misp_modules/modules/expansion/hibp.py) - a hover module to lookup against Have I Been Pwned?
|
* [hibp](misp_modules/modules/expansion/hibp.py) - a hover module to lookup against Have I Been Pwned?
|
||||||
* [html_to_markdown](misp_modules/modules/expansion/html_to_markdown.py) - Simple HTML to markdown converter
|
* [html_to_markdown](misp_modules/modules/expansion/html_to_markdown.py) - Simple HTML to markdown converter
|
||||||
|
* [HYAS Insight](misp_modules/modules/expansion/hyasinsight.py) - a hover and expansion module to get information from [HYAS Insight](https://www.hyas.com/hyas-insight).
|
||||||
* [intel471](misp_modules/modules/expansion/intel471.py) - an expansion module to get info from [Intel471](https://intel471.com).
|
* [intel471](misp_modules/modules/expansion/intel471.py) - an expansion module to get info from [Intel471](https://intel471.com).
|
||||||
* [IPASN](misp_modules/modules/expansion/ipasn.py) - a hover and expansion to get the BGP ASN of an IP address.
|
* [IPASN](misp_modules/modules/expansion/ipasn.py) - a hover and expansion to get the BGP ASN of an IP address.
|
||||||
* [iprep](misp_modules/modules/expansion/iprep.py) - an expansion module to get IP reputation from packetmail.net.
|
* [iprep](misp_modules/modules/expansion/iprep.py) - an expansion module to get IP reputation from packetmail.net.
|
||||||
|
@ -85,6 +86,7 @@ For more information: [Extending MISP with Python modules](https://www.misp-proj
|
||||||
* [TruSTAR Enrich](misp_modules/modules/expansion/trustar_enrich.py) - an expansion module to enrich MISP data with [TruSTAR](https://www.trustar.co/).
|
* [TruSTAR Enrich](misp_modules/modules/expansion/trustar_enrich.py) - an expansion module to enrich MISP data with [TruSTAR](https://www.trustar.co/).
|
||||||
* [urlhaus](misp_modules/modules/expansion/urlhaus.py) - Query urlhaus to get additional data about a domain, hash, hostname, ip or url.
|
* [urlhaus](misp_modules/modules/expansion/urlhaus.py) - Query urlhaus to get additional data about a domain, hash, hostname, ip or url.
|
||||||
* [urlscan](misp_modules/modules/expansion/urlscan.py) - an expansion module to query [urlscan.io](https://urlscan.io).
|
* [urlscan](misp_modules/modules/expansion/urlscan.py) - an expansion module to query [urlscan.io](https://urlscan.io).
|
||||||
|
* [variotdbs](misp_modules/modules/expansion/variotdbs.py) - an expansion module to query the [VARIoT db](https://www.variotdbs.pl) API to get more information about a Vulnerability
|
||||||
* [virustotal](misp_modules/modules/expansion/virustotal.py) - an expansion module to query the [VirusTotal](https://www.virustotal.com/gui/home) API with a high request rate limit required. (More details about the API: [here](https://developers.virustotal.com/reference))
|
* [virustotal](misp_modules/modules/expansion/virustotal.py) - an expansion module to query the [VirusTotal](https://www.virustotal.com/gui/home) API with a high request rate limit required. (More details about the API: [here](https://developers.virustotal.com/reference))
|
||||||
* [virustotal_public](misp_modules/modules/expansion/virustotal_public.py) - an expansion module to query the [VirusTotal](https://www.virustotal.com/gui/home) API with a public key and a low request rate limit. (More details about the API: [here](https://developers.virustotal.com/reference))
|
* [virustotal_public](misp_modules/modules/expansion/virustotal_public.py) - an expansion module to query the [VirusTotal](https://www.virustotal.com/gui/home) API with a public key and a low request rate limit. (More details about the API: [here](https://developers.virustotal.com/reference))
|
||||||
* [VMray](misp_modules/modules/expansion/vmray_submit.py) - a module to submit a sample to VMray.
|
* [VMray](misp_modules/modules/expansion/vmray_submit.py) - a module to submit a sample to VMray.
|
||||||
|
@ -142,6 +144,7 @@ sudo -u www-data /var/www/MISP/venv/bin/pip install .
|
||||||
sudo cp etc/systemd/system/misp-modules.service /etc/systemd/system/
|
sudo cp etc/systemd/system/misp-modules.service /etc/systemd/system/
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable --now misp-modules
|
sudo systemctl enable --now misp-modules
|
||||||
|
sudo service misp-modules start #or
|
||||||
/var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 & #to start the modules
|
/var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 & #to start the modules
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
|
254
REQUIREMENTS
|
@ -1,172 +1,112 @@
|
||||||
#
|
|
||||||
# These requirements were autogenerated by pipenv
|
|
||||||
# To regenerate from the project's Pipfile, run:
|
|
||||||
#
|
|
||||||
# pipenv lock --requirements
|
|
||||||
#
|
|
||||||
|
|
||||||
-i https://pypi.org/simple
|
-i https://pypi.org/simple
|
||||||
.
|
-e .
|
||||||
aiohttp==3.8.1
|
-e git+https://github.com/D4-project/BGP-Ranking.git/@fd9c0e03af9b61d4bf0b67ac73c7208a55178a54#egg=pybgpranking&subdirectory=client
|
||||||
aiosignal==1.2.0; python_version >= '3.6'
|
-e git+https://github.com/D4-project/IPASN-History.git/@fc5e48608afc113e101ca6421bf693b7b9753f9e#egg=pyipasnhistory&subdirectory=client
|
||||||
antlr4-python3-runtime==4.9.3; python_version >= '3'
|
-e git+https://github.com/MISP/PyIntel471.git@0df8d51f1c1425de66714b3a5a45edb69b8cc2fc#egg=pyintel471
|
||||||
|
-e git+https://github.com/MISP/PyMISP.git@b5b40ae2c5225a4b349c26294cfc012309a61352#egg=pymisp[fileobjects,openioc,virustotal,pdfexport]
|
||||||
|
-e git+https://github.com/Rafiot/uwhoisd.git@411572840eba4c72dc321c549b36a54ed5cea9de#egg=uwhois&subdirectory=client
|
||||||
|
-e git+https://github.com/cartertemm/ODTReader.git/@49d6938693f6faa3ff09998f86dba551ae3a996b#egg=odtreader
|
||||||
|
-e git+https://github.com/sebdraven/pydnstrails@48c1f740025c51289f43a24863d1845ff12fd21a#egg=pydnstrails
|
||||||
|
-e git+https://github.com/sebdraven/pyonyphe@1ce15581beebb13e841193a08a2eb6f967855fcb#egg=pyonyphe
|
||||||
|
-e git+https://github.com/stricaud/faup.git#egg=pyfaup&subdirectory=src/lib/bindings/python
|
||||||
|
aiohttp==3.4.4
|
||||||
|
antlr4-python3-runtime==4.8 ; python_version >= '3'
|
||||||
apiosintds==1.8.3
|
apiosintds==1.8.3
|
||||||
appdirs==1.4.4
|
|
||||||
argparse==1.4.0
|
argparse==1.4.0
|
||||||
assemblyline-client==4.3.5
|
assemblyline-client==3.7.3
|
||||||
async-timeout==4.0.2; python_version >= '3.6'
|
async-timeout==3.0.1
|
||||||
asynctest==0.13.0; python_version < '3.8'
|
attrs==19.3.0
|
||||||
attrs==21.4.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
|
||||||
backoff==1.11.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
|
||||||
backports.zoneinfo==0.2.1; python_version < '3.9'
|
|
||||||
backscatter==0.2.4
|
backscatter==0.2.4
|
||||||
beautifulsoup4==4.11.1
|
beautifulsoup4==4.8.2
|
||||||
bidict==0.22.0; python_version >= '3.7'
|
|
||||||
blockchain==1.4.4
|
blockchain==1.4.4
|
||||||
censys==2.1.3
|
censys==0.0.8
|
||||||
certifi==2021.10.8
|
certifi==2019.11.28
|
||||||
cffi==1.15.0
|
cffi==1.14.0
|
||||||
chardet==4.0.0
|
chardet==3.0.4
|
||||||
charset-normalizer==2.0.12; python_version >= '3'
|
|
||||||
clamd==1.0.2
|
|
||||||
click-plugins==1.1.1
|
click-plugins==1.1.1
|
||||||
click==8.1.2; python_version >= '3.7'
|
click==7.1.1
|
||||||
colorama==0.4.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
colorama==0.4.3
|
||||||
colorclass==2.2.2; python_version >= '2.6'
|
cryptography==2.8
|
||||||
commonmark==0.9.1
|
decorator==4.4.2
|
||||||
compressed-rtf==1.0.6
|
deprecated==1.2.7
|
||||||
configparser==5.2.0; python_version >= '3.6'
|
dnspython==1.16.0
|
||||||
crowdstrike-falconpy==1.0.8
|
domaintools-api==0.3.3
|
||||||
cryptography==36.0.2; python_version >= '3.6'
|
|
||||||
decorator==5.1.1; python_version >= '3.5'
|
|
||||||
deprecated==1.2.13; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
|
||||||
dnsdb2==1.1.4
|
|
||||||
dnspython==2.2.1
|
|
||||||
domaintools-api==0.6.2
|
|
||||||
easygui==0.98.3
|
|
||||||
ebcdic==1.1.1
|
|
||||||
enum-compat==0.0.3
|
enum-compat==0.0.3
|
||||||
extract-msg==0.30.10
|
ez-setup==0.9
|
||||||
ezodf==0.3.2
|
ezodf==0.3.2
|
||||||
filelock==3.6.0; python_version >= '3.7'
|
future==0.18.2
|
||||||
frozenlist==1.3.0; python_version >= '3.7'
|
futures==3.1.1
|
||||||
future==0.18.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
geoip2==3.0.0
|
||||||
geoip2==4.5.0
|
httplib2==0.17.0
|
||||||
git+https://github.com/D4-project/BGP-Ranking.git/@68de39f6c5196f796055c1ac34504054d688aa59#egg=pybgpranking&subdirectory=client
|
idna-ssl==1.1.0 ; python_version < '3.7'
|
||||||
git+https://github.com/D4-project/IPASN-History.git/@a2853c39265cecdd0c0d16850bd34621c0551b87#egg=pyipasnhistory&subdirectory=client
|
idna==2.9
|
||||||
git+https://github.com/MISP/PyIntel471.git@917272fafa8e12102329faca52173e90c5256968#egg=pyintel471
|
importlib-metadata==1.6.0 ; python_version < '3.8'
|
||||||
git+https://github.com/SteveClement/trustar-python.git@6954eae38e0c77eaeef26084b6c5fd033925c1c7#egg=trustar
|
isodate==0.6.0
|
||||||
git+https://github.com/cartertemm/ODTReader.git/@49d6938693f6faa3ff09998f86dba551ae3a996b#egg=odtreader
|
jbxapi==3.4.0
|
||||||
git+https://github.com/sebdraven/pydnstrails@48c1f740025c51289f43a24863d1845ff12fd21a#egg=pydnstrails
|
jsonschema==3.2.0
|
||||||
git+https://github.com/sebdraven/pyonyphe@49381beb41c61c90d8997ad2d04868977411bbcc#egg=pyonyphe
|
lief==0.10.1
|
||||||
httplib2==0.20.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
lxml==4.6.4
|
||||||
idna-ssl==1.1.0; python_version < '3.7'
|
|
||||||
idna==3.3; python_version >= '3'
|
|
||||||
imapclient==2.2.0
|
|
||||||
importlib-metadata==4.11.3; python_version < '3.8'
|
|
||||||
importlib-resources==5.6.0; python_version < '3.9'
|
|
||||||
isodate==0.6.1
|
|
||||||
itsdangerous==2.1.2; python_version >= '3.7'
|
|
||||||
jbxapi==3.17.2
|
|
||||||
jeepney==0.8.0; sys_platform == 'linux'
|
|
||||||
json-log-formatter==0.5.1
|
|
||||||
jsonschema<5.0.0, >=4.5.1; python_version >= '3.7'
|
|
||||||
keyring==23.5.0; python_version >= '3.7'
|
|
||||||
lark-parser==0.12.0
|
|
||||||
lief<0.12.0, >=0.11.5
|
|
||||||
lxml==4.8.0
|
|
||||||
maclookup==1.0.3
|
maclookup==1.0.3
|
||||||
markdownify==0.5.3
|
maxminddb==1.5.2
|
||||||
maxminddb==2.2.0; python_version >= '3.6'
|
multidict==4.7.5
|
||||||
more-itertools==8.12.0; python_version >= '3.5'
|
|
||||||
msoffcrypto-tool==5.0.0; python_version >= '3' and platform_python_implementation != 'PyPy' or (platform_system != 'Windows' and platform_system != 'Darwin')
|
|
||||||
multidict==6.0.2; python_version >= '3.7'
|
|
||||||
mwdblib==4.1.0
|
|
||||||
ndjson==0.3.1
|
|
||||||
np==1.0.2
|
np==1.0.2
|
||||||
numpy==1.21.5; python_version < '3.10' and platform_machine != 'aarch64' and platform_machine != 'arm64'
|
numpy==1.21.4
|
||||||
oauth2==1.9.0.post1
|
oauth2==1.9.0.post1
|
||||||
olefile==0.46; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
opencv-python==4.2.0.32
|
||||||
oletools>=0.60
|
pandas-ods-reader==0.1.4
|
||||||
opencv-python==4.5.5.64
|
pandas==1.3.4
|
||||||
packaging==21.3; python_version >= '3.6'
|
passivetotal==1.0.31
|
||||||
pandas-ods-reader==0.1.2
|
pdftotext==2.1.4
|
||||||
pandas==1.3.5
|
pillow==7.0.0
|
||||||
passivetotal==2.5.9
|
progressbar2==3.50.1
|
||||||
pcodedmp==1.2.6
|
psutil==5.7.0
|
||||||
pdftotext==2.2.2
|
pycparser==2.20
|
||||||
pillow==9.1.0
|
pycryptodome==3.9.7
|
||||||
progressbar2==4.0.0; python_version >= '3.7'
|
pycryptodomex==3.9.7
|
||||||
psutil==5.9.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
pydeep==0.4
|
||||||
pycparser==2.21
|
pyeupi==1.0
|
||||||
pycryptodome==3.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
|
||||||
pycryptodomex==3.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
|
||||||
pydeep2==0.5.1
|
|
||||||
pyeupi==1.1
|
|
||||||
pyfaup==1.2
|
|
||||||
pygeoip==0.3.2
|
pygeoip==0.3.2
|
||||||
pygments==2.11.2; python_version >= '3.5'
|
pyopenssl==19.1.0
|
||||||
pymisp[email,fileobjects,openioc,pdfexport,url]==2.4.157
|
pyparsing==2.4.6
|
||||||
pyparsing==2.4.7; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
pypdns==1.5.1
|
||||||
pypdns==1.5.2
|
pypssl==2.1
|
||||||
pypssl==2.2
|
pyrsistent==0.16.0
|
||||||
pyrsistent==0.18.1; python_version >= '3.7'
|
pytesseract==0.3.3
|
||||||
pytesseract==0.3.9
|
python-dateutil==2.8.2
|
||||||
python-baseconv==1.2.2
|
python-docx==0.8.10
|
||||||
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
python-magic==0.4.15
|
||||||
python-docx==0.8.11
|
python-pptx==0.6.18
|
||||||
python-engineio==4.3.1; python_version >= '3.6'
|
python-utils==2.4.0
|
||||||
python-magic==0.4.25
|
pytz==2021.3
|
||||||
python-pptx==0.6.21
|
pyyaml==5.3.1
|
||||||
python-socketio[client]==5.5.2; python_version >= '3.6'
|
pyzbar==0.1.8
|
||||||
python-utils==3.1.0; python_version >= '3.7'
|
pyzipper==0.3.1 ; python_version >= '3.5'
|
||||||
pytz-deprecation-shim==0.1.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
|
rdflib==4.2.2
|
||||||
pytz==2019.3
|
redis==3.4.1
|
||||||
pyyaml==6.0; python_version >= '3.6'
|
reportlab==3.5.42
|
||||||
pyzbar==0.1.9
|
requests-cache==0.5.2
|
||||||
pyzipper==0.3.5; python_version >= '3.5'
|
requests[security]==2.23.0
|
||||||
rdflib==6.1.1; python_version >= '3.7'
|
shodan==1.22.0
|
||||||
redis==4.2.2; python_version >= '3.6'
|
sigmatools==0.16.0
|
||||||
reportlab==3.6.9
|
six==1.16.0
|
||||||
requests-cache==0.6.4; python_version >= '3.6'
|
socketio-client==0.5.6
|
||||||
requests-file==1.5.1
|
soupsieve==2.0
|
||||||
requests[security]==2.27.1
|
sparqlwrapper==1.8.5
|
||||||
rich==12.2.0; python_version < '4.0' and python_full_version >= '3.6.3'
|
stix2-patterns==1.3.0
|
||||||
rtfde==0.0.2
|
tabulate==0.8.7
|
||||||
secretstorage==3.3.1; sys_platform == 'linux'
|
tornado==6.0.4
|
||||||
setuptools==62.1.0; python_version >= '3.7'
|
trustar==0.3.28
|
||||||
shodan==1.27.0
|
url-normalize==1.4.1
|
||||||
sigmatools==0.19.1
|
|
||||||
simplejson==3.17.6; python_version >= '2.5' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
|
||||||
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
|
||||||
socialscan==1.4.2
|
|
||||||
socketio-client==0.5.7.4
|
|
||||||
soupsieve==2.3.2; python_version >= '3.6'
|
|
||||||
sparqlwrapper==2.0.0
|
|
||||||
stix2-patterns==2.0.0
|
|
||||||
stix2==3.0.1
|
|
||||||
tabulate==0.8.9
|
|
||||||
tau-clients==0.2.5
|
|
||||||
taxii2-client==2.3.0
|
|
||||||
tldextract==3.2.0; python_version >= '3.7'
|
|
||||||
tornado==6.1; python_version >= '3.5'
|
|
||||||
tqdm==4.64.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
|
||||||
typing-extensions==4.1.1; python_version < '3.8'
|
|
||||||
tzdata==2022.1; python_version >= '3.6'
|
|
||||||
tzlocal==4.2; python_version >= '3.6'
|
|
||||||
unicodecsv==0.14.1
|
|
||||||
url-normalize==1.4.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
|
|
||||||
urlarchiver==0.2
|
urlarchiver==0.2
|
||||||
urllib3==1.26.9; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'
|
urllib3==1.25.8
|
||||||
validators==0.14.0
|
validators==0.14.0
|
||||||
vt-graph-api==2.0.0
|
vt-graph-api==1.0.1
|
||||||
vt-py==0.14.0
|
vulners==1.5.5
|
||||||
vulners==2.0.2
|
wand==0.5.9
|
||||||
wand==0.6.7
|
websocket-client==0.57.0
|
||||||
websocket-client==1.3.2; python_version >= '3.7'
|
wrapt==1.12.1
|
||||||
wrapt==1.14.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
xlrd==1.2.0
|
||||||
xlrd==2.0.1
|
xlsxwriter==1.2.8
|
||||||
xlsxwriter==3.0.3; python_version >= '3.4'
|
|
||||||
yara-python==3.8.1
|
yara-python==3.8.1
|
||||||
yarl==1.7.2; python_version >= '3.6'
|
yarl==1.4.2
|
||||||
zipp==3.8.0; python_version >= '3.7'
|
zipp==3.1.0
|
||||||
|
|
|
@ -0,0 +1,374 @@
|
||||||
|
## How to add your own MISP modules?
|
||||||
|
|
||||||
|
Create your module in [misp_modules/modules/expansion/](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/expansion/), [misp_modules/modules/export_mod/](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/export_mod/), or [misp_modules/modules/import_mod/](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/import_mod/). The module should have at minimum three functions:
|
||||||
|
|
||||||
|
* **introspection** function that returns a dict of the supported attributes (input and output) by your expansion module.
|
||||||
|
* **handler** function which accepts a JSON document to expand the values and return a dictionary of the expanded values.
|
||||||
|
* **version** function that returns a dict with the version and the associated meta-data including potential configurations required of the module.
|
||||||
|
|
||||||
|
Don't forget to return an error key and value if an error is raised to propagate it to the MISP user-interface.
|
||||||
|
|
||||||
|
Your module's script name should also be added in the `__all__` list of `<module type folder>/__init__.py` in order for it to be loaded.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
...
|
||||||
|
# Checking for required value
|
||||||
|
if not request.get('ip-src'):
|
||||||
|
# Return an error message
|
||||||
|
return {'error': "A source IP is required"}
|
||||||
|
...
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
### introspection
|
||||||
|
|
||||||
|
The function that returns a dict of the supported attributes (input and output) by your expansion module.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
mispattributes = {'input': ['link', 'url'],
|
||||||
|
'output': ['attachment', 'malware-sample']}
|
||||||
|
|
||||||
|
def introspection():
|
||||||
|
return mispattributes
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### version
|
||||||
|
|
||||||
|
The function that returns a dict with the version and the associated meta-data including potential configurations required of the module.
|
||||||
|
|
||||||
|
|
||||||
|
### Additional Configuration Values
|
||||||
|
|
||||||
|
If your module requires additional configuration (to be exposed via the MISP user-interface), you can define those in the moduleconfig value returned by the version function.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
# config fields that your code expects from the site admin
|
||||||
|
moduleconfig = ["apikey", "event_limit"]
|
||||||
|
|
||||||
|
def version():
|
||||||
|
moduleinfo['config'] = moduleconfig
|
||||||
|
return moduleinfo
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
When you do this a config array is added to the meta-data output containing all the potential configuration values:
|
||||||
|
|
||||||
|
~~~
|
||||||
|
"meta": {
|
||||||
|
"description": "PassiveTotal expansion service to expand values with multiple Passive DNS sources",
|
||||||
|
"config": [
|
||||||
|
"username",
|
||||||
|
"password"
|
||||||
|
],
|
||||||
|
"module-type": [
|
||||||
|
"expansion",
|
||||||
|
"hover"
|
||||||
|
],
|
||||||
|
|
||||||
|
...
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
If you want to use the configuration values set in the web interface they are stored in the key `config` in the JSON object passed to the handler.
|
||||||
|
|
||||||
|
~~~
|
||||||
|
def handler(q=False):
|
||||||
|
|
||||||
|
# Check if we were given a configuration
|
||||||
|
config = q.get("config", {})
|
||||||
|
|
||||||
|
# Find out if there is a username field
|
||||||
|
username = config.get("username", None)
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
### handler
|
||||||
|
|
||||||
|
The function which accepts a JSON document to expand the values and return a dictionary of the expanded values.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
def handler(q=False):
|
||||||
|
"Fully functional rot-13 encoder"
|
||||||
|
if q is False:
|
||||||
|
return False
|
||||||
|
request = json.loads(q)
|
||||||
|
src = request.get('ip-src')
|
||||||
|
if src is None:
|
||||||
|
# Return an error message
|
||||||
|
return {'error': "A source IP is required"}
|
||||||
|
else:
|
||||||
|
return {'results':
|
||||||
|
codecs.encode(src, "rot-13")}
|
||||||
|
~~~
|
||||||
|
|
||||||
|
#### export module
|
||||||
|
|
||||||
|
For an export module, the `request["data"]` object corresponds to a list of events (dictionaries) to handle.
|
||||||
|
|
||||||
|
Iterating over events attributes is performed using their `Attribute` key.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
...
|
||||||
|
for event in request["data"]:
|
||||||
|
for attribute in event["Attribute"]:
|
||||||
|
# do stuff w/ attribute['type'], attribute['value'], ...
|
||||||
|
...
|
||||||
|
|
||||||
|
### Returning Binary Data
|
||||||
|
|
||||||
|
If you want to return a file or other data you need to add a data attribute.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
{"results": {"values": "filename.txt",
|
||||||
|
"types": "attachment",
|
||||||
|
"data" : base64.b64encode(<ByteIO>) # base64 encode your data first
|
||||||
|
"comment": "This is an attachment"}}
|
||||||
|
~~~
|
||||||
|
|
||||||
|
If the binary file is malware you can use 'malware-sample' as the type. If you do this the malware sample will be automatically zipped and password protected ('infected') after being uploaded.
|
||||||
|
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
{"results": {"values": "filename.txt",
|
||||||
|
"types": "malware-sample",
|
||||||
|
"data" : base64.b64encode(<ByteIO>) # base64 encode your data first
|
||||||
|
"comment": "This is an attachment"}}
|
||||||
|
~~~
|
||||||
|
|
||||||
|
[To learn more about how data attributes are processed you can read the processing code here.](https://github.com/MISP/PyMISP/blob/4f230c9299ad9d2d1c851148c629b61a94f3f117/pymisp/mispevent.py#L185-L200)
|
||||||
|
|
||||||
|
|
||||||
|
### Module type
|
||||||
|
|
||||||
|
A MISP module can be of four types:
|
||||||
|
|
||||||
|
- **expansion** - service related to an attribute that can be used to extend and update an existing event.
|
||||||
|
- **hover** - service related to an attribute to provide additional information to the users without updating the event.
|
||||||
|
- **import** - service related to importing and parsing an external object that can be used to extend an existing event.
|
||||||
|
- **export** - service related to exporting an object, event, or data.
|
||||||
|
|
||||||
|
module-type is an array where the list of supported types can be added.
|
||||||
|
|
||||||
|
## Testing your modules?
|
||||||
|
|
||||||
|
MISP uses the **modules** function to discover the available MISP modules and their supported MISP attributes:
|
||||||
|
|
||||||
|
~~~
|
||||||
|
% curl -s http://127.0.0.1:6666/modules | jq .
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "passivetotal",
|
||||||
|
"type": "expansion",
|
||||||
|
"mispattributes": {
|
||||||
|
"input": [
|
||||||
|
"hostname",
|
||||||
|
"domain",
|
||||||
|
"ip-src",
|
||||||
|
"ip-dst"
|
||||||
|
],
|
||||||
|
"output": [
|
||||||
|
"ip-src",
|
||||||
|
"ip-dst",
|
||||||
|
"hostname",
|
||||||
|
"domain"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"description": "PassiveTotal expansion service to expand values with multiple Passive DNS sources",
|
||||||
|
"config": [
|
||||||
|
"username",
|
||||||
|
"password"
|
||||||
|
],
|
||||||
|
"author": "Alexandre Dulaunoy",
|
||||||
|
"version": "0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sourcecache",
|
||||||
|
"type": "expansion",
|
||||||
|
"mispattributes": {
|
||||||
|
"input": [
|
||||||
|
"link"
|
||||||
|
],
|
||||||
|
"output": [
|
||||||
|
"link"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"description": "Module to cache web pages of analysis reports, OSINT sources. The module returns a link of the cached page.",
|
||||||
|
"author": "Alexandre Dulaunoy",
|
||||||
|
"version": "0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dns",
|
||||||
|
"type": "expansion",
|
||||||
|
"mispattributes": {
|
||||||
|
"input": [
|
||||||
|
"hostname",
|
||||||
|
"domain"
|
||||||
|
],
|
||||||
|
"output": [
|
||||||
|
"ip-src",
|
||||||
|
"ip-dst"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"description": "Simple DNS expansion service to resolve IP address from MISP attributes",
|
||||||
|
"author": "Alexandre Dulaunoy",
|
||||||
|
"version": "0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
~~~
|
||||||
|
|
||||||
|
The MISP module service returns the available modules in a JSON array containing each module name along with their supported input attributes.
|
||||||
|
|
||||||
|
Based on this information, a query can be built in a JSON format and saved as body.json:
|
||||||
|
|
||||||
|
~~~json
|
||||||
|
{
|
||||||
|
"hostname": "www.foo.be",
|
||||||
|
"module": "dns"
|
||||||
|
}
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Then you can POST this JSON format query towards the MISP object server:
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
curl -s http://127.0.0.1:6666/query -H "Content-Type: application/json" --data @body.json -X POST
|
||||||
|
~~~
|
||||||
|
|
||||||
|
The module should output the following JSON:
|
||||||
|
|
||||||
|
~~~json
|
||||||
|
{
|
||||||
|
"results": [
|
||||||
|
{
|
||||||
|
"types": [
|
||||||
|
"ip-src",
|
||||||
|
"ip-dst"
|
||||||
|
],
|
||||||
|
"values": [
|
||||||
|
"188.65.217.78"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
~~~
|
||||||
|
|
||||||
|
It is also possible to restrict the category options of the resolved attributes by passing a list of categories along (optional):
|
||||||
|
|
||||||
|
~~~json
|
||||||
|
{
|
||||||
|
"results": [
|
||||||
|
{
|
||||||
|
"types": [
|
||||||
|
"ip-src",
|
||||||
|
"ip-dst"
|
||||||
|
],
|
||||||
|
"values": [
|
||||||
|
"188.65.217.78"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"Network activity",
|
||||||
|
"Payload delivery"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
~~~
|
||||||
|
|
||||||
|
For both the type and the category lists, the first item in the list will be the default setting on the interface.
|
||||||
|
|
||||||
|
### Enable your module in the web interface
|
||||||
|
|
||||||
|
For a module to be activated in the MISP web interface it must be enabled in the "Plugin Settings.
|
||||||
|
|
||||||
|
Go to "Administration > Server Settings" in the top menu
|
||||||
|
- Go to "Plugin Settings" in the top "tab menu bar"
|
||||||
|
- Click on the name of the type of module you have created to expand the list of plugins to show your module.
|
||||||
|
- Find the name of your plugin's "enabled" value in the Setting Column.
|
||||||
|
"Plugin.[MODULE NAME]_enabled"
|
||||||
|
- Double click on its "Value" column
|
||||||
|
|
||||||
|
~~~
|
||||||
|
Priority Setting Value Description Error Message
|
||||||
|
Recommended Plugin.Import_ocr_enabled false Enable or disable the ocr module. Value not set.
|
||||||
|
~~~
|
||||||
|
|
||||||
|
- Use the drop-down to set the enabled value to 'true'
|
||||||
|
|
||||||
|
~~~
|
||||||
|
Priority Setting Value Description Error Message
|
||||||
|
Recommended Plugin.Import_ocr_enabled true Enable or disable the ocr module. Value not set.
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### Set any other required settings for your module
|
||||||
|
|
||||||
|
In this same menu set any other plugin settings that are required for testing.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
In order to provide documentation about some modules that require specific input / output / configuration, the [doc](https://github.com/MISP/misp-modules/tree/master/doc) directory contains detailed information about the general purpose, requirements, features, input and output of each of these modules:
|
||||||
|
|
||||||
|
- ***description** - quick description of the general purpose of the module, as the one given by the moduleinfo
|
||||||
|
- **requirements** - special libraries needed to make the module work
|
||||||
|
- **features** - description of the way to use the module, with the required MISP features to make the module give the intended result
|
||||||
|
- **references** - link(s) giving additional information about the format concerned in the module
|
||||||
|
- **input** - description of the format of data used in input
|
||||||
|
- **output** - description of the format given as the result of the module execution
|
||||||
|
|
||||||
|
In addition to the module documentation please add your module to [docs/index.md](https://github.com/MISP/misp-modules/tree/master/docs/index.md).
|
||||||
|
|
||||||
|
There are also [complementary slides](https://www.misp-project.org/misp-training/3.1-misp-modules.pdf) for the creation of MISP modules.
|
||||||
|
|
||||||
|
|
||||||
|
## Tips for developers creating modules
|
||||||
|
|
||||||
|
Download a pre-built virtual image from the [MISP training materials](https://www.circl.lu/services/misp-training-materials/).
|
||||||
|
|
||||||
|
- Create a Host-Only adapter in VirtualBox
|
||||||
|
- Set your Misp OVA to that Host-Only adapter
|
||||||
|
- Start the virtual machine
|
||||||
|
- Get the IP address of the virutal machine
|
||||||
|
- SSH into the machine (Login info on training page)
|
||||||
|
- Go into the misp-modules directory
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
cd /usr/local/src/misp-modules
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Set the git repo to your fork and checkout your development branch. If you SSH'ed in as the misp user you will have to use sudo.
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
sudo git remote set-url origin https://github.com/YourRepo/misp-modules.git
|
||||||
|
sudo git pull
|
||||||
|
sudo git checkout MyModBranch
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Remove the contents of the build directory and re-install misp-modules.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
sudo rm -fr build/*
|
||||||
|
sudo pip3 install --upgrade .
|
||||||
|
~~~
|
||||||
|
|
||||||
|
SSH in with a different terminal and run `misp-modules` with debugging enabled.
|
||||||
|
|
||||||
|
~~~python
|
||||||
|
sudo killall misp-modules
|
||||||
|
misp-modules -d
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
In your original terminal you can now run your tests manually and see any errors that arrive
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
cd tests/
|
||||||
|
curl -s http://127.0.0.1:6666/query -H "Content-Type: application/json" --data @MY_TEST_FILE.json -X POST
|
||||||
|
cd ../
|
||||||
|
~~~
|
|
@ -0,0 +1,192 @@
|
||||||
|
## How to install and start MISP modules (in a Python virtualenv)?
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
SUDO_WWW="sudo -u www-data"
|
||||||
|
|
||||||
|
sudo apt-get install -y \
|
||||||
|
git \
|
||||||
|
libpq5 \
|
||||||
|
libjpeg-dev \
|
||||||
|
tesseract-ocr \
|
||||||
|
libpoppler-cpp-dev \
|
||||||
|
imagemagick virtualenv \
|
||||||
|
libopencv-dev \
|
||||||
|
zbar-tools \
|
||||||
|
libzbar0 \
|
||||||
|
libzbar-dev \
|
||||||
|
libfuzzy-dev \
|
||||||
|
libcaca-dev
|
||||||
|
|
||||||
|
# BEGIN with virtualenv:
|
||||||
|
$SUDO_WWW virtualenv -p python3 /var/www/MISP/venv
|
||||||
|
# END with virtualenv
|
||||||
|
|
||||||
|
cd /usr/local/src/
|
||||||
|
# Ideally you add your user to the staff group and make /usr/local/src group writeable, below follows an example with user misp
|
||||||
|
sudo adduser misp staff
|
||||||
|
sudo chmod 2775 /usr/local/src
|
||||||
|
sudo chown root:staff /usr/local/src
|
||||||
|
git clone https://github.com/MISP/misp-modules.git
|
||||||
|
git clone git://github.com/stricaud/faup.git faup
|
||||||
|
git clone git://github.com/stricaud/gtcaca.git gtcaca
|
||||||
|
|
||||||
|
# Install gtcaca/faup
|
||||||
|
cd gtcaca
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake .. && make
|
||||||
|
sudo make install
|
||||||
|
cd ../../faup
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake .. && make
|
||||||
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
|
||||||
|
cd ../../misp-modules
|
||||||
|
|
||||||
|
# BEGIN with virtualenv:
|
||||||
|
$SUDO_WWW /var/www/MISP/venv/bin/pip install -I -r REQUIREMENTS
|
||||||
|
$SUDO_WWW /var/www/MISP/venv/bin/pip install .
|
||||||
|
# END with virtualenv
|
||||||
|
|
||||||
|
# BEGIN without virtualenv:
|
||||||
|
sudo pip install -I -r REQUIREMENTS
|
||||||
|
sudo pip install .
|
||||||
|
# END without virtualenv
|
||||||
|
|
||||||
|
# Start misp-modules as a service
|
||||||
|
sudo cp etc/systemd/system/misp-modules.service /etc/systemd/system/
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable --now misp-modules
|
||||||
|
/var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 -s & #to start the modules
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
## How to install and start MISP modules on RHEL-based distributions ?
|
||||||
|
|
||||||
|
As of this writing, the official RHEL repositories only contain Ruby 2.0.0 and Ruby 2.1 or higher is required. As such, this guide installs Ruby 2.2 from the SCL repository.
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
SUDO_WWW="sudo -u apache"
|
||||||
|
sudo yum install \
|
||||||
|
rh-ruby22 \
|
||||||
|
openjpeg-devel \
|
||||||
|
rubygem-rouge \
|
||||||
|
rubygem-asciidoctor \
|
||||||
|
zbar-devel \
|
||||||
|
opencv-devel \
|
||||||
|
gcc-c++ \
|
||||||
|
pkgconfig \
|
||||||
|
poppler-cpp-devel \
|
||||||
|
python-devel \
|
||||||
|
redhat-rpm-config
|
||||||
|
cd /usr/local/src/
|
||||||
|
sudo git clone https://github.com/MISP/misp-modules.git
|
||||||
|
cd misp-modules
|
||||||
|
$SUDO_WWW /usr/bin/scl enable rh-python36 "virtualenv -p python3 /var/www/MISP/venv"
|
||||||
|
$SUDO_WWW /var/www/MISP/venv/bin/pip install -U -I -r REQUIREMENTS
|
||||||
|
$SUDO_WWW /var/www/MISP/venv/bin/pip install -U .
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
Create the service file /etc/systemd/system/misp-modules.service :
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
echo "[Unit]
|
||||||
|
Description=MISP's modules
|
||||||
|
After=misp-workers.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=apache
|
||||||
|
Group=apache
|
||||||
|
ExecStart=/usr/bin/scl enable rh-python36 rh-ruby22 '/var/www/MISP/venv/bin/misp-modules –l 127.0.0.1 –s'
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/misp-modules.service
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
The After=misp-workers.service must be changed or removed if you have not created a misp-workers service. Then, enable the misp-modules service and start it:
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable --now misp-modules
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
## How to use an MISP modules Docker container
|
||||||
|
|
||||||
|
### Docker build
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
docker build -t misp-modules \
|
||||||
|
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%d") \
|
||||||
|
docker/
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
### Docker run
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
# Start Redis
|
||||||
|
docker run --rm -d --name=misp-redis redis:alpine
|
||||||
|
# Start MISP-modules
|
||||||
|
docker run \
|
||||||
|
--rm -d --name=misp-modules \
|
||||||
|
-e REDIS_BACKEND=misp-redis \
|
||||||
|
-e REDIS_PORT="6379" \
|
||||||
|
-e REDIS_PW="" \
|
||||||
|
-e REDIS_DATABASE="245" \
|
||||||
|
-e MISP_MODULES_DEBUG="false" \
|
||||||
|
dcso/misp-dockerized-misp-modules
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
### Docker-compose
|
||||||
|
|
||||||
|
~~~~yml
|
||||||
|
services:
|
||||||
|
misp-modules:
|
||||||
|
# https://hub.docker.com/r/dcso/misp-dockerized-misp-modules
|
||||||
|
image: dcso/misp-dockerized-misp-modules:3
|
||||||
|
|
||||||
|
# Local image:
|
||||||
|
#image: misp-modules
|
||||||
|
#build:
|
||||||
|
# context: docker/
|
||||||
|
|
||||||
|
environment:
|
||||||
|
# Redis
|
||||||
|
REDIS_BACKEND: misp-redis
|
||||||
|
REDIS_PORT: "6379"
|
||||||
|
REDIS_DATABASE: "245"
|
||||||
|
# System PROXY (OPTIONAL)
|
||||||
|
http_proxy:
|
||||||
|
https_proxy:
|
||||||
|
no_proxy: 0.0.0.0
|
||||||
|
# Timezone (OPTIONAL)
|
||||||
|
TZ: Europe/Berlin
|
||||||
|
# MISP-Modules (OPTIONAL)
|
||||||
|
MISP_MODULES_DEBUG: "false"
|
||||||
|
# Logging options (OPTIONAL)
|
||||||
|
LOG_SYSLOG_ENABLED: "no"
|
||||||
|
misp-redis:
|
||||||
|
# https://hub.docker.com/_/redis or alternative https://hub.docker.com/r/dcso/misp-dockerized-redis/
|
||||||
|
image: redis:alpine
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
## Install misp-module on an offline instance.
|
||||||
|
First, you need to grab all necessary packages for example like this :
|
||||||
|
|
||||||
|
Use pip wheel to create an archive
|
||||||
|
~~~
|
||||||
|
mkdir misp-modules-offline
|
||||||
|
pip3 wheel -r REQUIREMENTS shodan --wheel-dir=./misp-modules-offline
|
||||||
|
tar -cjvf misp-module-bundeled.tar.bz2 ./misp-modules-offline/*
|
||||||
|
~~~
|
||||||
|
On offline machine :
|
||||||
|
~~~
|
||||||
|
mkdir misp-modules-bundle
|
||||||
|
tar xvf misp-module-bundeled.tar.bz2 -C misp-modules-bundle
|
||||||
|
cd misp-modules-bundle
|
||||||
|
ls -1|while read line; do sudo pip3 install --force-reinstall --ignore-installed --upgrade --no-index --no-deps ${line};done
|
||||||
|
~~~
|
||||||
|
Next you can follow standard install procedure.
|
|
@ -0,0 +1,661 @@
|
||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 171 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 898 B |
After Width: | Height: | Size: 648 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 25 KiB |
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="125px" height="32px" viewBox="0 0 125 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<!-- Generator: Sketch 47 (45396) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>nexthink</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="nexthink" fill-rule="nonzero">
|
||||||
|
<path d="M0,8 C0.7,7.8 1.5,7.6 2.7,7.4 C3.9,7.2 5.3,7.1 6.9,7.1 C8.3,7.1 9.5,7.3 10.4,7.7 C11.3,8.1 11.9,8.7 12.5,9.4 C13.1,10.1 13.5,11 13.7,12 C13.9,13 14,14.1 14,15.3 L14,25.4 L11,25.4 L11,16 C11,14.9 10.9,14 10.8,13.2 C10.7,12.4 10.4,11.8 10.1,11.3 C9.8,10.8 9.3,10.5 8.7,10.2 C8.1,10 7.4,9.9 6.5,9.9 L5.4,9.9 C5.1,10 4.7,10 4.4,10 C4.1,10 3.8,10.1 3.5,10.1 C3.2,10.1 3.1,10.2 3,10.2 L3,25.3 L0,25.3 L0,8 Z" id="Shape" fill="#333333"></path>
|
||||||
|
<path d="M17.5,16.4 C17.5,14.8 17.7,13.6 18.2,12.4 C18.7,11.2 19.3,10.2 20,9.4 C20.8,8.6 21.6,8 22.6,7.6 C23.6,7.2 24.6,7 25.6,7 C28,7 29.9,7.8 31.2,9.3 C32.5,10.8 33.1,13.1 33.1,16.2 L33.1,16.6 L33.1,17.4 L20.9,17.4 C21,19.3 21.6,20.6 22.5,21.6 C23.4,22.6 24.9,23 26.9,23 C28,23 29,22.9 29.7,22.7 C30.5,22.5 31.1,22.3 31.4,22.1 L31.8,24.8 C31.4,25 30.7,25.2 29.7,25.5 C28.7,25.7 27.6,25.8 26.4,25.8 C24.8,25.8 23.5,25.6 22.3,25.1 C21.2,24.6 20.2,24 19.5,23.1 C18.8,22.3 18.2,21.3 17.9,20.1 C17.7,19.1 17.5,17.8 17.5,16.4 L17.5,16.4 Z M29.8,14.4 C29.8,13 29.5,12.1 28.7,11.2 C28,10.3 27,9.8 25.7,9.8 C25,9.8 24.3,9.9 23.8,10.2 C23.2,10.5 22.8,10.9 22.4,11.3 C22,11.8 21.7,12.3 21.5,12.9 C21.3,13.5 21.1,13.8 21.1,14.4 L29.8,14.4 Z" id="Shape" fill="#333333"></path>
|
||||||
|
<path d="M56,7.4 L63,7.4 L63,10.4 L56,10.4 L56,18.4 C56,19.3 56.1,20 56.2,20.6 C56.3,21.2 56.5,21.6 56.8,22 C57.1,22.3 57.4,22.6 57.8,22.7 C58.2,22.8 58.6,22.9 59.2,22.9 C60.2,22.9 61.3,22.8 61.8,22.6 C62.4,22.4 62.8,22.2 63,22.1 L63.6,24.8 C63.3,25 62.7,25.2 61.9,25.4 C61.1,25.6 60.2,25.8 59.1,25.8 C57.9,25.8 56.9,25.6 56.1,25.3 C55.3,25 54.7,24.5 54.2,23.9 C53.7,23.3 53.4,22.5 53.2,21.6 C53,20.7 52.9,19.6 52.9,18.4 L52.9,2.4 L55.9,1.8 L55.9,7.4 L56,7.4 Z" id="Shape" fill="#333333"></path>
|
||||||
|
<path d="M67,25.4 L67,1.2 L70,0.6 L70,7.8 C70.6,7.6 71.2,7.4 71.8,7.3 C72.5,7.2 73.2,7.1 73.8,7.1 C75.2,7.1 76.1,7.3 77.1,7.7 C78,8.1 78.9,8.7 79.4,9.4 C80,10.1 80.4,11 80.6,12 C80.8,13 80.9,14.1 80.9,15.3 L80.9,25.4 L77.9,25.4 L77.9,16 C77.9,14.9 77.8,14 77.7,13.2 C77.6,12.4 77.3,11.8 77,11.3 C76.7,10.8 76.2,10.5 75.6,10.2 C75,10 74.6,9.9 73.7,9.9 C73.4,9.9 72.7,9.9 72.3,10 C71.9,10 71.6,10.1 71.2,10.2 C70.9,10.3 70.6,10.3 70.3,10.4 C70,10.5 69.9,10.5 69.8,10.6 L69.8,25.5 L67,25.5 L67,25.4 Z" id="Shape" fill="#333333"></path>
|
||||||
|
<path d="M86.6,4.2 C86,4.2 85.5,4 85.1,3.6 C84.7,3.2 84.5,2.7 84.5,2.1 C84.5,1.5 84.7,0.9 85.1,0.6 C85.5,0.2 86,0 86.6,0 C87.2,0 87.7,0.2 88.1,0.6 C88.5,1 88.7,1.5 88.7,2.1 C88.7,2.7 88.5,3.3 88.1,3.6 C87.7,4 87.2,4.2 86.6,4.2 L86.6,4.2 Z M88,25.4 L85,25.4 L85,7.4 L88,7.4 L88,25.4 Z" id="Shape" fill="#333333"></path>
|
||||||
|
<path d="M92,8 C92.7,7.8 93.5,7.6 94.7,7.4 C95.9,7.2 96.5,7.1 98.1,7.1 C99.5,7.1 101.2,7.3 102.1,7.7 C103,8.1 103.8,8.7 104.4,9.4 C105,10.1 105.4,11 105.6,12 C105.8,13 105.9,14.1 105.9,15.3 L105.9,25.4 L102.9,25.4 L102.9,16 C102.9,14.9 102.8,14 102.7,13.2 C102.6,12.4 102.3,11.8 102,11.3 C101.7,10.8 101.2,10.5 100.6,10.2 C100,10 98.9,9.9 98,9.9 L97.4,9.9 C97,9.9 96.7,10 96.3,10 C96,10 95.7,10.1 95.5,10.1 C95.2,10.1 95,10.2 94.9,10.2 L94.9,25.3 L91.9,25.3 L91.9,8 L92,8 Z" id="Shape" fill="#333333"></path>
|
||||||
|
<path d="M116.2,15.5 C116.9,16 117.6,16.7 118.4,17.5 C119.2,18.3 119.9,19.1 120.7,20 C121.4,20.9 122.2,21.8 122.8,22.8 C123.5,23.7 124,24.6 124.5,25.4 L120.7,25.4 C120.2,24.6 119.7,23.8 119,22.9 C118.4,22.1 117.7,21.3 117,20.5 C116.3,19.7 115.6,19 114.9,18.4 C114.2,17.8 113.6,17.2 112.9,16.8 L112.9,25.4 L109.9,25.4 L109.9,1.2 L112.9,0.6 L112.9,15 C113.5,14.4 114,13.8 114.7,13.2 C115.4,12.5 116,11.9 116.7,11.2 C117.3,10.5 118,9.9 118.5,9.2 C119.1,8.6 119.6,8 120,7.5 L123.8,7.5 C123.3,8.1 122.7,8.7 122.1,9.4 C121.5,10.1 120.8,10.8 120.2,11.5 C119.5,12.2 118.9,12.9 118.2,13.6 C117.4,14.2 116.8,14.9 116.2,15.5" id="Shape" fill="#333333"></path>
|
||||||
|
<g id="Group" transform="translate(15.000000, 1.000000)" fill="#333333">
|
||||||
|
<path d="M1.7,2.4 C14.8,-0.3 22.7,11.4 29.6,20.6 C32.1,23.9 34.7,26.9 38.5,28.8 C43,31 48.3,30.8 53.1,30.3 C53.9,30.2 56.6,28.9 54.5,29.1 C48.3,29.7 42.4,29.2 37.5,25.1 C33.8,22 31.3,17.6 28.3,14 C25.1,10.1 21.7,6.1 17.5,3.3 C12.9,0.3 7.4,0.2 2.3,1.3 C1.1,1.5 -0.5,2.9 1.7,2.4" id="Shape"></path>
|
||||||
|
<polygon id="Shape" points="23 24.4 19.7 24.4 32.3 6.4 35.6 6.4"></polygon>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 309 KiB |
|
@ -685,6 +685,28 @@ Expansion module to fetch the html content from an url and convert it into markd
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
#### [hyasinsight](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/expansion/hyasinsight.py)
|
||||||
|
|
||||||
|
<img src=logos/hyas.png height=60>
|
||||||
|
|
||||||
|
HYAS Insight integration to MISP provides direct, high volume access to HYAS Insight data. It enables investigators and analysts to understand and defend against cyber adversaries and their infrastructure.
|
||||||
|
- **features**:
|
||||||
|
>This Module takes the IP Address, Domain, URL, Email, Phone Number, MD5, SHA1, Sha256, SHA512 MISP Attributes as input to query the HYAS Insight API.
|
||||||
|
> The results of the HYAS Insight API are than are then returned and parsed into Hyas Insight Objects.
|
||||||
|
>
|
||||||
|
>An API key is required to submit queries to the HYAS Insight API.
|
||||||
|
>
|
||||||
|
- **input**:
|
||||||
|
>A MISP attribute of type IP Address(ip-src, ip-dst), Domain(hostname, domain), Email Address(email, email-src, email-dst, target-email, whois-registrant-email), Phone Number(phone-number, whois-registrant-phone), MDS(md5, x509-fingerprint-md5, ja3-fingerprint-md5, hassh-md5, hasshserver-md5), SHA1(sha1, x509-fingerprint-sha1), SHA256(sha256, x509-fingerprint-sha256), SHA512(sha512)
|
||||||
|
- **output**:
|
||||||
|
>Hyas Insight objects, resulting from the query on the HYAS Insight API.
|
||||||
|
- **references**:
|
||||||
|
>https://www.hyas.com/hyas-insight/
|
||||||
|
- **requirements**:
|
||||||
|
>A HYAS Insight API Key.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
#### [intel471](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/expansion/intel471.py)
|
#### [intel471](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/expansion/intel471.py)
|
||||||
|
|
||||||
<img src=logos/intel471.png height=60>
|
<img src=logos/intel471.png height=60>
|
||||||
|
@ -1606,6 +1628,28 @@ An expansion module to query urlscan.io.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
#### [variotdbs](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/expansion/variotdbs.py)
|
||||||
|
|
||||||
|
<img src=logos/variot.png height=60>
|
||||||
|
|
||||||
|
An expansion module to query the VARIoT db API for more information about a vulnerability.
|
||||||
|
- **features**:
|
||||||
|
>The module takes a vulnerability attribute as input and queries que VARIoT db API to gather additional information.
|
||||||
|
>
|
||||||
|
>The `vuln` endpoint is queried first to look for additional information about the vulnerability itself.
|
||||||
|
>
|
||||||
|
>The `exploits` endpoint is also queried then to look for the information of the potential related exploits, which are parsed and added to the results using the `exploit` object template.
|
||||||
|
- **input**:
|
||||||
|
>Vulnerability attribute.
|
||||||
|
- **output**:
|
||||||
|
>Additional information about the vulnerability, as it is stored on the VARIoT db, about the vulnerability itself, and the potential related exploits.
|
||||||
|
- **references**:
|
||||||
|
>https://www.variotdbs.pl/
|
||||||
|
- **requirements**:
|
||||||
|
>A VARIoT db API key (if you do not want to be limited to 100 queries / day)
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
#### [virustotal](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/expansion/virustotal.py)
|
#### [virustotal](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/expansion/virustotal.py)
|
||||||
|
|
||||||
<img src=logos/virustotal.png height=60>
|
<img src=logos/virustotal.png height=60>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
module_types = ['expansion', 'export_mod', 'import_mod']
|
module_types = ['expansion', 'export_mod', 'import_mod']
|
||||||
titles = ['Expansion Modules', 'Export Modules', 'Import Modules']
|
titles = ['Expansion Modules', 'Export Modules', 'Import Modules']
|
||||||
|
@ -17,6 +18,7 @@ def generate_doc(module_type, root_path, logo_path='logos'):
|
||||||
githubref = f'{githubpath}/{modulename}.py'
|
githubref = f'{githubpath}/{modulename}.py'
|
||||||
markdown.append(f'\n#### [{modulename}]({githubref})\n')
|
markdown.append(f'\n#### [{modulename}]({githubref})\n')
|
||||||
filename = os.path.join(current_path, filename)
|
filename = os.path.join(current_path, filename)
|
||||||
|
print(f'Processing {filename}')
|
||||||
with open(filename, 'rt') as f:
|
with open(filename, 'rt') as f:
|
||||||
definition = json.loads(f.read())
|
definition = json.loads(f.read())
|
||||||
if 'logo' in definition:
|
if 'logo' in definition:
|
||||||
|
|
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 102 KiB |
|
@ -0,0 +1,247 @@
|
||||||
|
|
||||||
|
#### [cef_export](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/cef_export.py)
|
||||||
|
|
||||||
|
Module to export a MISP event in CEF format.
|
||||||
|
- **features**:
|
||||||
|
>The module takes a MISP event in input, to look every attribute. Each attribute matching with some predefined types is then exported in Common Event Format.
|
||||||
|
>Thus, there is no particular feature concerning MISP Events since any event can be exported. However, 4 configuration parameters recognized by CEF format are required and should be provided by users before exporting data: the device vendor, product and version, as well as the default severity of data.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>Common Event Format file
|
||||||
|
- **references**:
|
||||||
|
>https://community.softwaregrp.com/t5/ArcSight-Connectors/ArcSight-Common-Event-Format-CEF-Guide/ta-p/1589306?attachment-id=65537
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [cisco_firesight_manager_ACL_rule_export](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/cisco_firesight_manager_ACL_rule_export.py)
|
||||||
|
|
||||||
|
<img src=../logos/cisco.png height=60>
|
||||||
|
|
||||||
|
Module to export malicious network activity attributes to Cisco fireSIGHT manager block rules.
|
||||||
|
- **features**:
|
||||||
|
>The module goes through the attributes to find all the network activity ones in order to create block rules for the Cisco fireSIGHT manager.
|
||||||
|
- **input**:
|
||||||
|
>Network activity attributes (IPs, URLs).
|
||||||
|
- **output**:
|
||||||
|
>Cisco fireSIGHT manager block rules.
|
||||||
|
- **requirements**:
|
||||||
|
>Firesight manager console credentials
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [defender_endpoint_export](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/defender_endpoint_export.py)
|
||||||
|
|
||||||
|
<img src=../logos/defender_endpoint.png height=60>
|
||||||
|
|
||||||
|
Defender for Endpoint KQL hunting query export module
|
||||||
|
- **features**:
|
||||||
|
>This module export an event as Defender for Endpoint KQL queries that can then be used in your own python3 or Powershell tool. If you are using Microsoft Sentinel, you can directly connect your MISP instance to Sentinel and then create queries using the `ThreatIntelligenceIndicator` table to match events against imported IOC.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>Defender for Endpoint KQL queries
|
||||||
|
- **references**:
|
||||||
|
>https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/advanced-hunting-schema-reference
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [goamlexport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/goamlexport.py)
|
||||||
|
|
||||||
|
<img src=../logos/goAML.jpg height=60>
|
||||||
|
|
||||||
|
This module is used to export MISP events containing transaction objects into GoAML format.
|
||||||
|
- **features**:
|
||||||
|
>The module works as long as there is at least one transaction object in the Event.
|
||||||
|
>
|
||||||
|
>Then in order to have a valid GoAML document, please follow these guidelines:
|
||||||
|
>- For each transaction object, use either a bank-account, person, or legal-entity object to describe the origin of the transaction, and again one of them to describe the target of the transaction.
|
||||||
|
>- Create an object reference for both origin and target objects of the transaction.
|
||||||
|
>- A bank-account object needs a signatory, which is a person object, put as object reference of the bank-account.
|
||||||
|
>- A person can have an address, which is a geolocation object, put as object reference of the person.
|
||||||
|
>
|
||||||
|
>Supported relation types for object references that are recommended for each object are the folowing:
|
||||||
|
>- transaction:
|
||||||
|
> - 'from', 'from_my_client': Origin of the transaction - at least one of them is required.
|
||||||
|
> - 'to', 'to_my_client': Target of the transaction - at least one of them is required.
|
||||||
|
> - 'address': Location of the transaction - optional.
|
||||||
|
>- bank-account:
|
||||||
|
> - 'signatory': Signatory of a bank-account - the reference from bank-account to a signatory is required, but the relation-type is optional at the moment since this reference will always describe a signatory.
|
||||||
|
> - 'entity': Entity owning the bank account - optional.
|
||||||
|
>- person:
|
||||||
|
> - 'address': Address of a person - optional.
|
||||||
|
- **input**:
|
||||||
|
>MISP objects (transaction, bank-account, person, legal-entity, geolocation), with references, describing financial transactions and their origin and target.
|
||||||
|
- **output**:
|
||||||
|
>GoAML format file, describing financial transactions, with their origin and target (bank accounts, persons or entities).
|
||||||
|
- **references**:
|
||||||
|
>http://goaml.unodc.org/
|
||||||
|
- **requirements**:
|
||||||
|
> - PyMISP
|
||||||
|
> - MISP objects
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [liteexport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/liteexport.py)
|
||||||
|
|
||||||
|
Lite export of a MISP event.
|
||||||
|
- **features**:
|
||||||
|
>This module is simply producing a json MISP event format file, but exporting only Attributes from the Event. Thus, MISP Events exported with this module should have attributes that are not internal references, otherwise the resulting event would be empty.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>Lite MISP Event
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [mass_eql_export](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/mass_eql_export.py)
|
||||||
|
|
||||||
|
<img src=../logos/eql.png height=60>
|
||||||
|
|
||||||
|
Mass EQL query export for a MISP event.
|
||||||
|
- **features**:
|
||||||
|
>This module produces EQL queries for all relevant attributes in a MISP event.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>Text file containing one or more EQL queries
|
||||||
|
- **references**:
|
||||||
|
>https://eql.readthedocs.io/en/latest/
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [nexthinkexport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/nexthinkexport.py)
|
||||||
|
|
||||||
|
<img src=../logos/nexthink.svg height=60>
|
||||||
|
|
||||||
|
Nexthink NXQL query export module
|
||||||
|
- **features**:
|
||||||
|
>This module export an event as Nexthink NXQL queries that can then be used in your own python3 tool or from wget/powershell
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>Nexthink NXQL queries
|
||||||
|
- **references**:
|
||||||
|
>https://doc.nexthink.com/Documentation/Nexthink/latest/APIAndIntegrations/IntroducingtheWebAPIV2
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [osqueryexport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/osqueryexport.py)
|
||||||
|
|
||||||
|
<img src=../logos/osquery.png height=60>
|
||||||
|
|
||||||
|
OSQuery export of a MISP event.
|
||||||
|
- **features**:
|
||||||
|
>This module export an event as osquery queries that can be used in packs or in fleet management solution like Kolide.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>osquery SQL queries
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [pdfexport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/pdfexport.py)
|
||||||
|
|
||||||
|
Simple export of a MISP event to PDF.
|
||||||
|
- **features**:
|
||||||
|
>The module takes care of the PDF file building, and work with any MISP Event. Except the requirement of reportlab, used to create the file, there is no special feature concerning the Event. Some parameters can be given through the config dict. 'MISP_base_url_for_dynamic_link' is your MISP URL, to attach an hyperlink to your event on your MISP instance from the PDF. Keep it clear to avoid hyperlinks in the generated pdf.
|
||||||
|
> 'MISP_name_for_metadata' is your CERT or MISP instance name. Used as text in the PDF' metadata
|
||||||
|
> 'Activate_textual_description' is a boolean (True or void) to activate the textual description/header abstract of an event
|
||||||
|
> 'Activate_galaxy_description' is a boolean (True or void) to activate the description of event related galaxies.
|
||||||
|
> 'Activate_related_events' is a boolean (True or void) to activate the description of related event. Be aware this might leak information on confidential events linked to the current event !
|
||||||
|
> 'Activate_internationalization_fonts' is a boolean (True or void) to activate Noto fonts instead of default fonts (Helvetica). This allows the support of CJK alphabet. Be sure to have followed the procedure to download Noto fonts (~70Mo) in the right place (/tools/pdf_fonts/Noto_TTF), to allow PyMisp to find and use them during PDF generation.
|
||||||
|
> 'Custom_fonts_path' is a text (path or void) to the TTF file of your choice, to create the PDF with it. Be aware the PDF won't support bold/italic/special style anymore with this option
|
||||||
|
- **input**:
|
||||||
|
>MISP Event
|
||||||
|
- **output**:
|
||||||
|
>MISP Event in a PDF file.
|
||||||
|
- **references**:
|
||||||
|
>https://acrobat.adobe.com/us/en/acrobat/about-adobe-pdf.html
|
||||||
|
- **requirements**:
|
||||||
|
> - PyMISP
|
||||||
|
> - reportlab
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [testexport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/testexport.py)
|
||||||
|
|
||||||
|
Skeleton export module.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [threatStream_misp_export](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/threatStream_misp_export.py)
|
||||||
|
|
||||||
|
<img src=../logos/threatstream.png height=60>
|
||||||
|
|
||||||
|
Module to export a structured CSV file for uploading to threatStream.
|
||||||
|
- **features**:
|
||||||
|
>The module takes a MISP event in input, to look every attribute. Each attribute matching with some predefined types is then exported in a CSV format recognized by ThreatStream.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>ThreatStream CSV format file
|
||||||
|
- **references**:
|
||||||
|
> - https://www.anomali.com/platform/threatstream
|
||||||
|
> - https://github.com/threatstream
|
||||||
|
- **requirements**:
|
||||||
|
>csv
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [threat_connect_export](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/threat_connect_export.py)
|
||||||
|
|
||||||
|
<img src=../logos/threatconnect.png height=60>
|
||||||
|
|
||||||
|
Module to export a structured CSV file for uploading to ThreatConnect.
|
||||||
|
- **features**:
|
||||||
|
>The module takes a MISP event in input, to look every attribute. Each attribute matching with some predefined types is then exported in a CSV format recognized by ThreatConnect.
|
||||||
|
>Users should then provide, as module configuration, the source of data they export, because it is required by the output format.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **output**:
|
||||||
|
>ThreatConnect CSV format file
|
||||||
|
- **references**:
|
||||||
|
>https://www.threatconnect.com
|
||||||
|
- **requirements**:
|
||||||
|
>csv
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [virustotal_collections](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/virustotal_collections.py)
|
||||||
|
|
||||||
|
<img src=../logos/virustotal.png height=60>
|
||||||
|
|
||||||
|
Creates a VT Collection from an event iocs.
|
||||||
|
- **features**:
|
||||||
|
>This export module which takes advantage of a new endpoint in VT APIv3 to create VT Collections from IOCs contained in a MISP event. With this module users will be able to create a collection just using the Download as... button.
|
||||||
|
- **input**:
|
||||||
|
>A domain, hash (md5, sha1, sha256 or sha512), hostname, url or IP address attribute.
|
||||||
|
- **output**:
|
||||||
|
>A VirusTotal collection in VT.
|
||||||
|
- **references**:
|
||||||
|
> - https://www.virustotal.com/
|
||||||
|
> - https://blog.virustotal.com/2021/11/introducing-virustotal-collections.html
|
||||||
|
- **requirements**:
|
||||||
|
>An access to the VirusTotal API (apikey).
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [vt_graph](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/export_mod/vt_graph.py)
|
||||||
|
|
||||||
|
<img src=../logos/virustotal.png height=60>
|
||||||
|
|
||||||
|
This module is used to create a VirusTotal Graph from a MISP event.
|
||||||
|
- **features**:
|
||||||
|
>The module takes the MISP event as input and queries the VirusTotal Graph API to create a new graph out of the event.
|
||||||
|
>
|
||||||
|
>Once the graph is ready, we get the url of it, which is returned so we can view it on VirusTotal.
|
||||||
|
- **input**:
|
||||||
|
>A MISP event.
|
||||||
|
- **output**:
|
||||||
|
>Link of the VirusTotal Graph created for the event.
|
||||||
|
- **references**:
|
||||||
|
>https://www.virustotal.com/gui/graph-overview
|
||||||
|
- **requirements**:
|
||||||
|
>vt_graph_api, the python library to query the VirusTotal graph API
|
||||||
|
|
||||||
|
-----
|
|
@ -0,0 +1,198 @@
|
||||||
|
|
||||||
|
#### [cof2misp](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/cof2misp.py)
|
||||||
|
|
||||||
|
Passive DNS Common Output Format (COF) MISP importer
|
||||||
|
- **features**:
|
||||||
|
>Takes as input a valid COF file or the output of the dnsdbflex utility and creates MISP objects for the input.
|
||||||
|
- **input**:
|
||||||
|
>Passive DNS output in Common Output Format (COF)
|
||||||
|
- **output**:
|
||||||
|
>MISP objects
|
||||||
|
- **references**:
|
||||||
|
>https://tools.ietf.org/id/draft-dulaunoy-dnsop-passive-dns-cof-08.html
|
||||||
|
- **requirements**:
|
||||||
|
>PyMISP
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [csvimport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/csvimport.py)
|
||||||
|
|
||||||
|
Module to import MISP attributes from a csv file.
|
||||||
|
- **features**:
|
||||||
|
>In order to parse data from a csv file, a header is required to let the module know which column is matching with known attribute fields / MISP types.
|
||||||
|
>
|
||||||
|
>This header either comes from the csv file itself or is part of the configuration of the module and should be filled out in MISP plugin settings, each field separated by COMMAS. Fields that do not match with any type known in MISP or are not MISP attribute fields should be ignored in import, using a space or simply nothing between two separators (example: 'ip-src, , comment, ').
|
||||||
|
>
|
||||||
|
>If the csv file already contains a header that does not start by a '#', you should tick the checkbox 'has_header' to avoid importing it and have potential issues. You can also redefine the header even if it is already contained in the file, by following the rules for headers explained earlier. One reason why you would redefine a header is for instance when you want to skip some fields, or some fields are not valid types.
|
||||||
|
- **input**:
|
||||||
|
>CSV format file.
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **references**:
|
||||||
|
> - https://tools.ietf.org/html/rfc4180
|
||||||
|
> - https://tools.ietf.org/html/rfc7111
|
||||||
|
- **requirements**:
|
||||||
|
>PyMISP
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [cuckooimport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/cuckooimport.py)
|
||||||
|
|
||||||
|
<img src=../logos/cuckoo.png height=60>
|
||||||
|
|
||||||
|
Module to import Cuckoo JSON.
|
||||||
|
- **features**:
|
||||||
|
>The module simply imports MISP Attributes from a Cuckoo JSON format file. There is thus no special feature to make it work.
|
||||||
|
- **input**:
|
||||||
|
>Cuckoo JSON file
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **references**:
|
||||||
|
> - https://cuckoosandbox.org/
|
||||||
|
> - https://github.com/cuckoosandbox/cuckoo
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [email_import](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/email_import.py)
|
||||||
|
|
||||||
|
Module to import emails in MISP.
|
||||||
|
- **features**:
|
||||||
|
>This module can be used to import e-mail text as well as attachments and urls.
|
||||||
|
>3 configuration parameters are then used to unzip attachments, guess zip attachment passwords, and extract urls: set each one of them to True or False to process or not the respective corresponding actions.
|
||||||
|
- **input**:
|
||||||
|
>E-mail file
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [goamlimport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/goamlimport.py)
|
||||||
|
|
||||||
|
<img src=../logos/goAML.jpg height=60>
|
||||||
|
|
||||||
|
Module to import MISP objects about financial transactions from GoAML files.
|
||||||
|
- **features**:
|
||||||
|
>Unlike the GoAML export module, there is here no special feature to import data from GoAML external files, since the module will import MISP Objects with their References on its own, as it is required for the export module to rebuild a valid GoAML document.
|
||||||
|
- **input**:
|
||||||
|
>GoAML format file, describing financial transactions, with their origin and target (bank accounts, persons or entities).
|
||||||
|
- **output**:
|
||||||
|
>MISP objects (transaction, bank-account, person, legal-entity, geolocation), with references, describing financial transactions and their origin and target.
|
||||||
|
- **references**:
|
||||||
|
>http://goaml.unodc.org/
|
||||||
|
- **requirements**:
|
||||||
|
>PyMISP
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [joe_import](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/joe_import.py)
|
||||||
|
|
||||||
|
<img src=../logos/joesandbox.png height=60>
|
||||||
|
|
||||||
|
A module to import data from a Joe Sandbox analysis json report.
|
||||||
|
- **features**:
|
||||||
|
>Module using the new format of modules able to return attributes and objects.
|
||||||
|
>
|
||||||
|
>The module returns the same results as the expansion module [joesandbox_query](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/expansion/joesandbox_query.py) using the submission link of the analysis to get the json report.
|
||||||
|
- **input**:
|
||||||
|
>Json report of a Joe Sandbox analysis.
|
||||||
|
- **output**:
|
||||||
|
>MISP attributes & objects parsed from the analysis report.
|
||||||
|
- **references**:
|
||||||
|
> - https://www.joesecurity.org
|
||||||
|
> - https://www.joesandbox.com/
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [lastline_import](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/lastline_import.py)
|
||||||
|
|
||||||
|
<img src=../logos/lastline.png height=60>
|
||||||
|
|
||||||
|
Deprecation notice: this module will be deprecated by December 2021, please use vmware_nsx module.
|
||||||
|
|
||||||
|
Module to import and parse reports from Lastline analysis links.
|
||||||
|
- **features**:
|
||||||
|
>The module requires a Lastline Portal `username` and `password`.
|
||||||
|
>The module uses the new format and it is able to return MISP attributes and objects.
|
||||||
|
>The module returns the same results as the [lastline_query](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/expansion/lastline_query.py) expansion module.
|
||||||
|
- **input**:
|
||||||
|
>Link to a Lastline analysis.
|
||||||
|
- **output**:
|
||||||
|
>MISP attributes and objects parsed from the analysis report.
|
||||||
|
- **references**:
|
||||||
|
>https://www.lastline.com
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [mispjson](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/mispjson.py)
|
||||||
|
|
||||||
|
Module to import MISP JSON format for merging MISP events.
|
||||||
|
- **features**:
|
||||||
|
>The module simply imports MISP Attributes from an other MISP Event in order to merge events together. There is thus no special feature to make it work.
|
||||||
|
- **input**:
|
||||||
|
>MISP Event
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [ocr](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/ocr.py)
|
||||||
|
|
||||||
|
Optical Character Recognition (OCR) module for MISP.
|
||||||
|
- **features**:
|
||||||
|
>The module tries to recognize some text from an image and import the result as a freetext attribute, there is then no special feature asked to users to make it work.
|
||||||
|
- **input**:
|
||||||
|
>Image
|
||||||
|
- **output**:
|
||||||
|
>freetext MISP attribute
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [openiocimport](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/openiocimport.py)
|
||||||
|
|
||||||
|
Module to import OpenIOC packages.
|
||||||
|
- **features**:
|
||||||
|
>The module imports MISP Attributes from OpenIOC packages, there is then no special feature for users to make it work.
|
||||||
|
- **input**:
|
||||||
|
>OpenIOC packages
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **references**:
|
||||||
|
>https://www.fireeye.com/blog/threat-research/2013/10/openioc-basics.html
|
||||||
|
- **requirements**:
|
||||||
|
>PyMISP
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [threatanalyzer_import](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/threatanalyzer_import.py)
|
||||||
|
|
||||||
|
Module to import ThreatAnalyzer archive.zip / analysis.json files.
|
||||||
|
- **features**:
|
||||||
|
>The module imports MISP Attributes from a ThreatAnalyzer format file. This file can be either ZIP, or JSON format.
|
||||||
|
>There is by the way no special feature for users to make the module work.
|
||||||
|
- **input**:
|
||||||
|
>ThreatAnalyzer format file
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **references**:
|
||||||
|
>https://www.threattrack.com/malware-analysis.aspx
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
#### [vmray_import](https://github.com/MISP/misp-modules/tree/main/misp_modules/modules/import_mod/vmray_import.py)
|
||||||
|
|
||||||
|
<img src=../logos/vmray.png height=60>
|
||||||
|
|
||||||
|
Module to import VMRay (VTI) results.
|
||||||
|
- **features**:
|
||||||
|
>The module imports MISP Attributes from VMRay format, using the VMRay api.
|
||||||
|
>Users should then provide as the module configuration the API Key as well as the server url in order to fetch their data to import.
|
||||||
|
- **input**:
|
||||||
|
>VMRay format
|
||||||
|
- **output**:
|
||||||
|
>MISP Event attributes
|
||||||
|
- **references**:
|
||||||
|
>https://www.vmray.com/
|
||||||
|
- **requirements**:
|
||||||
|
>vmray_rest_api
|
||||||
|
|
||||||
|
-----
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"description": "HYAS Insight integration to MISP provides direct, high volume access to HYAS Insight data. It enables investigators and analysts to understand and defend against cyber adversaries and their infrastructure.",
|
||||||
|
"logo": "hyas.png",
|
||||||
|
"requirements": [
|
||||||
|
"A HYAS Insight API Key."
|
||||||
|
],
|
||||||
|
"input": "A MISP attribute of type IP Address(ip-src, ip-dst), Domain(hostname, domain), Email Address(email, email-src, email-dst, target-email, whois-registrant-email), Phone Number(phone-number, whois-registrant-phone), MDS(md5, x509-fingerprint-md5, ja3-fingerprint-md5, hassh-md5, hasshserver-md5), SHA1(sha1, x509-fingerprint-sha1), SHA256(sha256, x509-fingerprint-sha256), SHA512(sha512)",
|
||||||
|
"output": "Hyas Insight objects, resulting from the query on the HYAS Insight API.",
|
||||||
|
"references": [
|
||||||
|
"https://www.hyas.com/hyas-insight/"
|
||||||
|
],
|
||||||
|
"features": "This Module takes the IP Address, Domain, URL, Email, Phone Number, MD5, SHA1, Sha256, SHA512 MISP Attributes as input to query the HYAS Insight API.\n The results of the HYAS Insight API are than are then returned and parsed into Hyas Insight Objects. \n\nAn API key is required to submit queries to the HYAS Insight API.\n"
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"description": "An expansion module to query the VARIoT db API for more information about a vulnerability.",
|
||||||
|
"logo": "variot.png",
|
||||||
|
"requirements": [
|
||||||
|
"A VARIoT db API key (if you do not want to be limited to 100 queries / day)"
|
||||||
|
],
|
||||||
|
"input": "Vulnerability attribute.",
|
||||||
|
"output": "Additional information about the vulnerability, as it is stored on the VARIoT db, about the vulnerability itself, and the potential related exploits.",
|
||||||
|
"references": [
|
||||||
|
"https://www.variotdbs.pl/"
|
||||||
|
],
|
||||||
|
"features": "The module takes a vulnerability attribute as input and queries que VARIoT db API to gather additional information.\n\nThe `vuln` endpoint is queried first to look for additional information about the vulnerability itself.\n\nThe `exploits` endpoint is also queried then to look for the information of the potential related exploits, which are parsed and added to the results using the `exploit` object template."
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ User=www-data
|
||||||
Group=www-data
|
Group=www-data
|
||||||
WorkingDirectory=/usr/local/src/misp-modules
|
WorkingDirectory=/usr/local/src/misp-modules
|
||||||
Environment="PATH=/var/www/MISP/venv/bin"
|
Environment="PATH=/var/www/MISP/venv/bin"
|
||||||
ExecStart=/var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 -s
|
ExecStart=/var/www/MISP/venv/bin/misp-modules -l 127.0.0.1
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -18,7 +18,8 @@ __all__ = ['cuckoo_submit', 'vmray_submit', 'bgpranking', 'circl_passivedns', 'c
|
||||||
'assemblyline_submit', 'assemblyline_query', 'ransomcoindb', 'malwarebazaar',
|
'assemblyline_submit', 'assemblyline_query', 'ransomcoindb', 'malwarebazaar',
|
||||||
'lastline_query', 'lastline_submit', 'sophoslabs_intelix', 'cytomic_orion', 'censys_enrich',
|
'lastline_query', 'lastline_submit', 'sophoslabs_intelix', 'cytomic_orion', 'censys_enrich',
|
||||||
'trustar_enrich', 'recordedfuture', 'html_to_markdown', 'socialscan', 'passive-ssh',
|
'trustar_enrich', 'recordedfuture', 'html_to_markdown', 'socialscan', 'passive-ssh',
|
||||||
'qintel_qsentry', 'mwdb', 'hashlookup', 'mmdb_lookup', 'ipqs_fraud_and_risk_scoring', 'clamav']
|
'qintel_qsentry', 'mwdb', 'hashlookup', 'mmdb_lookup', 'ipqs_fraud_and_risk_scoring',
|
||||||
|
'clamav', 'jinja_template_rendering','hyasinsight', 'variotdbs']
|
||||||
|
|
||||||
|
|
||||||
minimum_required_fields = ('type', 'uuid', 'value')
|
minimum_required_fields = ('type', 'uuid', 'value')
|
||||||
|
|
|
@ -4,7 +4,7 @@ from . import check_input_attribute, standard_error_message
|
||||||
from pymisp import MISPAttribute, MISPEvent, MISPObject
|
from pymisp import MISPAttribute, MISPEvent, MISPObject
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['domain', 'hostname', 'email', 'email-src', 'email-dst'], 'format': 'misp_standard'}
|
mispattributes = {'input': ['domain', 'hostname', 'email', 'email-src', 'email-dst', 'email-reply-to', 'dns-soa-email', 'target-email', 'whois-registrant-email'], 'format': 'misp_standard'}
|
||||||
moduleinfo = {'version': '0.2', 'author': 'Christian Studer',
|
moduleinfo = {'version': '0.2', 'author': 'Christian Studer',
|
||||||
'description': 'On demand query API for APIVoid.',
|
'description': 'On demand query API for APIVoid.',
|
||||||
'module-type': ['expansion', 'hover']}
|
'module-type': ['expansion', 'hover']}
|
||||||
|
|
|
@ -2,34 +2,70 @@ import json
|
||||||
import requests
|
import requests
|
||||||
from . import check_input_attribute, standard_error_message
|
from . import check_input_attribute, standard_error_message
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from pymisp import MISPEvent, MISPObject
|
from pymisp import MISPAttribute, MISPEvent, MISPObject
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['vulnerability'], 'format': 'misp_standard'}
|
mispattributes = {'input': ['vulnerability'], 'format': 'misp_standard'}
|
||||||
moduleinfo = {'version': '1', 'author': 'Christian Studer',
|
moduleinfo = {'version': '2', 'author': 'Christian Studer',
|
||||||
'description': 'An expansion module to enrich a CVE attribute with the vulnerability information.',
|
'description': 'An expansion module to enrich a CVE attribute with the vulnerability information.',
|
||||||
'module-type': ['expansion', 'hover']}
|
'module-type': ['expansion', 'hover']}
|
||||||
moduleconfig = ["custom_API"]
|
moduleconfig = ["custom_API"]
|
||||||
cveapi_url = 'https://cve.circl.lu/api/cve/'
|
cveapi_url = 'https://cvepremium.circl.lu/api/'
|
||||||
|
|
||||||
|
|
||||||
class VulnerabilityParser():
|
class VulnerabilityParser():
|
||||||
def __init__(self, attribute, vulnerability, api_url):
|
def __init__(self, attribute, api_url):
|
||||||
self.attribute = attribute
|
misp_attribute = MISPAttribute()
|
||||||
self.vulnerability = vulnerability
|
misp_attribute.from_dict(**attribute)
|
||||||
self.api_url = api_url
|
misp_event = MISPEvent()
|
||||||
self.misp_event = MISPEvent()
|
misp_event.add_attribute(**misp_attribute)
|
||||||
self.misp_event.add_attribute(**attribute)
|
self.__misp_attribute = misp_attribute
|
||||||
|
self.__misp_event = misp_event
|
||||||
|
self.__api_url = api_url
|
||||||
self.references = defaultdict(list)
|
self.references = defaultdict(list)
|
||||||
self.capec_features = ('id', 'name', 'summary', 'prerequisites', 'solutions')
|
self.__capec_features = ('id', 'name', 'summary', 'prerequisites', 'solutions')
|
||||||
self.vulnerability_mapping = {
|
self.__vulnerability_mapping = {
|
||||||
'id': 'id', 'summary': 'summary',
|
'id': 'id', 'summary': 'summary',
|
||||||
|
'Modified': 'modified', 'cvss3': 'cvss-score',
|
||||||
|
'cvss3-vector': 'cvss-string'
|
||||||
|
}
|
||||||
|
self.__vulnerability_multiple_mapping = {
|
||||||
'vulnerable_configuration': 'vulnerable-configuration',
|
'vulnerable_configuration': 'vulnerable-configuration',
|
||||||
'vulnerable_configuration_cpe_2_2': 'vulnerable-configuration',
|
'vulnerable_configuration_cpe_2_2': 'vulnerable-configuration',
|
||||||
'Modified': 'modified', 'Published': 'published',
|
'references': 'references'
|
||||||
'references': 'references', 'cvss': 'cvss-score'}
|
}
|
||||||
self.weakness_mapping = {'name': 'name', 'description_summary': 'description',
|
self.__weakness_mapping = {
|
||||||
'status': 'status', 'weaknessabs': 'weakness-abs'}
|
'name': 'name', 'description_summary': 'description',
|
||||||
|
'status': 'status', 'weaknessabs': 'weakness-abs'
|
||||||
|
}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def api_url(self) -> str:
|
||||||
|
return self.__api_url
|
||||||
|
|
||||||
|
@property
|
||||||
|
def capec_features(self) -> tuple:
|
||||||
|
return self.__capec_features
|
||||||
|
|
||||||
|
@property
|
||||||
|
def misp_attribute(self) -> MISPAttribute:
|
||||||
|
return self.__misp_attribute
|
||||||
|
|
||||||
|
@property
|
||||||
|
def misp_event(self) -> MISPEvent:
|
||||||
|
return self.__misp_event
|
||||||
|
|
||||||
|
@property
|
||||||
|
def vulnerability_mapping(self) -> dict:
|
||||||
|
return self.__vulnerability_mapping
|
||||||
|
|
||||||
|
@property
|
||||||
|
def vulnerability_multiple_mapping(self) -> dict:
|
||||||
|
return self.__vulnerability_multiple_mapping
|
||||||
|
|
||||||
|
@property
|
||||||
|
def weakness_mapping(self) -> dict:
|
||||||
|
return self.__weakness_mapping
|
||||||
|
|
||||||
def get_result(self):
|
def get_result(self):
|
||||||
if self.references:
|
if self.references:
|
||||||
|
@ -38,28 +74,26 @@ class VulnerabilityParser():
|
||||||
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
||||||
return {'results': results}
|
return {'results': results}
|
||||||
|
|
||||||
def parse_vulnerability_information(self):
|
def parse_vulnerability_information(self, vulnerability):
|
||||||
vulnerability_object = MISPObject('vulnerability')
|
vulnerability_object = MISPObject('vulnerability')
|
||||||
for feature in ('id', 'summary', 'Modified', 'cvss'):
|
for feature, relation in self.vulnerability_mapping.items():
|
||||||
value = self.vulnerability.get(feature)
|
if vulnerability.get(feature):
|
||||||
if value:
|
vulnerability_object.add_attribute(relation, vulnerability[feature])
|
||||||
vulnerability_object.add_attribute(self.vulnerability_mapping[feature], value)
|
if 'Published' in vulnerability:
|
||||||
if 'Published' in self.vulnerability:
|
vulnerability_object.add_attribute('published', vulnerability['Published'])
|
||||||
vulnerability_object.add_attribute('published', self.vulnerability['Published'])
|
|
||||||
vulnerability_object.add_attribute('state', 'Published')
|
vulnerability_object.add_attribute('state', 'Published')
|
||||||
for feature in ('references', 'vulnerable_configuration', 'vulnerable_configuration_cpe_2_2'):
|
for feature, relation in self.vulnerability_multiple_mapping.items():
|
||||||
if feature in self.vulnerability:
|
if feature in vulnerability:
|
||||||
relation = self.vulnerability_mapping[feature]
|
for value in vulnerability[feature]:
|
||||||
for value in self.vulnerability[feature]:
|
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
value = value['title']
|
value = value['title']
|
||||||
vulnerability_object.add_attribute(relation, value)
|
vulnerability_object.add_attribute(relation, value)
|
||||||
vulnerability_object.add_reference(self.attribute['uuid'], 'related-to')
|
vulnerability_object.add_reference(self.misp_attribute.uuid, 'related-to')
|
||||||
self.misp_event.add_object(vulnerability_object)
|
self.misp_event.add_object(vulnerability_object)
|
||||||
if 'cwe' in self.vulnerability and self.vulnerability['cwe'] not in ('Unknown', 'NVD-CWE-noinfo'):
|
if 'cwe' in vulnerability and vulnerability['cwe'] not in ('Unknown', 'NVD-CWE-noinfo'):
|
||||||
self.__parse_weakness(vulnerability_object.uuid)
|
self.__parse_weakness(vulnerability['cwe'], vulnerability_object.uuid)
|
||||||
if 'capec' in self.vulnerability:
|
if 'capec' in vulnerability:
|
||||||
self.__parse_capec(vulnerability_object.uuid)
|
self.__parse_capec(vulnerability['capec'], vulnerability_object.uuid)
|
||||||
|
|
||||||
def __build_references(self):
|
def __build_references(self):
|
||||||
for object_uuid, references in self.references.items():
|
for object_uuid, references in self.references.items():
|
||||||
|
@ -69,8 +103,8 @@ class VulnerabilityParser():
|
||||||
misp_object.add_reference(**reference)
|
misp_object.add_reference(**reference)
|
||||||
break
|
break
|
||||||
|
|
||||||
def __parse_capec(self, vulnerability_uuid):
|
def __parse_capec(self, capec_values, vulnerability_uuid):
|
||||||
for capec in self.vulnerability['capec']:
|
for capec in capec_values:
|
||||||
capec_object = MISPObject('attack-pattern')
|
capec_object = MISPObject('attack-pattern')
|
||||||
for feature in self.capec_features:
|
for feature in self.capec_features:
|
||||||
capec_object.add_attribute(feature, capec[feature])
|
capec_object.add_attribute(feature, capec[feature])
|
||||||
|
@ -84,29 +118,27 @@ class VulnerabilityParser():
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
def __parse_weakness(self, vulnerability_uuid):
|
def __parse_weakness(self, cwe_value, vulnerability_uuid):
|
||||||
cwe_string, cwe_id = self.vulnerability['cwe'].split('-')[:2]
|
cwe_string, cwe_id = cwe_value.split('-')[:2]
|
||||||
cwes = requests.get(self.api_url.replace('/cve/', '/cwe'))
|
cwe = requests.get(f'{self.api_url}cwe/{cwe_id}')
|
||||||
if cwes.status_code == 200:
|
if cwe.status_code == 200:
|
||||||
for cwe in cwes.json():
|
cwe = cwe.json()
|
||||||
if cwe['id'] == cwe_id:
|
weakness_object = MISPObject('weakness')
|
||||||
weakness_object = MISPObject('weakness')
|
weakness_object.add_attribute('id', f'{cwe_string}-{cwe_id}')
|
||||||
weakness_object.add_attribute('id', f'{cwe_string}-{cwe_id}')
|
for feature, relation in self.weakness_mapping.items():
|
||||||
for feature, relation in self.weakness_mapping.items():
|
if cwe.get(feature):
|
||||||
if cwe.get(feature):
|
weakness_object.add_attribute(relation, cwe[feature])
|
||||||
weakness_object.add_attribute(relation, cwe[feature])
|
self.misp_event.add_object(weakness_object)
|
||||||
self.misp_event.add_object(weakness_object)
|
self.references[vulnerability_uuid].append(
|
||||||
self.references[vulnerability_uuid].append(
|
{
|
||||||
{
|
'referenced_uuid': weakness_object.uuid,
|
||||||
'referenced_uuid': weakness_object.uuid,
|
'relationship_type': 'weakened-by'
|
||||||
'relationship_type': 'weakened-by'
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
break
|
|
||||||
|
|
||||||
|
|
||||||
def check_url(url):
|
def check_url(url):
|
||||||
return "{}/".format(url) if not url.endswith('/') else url
|
return f"{url}/" if not url.endswith('/') else url
|
||||||
|
|
||||||
|
|
||||||
def handler(q=False):
|
def handler(q=False):
|
||||||
|
@ -119,8 +151,8 @@ def handler(q=False):
|
||||||
if attribute.get('type') != 'vulnerability':
|
if attribute.get('type') != 'vulnerability':
|
||||||
misperrors['error'] = 'Vulnerability id missing.'
|
misperrors['error'] = 'Vulnerability id missing.'
|
||||||
return misperrors
|
return misperrors
|
||||||
api_url = check_url(request['config']['custom_API']) if request['config'].get('custom_API') else cveapi_url
|
api_url = check_url(request['config']['custom_API']) if request.get('config', {}).get('custom_API') else cveapi_url
|
||||||
r = requests.get("{}{}".format(api_url, attribute['value']))
|
r = requests.get(f"{api_url}cve/{attribute['value']}")
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
vulnerability = r.json()
|
vulnerability = r.json()
|
||||||
if not vulnerability:
|
if not vulnerability:
|
||||||
|
@ -129,8 +161,8 @@ def handler(q=False):
|
||||||
else:
|
else:
|
||||||
misperrors['error'] = 'API not accessible'
|
misperrors['error'] = 'API not accessible'
|
||||||
return misperrors['error']
|
return misperrors['error']
|
||||||
parser = VulnerabilityParser(attribute, vulnerability, api_url)
|
parser = VulnerabilityParser(attribute, api_url)
|
||||||
parser.parse_vulnerability_information()
|
parser.parse_vulnerability_information(vulnerability)
|
||||||
return parser.get_result()
|
return parser.get_result()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ import json
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['md5', 'sha1', 'sha256'], 'output': ['text']}
|
mispattributes = {'input': ['md5'], 'output': ['text']}
|
||||||
moduleinfo = {'version': '0.2', 'author': 'Alexandre Dulaunoy', 'description': 'An expansion module to check hashes against hashdd.com including NSLR dataset.', 'module-type': ['hover']}
|
moduleinfo = {'version': '0.2', 'author': 'Alexandre Dulaunoy', 'description': 'An expansion module to check hashes against hashdd.com including NSLR dataset.', 'module-type': ['hover']}
|
||||||
moduleconfig = []
|
moduleconfig = []
|
||||||
hashddapi_url = 'https://api.hashdd.com/'
|
hashddapi_url = 'https://api.hashdd.com/v1/knownlevel/nsrl/'
|
||||||
|
|
||||||
|
|
||||||
def handler(q=False):
|
def handler(q=False):
|
||||||
|
@ -20,10 +20,10 @@ def handler(q=False):
|
||||||
if v is None:
|
if v is None:
|
||||||
misperrors['error'] = 'Hash value is missing.'
|
misperrors['error'] = 'Hash value is missing.'
|
||||||
return misperrors
|
return misperrors
|
||||||
r = requests.post(hashddapi_url, data={'hash': v})
|
r = requests.get(hashddapi_url + v)
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
state = json.loads(r.text)
|
state = json.loads(r.text)
|
||||||
summary = state[v]['known_level'] if state and state.get(v) else 'Unknown hash'
|
summary = state['knownlevel'] if state and state['result'] == "SUCCESS" else state['message']
|
||||||
else:
|
else:
|
||||||
misperrors['error'] = '{} API not accessible'.format(hashddapi_url)
|
misperrors['error'] = '{} API not accessible'.format(hashddapi_url)
|
||||||
return misperrors['error']
|
return misperrors['error']
|
||||||
|
|
|
@ -0,0 +1,873 @@
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
|
from typing import Dict, List, Any
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import re
|
||||||
|
from requests.exceptions import (
|
||||||
|
HTTPError,
|
||||||
|
ProxyError,
|
||||||
|
InvalidURL,
|
||||||
|
ConnectTimeout
|
||||||
|
)
|
||||||
|
from . import check_input_attribute, standard_error_message
|
||||||
|
from pymisp import MISPEvent, MISPObject, Distribution
|
||||||
|
|
||||||
|
ip_query_input_type = [
|
||||||
|
'ip-src',
|
||||||
|
'ip-dst'
|
||||||
|
]
|
||||||
|
domain_query_input_type = [
|
||||||
|
'hostname',
|
||||||
|
'domain'
|
||||||
|
]
|
||||||
|
email_query_input_type = [
|
||||||
|
'email',
|
||||||
|
'email-src',
|
||||||
|
'email-dst',
|
||||||
|
'target-email',
|
||||||
|
'whois-registrant-email'
|
||||||
|
]
|
||||||
|
phone_query_input_type = [
|
||||||
|
'phone-number',
|
||||||
|
'whois-registrant-phone'
|
||||||
|
]
|
||||||
|
|
||||||
|
md5_query_input_type = [
|
||||||
|
'md5',
|
||||||
|
'x509-fingerprint-md5',
|
||||||
|
'ja3-fingerprint-md5',
|
||||||
|
'hassh-md5',
|
||||||
|
'hasshserver-md5'
|
||||||
|
]
|
||||||
|
|
||||||
|
sha1_query_input_type = [
|
||||||
|
'sha1',
|
||||||
|
'x509-fingerprint-sha1'
|
||||||
|
]
|
||||||
|
|
||||||
|
sha256_query_input_type = [
|
||||||
|
'sha256',
|
||||||
|
'x509-fingerprint-sha256'
|
||||||
|
]
|
||||||
|
|
||||||
|
sha512_query_input_type = [
|
||||||
|
'sha512'
|
||||||
|
]
|
||||||
|
|
||||||
|
misperrors = {
|
||||||
|
'error': 'Error'
|
||||||
|
}
|
||||||
|
mispattributes = {
|
||||||
|
'input': ip_query_input_type + domain_query_input_type + email_query_input_type + phone_query_input_type
|
||||||
|
+ md5_query_input_type + sha1_query_input_type + sha256_query_input_type + sha512_query_input_type,
|
||||||
|
'format': 'misp_standard'
|
||||||
|
}
|
||||||
|
|
||||||
|
moduleinfo = {
|
||||||
|
'version': '0.1',
|
||||||
|
'author': 'Mike Champ',
|
||||||
|
'description': '',
|
||||||
|
'module-type': ['expansion', 'hover']
|
||||||
|
}
|
||||||
|
moduleconfig = ['apikey']
|
||||||
|
TIMEOUT = 60
|
||||||
|
logger = logging.getLogger('hyasinsight')
|
||||||
|
logger.setLevel(logging.DEBUG)
|
||||||
|
HYAS_API_BASE_URL = 'https://insight.hyas.com/api/ext/'
|
||||||
|
WHOIS_CURRENT_BASE_URL = 'https://api.hyas.com/'
|
||||||
|
DEFAULT_DISTRIBUTION_SETTING = Distribution.your_organisation_only.value
|
||||||
|
IPV4_REGEX = r'\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b([^\/]|$)'
|
||||||
|
IPV6_REGEX = r'\b(?:(?:[0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:(?:(:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\b' # noqa: E501
|
||||||
|
# Enrichment Types
|
||||||
|
# HYAS API endpoints
|
||||||
|
PASSIVE_DNS_ENDPOINT = 'passivedns'
|
||||||
|
DYNAMIC_DNS_ENDPOINT = 'dynamicdns'
|
||||||
|
PASSIVE_HASH_ENDPOINT = 'passivehash'
|
||||||
|
SINKHOLE_ENDPOINT = 'sinkhole'
|
||||||
|
SSL_CERTIFICATE_ENDPOINT = 'ssl_certificate'
|
||||||
|
DEVICE_GEO_ENDPOINT = 'device_geo'
|
||||||
|
WHOIS_HISTORIC_ENDPOINT = 'whois'
|
||||||
|
WHOIS_CURRENT_ENDPOINT = 'whois/v1'
|
||||||
|
MALWARE_RECORDS_ENDPOINT = 'sample'
|
||||||
|
MALWARE_INFORMATION_ENDPOINT = 'sample/information'
|
||||||
|
C2ATTRIBUTION_ENDPOINT = 'c2attribution'
|
||||||
|
OPEN_SOURCE_INDICATORS_ENDPOINT = 'os_indicators'
|
||||||
|
|
||||||
|
# HYAS API endpoint params
|
||||||
|
DOMAIN_PARAM = 'domain'
|
||||||
|
IP_PARAM = 'ip'
|
||||||
|
IPV4_PARAM = 'ipv4'
|
||||||
|
IPV6_PARAM = 'ipv6'
|
||||||
|
EMAIL_PARAM = 'email'
|
||||||
|
PHONE_PARAM = 'phone'
|
||||||
|
MD5_PARAM = 'md5'
|
||||||
|
SHA256_PARAM = 'sha256'
|
||||||
|
SHA512_PARAM = 'sha512'
|
||||||
|
HASH_PARAM = 'hash'
|
||||||
|
SHA1_PARAM = 'sha1'
|
||||||
|
|
||||||
|
HYAS_IP_ENRICHMENT_ENDPOINTS_LIST = [DYNAMIC_DNS_ENDPOINT, PASSIVE_DNS_ENDPOINT, PASSIVE_HASH_ENDPOINT,
|
||||||
|
SINKHOLE_ENDPOINT,
|
||||||
|
SSL_CERTIFICATE_ENDPOINT, DEVICE_GEO_ENDPOINT, C2ATTRIBUTION_ENDPOINT,
|
||||||
|
MALWARE_RECORDS_ENDPOINT, OPEN_SOURCE_INDICATORS_ENDPOINT]
|
||||||
|
HYAS_DOMAIN_ENRICHMENT_ENDPOINTS_LIST = [PASSIVE_DNS_ENDPOINT, DYNAMIC_DNS_ENDPOINT, WHOIS_HISTORIC_ENDPOINT,
|
||||||
|
MALWARE_RECORDS_ENDPOINT, WHOIS_CURRENT_ENDPOINT, PASSIVE_HASH_ENDPOINT,
|
||||||
|
C2ATTRIBUTION_ENDPOINT, SSL_CERTIFICATE_ENDPOINT,
|
||||||
|
OPEN_SOURCE_INDICATORS_ENDPOINT]
|
||||||
|
HYAS_EMAIL_ENRICHMENT_ENDPOINTS_LIST = [DYNAMIC_DNS_ENDPOINT, WHOIS_HISTORIC_ENDPOINT, C2ATTRIBUTION_ENDPOINT]
|
||||||
|
HYAS_PHONE_ENRICHMENT_ENDPOINTS_LIST = [WHOIS_HISTORIC_ENDPOINT]
|
||||||
|
HYAS_SHA1_ENRICHMENT_ENDPOINTS_LIST = [SSL_CERTIFICATE_ENDPOINT, MALWARE_INFORMATION_ENDPOINT,
|
||||||
|
OPEN_SOURCE_INDICATORS_ENDPOINT]
|
||||||
|
HYAS_SHA256_ENRICHMENT_ENDPOINTS_LIST = [C2ATTRIBUTION_ENDPOINT, MALWARE_INFORMATION_ENDPOINT,
|
||||||
|
OPEN_SOURCE_INDICATORS_ENDPOINT]
|
||||||
|
HYAS_SHA512_ENRICHMENT_ENDPOINTS_LIST = [MALWARE_INFORMATION_ENDPOINT]
|
||||||
|
HYAS_MD5_ENRICHMENT_ENDPOINTS_LIST = [MALWARE_RECORDS_ENDPOINT, MALWARE_INFORMATION_ENDPOINT,
|
||||||
|
OPEN_SOURCE_INDICATORS_ENDPOINT]
|
||||||
|
|
||||||
|
HYAS_OBJECT_NAMES = {
|
||||||
|
DYNAMIC_DNS_ENDPOINT: "Dynamic DNS Information",
|
||||||
|
PASSIVE_HASH_ENDPOINT: "Passive Hash Information",
|
||||||
|
SINKHOLE_ENDPOINT: "Sinkhole Information",
|
||||||
|
SSL_CERTIFICATE_ENDPOINT: "SSL Certificate Information",
|
||||||
|
DEVICE_GEO_ENDPOINT: "Mobile Geolocation Information",
|
||||||
|
C2ATTRIBUTION_ENDPOINT: "C2 Attribution Information",
|
||||||
|
PASSIVE_DNS_ENDPOINT: "Passive DNS Information",
|
||||||
|
WHOIS_HISTORIC_ENDPOINT: "Whois Related Information",
|
||||||
|
WHOIS_CURRENT_ENDPOINT: "Whois Current Related Information",
|
||||||
|
MALWARE_INFORMATION_ENDPOINT: "Malware Sample Information",
|
||||||
|
OPEN_SOURCE_INDICATORS_ENDPOINT: "Open Source Intel for malware, ssl certificates and other indicators Information",
|
||||||
|
MALWARE_RECORDS_ENDPOINT: "Malware Sample Records Information"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def parse_attribute(comment, feature, value):
|
||||||
|
"""Generic Method for parsing the attributes in the object"""
|
||||||
|
attribute = {
|
||||||
|
'type': 'text',
|
||||||
|
'value': value,
|
||||||
|
'comment': comment,
|
||||||
|
'distribution': DEFAULT_DISTRIBUTION_SETTING,
|
||||||
|
'object_relation': feature
|
||||||
|
}
|
||||||
|
return attribute
|
||||||
|
|
||||||
|
|
||||||
|
def misp_object(endpoint, attribute_value):
|
||||||
|
object_name = HYAS_OBJECT_NAMES[endpoint]
|
||||||
|
hyas_object = MISPObject(object_name)
|
||||||
|
hyas_object.distribution = DEFAULT_DISTRIBUTION_SETTING
|
||||||
|
hyas_object.template_uuid = "d69d3d15-7b4d-49b1-9e0a-bb29f3d421d9"
|
||||||
|
hyas_object.template_id = "1"
|
||||||
|
hyas_object.description = "HYAS INSIGHT " + object_name
|
||||||
|
hyas_object.comment = "HYAS INSIGHT " + object_name + " for " + attribute_value
|
||||||
|
setattr(hyas_object, 'meta-category', 'network')
|
||||||
|
description = (
|
||||||
|
"An object containing the enriched attribute and "
|
||||||
|
"related entities from HYAS Insight."
|
||||||
|
)
|
||||||
|
hyas_object.from_dict(
|
||||||
|
**{"meta-category": "misc", "description": description,
|
||||||
|
"distribution": DEFAULT_DISTRIBUTION_SETTING}
|
||||||
|
)
|
||||||
|
return hyas_object
|
||||||
|
|
||||||
|
|
||||||
|
def flatten_json(y: Dict) -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
:param y: raw_response from HYAS api
|
||||||
|
:return: Flatten json response
|
||||||
|
"""
|
||||||
|
out = {}
|
||||||
|
|
||||||
|
def flatten(x, name=''):
|
||||||
|
# If the Nested key-value
|
||||||
|
# pair is of dict type
|
||||||
|
if type(x) is dict:
|
||||||
|
for a in x:
|
||||||
|
flatten(x[a], name + a + '_')
|
||||||
|
else:
|
||||||
|
out[name[:-1]] = x
|
||||||
|
|
||||||
|
flatten(y)
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def get_flatten_json_response(raw_api_response: List[Dict]) -> List[Dict]:
|
||||||
|
"""
|
||||||
|
:param raw_api_response: raw_api response from the API
|
||||||
|
:return: Flatten Json response
|
||||||
|
"""
|
||||||
|
flatten_json_response = []
|
||||||
|
if raw_api_response:
|
||||||
|
for obj in raw_api_response:
|
||||||
|
flatten_json_response.append(flatten_json(obj))
|
||||||
|
|
||||||
|
return flatten_json_response
|
||||||
|
|
||||||
|
|
||||||
|
def request_body(query_input, query_param, current):
|
||||||
|
"""
|
||||||
|
This Method returns the request body for specific endpoint.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if current:
|
||||||
|
return {
|
||||||
|
"applied_filters": {
|
||||||
|
query_input: query_param,
|
||||||
|
"current": True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
return {
|
||||||
|
"applied_filters": {
|
||||||
|
query_input: query_param
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def malware_info_lookup_to_markdown(results: Dict) -> list:
|
||||||
|
scan_results = results.get('scan_results', [])
|
||||||
|
out = []
|
||||||
|
if scan_results:
|
||||||
|
for res in scan_results:
|
||||||
|
malware_info_data = {
|
||||||
|
"avscan_score": results.get(
|
||||||
|
"avscan_score", ''),
|
||||||
|
"md5": results.get("md5", ''),
|
||||||
|
'av_name': res.get(
|
||||||
|
"av_name", ''),
|
||||||
|
'def_time': res.get(
|
||||||
|
"def_time", ''),
|
||||||
|
'threat_found': res.get(
|
||||||
|
'threat_found', ''),
|
||||||
|
'scan_time': results.get("scan_time", ''),
|
||||||
|
'sha1': results.get('sha1', ''),
|
||||||
|
'sha256': results.get('sha256', ''),
|
||||||
|
'sha512': results.get('sha512', '')
|
||||||
|
}
|
||||||
|
out.append(malware_info_data)
|
||||||
|
else:
|
||||||
|
malware_info_data = {
|
||||||
|
"avscan_score": results.get("avscan_score", ''),
|
||||||
|
"md5": results.get("md5", ''),
|
||||||
|
'av_name': '',
|
||||||
|
'def_time': '',
|
||||||
|
'threat_found': '',
|
||||||
|
'scan_time': results.get("scan_time", ''),
|
||||||
|
'sha1': results.get('sha1', ''),
|
||||||
|
'sha256': results.get('sha256', ''),
|
||||||
|
'sha512': results.get('sha512', '')
|
||||||
|
}
|
||||||
|
out.append(malware_info_data)
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
class RequestHandler:
|
||||||
|
"""A class for handling any outbound requests from this module."""
|
||||||
|
|
||||||
|
def __init__(self, apikey):
|
||||||
|
self.session = requests.Session()
|
||||||
|
self.api_key = apikey
|
||||||
|
|
||||||
|
def get(self, url: str, headers: dict = None, req_body=None) -> requests.Response:
|
||||||
|
"""General post method to fetch the response from HYAS Insight."""
|
||||||
|
response = []
|
||||||
|
try:
|
||||||
|
response = self.session.post(
|
||||||
|
url, headers=headers, json=req_body
|
||||||
|
)
|
||||||
|
if response:
|
||||||
|
response = response.json()
|
||||||
|
except (ConnectTimeout, ProxyError, InvalidURL) as error:
|
||||||
|
msg = "Error connecting with the HYAS Insight."
|
||||||
|
logger.error(f"{msg} Error: {error}")
|
||||||
|
misperrors["error"] = msg
|
||||||
|
return response
|
||||||
|
|
||||||
|
def hyas_lookup(self, end_point: str, query_input, query_param, current=False) -> requests.Response:
|
||||||
|
"""Do a lookup call."""
|
||||||
|
# Building the request
|
||||||
|
if current:
|
||||||
|
url = f'{WHOIS_CURRENT_BASE_URL}{WHOIS_CURRENT_ENDPOINT}'
|
||||||
|
else:
|
||||||
|
url = f'{HYAS_API_BASE_URL}{end_point}'
|
||||||
|
headers = {
|
||||||
|
'Content-type': 'application/json',
|
||||||
|
'X-API-Key': self.api_key,
|
||||||
|
}
|
||||||
|
req_body = request_body(query_input, query_param, current)
|
||||||
|
try:
|
||||||
|
response = self.get(url, headers, req_body)
|
||||||
|
except HTTPError as error:
|
||||||
|
msg = f"Error when requesting data from HYAS Insight. {error.response}: {error.response.reason}"
|
||||||
|
logger.error(msg)
|
||||||
|
misperrors["error"] = msg
|
||||||
|
raise
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
class HyasInsightParser:
|
||||||
|
"""A class for handling the enrichment objects"""
|
||||||
|
|
||||||
|
def __init__(self, attribute):
|
||||||
|
self.attribute = attribute
|
||||||
|
self.misp_event = MISPEvent()
|
||||||
|
self.misp_event.add_attribute(**attribute)
|
||||||
|
|
||||||
|
self.c2_attribution_data_items = [
|
||||||
|
'actor_ipv4',
|
||||||
|
'c2_domain',
|
||||||
|
'c2_ip',
|
||||||
|
'c2_url',
|
||||||
|
'datetime',
|
||||||
|
'email',
|
||||||
|
'email_domain',
|
||||||
|
'referrer_domain',
|
||||||
|
'referrer_ipv4',
|
||||||
|
'referrer_url',
|
||||||
|
'sha256'
|
||||||
|
]
|
||||||
|
self.c2_attribution_data_items_friendly_names = {
|
||||||
|
'actor_ipv4': 'Actor IPv4',
|
||||||
|
'c2_domain': 'C2 Domain',
|
||||||
|
'c2_ip': 'C2 IP',
|
||||||
|
'c2_url': 'C2 URL',
|
||||||
|
'datetime': 'DateTime',
|
||||||
|
'email': 'Email',
|
||||||
|
'email_domain': 'Email Domain',
|
||||||
|
'referrer_domain': 'Referrer Domain',
|
||||||
|
'referrer_ipv4': 'Referrer IPv4',
|
||||||
|
'referrer_url': 'Referrer URL',
|
||||||
|
'sha256': 'SHA256'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.device_geo_data_items = [
|
||||||
|
'datetime',
|
||||||
|
'device_user_agent',
|
||||||
|
'geo_country_alpha_2',
|
||||||
|
'geo_horizontal_accuracy',
|
||||||
|
'ipv4',
|
||||||
|
'ipv6',
|
||||||
|
'latitude',
|
||||||
|
'longitude',
|
||||||
|
'wifi_bssid'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.device_geo_data_items_friendly_names = {
|
||||||
|
'datetime': 'DateTime',
|
||||||
|
'device_user_agent': 'Device User Agent',
|
||||||
|
'geo_country_alpha_2': 'Alpha-2 Code',
|
||||||
|
'geo_horizontal_accuracy': 'GPS Horizontal Accuracy',
|
||||||
|
'ipv4': 'IPv4 Address',
|
||||||
|
'ipv6': 'IPv6 Address',
|
||||||
|
'latitude': 'Latitude',
|
||||||
|
'longitude': 'Longitude',
|
||||||
|
'wifi_bssid': 'WIFI BSSID'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.dynamic_dns_data_items = [
|
||||||
|
'a_record',
|
||||||
|
'account',
|
||||||
|
'created',
|
||||||
|
'created_ip',
|
||||||
|
'domain',
|
||||||
|
'domain_creator_ip',
|
||||||
|
'email',
|
||||||
|
]
|
||||||
|
|
||||||
|
self.dynamic_dns_data_items_friendly_names = {
|
||||||
|
'a_record': 'A Record',
|
||||||
|
'account': 'Account Holder',
|
||||||
|
'created': 'Created Date',
|
||||||
|
'created_ip': 'Account Holder IP Address',
|
||||||
|
'domain': 'Domain',
|
||||||
|
'domain_creator_ip': 'Domain Creator IP Address',
|
||||||
|
'email': 'Email Address',
|
||||||
|
}
|
||||||
|
|
||||||
|
self.os_indicators_data_items = [
|
||||||
|
'context',
|
||||||
|
'datetime',
|
||||||
|
'domain',
|
||||||
|
'domain_2tld',
|
||||||
|
'first_seen',
|
||||||
|
'ipv4',
|
||||||
|
'ipv6',
|
||||||
|
'last_seen',
|
||||||
|
'md5',
|
||||||
|
'sha1',
|
||||||
|
'sha256',
|
||||||
|
'source_name',
|
||||||
|
'source_url',
|
||||||
|
'url'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.os_indicators_data_items_friendly_names = {
|
||||||
|
'context': 'Context',
|
||||||
|
'datetime': 'DateTime',
|
||||||
|
'domain': 'Domain',
|
||||||
|
'domain_2tld': 'Domain 2TLD',
|
||||||
|
'first_seen': 'First Seen',
|
||||||
|
'ipv4': 'IPv4 Address',
|
||||||
|
'ipv6': 'IPv6 Address',
|
||||||
|
'last_seen': 'Last Seen',
|
||||||
|
'md5': 'MD5',
|
||||||
|
'sha1': 'SHA1',
|
||||||
|
'sha256': 'SHA256',
|
||||||
|
'source_name': 'Source Name',
|
||||||
|
'source_url': 'Source URL',
|
||||||
|
'url': 'URL'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.passive_dns_data_items = [
|
||||||
|
'cert_name',
|
||||||
|
'count',
|
||||||
|
'domain',
|
||||||
|
'first_seen',
|
||||||
|
'ip_geo_city_name',
|
||||||
|
'ip_geo_country_iso_code',
|
||||||
|
'ip_geo_country_name',
|
||||||
|
'ip_geo_location_latitude',
|
||||||
|
'ip_geo_location_longitude',
|
||||||
|
'ip_geo_postal_code',
|
||||||
|
'ip_ip',
|
||||||
|
'ip_isp_autonomous_system_number',
|
||||||
|
'ip_isp_autonomous_system_organization',
|
||||||
|
'ip_isp_ip_address',
|
||||||
|
'ip_isp_isp',
|
||||||
|
'ip_isp_organization',
|
||||||
|
'ipv4',
|
||||||
|
'ipv6',
|
||||||
|
'last_seen'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.passive_dns_data_items_friendly_names = {
|
||||||
|
'cert_name': 'Certificate Provider Name',
|
||||||
|
'count': 'Passive DNS Count',
|
||||||
|
'domain': 'Domain',
|
||||||
|
'first_seen': 'First Seen',
|
||||||
|
'ip_geo_city_name': 'IP Organization City',
|
||||||
|
'ip_geo_country_iso_code': 'IP Organization Country ISO Code',
|
||||||
|
'ip_geo_country_name': 'IP Organization Country Name',
|
||||||
|
'ip_geo_location_latitude': 'IP Organization Latitude',
|
||||||
|
'ip_geo_location_longitude': 'IP Organization Longitude',
|
||||||
|
'ip_geo_postal_code': 'IP Organization Postal Code',
|
||||||
|
'ip_ip': 'IP Address',
|
||||||
|
'ip_isp_autonomous_system_number': 'ASN IP',
|
||||||
|
'ip_isp_autonomous_system_organization': 'ASO IP',
|
||||||
|
'ip_isp_ip_address': 'IP Address',
|
||||||
|
'ip_isp_isp': 'ISP',
|
||||||
|
'ip_isp_organization': 'ISP Organization',
|
||||||
|
'ipv4': 'IPv4 Address',
|
||||||
|
'ipv6': 'IPv6 Address',
|
||||||
|
'last_seen': 'Last Seen'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.passive_hash_data_items = [
|
||||||
|
'domain',
|
||||||
|
'md5_count'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.passive_hash_data_items_friendly_names = {
|
||||||
|
'domain': 'Domain',
|
||||||
|
'md5_count': 'Passive DNS Count'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.malware_records_data_items = [
|
||||||
|
'datetime',
|
||||||
|
'domain',
|
||||||
|
'ipv4',
|
||||||
|
'ipv6',
|
||||||
|
'md5',
|
||||||
|
'sha1',
|
||||||
|
'sha256'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.malware_records_data_items_friendly_names = {
|
||||||
|
'datetime': 'DateTime',
|
||||||
|
'domain': 'Domain',
|
||||||
|
'ipv4': 'IPv4 Address',
|
||||||
|
'ipv6': 'IPv6 Address',
|
||||||
|
'md5': 'MD5',
|
||||||
|
'sha1': 'SHA1',
|
||||||
|
'sha256': 'SHA256'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.malware_information_data_items = [
|
||||||
|
'avscan_score',
|
||||||
|
'md5',
|
||||||
|
'av_name',
|
||||||
|
'def_time',
|
||||||
|
'threat_found',
|
||||||
|
'scan_time',
|
||||||
|
'sha1',
|
||||||
|
'sha256',
|
||||||
|
'sha512'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.malware_information_data_items_friendly_names = {
|
||||||
|
'avscan_score': 'AV Scan Score',
|
||||||
|
'md5': 'MD5',
|
||||||
|
'av_name': 'AV Name',
|
||||||
|
'def_time': 'AV DateTime',
|
||||||
|
'threat_found': 'Source',
|
||||||
|
'scan_time': 'Scan DateTime',
|
||||||
|
'sha1': 'SHA1',
|
||||||
|
'sha256': 'SHA256',
|
||||||
|
'sha512': 'SHA512'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.sinkhole_data_items = [
|
||||||
|
'count',
|
||||||
|
'country_name',
|
||||||
|
'country_code',
|
||||||
|
'data_port',
|
||||||
|
'datetime',
|
||||||
|
'ipv4',
|
||||||
|
'last_seen',
|
||||||
|
'organization_name',
|
||||||
|
'sink_source'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.sinkhole_data_items_friendly_names = {
|
||||||
|
'count': 'Sinkhole Count',
|
||||||
|
'country_name': 'IP Address Country',
|
||||||
|
'country_code': 'IP Address Country Code',
|
||||||
|
'data_port': 'Data Port',
|
||||||
|
'datetime': 'First Seen',
|
||||||
|
'ipv4': 'IP Address',
|
||||||
|
'last_seen': 'Last Seen',
|
||||||
|
'organization_name': 'ISP Organization',
|
||||||
|
'sink_source': 'Sink Source IP'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.ssl_certificate_data_items = [
|
||||||
|
'ip',
|
||||||
|
'ssl_cert_cert_key',
|
||||||
|
'ssl_cert_expire_date',
|
||||||
|
'ssl_cert_issue_date',
|
||||||
|
'ssl_cert_issuer_commonName',
|
||||||
|
'ssl_cert_issuer_countryName',
|
||||||
|
'ssl_cert_issuer_localityName',
|
||||||
|
'ssl_cert_issuer_organizationName',
|
||||||
|
'ssl_cert_issuer_organizationalUnitName',
|
||||||
|
'ssl_cert_issuer_stateOrProvinceName',
|
||||||
|
'ssl_cert_md5',
|
||||||
|
'ssl_cert_serial_number',
|
||||||
|
'ssl_cert_sha1',
|
||||||
|
'ssl_cert_sha_256',
|
||||||
|
'ssl_cert_sig_algo',
|
||||||
|
'ssl_cert_ssl_version',
|
||||||
|
'ssl_cert_subject_commonName',
|
||||||
|
'ssl_cert_subject_countryName',
|
||||||
|
'ssl_cert_subject_localityName',
|
||||||
|
'ssl_cert_subject_organizationName',
|
||||||
|
'ssl_cert_subject_organizationalUnitName',
|
||||||
|
'ssl_cert_timestamp'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.ssl_certificate_data_items_friendly_names = {
|
||||||
|
'ip': 'IP Address',
|
||||||
|
'ssl_cert_cert_key': 'Certificate Key',
|
||||||
|
'ssl_cert_expire_date': 'Certificate Expiration Date',
|
||||||
|
'ssl_cert_issue_date': 'Certificate Issue Date',
|
||||||
|
'ssl_cert_issuer_commonName': 'Issuer Common Name',
|
||||||
|
'ssl_cert_issuer_countryName': 'Issuer Country Name',
|
||||||
|
'ssl_cert_issuer_localityName': 'Issuer City Name',
|
||||||
|
'ssl_cert_issuer_organizationName': 'Issuer Organization Name',
|
||||||
|
'ssl_cert_issuer_organizationalUnitName': 'Issuer Organization Unit Name',
|
||||||
|
'ssl_cert_issuer_stateOrProvinceName': 'Issuer State or Province Name',
|
||||||
|
'ssl_cert_md5': 'Certificate MD5',
|
||||||
|
'ssl_cert_serial_number': 'Certificate Serial Number',
|
||||||
|
'ssl_cert_sha1': 'Certificate SHA1',
|
||||||
|
'ssl_cert_sha_256': 'Certificate SHA256',
|
||||||
|
'ssl_cert_sig_algo': 'Certificate Signature Algorithm',
|
||||||
|
'ssl_cert_ssl_version': 'SSL Version',
|
||||||
|
'ssl_cert_subject_commonName': 'Reciever Subject Name',
|
||||||
|
'ssl_cert_subject_countryName': 'Receiver Country Name',
|
||||||
|
'ssl_cert_subject_localityName': 'Receiver City Name',
|
||||||
|
'ssl_cert_subject_organizationName': 'Receiver Organization Name',
|
||||||
|
'ssl_cert_subject_organizationalUnitName': 'Receiver Organization Unit Name',
|
||||||
|
'ssl_cert_timestamp': 'Certificate DateTime'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.whois_historic_data_items = [
|
||||||
|
'abuse_emails',
|
||||||
|
'address',
|
||||||
|
'city',
|
||||||
|
'country',
|
||||||
|
'datetime',
|
||||||
|
'domain',
|
||||||
|
'domain_2tld',
|
||||||
|
'domain_created_datetime',
|
||||||
|
'domain_expires_datetime',
|
||||||
|
'domain_updated_datetime',
|
||||||
|
'email',
|
||||||
|
'idn_name',
|
||||||
|
'name',
|
||||||
|
'nameserver',
|
||||||
|
'organization',
|
||||||
|
'phone',
|
||||||
|
'privacy_punch',
|
||||||
|
'registrar'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.whois_historic_data_items_friendly_names = {
|
||||||
|
'abuse_emails': 'Abuse Emails',
|
||||||
|
'address': 'Address',
|
||||||
|
'city': 'City',
|
||||||
|
'country': 'Country',
|
||||||
|
'datetime': 'Datetime',
|
||||||
|
'domain': 'Domain',
|
||||||
|
'domain_2tld': 'Domain 2tld',
|
||||||
|
'domain_created_datetime': 'Domain Created Time',
|
||||||
|
'domain_expires_datetime': 'Domain Expires Time',
|
||||||
|
'domain_updated_datetime': 'Domain Updated Time',
|
||||||
|
'email': 'Email Address',
|
||||||
|
'idn_name': 'IDN Name',
|
||||||
|
'name': 'Name',
|
||||||
|
'nameserver': 'Nameserver',
|
||||||
|
'organization': 'Organization',
|
||||||
|
'phone': 'Phone Info',
|
||||||
|
'privacy_punch': 'Privacy Punch',
|
||||||
|
'registrar': 'Registrar'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.whois_current_data_items = [
|
||||||
|
'abuse_emails',
|
||||||
|
'address',
|
||||||
|
'city',
|
||||||
|
'country',
|
||||||
|
'datetime',
|
||||||
|
'domain',
|
||||||
|
'domain_2tld',
|
||||||
|
'domain_created_datetime',
|
||||||
|
'domain_expires_datetime',
|
||||||
|
'domain_updated_datetime',
|
||||||
|
'email',
|
||||||
|
'idn_name',
|
||||||
|
'name',
|
||||||
|
'nameserver',
|
||||||
|
'organization',
|
||||||
|
'phone',
|
||||||
|
'privacy_punch',
|
||||||
|
'registrar',
|
||||||
|
'state'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.whois_current_data_items_friendly_names = {
|
||||||
|
'abuse_emails': 'Abuse Emails',
|
||||||
|
'address': 'Address',
|
||||||
|
'city': 'City',
|
||||||
|
'country': 'Country',
|
||||||
|
'datetime': 'Datetime',
|
||||||
|
'domain': 'Domain',
|
||||||
|
'domain_2tld': 'Domain 2tld',
|
||||||
|
'domain_created_datetime': 'Domain Created Time',
|
||||||
|
'domain_expires_datetime': 'Domain Expires Time',
|
||||||
|
'domain_updated_datetime': 'Domain Updated Time',
|
||||||
|
'email': 'Email Address',
|
||||||
|
'idn_name': 'IDN Name',
|
||||||
|
'name': 'Name',
|
||||||
|
'nameserver': 'Nameserver',
|
||||||
|
'organization': 'Organization',
|
||||||
|
'phone': 'Phone',
|
||||||
|
'privacy_punch': 'Privacy Punch',
|
||||||
|
'registrar': 'Registrar',
|
||||||
|
'state': 'State'
|
||||||
|
}
|
||||||
|
|
||||||
|
def create_misp_attributes_and_objects(self, response, endpoint, attribute_value):
|
||||||
|
flatten_json_response = get_flatten_json_response(response)
|
||||||
|
data_items: List[str] = []
|
||||||
|
data_items_friendly_names: Dict[str, str] = {}
|
||||||
|
if endpoint == DEVICE_GEO_ENDPOINT:
|
||||||
|
data_items: List[str] = self.device_geo_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.device_geo_data_items_friendly_names
|
||||||
|
elif endpoint == DYNAMIC_DNS_ENDPOINT:
|
||||||
|
data_items: List[str] = self.dynamic_dns_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.dynamic_dns_data_items_friendly_names
|
||||||
|
elif endpoint == PASSIVE_DNS_ENDPOINT:
|
||||||
|
data_items: List[str] = self.passive_dns_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.passive_dns_data_items_friendly_names
|
||||||
|
elif endpoint == PASSIVE_HASH_ENDPOINT:
|
||||||
|
data_items: List[str] = self.passive_hash_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.passive_hash_data_items_friendly_names
|
||||||
|
elif endpoint == SINKHOLE_ENDPOINT:
|
||||||
|
data_items: List[str] = self.sinkhole_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.sinkhole_data_items_friendly_names
|
||||||
|
elif endpoint == WHOIS_HISTORIC_ENDPOINT:
|
||||||
|
data_items = self.whois_historic_data_items
|
||||||
|
data_items_friendly_names = self.whois_historic_data_items_friendly_names
|
||||||
|
elif endpoint == WHOIS_CURRENT_ENDPOINT:
|
||||||
|
data_items: List[str] = self.whois_current_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.whois_current_data_items_friendly_names
|
||||||
|
elif endpoint == SSL_CERTIFICATE_ENDPOINT:
|
||||||
|
data_items: List[str] = self.ssl_certificate_data_items
|
||||||
|
data_items_friendly_names: Dict[str, str] = self.ssl_certificate_data_items_friendly_names
|
||||||
|
elif endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
data_items: List[str] = self.malware_information_data_items
|
||||||
|
data_items_friendly_names = self.malware_information_data_items_friendly_names
|
||||||
|
elif endpoint == MALWARE_RECORDS_ENDPOINT:
|
||||||
|
data_items: List[str] = self.malware_records_data_items
|
||||||
|
data_items_friendly_names = self.malware_records_data_items_friendly_names
|
||||||
|
elif endpoint == OPEN_SOURCE_INDICATORS_ENDPOINT:
|
||||||
|
data_items: List[str] = self.os_indicators_data_items
|
||||||
|
data_items_friendly_names = self.os_indicators_data_items_friendly_names
|
||||||
|
elif endpoint == C2ATTRIBUTION_ENDPOINT:
|
||||||
|
data_items: List[str] = self.c2_attribution_data_items
|
||||||
|
data_items_friendly_names = self.c2_attribution_data_items_friendly_names
|
||||||
|
|
||||||
|
for result in flatten_json_response:
|
||||||
|
hyas_object = misp_object(endpoint, attribute_value)
|
||||||
|
for data_item in result.keys():
|
||||||
|
if data_item in data_items:
|
||||||
|
data_item_text = data_items_friendly_names[data_item]
|
||||||
|
data_item_value = str(result[data_item])
|
||||||
|
hyas_object.add_attribute(
|
||||||
|
**parse_attribute(hyas_object.comment, data_item_text, data_item_value))
|
||||||
|
hyas_object.add_reference(self.attribute['uuid'], 'related-to')
|
||||||
|
self.misp_event.add_object(hyas_object)
|
||||||
|
|
||||||
|
def get_results(self):
|
||||||
|
"""returns the dictionary object to MISP Instance"""
|
||||||
|
event = json.loads(self.misp_event.to_json())
|
||||||
|
results = {key: event[key] for key in ('Attribute', 'Object')}
|
||||||
|
return {'results': results}
|
||||||
|
|
||||||
|
|
||||||
|
def handler(q=False):
|
||||||
|
"""The function which accepts a JSON document to expand the values and return a dictionary of the expanded
|
||||||
|
values. """
|
||||||
|
if q is False:
|
||||||
|
return False
|
||||||
|
request = json.loads(q)
|
||||||
|
# check if the apikey is provided
|
||||||
|
if not request.get('config') or not request['config'].get('apikey'):
|
||||||
|
misperrors['error'] = 'HYAS Insight apikey is missing'
|
||||||
|
return misperrors
|
||||||
|
apikey = request['config'].get('apikey')
|
||||||
|
# check attribute is added to the event
|
||||||
|
if not request.get('attribute') or not check_input_attribute(request['attribute']):
|
||||||
|
return {'error': f'{standard_error_message}, which should contain at least a type, a value and an uuid.'}
|
||||||
|
|
||||||
|
attribute = request['attribute']
|
||||||
|
attribute_type = attribute['type']
|
||||||
|
attribute_value = attribute['value']
|
||||||
|
|
||||||
|
# check if the attribute type is supported by IPQualityScore
|
||||||
|
if attribute_type not in mispattributes['input']:
|
||||||
|
return {'error': 'Unsupported attributes type for HYAS Insight Enrichment'}
|
||||||
|
request_handler = RequestHandler(apikey)
|
||||||
|
parser = HyasInsightParser(attribute)
|
||||||
|
has_results = False
|
||||||
|
if attribute_type in ip_query_input_type:
|
||||||
|
ip_param = ''
|
||||||
|
for endpoint in HYAS_IP_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
if endpoint == DEVICE_GEO_ENDPOINT:
|
||||||
|
if re.match(IPV4_REGEX, attribute_value):
|
||||||
|
ip_param = IPV4_PARAM
|
||||||
|
elif re.match(IPV6_REGEX, attribute_value):
|
||||||
|
ip_param = IPV6_PARAM
|
||||||
|
elif endpoint == PASSIVE_HASH_ENDPOINT:
|
||||||
|
ip_param = IPV4_PARAM
|
||||||
|
elif endpoint == SINKHOLE_ENDPOINT:
|
||||||
|
ip_param = IPV4_PARAM
|
||||||
|
elif endpoint == MALWARE_RECORDS_ENDPOINT:
|
||||||
|
ip_param = IPV4_PARAM
|
||||||
|
else:
|
||||||
|
ip_param = IP_PARAM
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, ip_param, attribute_value)
|
||||||
|
if endpoint == SSL_CERTIFICATE_ENDPOINT:
|
||||||
|
enrich_response = enrich_response.get('ssl_certs')
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in domain_query_input_type:
|
||||||
|
for endpoint in HYAS_DOMAIN_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
if not endpoint == WHOIS_CURRENT_ENDPOINT:
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, DOMAIN_PARAM, attribute_value)
|
||||||
|
else:
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, DOMAIN_PARAM, attribute_value,
|
||||||
|
endpoint == WHOIS_CURRENT_ENDPOINT)
|
||||||
|
enrich_response = enrich_response.get('items')
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in email_query_input_type:
|
||||||
|
for endpoint in HYAS_EMAIL_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, EMAIL_PARAM, attribute_value)
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in phone_query_input_type:
|
||||||
|
for endpoint in HYAS_PHONE_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, PHONE_PARAM, attribute_value)
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in md5_query_input_type:
|
||||||
|
md5_param = MD5_PARAM
|
||||||
|
for endpoint in HYAS_MD5_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
md5_param = HASH_PARAM
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, md5_param, attribute_value)
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
enrich_response = malware_info_lookup_to_markdown(enrich_response)
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in sha1_query_input_type:
|
||||||
|
sha1_param = SHA1_PARAM
|
||||||
|
for endpoint in HYAS_SHA1_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
sha1_param = HASH_PARAM
|
||||||
|
elif endpoint == SSL_CERTIFICATE_ENDPOINT:
|
||||||
|
sha1_param = HASH_PARAM
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, sha1_param, attribute_value)
|
||||||
|
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
enrich_response = malware_info_lookup_to_markdown(enrich_response)
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in sha256_query_input_type:
|
||||||
|
sha256_param = SHA256_PARAM
|
||||||
|
for endpoint in HYAS_SHA256_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
sha256_param = HASH_PARAM
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, sha256_param, attribute_value)
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
enrich_response = malware_info_lookup_to_markdown(enrich_response)
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
elif attribute_type in sha512_query_input_type:
|
||||||
|
sha512_param = ''
|
||||||
|
for endpoint in HYAS_SHA512_ENRICHMENT_ENDPOINTS_LIST:
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
sha512_param = HASH_PARAM
|
||||||
|
enrich_response = request_handler.hyas_lookup(endpoint, sha512_param, attribute_value)
|
||||||
|
if enrich_response:
|
||||||
|
has_results = True
|
||||||
|
if endpoint == MALWARE_INFORMATION_ENDPOINT:
|
||||||
|
enrich_response = malware_info_lookup_to_markdown(enrich_response)
|
||||||
|
parser.create_misp_attributes_and_objects(enrich_response, endpoint, attribute_value)
|
||||||
|
|
||||||
|
if has_results:
|
||||||
|
return parser.get_results()
|
||||||
|
else:
|
||||||
|
return {'error': 'No records found in HYAS Insight for the provided attribute.'}
|
||||||
|
|
||||||
|
|
||||||
|
def introspection():
|
||||||
|
"""The function that returns a dict of the supported attributes (input and output) by your expansion module."""
|
||||||
|
return mispattributes
|
||||||
|
|
||||||
|
|
||||||
|
def version():
|
||||||
|
"""The function that returns a dict with the version and the associated meta-data including potential
|
||||||
|
configurations required of the module. """
|
||||||
|
moduleinfo['config'] = moduleconfig
|
||||||
|
return moduleinfo
|
|
@ -0,0 +1,44 @@
|
||||||
|
#!/usr/bin/env python\
|
||||||
|
|
||||||
|
import json
|
||||||
|
from jinja2.sandbox import SandboxedEnvironment
|
||||||
|
|
||||||
|
misperrors = {'error': 'Error'}
|
||||||
|
mispattributes = {'input': ['text'], 'output': ['text']}
|
||||||
|
moduleinfo = {'version': '0.1', 'author': 'Sami Mokaddem',
|
||||||
|
'description': 'Render the template with the data passed',
|
||||||
|
'module-type': ['expansion']}
|
||||||
|
|
||||||
|
default_template = '- Default template -'
|
||||||
|
|
||||||
|
def renderTemplate(data, template=default_template):
|
||||||
|
env = SandboxedEnvironment()
|
||||||
|
return env.from_string(template).render(data)
|
||||||
|
|
||||||
|
def handler(q=False):
|
||||||
|
if q is False:
|
||||||
|
return False
|
||||||
|
request = json.loads(q)
|
||||||
|
if request.get('text'):
|
||||||
|
data = request['text']
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
data = json.loads(data)
|
||||||
|
template = data.get('template', default_template)
|
||||||
|
templateData = data.get('data', {})
|
||||||
|
try:
|
||||||
|
rendered = renderTemplate(templateData, template)
|
||||||
|
except TypeError:
|
||||||
|
rendered = ''
|
||||||
|
|
||||||
|
r = {'results': [{'types': mispattributes['output'],
|
||||||
|
'values':[rendered]}]}
|
||||||
|
return r
|
||||||
|
|
||||||
|
|
||||||
|
def introspection():
|
||||||
|
return mispattributes
|
||||||
|
|
||||||
|
|
||||||
|
def version():
|
||||||
|
return moduleinfo
|
|
@ -2,10 +2,10 @@ import json
|
||||||
from dns import reversename, resolver, exception
|
from dns import reversename, resolver, exception
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['ip-src', 'ip-dst', 'domain|ip'], 'output': ['hostname']}
|
mispattributes = {'input': ['ip-src', 'ip-dst', 'domain|ip', 'ip-src|port', 'ip-dst|port'], 'output': ['hostname']}
|
||||||
|
|
||||||
# possible module-types: 'expansion', 'hover' or both
|
# possible module-types: 'expansion', 'hover' or both
|
||||||
moduleinfo = {'version': '0.1', 'author': 'Andreas Muehlemann',
|
moduleinfo = {'version': '0.3', 'author': 'Andreas Muehlemann',
|
||||||
'description': 'Simple Reverse DNS expansion service to resolve reverse DNS from MISP attributes',
|
'description': 'Simple Reverse DNS expansion service to resolve reverse DNS from MISP attributes',
|
||||||
'module-type': ['expansion', 'hover']}
|
'module-type': ['expansion', 'hover']}
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@ def handler(q=False):
|
||||||
toquery = request['ip-src']
|
toquery = request['ip-src']
|
||||||
elif request.get('domain|ip'):
|
elif request.get('domain|ip'):
|
||||||
toquery = request['domain|ip'].split('|')[1]
|
toquery = request['domain|ip'].split('|')[1]
|
||||||
|
elif request.get('ip-src|port'):
|
||||||
|
toquery = request['ip-src|port'].split('|')[0]
|
||||||
|
elif request.get('ip-dst|port'):
|
||||||
|
toquery = request['ip-dst|port'].split('|')[0]
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,6 @@ class ShodanParser():
|
||||||
ip_address_object = MISPObject('ip-api-address')
|
ip_address_object = MISPObject('ip-api-address')
|
||||||
for attribute in ip_address_attributes:
|
for attribute in ip_address_attributes:
|
||||||
ip_address_object.add_attribute(**attribute)
|
ip_address_object.add_attribute(**attribute)
|
||||||
ip_address_object.add_attribute(**self._get_source_attribute())
|
|
||||||
ip_address_object.add_reference(self.attribute.uuid, 'describes')
|
ip_address_object.add_reference(self.attribute.uuid, 'describes')
|
||||||
self.misp_event.add_object(ip_address_object)
|
self.misp_event.add_object(ip_address_object)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,216 @@
|
||||||
|
import json
|
||||||
|
import requests
|
||||||
|
from . import check_input_attribute, standard_error_message
|
||||||
|
from pymisp import MISPAttribute, MISPEvent, MISPObject
|
||||||
|
|
||||||
|
misperrors = {'error': 'Error'}
|
||||||
|
mispattributes = {'input': ['vulnerability'], 'format': 'misp_standard'}
|
||||||
|
moduleinfo = {'version': '1', 'author': 'Christian Studer',
|
||||||
|
'description': 'An expansion module to query variotdbs.pl',
|
||||||
|
'module-type': ['expansion', 'hover']}
|
||||||
|
moduleconfig = ['API_key']
|
||||||
|
variotdbs_url = 'https://www.variotdbs.pl/api'
|
||||||
|
|
||||||
|
|
||||||
|
class VariotdbsParser:
|
||||||
|
def __init__(self, attribute):
|
||||||
|
misp_attribute = MISPAttribute()
|
||||||
|
misp_attribute.from_dict(**attribute)
|
||||||
|
misp_event = MISPEvent()
|
||||||
|
misp_event.add_attribute(**misp_attribute)
|
||||||
|
self.__misp_attribute = misp_attribute
|
||||||
|
self.__misp_event = misp_event
|
||||||
|
self.__exploit_mapping = {
|
||||||
|
'credits': 'credit',
|
||||||
|
'description': 'description',
|
||||||
|
'exploit': 'exploit',
|
||||||
|
'title': 'title'
|
||||||
|
}
|
||||||
|
self.__exploit_multiple_mapping = {
|
||||||
|
'cve': {
|
||||||
|
'feature': 'cve_id',
|
||||||
|
'relation': 'cve-id'
|
||||||
|
},
|
||||||
|
'references': {
|
||||||
|
'feature': 'url',
|
||||||
|
'relation': 'reference'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.__vulnerability_data_mapping = {
|
||||||
|
'credits': 'credit',
|
||||||
|
'description': 'description',
|
||||||
|
'title': 'summary'
|
||||||
|
}
|
||||||
|
self.__vulnerability_flat_mapping = {
|
||||||
|
'cve': 'id', 'id': 'id'
|
||||||
|
}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def exploit_mapping(self) -> dict:
|
||||||
|
return self.__exploit_mapping
|
||||||
|
|
||||||
|
@property
|
||||||
|
def exploit_multiple_mapping(self) -> dict:
|
||||||
|
return self.__exploit_multiple_mapping
|
||||||
|
|
||||||
|
@property
|
||||||
|
def misp_attribute(self) -> MISPAttribute:
|
||||||
|
return self.__misp_attribute
|
||||||
|
|
||||||
|
@property
|
||||||
|
def misp_event(self) -> MISPEvent:
|
||||||
|
return self.__misp_event
|
||||||
|
|
||||||
|
@property
|
||||||
|
def vulnerability_data_mapping(self) -> dict:
|
||||||
|
return self.__vulnerability_data_mapping
|
||||||
|
|
||||||
|
@property
|
||||||
|
def vulnerability_flat_mapping(self) -> dict:
|
||||||
|
return self.__vulnerability_flat_mapping
|
||||||
|
|
||||||
|
def get_results(self):
|
||||||
|
event = json.loads(self.misp_event.to_json())
|
||||||
|
results = {key: event[key] for key in ('Attribute', 'Object') if event.get(key)}
|
||||||
|
return {'results': results}
|
||||||
|
|
||||||
|
def parse_exploit_information(self, query_results):
|
||||||
|
for exploit in query_results:
|
||||||
|
exploit_object = MISPObject('exploit')
|
||||||
|
exploit_object.add_attribute('exploitdb-id', exploit['edb_id'])
|
||||||
|
for feature, relation in self.exploit_mapping.items():
|
||||||
|
if exploit.get(feature):
|
||||||
|
exploit_object.add_attribute(
|
||||||
|
relation,
|
||||||
|
exploit[feature]['data']
|
||||||
|
)
|
||||||
|
for feature, relation in self.exploit_multiple_mapping.items():
|
||||||
|
if exploit.get(feature):
|
||||||
|
for value in exploit[feature]['data']:
|
||||||
|
exploit_object.add_attribute(
|
||||||
|
relation['relation'],
|
||||||
|
value[relation['feature']]
|
||||||
|
)
|
||||||
|
exploit_object.add_reference(self.misp_attribute.uuid, 'related-to')
|
||||||
|
self.misp_event.add_object(exploit_object)
|
||||||
|
|
||||||
|
def parse_vulnerability_information(self, query_results):
|
||||||
|
vulnerability_object = MISPObject('vulnerability')
|
||||||
|
for feature, relation in self.vulnerability_flat_mapping.items():
|
||||||
|
if query_results.get(feature):
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
relation,
|
||||||
|
query_results[feature]
|
||||||
|
)
|
||||||
|
for feature, relation in self.vulnerability_data_mapping.items():
|
||||||
|
if query_results.get(feature, {}).get('data'):
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
relation,
|
||||||
|
query_results[feature]['data']
|
||||||
|
)
|
||||||
|
if query_results.get('configurations', {}).get('data'):
|
||||||
|
for configuration in query_results['configurations']['data']:
|
||||||
|
for node in configuration['nodes']:
|
||||||
|
for cpe_match in node['cpe_match']:
|
||||||
|
if cpe_match['vulnerable']:
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
'vulnerable-configuration',
|
||||||
|
cpe_match['cpe23Uri']
|
||||||
|
)
|
||||||
|
if query_results.get('cvss', {}).get('data'):
|
||||||
|
cvss = {}
|
||||||
|
for cvss_data in query_results['cvss']['data']:
|
||||||
|
for cvss_v3 in cvss_data['cvssV3']:
|
||||||
|
cvss[float(cvss_v3['trust'])] = cvss_v3
|
||||||
|
if cvss:
|
||||||
|
cvss = cvss[max(cvss)]
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
'cvss-score',
|
||||||
|
cvss['baseScore']
|
||||||
|
)
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
'cvss-string',
|
||||||
|
cvss['vectorString']
|
||||||
|
)
|
||||||
|
if query_results.get('references', {}).get('data'):
|
||||||
|
for reference in query_results['references']['data']:
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
'references',
|
||||||
|
reference['url']
|
||||||
|
)
|
||||||
|
if query_results.get('sources_release_date', {}).get('data'):
|
||||||
|
for release_date in query_results['sources_release_date']['data']:
|
||||||
|
if release_date['db'] != 'NVD':
|
||||||
|
continue
|
||||||
|
if release_date['id'] == self.misp_attribute.value:
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
'published',
|
||||||
|
release_date['date']
|
||||||
|
)
|
||||||
|
break
|
||||||
|
if query_results.get('sources_update_date', {}).get('data'):
|
||||||
|
for update_date in query_results['sources_update_date']['data']:
|
||||||
|
if update_date['db'] != 'NVD':
|
||||||
|
continue
|
||||||
|
if update_date['id'] == self.misp_attribute.value:
|
||||||
|
vulnerability_object.add_attribute(
|
||||||
|
'modified',
|
||||||
|
update_date['date']
|
||||||
|
)
|
||||||
|
break
|
||||||
|
vulnerability_object.add_reference(self.misp_attribute.uuid, 'related-to')
|
||||||
|
self.misp_event.add_object(vulnerability_object)
|
||||||
|
|
||||||
|
|
||||||
|
def handler(q=False):
|
||||||
|
if q is False:
|
||||||
|
return False
|
||||||
|
request = json.loads(q)
|
||||||
|
if not request.get('attribute') or not check_input_attribute(request['attribute']):
|
||||||
|
return {'error': f'{standard_error_message}, which should contain at least a type, a value and an uuid.'}
|
||||||
|
attribute = request['attribute']
|
||||||
|
if attribute.get('type') != 'vulnerability':
|
||||||
|
return {'error': 'Vulnerability id missing.'}
|
||||||
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
if request.get('config', {}).get('API_key'):
|
||||||
|
headers['Authorization'] = f"Token {request['config']['API_key']}"
|
||||||
|
empty = True
|
||||||
|
parser = VariotdbsParser(attribute)
|
||||||
|
r = requests.get(f"{variotdbs_url}/vuln/{attribute['value']}/", headers=headers)
|
||||||
|
if r.status_code == 200:
|
||||||
|
vulnerability_results = r.json()
|
||||||
|
if vulnerability_results:
|
||||||
|
parser.parse_vulnerability_information(vulnerability_results)
|
||||||
|
empty = False
|
||||||
|
else:
|
||||||
|
if r.reason != 'Not Found':
|
||||||
|
return {'error': 'Error while querying the variotdbs API.'}
|
||||||
|
r = requests.get(f"{variotdbs_url}/exploits/?cve={attribute['value']}", headers=headers)
|
||||||
|
if r.status_code == 200:
|
||||||
|
exploit_results = r.json()
|
||||||
|
if exploit_results:
|
||||||
|
parser.parse_exploit_information(exploit_results['results'])
|
||||||
|
empty = False
|
||||||
|
if exploit_results['next'] is not None:
|
||||||
|
while(1):
|
||||||
|
exploit_results = requests.get(exploit_results['next'], headers=headers)
|
||||||
|
if exploit_results.status_code != 200:
|
||||||
|
break
|
||||||
|
exploit_results = exploit_results.json()
|
||||||
|
parser.parse_exploit_information(exploit_results['results'])
|
||||||
|
if exploit_results['next'] is None:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
return {'error': 'Error while querying the variotdbs API.'}
|
||||||
|
if empty:
|
||||||
|
return {'error': 'Empty results'}
|
||||||
|
return parser.get_results()
|
||||||
|
|
||||||
|
|
||||||
|
def introspection():
|
||||||
|
return mispattributes
|
||||||
|
|
||||||
|
|
||||||
|
def version():
|
||||||
|
moduleinfo['config'] = moduleconfig
|
||||||
|
return moduleinfo
|
|
@ -67,7 +67,7 @@ def handler(q=False):
|
||||||
image = img.make_blob('png')
|
image = img.make_blob('png')
|
||||||
log.debug("Final image size is {}x{}".format(pdf.width, pdf.height * (p + 1)))
|
log.debug("Final image size is {}x{}".format(pdf.width, pdf.height * (p + 1)))
|
||||||
else:
|
else:
|
||||||
image = document
|
image = base64.b64decode(request["data"])
|
||||||
|
|
||||||
image_file = BytesIO(image)
|
image_file = BytesIO(image)
|
||||||
image_file.seek(0)
|
image_file.seek(0)
|
||||||
|
|
|
@ -16,7 +16,7 @@ edit_uri: ""
|
||||||
use_directory_urls: true
|
use_directory_urls: true
|
||||||
|
|
||||||
# Copyright
|
# Copyright
|
||||||
copyright: "Copyright © 2019-2021 MISP Project"
|
copyright: "Copyright © 2019-2022 MISP Project"
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
extra:
|
extra:
|
||||||
|
|
|
@ -264,6 +264,21 @@ class TestExpansions(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
self.assertEqual(self.get_errors(response), 'Have I Been Pwned authentication is incomplete (no API key)')
|
self.assertEqual(self.get_errors(response), 'Have I Been Pwned authentication is incomplete (no API key)')
|
||||||
|
|
||||||
|
def test_hyasinsight(self):
|
||||||
|
module_name = "hyasinsight"
|
||||||
|
query = {"module": module_name,
|
||||||
|
"attribute": {"type": "phone-number",
|
||||||
|
"value": "+84853620279",
|
||||||
|
"uuid": "b698dc2b-94c1-487d-8b65-3114bad5a40c"},
|
||||||
|
"config": {}}
|
||||||
|
if module_name in self.configs:
|
||||||
|
query['config'] = self.configs[module_name]
|
||||||
|
response = self.misp_modules_post(query)
|
||||||
|
self.assertEqual(self.get_values(response)['domain'], 'tienichphongnet.com')
|
||||||
|
else:
|
||||||
|
response = self.misp_modules_post(query)
|
||||||
|
self.assertEqual(self.get_errors(response), 'HYAS Insight apikey is missing')
|
||||||
|
|
||||||
def test_greynoise(self):
|
def test_greynoise(self):
|
||||||
module_name = 'greynoise'
|
module_name = 'greynoise'
|
||||||
query = {"module": module_name, "ip-dst": "1.1.1.1"}
|
query = {"module": module_name, "ip-dst": "1.1.1.1"}
|
||||||
|
@ -308,6 +323,7 @@ class TestExpansions(unittest.TestCase):
|
||||||
response = self.misp_modules_post(query)
|
response = self.misp_modules_post(query)
|
||||||
self.assertEqual(self.get_errors(response), 'IPQualityScore apikey is missing')
|
self.assertEqual(self.get_errors(response), 'IPQualityScore apikey is missing')
|
||||||
|
|
||||||
|
|
||||||
def test_macaddess_io(self):
|
def test_macaddess_io(self):
|
||||||
module_name = 'macaddress_io'
|
module_name = 'macaddress_io'
|
||||||
query = {"module": module_name, "mac-address": "44:38:39:ff:ef:57"}
|
query = {"module": module_name, "mac-address": "44:38:39:ff:ef:57"}
|
||||||
|
|