-
-
Notifications
You must be signed in to change notification settings - Fork 529
detect-it-easy analyzer, closes #1590 #2354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
11ae110
die
9fc11c6
tweeks
475e4d2
codefactor
39d84d0
codefactor
04a303e
ypo
71e944f
gitignore
35b4922
typo fix
e763f7d
detectiteasyyyyy
ae4fe4d
tests
646e736
supported files
3a87aa6
Merge branch 'develop' of https://github.com/intelowlproject/IntelOwl…
55e03ca
msdos
ddad7a0
logs, file support, soft t/o, poll
551da9b
migrate
530bb1d
for all files
ce95dea
docker_based_true
3467275
params
f47dd88
Merge branch 'develop' of https://github.com/intelowlproject/IntelOwl…
bea64c1
tests debug[1]
ba7b288
Update api_app/analyzers_manager/migrations/0094_analyzer_config_dete…
mlodic 14df652
Update api_app/analyzers_manager/file_analyzers/detectiteasy.py
mlodic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import logging | ||
|
|
||
| from api_app.analyzers_manager.classes import DockerBasedAnalyzer, FileAnalyzer | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class DetectItEasy(FileAnalyzer, DockerBasedAnalyzer): | ||
| name: str = "executable_analyzer" | ||
| url: str = "http://malware_tools_analyzers:4002/die" | ||
| # http request polling max number of tries | ||
| max_tries: int = 10 | ||
| # interval between http request polling (in secs) | ||
| poll_distance: int = 3 | ||
g4ze marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| def update(self): | ||
| pass | ||
|
|
||
| def run(self): | ||
| fname = str(self.filename).replace("/", "_").replace(" ", "_") | ||
| # get the file to send | ||
| binary = self.read_file_bytes() | ||
| args = [f"@{fname}", "--json"] | ||
| req_data = { | ||
| "args": args, | ||
| } | ||
| req_files = {fname: binary} | ||
| logger.info(f"Running {self.analyzer_name} with args: {args}") | ||
g4ze marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| report = self._docker_run(req_data, req_files, analyzer_name=self.analyzer_name) | ||
| if not report: | ||
| self.report.errors.append("DIE does not support the file") | ||
mlodic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return {} | ||
| return report | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,11 @@ freshclam # download db for first time | |
| freshclam -d & # run updater in bg | ||
| echo "running clamd" | ||
| clamd --debug & # run daemon in bg | ||
|
|
||
| # diec analyzer variable | ||
| export LD_LIBRARY_PATH="/opt/deploy/die/die_lin64_portabl/base:$LD_LIBRARY_PATH" | ||
|
||
|
|
||
|
|
||
| # change user | ||
| su malware_tools_analyzers-user -s /bin/bash | ||
| echo "running fangfrisch" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.