Skip to content
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

Ignore non-JSON output in detect-it-easy output #2473

Merged

Conversation

josh-feather
Copy link
Contributor

@josh-feather josh-feather commented Jan 29, 2025

The diec binary outputs non-JSON output in JSON mode, causing the parsing to fail. For example:

[!] Heuristic scan is disabled. Use --heuristicscan to enable
{
    "detects": [
        {
            "filetype": "PE64",
            "info": "",
            "offset": "0",
            "parentfilepart": "Header",
            "size": "3488048",
            "values": [
                {
                    "info": "",
                    "name": "Microsoft Linker",
                    "string": "Linker: Microsoft Linker(14.22.27905)",
                    "type": "Linker",
                    "version": "14.22.27905"
                },
                {
                    "info": "C++",
                    "name": "Microsoft Visual C/C++",
                    "string": "Compiler: Microsoft Visual C/C++(19.22.27905)[C++]",
                    "type": "Compiler",
                    "version": "19.22.27905"
                },
                {
                    "info": "",
                    "name": "Visual Studio",
                    "string": "Tool: Visual Studio(2019, v16.2)",
                    "type": "Tool",
                    "version": "2019, v16.2"
                }
            ]
        }
    ]
}

There is a related issue noted against the DIE project:
horsicq/Detect-It-Easy#242

The `diec` binary outputs non-JSON output in JSON mode, causing the parsing to fail. For example:

```text
[!] Heuristic scan is disabled. Use --heuristicscan to enable
{
    "detects": [
        {
            "filetype": "PE64",
            "info": "",
            "offset": "0",
            "parentfilepart": "Header",
            "size": "3488048",
            "values": [
                {
                    "info": "",
                    "name": "Microsoft Linker",
                    "string": "Linker: Microsoft Linker(14.22.27905)",
                    "type": "Linker",
                    "version": "14.22.27905"
                },
                {
                    "info": "C++",
                    "name": "Microsoft Visual C/C++",
                    "string": "Compiler: Microsoft Visual C/C++(19.22.27905)[C++]",
                    "type": "Compiler",
                    "version": "19.22.27905"
                },
                {
                    "info": "",
                    "name": "Visual Studio",
                    "string": "Tool: Visual Studio(2019, v16.2)",
                    "type": "Tool",
                    "version": "2019, v16.2"
                }
            ]
        }
    ]
}
```

There is a related issue noted against the DIE project:
horsicq/Detect-It-Easy#242
@josh-feather josh-feather force-pushed the grab-detect-it-easy-json branch from c07a187 to 6ca1ebc Compare January 29, 2025 12:33
@doomedraven doomedraven merged commit 8737968 into kevoreilly:master Jan 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants