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 scanning model #11

Merged
merged 11 commits into from
Aug 11, 2023
Merged

Dynamic scanning model #11

merged 11 commits into from
Aug 11, 2023

Conversation

Col-E
Copy link
Collaborator

@Col-E Col-E commented Aug 1, 2023

Example of format for partial matching of https://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java

{
  "archetype": {
    "level": "MAXIMUM",
    "identifier": "Windows Registry",
    "description": "Indicators of working with Windows Registry"
  },
  "code-patterns": {
    "invokeRootUser": [{ "op": "STARTS_WITH invoke", "args": "STARTS_WITH java/util/prefs/Preferences.userRoot()" }],
    "invokeRootSysm": [{ "op": "STARTS_WITH invoke", "args": "STARTS_WITH java/util/prefs/Preferences.systemRoot()" }]
  },
  "code-behaviors": {
    "lookupMethod": {
      "location": { "class": "EQUALS java/lang/Class", "mname": "EQUALS getDeclaredMethod" },
      "condition": { "ANY": [
        { "index": 1, "match": "EQUALS WindowsRegOpenKey" },
        { "index": 1, "match": "EQUALS WindowsRegCloseKey" },
        { "index": 1, "match": "EQUALS WindowsRegQueryValueEx" },
        { "index": 1, "match": "EQUALS WindowsRegEnumValue" },
        { "index": 1, "match": "EQUALS WindowsRegEnumKeyEx" },
        { "index": 1, "match": "EQUALS WindowsRegSetValueEx" },
        { "index": 1, "match": "EQUALS WindowsRegDeleteValue" },
        { "index": 1, "match": "EQUALS WindowsRegDeleteKey" }
      ]}
    }
  }
}

PR includes:

  • Models to support dynamic signatures
  • Basic plugging into the existing SSVM pipeline

PR does not include:

  • Implementations for EntryPointDiscovery or CoverageEntryPointSupplier which are required for the dynamic scanner to actually work
    • That will be a future PR

@Col-E Col-E added the enhancement New feature or request label Aug 1, 2023
@Col-E Col-E requested a review from xyzeva August 1, 2023 03:20
@Col-E Col-E marked this pull request as draft August 1, 2023 03:21
Copy link
Member

@xyzeva xyzeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good, few changes needed here and there

@xyzeva xyzeva self-requested a review August 1, 2023 13:45
@Col-E Col-E marked this pull request as ready for review August 11, 2023 03:02
Copy link
Member

@xyzeva xyzeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Col-E Col-E merged commit d0fbd4e into main Aug 11, 2023
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants