diff --git a/docs/conf.py b/docs/conf.py index ce9f27d..b17036b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,7 +21,7 @@ import types sys.path.insert(0, os.path.join(os.path.abspath('..'), 'server')) -import sphinx.ext.autodoc +import sphinx.ext.autodoc.importer # -- General configuration ------------------------------------------------ @@ -44,7 +44,7 @@ autodoc_mock_imports = ['httplib2', 'oauth2client', 'apiclient', 'django', 'capstone'] -class _MyMockModule(sphinx.ext.autodoc._MockModule): +class _MyMockModule(sphinx.ext.autodoc.importer._MockModule): '''Class created to get around autodoc issues with server's dependencies.''' @classmethod def __getattr__(self, name): diff --git a/docs/index.rst b/docs/index.rst index 72bced1..b90fa9a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,7 +26,41 @@ Installing your own FIRST server can be quick and easy with an Ubuntu machine an http://localhost:8888/oauth/google http://first.talosintelligence.com/oauth/google - Once created you will have the option to down the JSON file containing the generated secret. Optionally, you can add install/ssl/apache.crt and apache.key file if you have an SSL certificate you would prefer to use. + Once created you will have the option to download the JSON file containing the generated secret. Optionally, you can add install/ssl/apache.crt and apache.key file if you have an SSL certificate you would prefer to use. (Note that docker will generate one for you when the docker image is built.) + +.. important:: + + **Server configuration (first_config.json)** + + Before building the docker image of FIRST-server you will need to create a configuration file under the path ``server/first_config.json``. You have an example configuration file that you can copy, under the following path: ``server/example_config.json``. This configuration file has the following contents: + + .. code:: + + { + "secret_key" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + + "db_engine" : "django.db.backends.mysql", + "db_dbname" : "first_db", + "db_user" : "root", + "db_password" : "password12345", + "db_host" : "mysql", + "db_port" : 3306, + + "debug" : true, + "allowed_hosts" : ["localhost", "testserver"], + + "oauth_path" : "/usr/local/etc/google_secret.json" + } + + This configuration values should just work correctly on a default local docker set up. For a production enviroment: + + * ``secret_key`` should be a random and unique value + * ``db_user``, ``db_password``, ``db_host``, ``db_port`` should be updated to match your MySQL production database. + * ``debug`` should be set to false + * ``allowed_hosts`` should match the host name where you configured your server (e.g.: first.talosintelligence.com) + * ``oauth_path`` should match the path where you have your ``google_secret.json`` file. + +Once you have created and downloaded your ``google_secret.json`` file, and created the ``first_config.json`` configuration file, you can proceed to build and start your FIRST-server docker image: .. code:: diff --git a/server/example_config.json b/server/example_config.json index bb19c86..08c0653 100644 --- a/server/example_config.json +++ b/server/example_config.json @@ -2,14 +2,14 @@ "secret_key" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "db_engine" : "django.db.backends.mysql", - "db_dbname" : "first", - "db_user" : "user", - "db_password" : "pass", - "db_host" : "localhost", + "db_dbname" : "first_db", + "db_user" : "root", + "db_password" : "password12345", + "db_host" : "mysql", "db_port" : 3306, "debug" : true, "allowed_hosts" : ["localhost", "testserver"], - "oauth_path" : "/path/to/your/google_secret.json", + "oauth_path" : "/usr/local/etc/google_secret.json" } diff --git a/server/first_core/disassembly/__init__.py b/server/first_core/disassembly/__init__.py index 010739e..87f950b 100644 --- a/server/first_core/disassembly/__init__.py +++ b/server/first_core/disassembly/__init__.py @@ -1,12 +1,77 @@ # Third Party Modules -from capstone import * -from capstone.ppc import * -from capstone.systemz import * -from capstone.arm import * -from capstone.arm64 import * -from capstone.x86 import * -from capstone.sparc import * -from capstone.mips import * + +from capstone import CS_MODE_32 +from capstone import CS_MODE_64 +from capstone import CS_MODE_16 +from capstone import CS_ARCH_PPC +from capstone import CS_ARCH_X86 +from capstone import CS_ARCH_SYSZ +from capstone import CS_ARCH_ARM +from capstone import CS_MODE_ARM +from capstone import CS_ARCH_ARM64 +from capstone import CS_ARCH_SPARC +from capstone import CS_ARCH_MIPS + +from capstone.ppc import PPC_OP_REG +from capstone.ppc import PPC_OP_IMM +from capstone.ppc import PPC_OP_MEM +from capstone.ppc import PPC_OP_INVALID + +from capstone.x86 import X86_OP_REG +from capstone.x86 import X86_OP_IMM +from capstone.x86 import X86_OP_MEM +from capstone.x86 import X86_OP_INVALID +from capstone.x86 import X86_INS_CALL +from capstone.x86 import X86_INS_JA +from capstone.x86 import X86_INS_JAE +from capstone.x86 import X86_INS_JB +from capstone.x86 import X86_INS_JBE +from capstone.x86 import X86_INS_JCXZ +from capstone.x86 import X86_INS_JE +from capstone.x86 import X86_INS_JECXZ +from capstone.x86 import X86_INS_JG +from capstone.x86 import X86_INS_JGE +from capstone.x86 import X86_INS_JL +from capstone.x86 import X86_INS_JLE +from capstone.x86 import X86_INS_JMP +from capstone.x86 import X86_INS_JNE +from capstone.x86 import X86_INS_JNO +from capstone.x86 import X86_INS_JNP +from capstone.x86 import X86_INS_JNS +from capstone.x86 import X86_INS_JO +from capstone.x86 import X86_INS_JP +from capstone.x86 import X86_INS_JRCXZ +from capstone.x86 import X86_INS_JS +from capstone.x86 import X86_INS_LJMP +from capstone.x86 import X86_REG_SP +from capstone.x86 import X86_REG_EBP +from capstone.x86 import X86_REG_ESP +from capstone.x86 import X86_REG_RSP + +from capstone.systemz import SYSZ_OP_REG +from capstone.systemz import SYSZ_OP_IMM +from capstone.systemz import SYSZ_OP_MEM +from capstone.systemz import SYSZ_OP_INVALID + +from capstone.arm import ARM_OP_REG +from capstone.arm import ARM_OP_IMM +from capstone.arm import ARM_OP_MEM +from capstone.arm import ARM_OP_INVALID +from capstone.arm64 import ARM64_OP_REG +from capstone.arm64 import ARM64_OP_IMM +from capstone.arm64 import ARM64_OP_MEM +from capstone.arm64 import ARM64_OP_INVALID + +from capstone.sparc import SPARC_OP_IMM +from capstone.sparc import SPARC_OP_REG +from capstone.sparc import SPARC_OP_MEM +from capstone.sparc import SPARC_OP_INVALID + +from capstone.mips import MIPS_OP_REG +from capstone.mips import MIPS_OP_IMM +from capstone.mips import MIPS_OP_MEM +from capstone.mips import MIPS_OP_INVALID + arch_mapping = { 'ppc' : (CS_ARCH_PPC, CS_MODE_32),