Skip to content

C# code to features #1135

@mr-tz

Description

@mr-tz

Most analysts will read decompiled C# code. Can we A) create an utility to parse code segments to features (e.g. using capa-scripts portions) or B) even better allow to include verbatim C# code in rules?

A)

Given a code line

HttpWebRequest r = System.Net.WebRequest.Create(<url>)
r.Method = "Get";

We extract the respective features.
EDIT: This would be a separate script (or show-features) used as part of rule writing.

B)

- features:
  - code: >
         HttpWebRequest r = System.Net.WebRequest.Create(<url>)
         r.Method = "Get";

Would this be worth the effort?

Ref

Idea came to me from here:

Ok, I'm having trouble following this. Can you include a comment of an example code snippet?

Originally posted by @mr-tz in mandiant/capa-rules#601 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions