Skip to content

Commit 09004f7

Browse files
authored
Merge pull request #85 from mitre/feature-celery
So many commits, much celery, wow
2 parents 387a3a9 + cc4ccb2 commit 09004f7

File tree

155 files changed

+35633
-2294
lines changed

Some content is hidden

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

155 files changed

+35633
-2294
lines changed

.gitignore

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ report.json
1111
__pycache__/
1212
*.py[cod]
1313
*.swp
14+
*.swo
15+
1416
# C extensions
1517
*.so
1618
*.dll
19+
1720
#PyCharm
1821
.idea
19-
#Keys dir
22+
23+
# VSCode
24+
.vscode/
25+
26+
# Keys dir
2027
keys/
28+
2129
# Distribution / packaging
2230
.Python
2331
env/
@@ -34,14 +42,17 @@ var/
3442
*.egg-info/
3543
.installed.cfg
3644
*.egg
45+
3746
# PyInstaller
3847
# Usually these files are written by a python script from a template
3948
# before PyInstaller builds the exe, so as to inject date/other infos into it.
4049
*.manifest
4150
*.spec
51+
4252
# Installer logs
4353
pip-log.txt
4454
pip-delete-this-directory.txt
55+
4556
# Unit test / coverage reports
4657
.pytest_cache
4758
htmlcov/
@@ -50,16 +61,25 @@ htmlcov/
5061
.cache
5162
nosetests.xml
5263
coverage.xml
64+
.pytest_cache/
65+
5366
# Translations
5467
*.mo
5568
*.pot
69+
5670
# Django stuff:
5771
*.log
72+
5873
# Sphinx documentation
5974
docs/_build/
75+
6076
# PyBuilder
6177
target/
78+
6279
# Sqlite DB
6380
sqlite.db
81+
task_db
82+
testing.db
83+
6484
# Tmp Upload Dir
6585
utils/tmp/

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- repo: [email protected]:pre-commit/pre-commit-hooks
2+
sha: v1.2.0
3+
hooks:
4+
- id: end-of-file-fixer
5+
- id: trailing-whitespace
6+
- id: check-merge-conflict
7+
- id: detect-private-key
8+
- id: mixed-line-ending
9+
- id: flake8
10+
args:
11+
- --ignore=E126,E127,E128,E402
12+
- --max-line-length=120

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ python:
55
- "3.4"
66
- "3.5"
77
- "3.6"
8+
env:
9+
- MOZ_HEADLESS=1
10+
addons:
11+
firefox: latest
12+
before_install:
13+
- npm install -g geckodriver
814
install:
915
- yes "" | sudo -HE ./install.sh
1016
- pip install -r requirements.txt

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,3 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
364364
This Source Code Form is "Incompatible
365365
With Secondary Licenses", as defined by
366366
the Mozilla Public License, v. 2.0.
367-

README.md

