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

design filename HBI feature for use in dynamic analysis #1559

Open
Tracked by #1549
williballenthin opened this issue Jun 15, 2023 · 4 comments
Open
Tracked by #1549

design filename HBI feature for use in dynamic analysis #1559

williballenthin opened this issue Jun 15, 2023 · 4 comments
Labels
breaking-change introduces a breaking change that should be released in a major version dynamic related to dynamic analysis flavor enhancement New feature or request gsoc Work related to Google Summer of Code project.

Comments

@williballenthin
Copy link
Collaborator

williballenthin commented Jun 15, 2023

let's discuss the requirements and sketch a design for how this feature should look and act. the idea is to represent a file name or path artifact that is manipulated during a dynamic analysis session.

this should include how the rule syntax changes, the format of the feature and properties of the feature, and at least two example rules showing how the feature would be used.

once we're happy with the design, then lets plan for opening a standalone PR with the file path feature.

open questions include:

  • how to represent operations, like read/write/create/delete
  • how to represent paths versus names versus volumes versus streams, etc.
  • how to represent the data written/read from a file
  • how to combine all the above with logic, or not. and how this affects rule syntax
@williballenthin williballenthin added enhancement New feature or request breaking-change introduces a breaking change that should be released in a major version gsoc Work related to Google Summer of Code project. dynamic related to dynamic analysis flavor labels Jun 15, 2023
@yelhamer yelhamer moved this to todo in @yelhamer GSoC 2023 Jun 19, 2023
@yelhamer yelhamer moved this from todo to next up in @yelhamer GSoC 2023 Jun 19, 2023
@yelhamer yelhamer moved this from next up to in progress in @yelhamer GSoC 2023 Jun 21, 2023
@yelhamer
Copy link
Collaborator

yelhamer commented Jul 1, 2023

For this feature, I propose to have a syntax similar to that of other HBI-based features; that is, a filename keyword that has modifiers (read, write, delete). Additionally, I think it would be a nice addition to support UNIX-like wildcards such as: ?, *, and {}. Example:

rule:
  meta:
    name: persistence via ssh
    scope: file
  features:
    - filename/write: "/home/*/.ssh/authorized_keys"

Another example:

rule:
  meta:
    name: persistence via cron
    scope: file
  features:
    - filename/write: "/etc/cron.{daily,hourly,monthly,weekly}/*"

The pros are that this format is widely known, in addition to it being easy to parse — as opposed to regex — and quite expressive.
These features could also be extracted at call or instruction scope levels.

@mr-tz
Copy link
Collaborator

mr-tz commented Jul 3, 2023

This looks like a good start. How do you envision addressing paths vs. files? Would it be filename: C:\Windows for example?

@yelhamer
Copy link
Collaborator

yelhamer commented Jul 3, 2023

Hmm, good point. Maybe treat directories as files as well (like you suggest)?

@mr-tz
Copy link
Collaborator

mr-tz commented Jul 3, 2023

For that general case I'd then suggest file or path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change introduces a breaking change that should be released in a major version dynamic related to dynamic analysis flavor enhancement New feature or request gsoc Work related to Google Summer of Code project.
Projects
Status: in progress
Development

No branches or pull requests

3 participants