82 Commits
Author SHA1 Message Date
Nex 1962aa3fa8 Using safelist/blocklist 2020-06-02 09:30:18 +02:00
Ricardo van Zutphen 9abb5caea5 Update config and startup tests 2019-06-14 14:30:44 +02:00
Jurriaan Bremer 3fd9c0b7dc version 2.0.7 2019-06-14 13:29:49 +02:00
Ben de Graaff 65dba7a492 Remove unused force_port for ResultServer and allow port = 0 2019-05-17 17:24:46 +02:00
Wyatt Roersma 14070146dc Add configuration option to kvm.conf for a custom dsn option that allows the use of remote kvm servers or the standard default of "qemu:///system". 2018-10-10 06:06:50 -06:00
Andres ea221cef92 Allow specifying list of IRMA probes to use #2513 2018-10-09 14:46:50 +02:00
Jurriaan Bremer 443349ecc6 finalize the secret authentication page 2018-09-13 18:32:42 +02:00
Jurriaan Bremer c82ca7303e move api token creation, awaiting config improvements 2018-09-09 10:40:07 +02:00
Jurriaan Bremer 713915ec59 allow ssl replay functionality through mitmproxy certificates
This commit passes through tlsmaster.txt secrets to httpreplay such that
it can prepare the correct .mitm file through mitmproxy and also
installs the mitmproxy certificate as part of replay. Replay now
supports both HTTP and HTTPS.
2018-08-01 03:43:17 +02:00
Jurriaan Bremer 5474a81dc3 implement .pcap/.mitm analysis replay functionality
Implements an Auxiliary module for setting up mitmdump (part of
mitmproxy), version 3.0 or higher, for replaying pre-captured HTTP
requests.

Bumps httpreplay for decoupling the pcap2mitm method from the click
entry point and does some other code cleanup. Also makes Cuckoo
Rooter less quiet, somewhat simplifying debugging.

In the future we might want also want to invoke drop_enable and
drop_disable Cuckoo Rooter commands, ensuring no network traffic is
propagated outside of the host machine.
2018-06-24 12:09:20 +02:00
Jurriaan Bremer 5735f14437 allow port redirection in inetsim routing mode 2018-06-24 11:56:16 +02:00
Jurriaan Bremer 070ae54f08 prepare for 2.0.6 release 2018-06-03 11:52:46 +02:00
Jurriaan Bremer aa701e0030 beautify database migration message, small improvements 2018-04-18 22:23:13 +02:00
Jurriaan Bremer a6604bee46 code cleanup 2018-03-15 12:39:33 +01:00
Daan Spitz f1626fc488 move per-vm vbox control port config directive to global port range 2018-03-15 12:39:32 +01:00
Daan Spitz ead46579df add controlport config directive 2018-03-15 12:39:29 +01:00
Daan Spitz 7e89d1658f fix typo and missing config file 2018-03-15 12:39:29 +01:00
Daan Spitz 8814270b1a add remotecontrol/guacd config directives 2018-03-15 12:39:29 +01:00
Jurriaan Bremer 2f0fba027c move mitm.py and gatherer.py to cwd/stuff 2017-09-10 13:36:36 +02:00
Jurriaan Bremer 382b66ca69 various tweaks and move elf to its own static.elf key 2017-08-07 14:17:42 +02:00
Jurriaan Bremer d14a5a7909 Merge branch 'linux-analysis'
Conflicts:
	cuckoo/compat/config.py
	tests/test_config.py
	tests/test_guest.py
2017-07-12 16:40:34 +02:00
Jurriaan Bremer d39076b2cf various minor tweaks 2017-07-12 16:35:52 +02:00
Daan Spitz 92c0cfbbf9 add snapshot + enable_kvm to qemu config #1545 (thanks doomedraven) 2017-07-04 19:18:17 +02:00
Jurriaan Bremer 2d4f2e00a2 minor tweaks and bump configuration migrations 2017-05-28 09:56:42 +02:00
Jurriaan Bremer 26fba3e178 move results into its own extracted processing module, yara scripts
Introduces the concept of Yara rules for extracted scripts. We'll likely
also have a category for extracted shellcode soon. First to work on
recursive extraction and allowing 3rd party plugins to, e.g., extract a
shellcode stream from a PowerShell script (statically).
2017-05-27 23:06:11 +02:00
Jurriaan Bremer 2824726ca1 initialize console logging awaiting file logging
While checking the configuration settings we want to be able to do some
console logging in case something went wrong. Improve our existing logic
to initialize console logging rather than printing to stderr directly.
2017-04-28 23:41:09 +02:00
Jurriaan Bremer e7d6350591 allow per-vm osprofile declarations, further wip #1354 (thanks doomedraven) 2017-04-25 20:55:35 +02:00
Jurriaan Bremer 443c381959 fix full migration unit test to work with multiple configured vms 2017-04-23 14:29:03 +02:00
Jurriaan Bremer 0fdcdc4d4c wip on mitigating pid_generic issues #1392 (thanks pinksawtooth)
This should pose an improvement on the full memory analysis module, but
it hasn't been tested (or unit tested) as of yet. Awaiting feedback.
2017-04-12 00:40:48 +02:00
Jurriaan Bremer 221cdb252f more properly propagate machine.options #1381 #1392
For unknown reasons nobody ran into this issue before the 2.0.0 release,
however, on a clean Cuckoo setup with newly created configuration, the
machine.options field would always be set to None rather than an empty
string or list, resulting in various exceptions around the Core code.

This commit more improves the handling of this 'special' list type and
ensures the machine.options field will always be at least an empty list.
This counts for both the data retrieved from the configuration as well
as the database handling part.

Thanks to CSIRTUK and pinksawtooth for reporting and doomedraven for
providing an ad hoc solution.
2017-04-12 00:36:43 +02:00
Jurriaan Bremer 77d5ed1676 preparations for combining html and pdf reporting 2017-03-23 14:25:18 +01:00
Jurriaan Bremer ea56b49a8a further purify configuration read/write abilities
* Code de-duplication with regards to get_section_types() in Config.
* Make cast() & read_kv_conf() less strict about star sections.
* Don't overwrite given values for default star items, e.g., "cuckoo1".
2017-03-22 20:20:12 +01:00
Jurriaan Bremer b4dc6e067c resolve typo 2017-03-19 12:57:16 +01:00
Jurriaan Bremer e85f0f5476 Merge branch 'kernel' into package
Conflicts:
	cuckoo/compat/config.py
	cuckoo/core/guest.py
	cuckoo/data/analyzer/windows/analyzer.py
	cuckoo/data/analyzer/windows/lib/api/process.py
	cuckoo/misc.py
	cuckoo/processing/debug.py
	tests/test_config.py
	tests/test_misc.py
	tests/test_startup.py
2017-03-17 15:32:35 +01:00
Jurriaan Bremer d4028b8a8c fix two config-related bugs with multiple star items
* While writing away the configuration, the "section" variable would be
  overwritten, causing an exception for the second star entry.
* Improve config2() to accept star items and return a Dictionary.
2017-03-17 12:35:54 +01:00
Jurriaan Bremer 0356883c45 wip on host vs guest communication issues and more
* Identify and report Host <> Guest connection issues and drop hints to
  the user in both the command-line logs as well as the Web Interface.
* Provide FAQ entry for these issues.
* Only keep unique errors & actions in the report.
* Some other documentation tweaks (regarding formatting etc).
2017-03-16 12:48:34 +01:00
Jurriaan Bremer e65b237ea5 more configuration migration unittests
Unittests for performing configuration migrations on 1.2, 2.0-rc1, and
2.0-rc2 as well as slight migration improvements.
2017-03-14 02:08:24 +01:00
Jurriaan Bremer 7d0a508208 resolve configuration migration issues
* Due to legacy configuration, the "bpf" entry may not exist yet.
* Mapping from actual version numbers to configuration migration ones.
* Add support for bugfix release Cuckoo Sandbox 1.1.1.
* Unittesting for configuration from Cuckoo 1.1.
2017-03-14 01:40:35 +01:00
Jurriaan Bremer 1cd00bf987 forgot to get rid of configuration entry for jsondump encoding
And introduce a small unittest to ensure this won't happen again :-)
2017-03-07 21:00:04 +01:00
Jurriaan Bremer b1506461b9 apply a bit of sanity to jsondump (+40% performance improvement)
* Get rid of the "encoding" configuration value. This should be latin-1
  as otherwise we'll get unicode-related issues. If there are actually
  other possible encodings formats we can always consider changing to
  one of those if they meet our requirements (i.e., unittests).
* Bump file I/O buffering size to 1 MB, this may improve performance
  slightly (as compared to the default 8 KB value).
* Get rid of UnicodeError & use "indent" value the way you expect it.

Especially the removal of codecs.open() is a great performance boost,
reducing the required time by almost half in some cases.
2017-03-07 02:02:51 +01:00
Jurriaan Bremer ac17e1761c further minimize on reading in configuration files
It's most certainly not necessary to read in configuration files once or
multiple times for each processed analysis. We strip down on re-reading
configuration files by, yet again, moving away from Config() usage to
the config() and config2() variants (which cache results).

* Use config2() to obtain cached versions of the configuration values
  for running Auxiliary, Processing, and Reporting modules.
* Get rid of Config() usage in some processing modules.
* Unittests for all of the above, including a unittest which ensures
  that Config() is only called twice when processing multiple analyses;
  once for reading in processing.conf and once for reporting.conf.

Without these changes, it would be possible to have a dozens (although
for larger analyses this could be much, much more) configuration reads
per processed analysis.
2017-03-06 15:31:47 +01:00
Jurriaan Bremer 8800f63010 disable virustotal support by default #1319 2017-03-06 11:32:12 +01:00
Jurriaan Bremer ca6fe4e2ce handle another config parsing issue
So having a whitespace in front of the line means the data belongs to
the line before it. If this is the first line in a section, then there's
no line before it, and ConfigParser throws a ParsingError exception. We
should just probably write our own .ini-style configuration parser..
2017-03-02 11:25:09 +01:00
Jurriaan Bremer 947fabe788 Merge branch 'master' into package
Also updates the previously-broken Moloch integration to something that
should work (although it hasn't been tested or unit tested).

Conflicts:
	cuckoo/data-private/cwd/conf/qemu.conf
	cuckoo/data-private/cwd/conf/reporting.conf
	web/analysis/views.py
	web/web/settings.py
2017-02-28 20:44:49 +01:00
Jurriaan Bremer 823c08251c mattermost configuration migration and updated defaults
As per the mattermost configuration in the master branch, all options
were assumed to be disabled by default. Reflect this in our defaults.
2017-02-28 14:11:00 +01:00
Jurriaan Bremer 9d7983ec5a handle configparser-related configuration parsing bug
This is probably a feature on ConfigParser's side to support multi-line
values for certain keys, but it seems to have broken the Cuckoo setup
for at least a handful of people so far. So let's raise an accurate
exception early on to prevent those people from running into related
issues later on at runtime.
2017-02-25 14:13:23 +01:00
Jurriaan Bremer 3a3e861cbf part one on web interface modernization
In no particular order:
* Sort emitted analysis options by alphabat.
* Allow assignment of analysis options by string and dict.
* Allow assignment of analysis tags by string and tuple/list.
* Further analysis options <> Web Interface options translation.
* Simplify and improve correctness of analysis import functionality.
* Remove plenty of outdated code / templates / etc.
* Attempt to pass analysis options & errors to /filetree.
* Reimplement resubmit & reboot analysis using new submit.
* Low/medium/high priority are {1..3}, not {0..2} in Web Interface.
* Fixed up various "missing variable" templating issues.
* Made /submit/api/submit input & unit tests up-to-date.
* Code refactoring, cleanup, and unit tests.

Following the one-liner to more properly indent & sort dictionary keys
alphabetically for the /submit input JSON data (so that future changes
are more clear than our current changes - which not only made the input
data more up-to-date but also altered some fields).

import json, sys
print json.dumps(json.load(sys.stdin), indent=4, sort_keys=True)
2017-02-23 03:43:44 +01:00
Jurriaan Bremer 1c661d6c5b Merge core-submit into package (using imerge) 2017-02-20 20:21:19 +01:00
Jurriaan Bremer 059776489d this is 2017, bump some defaults
* Required free diskspace from 64 MB to 1 GB.
* Maximum dropped file size from 10 MB to 128 MB.
* Maximum .bson behavioral analysis size from 100 MB to 128 MB.
2017-02-20 18:49:41 +01:00
Jurriaan Bremer 020597ae6e start of major mongodb/elasticsearch overhaul
First work on abstraction layers for MongoDB/GridFS and ElasticSearch
usage, making the code easier on the eye and less complex to unit test.
* Introduce init_once() method for all plugins/modules.
* Use global mongo & elastic instance so only one connection is
  required, instead of a connection per processed analysis.
* Configuration migration for MongoDB user authentication.
* Proper configuration support for ElasticSearch's multiple hosts.
* Get rid of "settings.MONGO" & "settings.ELASTIC" usage.
* Include elasticsearch==2.2.0 dependency (to be upgraded by #1196).
* Some unit tests to back up the above, but not full coverage.
* Code cleanup & Screenshots unit test fix.

Note that as per their documentation, both the MongoDB and ElasticSearch
Python API's are thread-safe. Other than that, let's hope the untested
changes are fine :-)
2017-02-18 16:03:11 +01:00