Lines changed: 88 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,88 @@
1-
MultiScanner
2-
============
3-
[![Build Status](https://travis-ci.org/mitre/multiscanner.svg)](https://travis-ci.org/mitre/multiscanner)
4-
5-
Introduction
6-
------------
7-
MultiScanner is a file analysis framework that assists the user in evaluating a set
8-
of files by automatically running a suite of tools for the user and aggregating the output.
9-
Tools can be custom built python scripts, web APIs, software running on another machine, etc.
10-
Tools are incorporated by creating modules that run in the MultiScanner framework.
11-
12-
Modules are designed to be quickly written and easily incorporated into the framework.
13-
Currently written and maintained modules are related to malware analytics, but the framework is not limited to that
14-
scope. For a list of modules you can look in [modules](modules), descriptions and config
15-
options can be found in [docs/modules.md](docs/modules.md)
16-
17-
Requirements
18-
------------
19-
Python 3.6 is recommended. Compatibility with 2.7+ and
20-
3.4+ is supported but not as thoroughly maintained and tested. Please submit an issue
21-
or a pull request fixing any issues found with other versions of Python.
22-
23-
24-
An installer script is included in the project [install.sh](<install.sh>), which
25-
installs the prerequisites on most systems.
26-
27-
Installation
28-
------------
29-
### MultiScanner ###
30-
If you're running on a RedHat or Debian based linux distribution you should try and run
31-
[install.sh](<install.sh>). Otherwise the required python packages are defined in
32-
[requirements.txt](<requirements.txt>).
33-
34-
MultiScanner must have a configuration file to run. Generate the MultiScanner default
35-
configuration by running `python multiscanner.py init` after cloning the repository.
36-
This command can be used to rewrite the configuration file to its default state or,
37-
if new modules have been written, to add their configuration to the configuration
38-
file.
39-
40-
### Analytic Machine ###
41-
Default modules have the option to be run locally or via SSH. The development team
42-
runs MultiScanner on a Linux host and hosts the majority of analytical tools on
43-
a separate Windows machine. The SSH server used in this environment is freeSSHd
44-
from <http://www.freesshd.com/>.
45-
46-
A network share accessible to both the MultiScanner and the Analytic Machines is
47-
required for the multi-machine setup. Once configured, the network share path must
48-
be identified in the configuration file, config.ini. To do this, set the `copyfilesto`
49-
option under `[main]` to be the mount point on the system running MultiScanner.
50-
Modules can have a `replacement path` option, which is the network share mount point
51-
on the analytic machine.
52-
53-
Module Writing
54-
--------------
55-
Modules are intended to be quickly written and incorporated into the framework.
56-
A finished module must be placed in the modules folder before it can be used. The
57-
configuration file does not need to be manually updated. See [docs/module\_writing.md](<docs/module_writing.md>)
58-
for more information.
59-
60-
Module Configuration
61-
--------------------
62-
Modules are configured within the configuration file, config.ini. See
63-
[docs/modules.md](<docs/modules.md>) for more information.
64-
65-
Python API
66-
----------
67-
MultiScanner can be incorporated as a module in another projects. Below is a simple
68-
example of how to import MultiScanner into a Python script.
69-
70-
``` python
71-
import multiscanner
72-
output = multiscanner.multiscan(FileList)
73-
Results = multiscanner.parse_reports(output, python=True)
74-
```
75-
76-
Results is a dictionary object where each key is a filename of a scanned file.
77-
78-
`multiscanner.config_init(filepath)` will create a default configuration file at
79-
the location defined by filepath.
80-
81-
Other Reading
82-
-------------
83-
For more information on module configuration or writing modules check the
84-
[docs](<docs>) folder.
1+
MultiScanner
2+
============
3+
[![Build Status](https://travis-ci.org/mitre/multiscanner.svg)](https://travis-ci.org/mitre/multiscanner)
4+
5+
Introduction
6+
------------
7+
MultiScanner is a file analysis framework that assists the user in evaluating a set
8+
of files by automatically running a suite of tools for the user and aggregating the output.
9+
Tools can be custom built python scripts, web APIs, software running on another machine, etc.
10+
Tools are incorporated by creating modules that run in the MultiScanner framework.
11+
12+
Modules are designed to be quickly written and easily incorporated into the framework.
13+
Currently written and maintained modules are related to malware analytics, but the framework is not limited to that
14+
scope. For a list of modules you can look in [modules](modules), descriptions and config
15+
options can be found in [docs/modules.md](docs/modules.md)
16+
17+
Requirements
18+
------------
19+
Python 3.6 is recommended. Compatibility with 2.7+ and
20+
3.4+ is supported but not as thoroughly maintained and tested. Please submit an issue
21+
or a pull request fixing any issues found with other versions of Python.
22+
23+
24+
An installer script is included in the project [install.sh](<install.sh>), which
25+
installs the prerequisites on most systems.
26+
27+
Installation
28+
------------
29+
### MultiScanner ###
30+
If you're running on a RedHat or Debian based linux distribution you should try and run
31+
[install.sh](<install.sh>). Otherwise the required python packages are defined in
32+
[requirements.txt](<requirements.txt>).
33+
34+
MultiScanner must have a configuration file to run. Generate the MultiScanner default
35+
configuration by running `python multiscanner.py init` after cloning the repository.
36+
This command can be used to rewrite the configuration file to its default state or,
37+
if new modules have been written, to add their configuration to the configuration
38+
file.
39+
40+
### Analytic Machine ###
41+
Default modules have the option to be run locally or via SSH. The development team
42+
runs MultiScanner on a Linux host and hosts the majority of analytical tools on
43+
a separate Windows machine. The SSH server used in this environment is freeSSHd
44+
from <http://www.freesshd.com/>.
45+
46+
A network share accessible to both the MultiScanner and the Analytic Machines is
47+
required for the multi-machine setup. Once configured, the network share path must
48+
be identified in the configuration file, config.ini. To do this, set the `copyfilesto`
49+
option under `[main]` to be the mount point on the system running MultiScanner.
50+
Modules can have a `replacement path` option, which is the network share mount point
51+
on the analytic machine.
52+
53+
Module Writing
54+
--------------
55+
Modules are intended to be quickly written and incorporated into the framework.
56+
A finished module must be placed in the modules folder before it can be used. The
57+
configuration file does not need to be manually updated. See [docs/module\_writing.md](<docs/module_writing.md>)
58+
for more information.
59+
60+
Module Configuration
61+
--------------------
62+
Modules are configured within the configuration file, config.ini. See
63+
[docs/modules.md](<docs/modules.md>) for more information.
64+
65+
Python API
66+
----------
67+
MultiScanner can be incorporated as a module in another projects. Below is a simple
68+
example of how to import MultiScanner into a Python script.
69+
70+
``` python
71+
import multiscanner
72+
output = multiscanner.multiscan(FileList)
73+
Results = multiscanner.parse_reports(output, python=True)
74+
```
75+
76+
Results is a dictionary object where each key is a filename of a scanned file.
77+
78+
`multiscanner.config_init(filepath)` will create a default configuration file at
79+
the location defined by filepath.
80+
81+
Distributed MultiScanner
82+
------------------------
83+
MultiScanner is also part of a distributed, scalable file analysis framework, complete with distributed task management, web interface, REST API, and report storage. Please set [Distributed Multiscanner](<docs/distributed_multiscanner.md>) for more details. Additionally, we distribute a standalone Docker container with the base set of features (web UI, REST API, ElasticSearch node) as an introduction to the capabilities of this Distributed MultiScanner. See [here](<docs/docker_standalone.md>) for more details. (*Note*: this standalone container should not be used in production, it is simply a primer on what a full installation would look like).
84+
85+
Other Reading
86+
-------------
87+
For more information on module configuration or writing modules check the
88+
[docs](<docs>) folder.

TODO.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
This is a list of things that are wanted features
2-
3-
# Feature Updates #
4-
- **Better output** - Printing json to the console is not super pretty. Maybe making an HTML output available for an analyst?
5-
- **Module logging** - Create an API that allows modules to log errors and messages to a file.
6-
- **Multiprocessing** - Currently modules are only run as threads, giving modules access to a multiprocessing pool for cpu intensive modules would be good.
7-
- **Ability for modules to submit files** - Having modules be able to extract files that should be scanned and included in the report could be helpful in some use cases.
8-
- **Maliciousness Weight** - Allow an analyst to define custom weights to results to priorities what to look at. Also having a "is malicious" flag if a file breaches a threshold
9-
- **REST API** - Creating a script that provides a web api to submit files and pull reports.
10-
11-
# New Modules #
12-
- OPSWAT Metascan
13-
- PEframe https://github.com/guelfoweb/peframe
1+
This is a list of things that are wanted features
2+
3+
# Feature Updates #
4+
- **Better output** - Printing json to the console is not super pretty. Maybe making an HTML output available for an analyst?
5+
- **Module logging** - Create an API that allows modules to log errors and messages to a file.
6+
- **Multiprocessing** - Currently modules are only run as threads, giving modules access to a multiprocessing pool for cpu intensive modules would be good.
7+
- **Ability for modules to submit files** - Having modules be able to extract files that should be scanned and included in the report could be helpful in some use cases.
8+
- **Maliciousness Weight** - Allow an analyst to define custom weights to results to priorities what to look at. Also having a "is malicious" flag if a file breaches a threshold
9+
- **REST API** - Creating a script that provides a web api to submit files and pull reports.
10+
11+
# New Modules #
12+
- OPSWAT Metascan
13+
- PEframe https://github.com/guelfoweb/peframe

__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import sys
21
import os
2+
import sys
3+
34
sys.path.insert(0, os.path.dirname(__file__))
4-
from . import multiscanner, storage
5+
6+
from . import multiscanner
7+
58
common = multiscanner.common
69
multiscan = multiscanner.multiscan
710
parse_reports = multiscanner.parse_reports

0 commit comments

Comments
 (0)