Skip to content

Commit 86e0145

Browse files
authored
Merge pull request #178 from mitre/release/2.0.0rc1
v2.0 release
2 parents 3576699 + 36e2e44 commit 86e0145

File tree

184 files changed

+4367
-28145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4367
-28145
lines changed

.pre-commit-config.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
- repo: [email protected]:pre-commit/pre-commit-hooks
2-
sha: v1.2.0
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v1.4.0
34
hooks:
45
- id: end-of-file-fixer
56
- id: trailing-whitespace
@@ -8,5 +9,5 @@
89
- id: mixed-line-ending
910
- id: flake8
1011
args:
11-
- --ignore=E126,E127,E128,E402
12+
- --ignore=E126,E127,E128,E402,F841
1213
- --max-line-length=120

.travis.yml

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1+
dist: xenial
12
sudo: required
23
language: python
34
python:
45
- "2.7"
5-
- "3.4"
66
- "3.5"
77
- "3.6"
8+
- "3.7"
89
env:
910
- MOZ_HEADLESS=1
1011
addons:
1112
firefox: latest
13+
apt:
14+
# Keep these in sync with the dependencies from the install.sh script
15+
packages:
16+
- build-essential
17+
- curl
18+
- dh-autoreconf
19+
- gcc
20+
- libffi-dev
21+
- libfuzzy-dev
22+
- python-dev
23+
- git
24+
- libssl-dev
25+
- unzip
26+
- libmagic-dev
1227
before_install:
1328
- npm install -g geckodriver
1429
install:
15-
- yes "" | sudo -HE ./install.sh
16-
- pip install -r requirements.txt
17-
- python multiscanner.py init
30+
- pip install -U pip setuptools
31+
- pip install tox-travis pre-commit
1832
script:
19-
- flake8 --exit-zero .
20-
- pytest
33+
- tox
34+
- pre-commit run --all-files

MANIFEST.in

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
graft multiscanner
2+
recursive-exclude * __pycache__
3+
recursive-exclude * *.py[co]
4+
recursive-exclude multiscanner\tests *
5+
6+
recursive-include docs
7+
include README.md
8+
include LICENSE
9+
include AUTHORS
10+
include requirements.txt
11+
include requirements-dev.txt
12+
include requirements-test.txt
13+
include install.sh

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Then run the following (substituting the actual file you want to scan for `<file
3636
$ git clone https://github.com/mitre/multiscanner.git
3737
$ cd multiscanner
3838
$ sudo -HE ./install.sh
39-
$ python multiscanner.py init
39+
$ multiscanner init
4040
```
4141

4242
This will generate a default configuration for you. Check `config.ini` to see what
@@ -45,13 +45,13 @@ modules are enabled. See [Configuration](http://multiscanner.readthedocs.io/en/l
4545
Now you can scan a file (substituting the actual file you want to scan for `<file>`):
4646

4747
``` bash
48-
$ python multiscanner.py <file>
48+
$ multiscanner <file>
4949
```
5050

5151
You can run the following to get a list of all of MultiScanner's command-line options:
5252

5353
``` bash
54-
$ python multiscanner.py --help
54+
$ multiscanner --help
5555
```
5656

5757
**Note**: If you are not on a RedHat or Debian based Linux distribution, instead of

__init__.py

-11
This file was deleted.

docker-compose.yml

+5-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
elastic:
4-
image: "docker.elastic.co/elasticsearch/elasticsearch:5.6.3"
4+
image: "docker.elastic.co/elasticsearch/elasticsearch:6.3.2"
55
ports:
66
- "9200:9200"
77
- "9300:9300"
@@ -12,36 +12,16 @@ services:
1212
web:
1313
build:
1414
context: .
15-
dockerfile: docker_utils/Dockerfile_web
16-
# If you are behind a proxy, you must uncomment
17-
# the next 3 lines
18-
# args:
19-
# - http_proxy
20-
# - https_proxy
15+
dockerfile: docker_utils/Dockerfile
16+
command: multiscanner-web
2117
ports:
2218
- "127.0.0.1:8000:8000"
23-
# If you are behind a proxy, you must set the
24-
# proxy settings here (uncomment the next 4 lines)
25-
# environment:
26-
# - "http_proxy=http://proxy.example:80"
27-
# - "https_proxy=http://proxy.example:80"
28-
# - "no_proxy=localhost,127.0.0.1"
2919
api:
3020
build:
3121
context: .
32-
dockerfile: docker_utils/Dockerfile_api
33-
# If you are behind a proxy, you must uncomment
34-
# the next 3 lines
35-
# args:
36-
# - http_proxy
37-
# - https_proxy
22+
dockerfile: docker_utils/Dockerfile
23+
command: /wait-for-it.sh elastic:9200 -- multiscanner-api
3824
ports:
3925
- "127.0.0.1:8080:8080"
40-
# If you are behind a proxy, you must set the
41-
# proxy settings here (uncomment the next 4 lines)
42-
# environment:
43-
# - "http_proxy=http://proxy.example:80"
44-
# - "https_proxy=http://proxy.example:80"
45-
# - "no_proxy=localhost,127.0.0.1"
4626
depends_on:
4727
- elastic

docker_utils/Dockerfile

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
FROM alpine
2+
MAINTAINER Patrick Copeland ptcnop
3+
4+
ENV YARA_VERSION 3.8.1
5+
ENV YARA_PY_VERSION 3.8.1
6+
ENV SSDEEP ssdeep-2.13
7+
8+
COPY requirements.txt /opt/multiscanner/
9+
10+
RUN apk add --no-cache \
11+
bash \
12+
bison \
13+
file \
14+
jansson \
15+
jpeg \
16+
libffi \
17+
python3 \
18+
su-exec \
19+
tini \
20+
zip \
21+
zlib \
22+
&& apk add --no-cache -t .build-deps \
23+
autoconf \
24+
automake \
25+
build-base \
26+
file-dev \
27+
flex \
28+
git \
29+
jansson-dev \
30+
jpeg-dev \
31+
libc-dev \
32+
libffi-dev \
33+
libtool \
34+
musl-dev \
35+
postgresql-dev \
36+
py3-pip \
37+
python3-dev \
38+
zlib-dev \
39+
# ssdeep
40+
&& echo "Install ssdeep from source..." \
41+
&& cd /tmp \
42+
&& wget -O /tmp/$SSDEEP.tar.gz https://downloads.sourceforge.net/project/ssdeep/$SSDEEP/$SSDEEP.tar.gz \
43+
&& tar zxvf $SSDEEP.tar.gz \
44+
&& cd $SSDEEP \
45+
&& ./configure \
46+
&& make \
47+
&& make install \
48+
# yara
49+
&& echo "Install Yara from source..." \
50+
&& cd /tmp/ \
51+
&& git clone --recursive --branch v$YARA_VERSION https://github.com/VirusTotal/yara.git \
52+
&& cd /tmp/yara \
53+
&& ./bootstrap.sh \
54+
&& sync \
55+
&& ./configure --with-crypto \
56+
--enable-magic \
57+
--enable-cuckoo \
58+
--enable-dotnet \
59+
&& make \
60+
&& make install \
61+
&& echo "Install yara-python..." \
62+
&& cd /tmp/ \
63+
&& git clone --recursive --branch v$YARA_PY_VERSION https://github.com/VirusTotal/yara-python \
64+
&& cd yara-python \
65+
&& python3 setup.py build --dynamic-linking \
66+
&& python3 setup.py install \
67+
&& echo "Downloading yara signatures..." \
68+
&& git clone --depth 1 https://github.com/Yara-Rules/rules.git /opt/multiscanner/etc/yarasigs/Yara-Rules \
69+
# install ms dependencies
70+
&& cd /opt/multiscanner \
71+
&& pip3 install --upgrade pip \
72+
&& pip3 install -r requirements.txt \
73+
# clean up
74+
&& rm -rf /tmp/* \
75+
&& apk del --purge .build-deps
76+
77+
COPY . /opt/multiscanner
78+
COPY ./docker_utils/*.ini /opt/multiscanner/
79+
COPY ./etc/pdf_config.json /opt/multiscanner/
80+
COPY ./etc/ember_model_2017.txt /opt/multiscanner/etc/ember/
81+
82+
WORKDIR /opt/multiscanner
83+
84+
RUN pip3 install .
85+
86+
RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /wait-for-it.sh \
87+
&& chmod +x /wait-for-it.sh
88+
89+
# Run script
90+
CMD multiscanner

docker_utils/Dockerfile_api

-16
This file was deleted.

docker_utils/Dockerfile_web

-13
This file was deleted.

docker_utils/api_config.ini

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ host_string = localhost
2323
db_name = task_db
2424
username = multiscanner
2525
password = CHANGEME
26+
retry_time = 5
27+
retry_num = 20

docker_utils/config.ini

+30
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ poll interval seconds = 5
3535
user agent = user_agent
3636
API key =
3737

38+
[VFindScan]
39+
ENABLED = False
40+
vstk_home = /opt/vstk
41+
uad_cmdline = []
42+
vfind_cmdline = []
43+
3844
[vtsearch]
3945
apikey = None
4046
ENABLED = False
@@ -84,6 +90,13 @@ Verify = False
8490
timeout = 360
8591
running timeout = 120
8692

93+
[EndgameEmber]
94+
ENABLED = False
95+
path-to-model = opt/multiscanner/etc/ember/ember_model_2017.txt
96+
97+
[MaliciousMacroBot]
98+
ENABLED = False
99+
87100
[ExifToolsScan]
88101
cmdline = ['-t']
89102
path = C:\exiftool.exe
@@ -108,15 +121,32 @@ cmdline = ['-r:3']
108121
host = ('MultiScanner', 22, 'User')
109122
replacement path = X:\
110123

124+
[UADScan]
125+
ENABLED = False
126+
vstk_home = /opt/vstk
127+
cmdline = []
128+
129+
[entropy]
130+
ENABLED = True
131+
132+
[fileextensions]
133+
ENABLED = True
134+
111135
[flarefloss]
112136
ENABLED = False
113137
path = /opt/floss
114138
cmdline = ['--show-metainfo']
115139

140+
[impfuzzy]
141+
ENABLED = True
142+
116143
[libmagic]
117144
magicfile = None
118145
ENABLED = True
119146

147+
[officemeta]
148+
ENABLED = True
149+
120150
[pdfinfo]
121151
ENABLED = True
122152
fast = False

docker_utils/storage.ini

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1-
[File]
1+
[main]
2+
retry_time = 5
3+
retry_num = 20
4+
5+
[BasicElasticSearchStorage]
26
ENABLED = False
3-
path = report.json
4-
gzip = False
5-
files-per-line = 1
7+
host = elastic
8+
port = 9200
9+
index = multiscanner_reports
10+
doc_type = reports
611

712
[ElasticSearchStorage]
813
ENABLED = True
914
host = elastic
1015
port = 9200
1116
index = multiscanner_reports
12-
doc_type = report
17+
metricbeat_enabled = True
18+
metricbeat_rollover_days = 7
19+
20+
[File]
21+
ENABLED = False
22+
path = report.json
23+
gzip = False
24+
files-per-line = 1
25+
26+
[MongoStorage]
27+
ENABLED = False
28+
host = localhost
29+
port = 27017
30+
database = multiscanner_reports
31+
collection = reports

docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/custom/analytics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Enabling analytics and advanced queries is the primary advantage of running seve
1111

1212
Analytic development is currently ad hoc. Until interfaces are created to standardize development, the :ref:`analytics` section might prove useful - it contains development details of the **ssdeep** analytic.
1313

14-
Here's the `ssdeep code <https://github.com/mitre/multiscanner/blob/feature-celery/analytics/ssdeep_analytics.py>`_ to use as a reference for how one might implement an analytic.
14+
Here's the `ssdeep code <https://github.com/mitre/multiscanner/blob/feature-celery/analytics/ssdeep_analytics.py>`_ to use as a reference for how one might implement an analytic.

0 commit comments

Comments
 (0)