Replies: 1 comment 4 replies
-
| binary and script rules in one fileThis is how we ended up organizing ELF/PE (for the most part). An example rule may look like this (see addition in the last line, using function-name here per Adam's current work [topic for another discussion]): rule:
  meta:
    name: encode data using Base64
    namespace: data-manipulation/encoding/base64
    ...
  features:
    - or:
      - and:
        - mnemonic: shl
        - mnemonic: shr
        - number: 0x3F = modulo 64
        - or:
          - number: 0x3D = '='
          - number: 0x3D3D = '=='
        - match: contain loop
        - optional:
          - number: 2
          - number: 3
          - number: 4
          - number: 6
          - number: 0xF
          - string: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
      - api: System.Convert::ToBase64String
      - function-name: System.Convert.ToBase64StringThis looks nice and comes with all the previously shown pros such as easy documentation and re-use of meta data. For rules that require more logic, files could be split up. Do we still want to use this approach when we support multiple scripting languages? Do we want to add a new key qualifier?       - function-name/c#: System.Convert.ToBase64String
      - function-name/python: base64.b64encode
      - ... | 
Beta Was this translation helpful? Give feedback.
                  
                    4 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Per the work in #1080 capa will support source code/scripts. Similar to the discussion on ELF/PE files (#701) we should decide how to organize and write new rules. This could include the creation of new features and/or changes to the rule syntax.
While the concerns and points from the ELF/PE still hold, the analysis of source code/scripts and compiled binaries differs enough to discuss new solutions here. To reiterate, the concerns are:
Beta Was this translation helpful? Give feedback.
All reactions