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

[BUG] 7za.exe matches cab_file flavor #371

Open
ryanohoro opened this issue Apr 25, 2023 · 1 comment
Open

[BUG] 7za.exe matches cab_file flavor #371

ryanohoro opened this issue Apr 25, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ryanohoro
Copy link
Collaborator

ryanohoro commented Apr 25, 2023

Describe the bug

When analyzing 7za.exe with Strelka, the cab_file flavor is applied, leading to it being processed by ScanLibarchive erroneously.

c136b1467d669a725478a6110ebaaab3cb88a3d389dfa688e06173c066b76fcf 7za.exe

{
  "depth": 0,
  "flavors": {
    "mime": [
      "application/x-dosexec"
    ],
    "yara": [
      "mz_file",
      "cab_file"
    ]
  },
  "name": "7za.exe",
  "scanners": [
    "ScanEntropy",
    "ScanFooter",
    "ScanHash",
    "ScanHeader",
    "ScanLibarchive",
    "ScanPe",
    "ScanTlsh",
    "ScanYara"
  ],
  "size": 587776,
  "tree": {
    "node": "3f188c3c-3bb9-4457-9ce3-298554b31cd4",
    "root": "3f188c3c-3bb9-4457-9ce3-298554b31cd4"
  }
}

Because cab_file checks for both a MSCF magic at the top, but also anywhere in a PE file, Windows-based compression utilities are likely to match. I expect that the second condition is an attempt to match self-extracting archives. ScanLibarchive can extract some self-extracting CAB files.

rule cab_file {
    meta:
        type = "archive"
    strings:
        $a = { 4D 53 43 46 00 00 00 00 }
    condition:
        $a at 0 or
        ( uint16(0) == 0x5A4D and $a )
}

Environment details

  • Operating System: Ubuntu 22.04
  • Architecture: x64

Steps to reproduce

  1. Download a copy of 7za.exe
  2. Upload to Strelka UI
  3. Observe cab_file and ScanLibarchive in the output event.

Expected behavior

Sample file should match only mz_file/application/x-dosexec flavors.

Screenshots

Release

  • Release: 0.23.03.14

Additional context

@ryanohoro ryanohoro added the bug Something isn't working label Apr 25, 2023
@phutelmyer
Copy link
Contributor

phutelmyer commented Apr 26, 2023

Good catch @ryanohoro.

I wonder if we can import pe into the taste.yara file using the pe module and add in and not pe (and not pe.is_pe)?

Not entirely sure what the criteria are for pe matching is for that module, so it may not work.

@phutelmyer phutelmyer assigned skalupa and unassigned phutelmyer Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants