From c58f131e10670e652bb3de1fa62f78ab2997aa0a Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 07:40:05 +0900 Subject: [PATCH 1/7] chg: [travis] Added py3.8 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0b87679..b70f838 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ python: - "3.6" - "3.6-dev" - "3.7-dev" + - "3.8-dev" before_install: - docker build -t misp-modules --build-arg BUILD_DATE=$(date -u +"%Y-%m-%d") docker/ From 72913c94891f26db88d3f5a278aa4f1cd70e5ad0 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 07:53:19 +0900 Subject: [PATCH 2/7] fix: [pip] pyfaup required --- REQUIREMENTS | 1 + 1 file changed, 1 insertion(+) diff --git a/REQUIREMENTS b/REQUIREMENTS index c69b383..e749db9 100644 --- a/REQUIREMENTS +++ b/REQUIREMENTS @@ -8,6 +8,7 @@ -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 From acee9888b684a27ba48500aa7b5cc94ea75650a0 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 08:45:10 +0900 Subject: [PATCH 3/7] chg: [travis] Added gtcaca and liblua to faup --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b70f838..3031967 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,15 @@ before_install: - docker build -t misp-modules --build-arg BUILD_DATE=$(date -u +"%Y-%m-%d") docker/ install: - - sudo apt-get install libzbar0 libzbar-dev libpoppler-cpp-dev tesseract-ocr libfuzzy-dev + - sudo apt-get install libzbar0 libzbar-dev libpoppler-cpp-dev tesseract-ocr libfuzzy-dev libcaca-dev liblua5.3-dev - pip install pipenv - pipenv install --dev + # install gtcaca + - git clone git://github.com/stricaud/gtcaca.git gtcaca + - pushd gtcaca/build + - cmake .. && make + - sudo make install + - popd # install pyfaup - git clone https://github.com/stricaud/faup.git - pushd faup/build From e655905ee0aad62485534d65332f32c938476304 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 11:45:47 +0900 Subject: [PATCH 4/7] chg: [doc] in case btc expansion fails, give another hint at why it fails --- tests/test_expansions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_expansions.py b/tests/test_expansions.py index 801769a..b853c25 100644 --- a/tests/test_expansions.py +++ b/tests/test_expansions.py @@ -105,9 +105,10 @@ class TestExpansions(unittest.TestCase): query = {"module": "btc_steroids", "btc": "1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA"} response = self.misp_modules_post(query) try: - self.assertTrue(self.get_values(response).startswith('\n\nAddress:\t1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA\nBalance:\t0.0000000000 BTC (+0.0005355700 BTC / -0.0005355700 BTC)')) + self.assertTrue(self.get_values(response).startswith('\n\nAddress:\t1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA\nBalance:\t0.0002126800 BTC (+0.0007482500 BTC / -0.0005355700 BTC)')) + except Exception: - self.assertEqual(self.get_values(response), 'Not a valid BTC address') + self.assertEqual(self.get_values(response), 'Not a valid BTC address, or Balance has changed') def test_btc_scam_check(self): query = {"module": "btc_scam_check", "btc": "1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA"} From 9f8a72ba64ea24cc02b96f27f60eac010851647c Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 11:59:33 +0900 Subject: [PATCH 5/7] fix: [travis] gtcaca has no build directory --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3031967..4d551b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ install: - pip install pipenv - pipenv install --dev # install gtcaca - - git clone git://github.com/stricaud/gtcaca.git gtcaca + - git clone git://github.com/stricaud/gtcaca.git + - mkdir -p gtcaca/build - pushd gtcaca/build - cmake .. && make - sudo make install From dbb7d37b1e5b597d38e60b9b7580d9f723e2230a Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 12:09:18 +0900 Subject: [PATCH 6/7] chg: [doc] Added details about faup --- docs/install.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/install.md b/docs/install.md index 72cf9d6..662e675 100644 --- a/docs/install.md +++ b/docs/install.md @@ -21,8 +21,28 @@ $SUDO_WWW virtualenv -p python3 /var/www/MISP/venv # END with virtualenv cd /usr/local/src/ -sudo git clone https://github.com/MISP/misp-modules.git -cd misp-modules +# 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 @@ -168,4 +188,4 @@ 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. \ No newline at end of file +Next you can follow standard install procedure. From 3fd6633c015f913b088b6fc07eaf1c418474bf71 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 1 May 2020 12:12:33 +0900 Subject: [PATCH 7/7] fix: [pep] Comply to PEP E261 --- misp_modules/modules/expansion/vmray_submit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misp_modules/modules/expansion/vmray_submit.py b/misp_modules/modules/expansion/vmray_submit.py index 73a0cdf..1c0d553 100644 --- a/misp_modules/modules/expansion/vmray_submit.py +++ b/misp_modules/modules/expansion/vmray_submit.py @@ -73,9 +73,9 @@ def handler(q=False): do_not_include_vmrayjobids = request["config"].get("do_not_include_vmrayjobids") try: - shareable = bool(strtobool(shareable)) # Do we want the sample to be shared? - reanalyze = not bool(strtobool(do_not_reanalyze)) # Always reanalyze the sample? - include_vmrayjobids = not bool(strtobool(do_not_include_vmrayjobids)) # Include the references to VMRay job IDs + shareable = bool(strtobool(shareable)) # Do we want the sample to be shared? + reanalyze = not bool(strtobool(do_not_reanalyze)) # Always reanalyze the sample? + include_vmrayjobids = not bool(strtobool(do_not_include_vmrayjobids)) # Include the references to VMRay job IDs except ValueError: misperrors["error"] = "Error while processing settings. Please double-check your values." return misperrors