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

Dynamic scan match model capabilities #6

Open
1 of 3 tasks
Col-E opened this issue Jul 12, 2023 · 0 comments
Open
1 of 3 tasks

Dynamic scan match model capabilities #6

Col-E opened this issue Jul 12, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Col-E
Copy link
Collaborator

Col-E commented Jul 12, 2023

Definitions

Basic parameter inspections

When calling any method, upon the VM entering that method we should be able to inspect parameter values and check for some conditions based on the variable types. Parameters can be matched by index.

Types:

  • Numeric primitives (byte, short, int, long, double, float, maybe boolean and char if you wanna be technical)
    • Comparisons to some N: > N, >= N, == N, < N, <= N, & N == N, & N != N
  • Reference types
    • String/CharSequence/StringBuilder
      • Checks with our TextMatchMode
    • Number boxed types
      • Map to primitives if not null, offer those abilities
    • Anything
      • Is null or not

Example cases:

  • Runtime.exec(s) where s.contains("malware.exe")
  • new URL(s) where s.matches(HTTP_PATTERN)

Scoped method calls

Given the following:

static void one() {
	two();
}
static void two() {
	three();
}
static void three() {
	// ...
}

Scoped calls would allow for making a match for one -> two -> three, effectively saying "match three, if called by two, which must be called by one".

Adjacent method calls

Given the following:

Runtime.getRuntime()
    .exec(new String(Base64.getDecoder().decode("ZXhhbXBsZQ==")));

Adjacent method calls would allow for making a match for decode --> exec, effectively saying "match exec if decode was used prior to calling in the same method". In this example such a match could be titled "using b64 to hide Runtime.exec calls"

Action items

  • Basic parameter value inspections
  • Scoped method calls with parameter checking
  • Adjacent method calls with parameter checking
@Col-E Col-E added the enhancement New feature or request label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant