Skip to content

Instantly share code, notes, and snippets.

@williballenthin
Last active January 4, 2023 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save williballenthin/adf1fe24e1c07f0e5a0f3a0938cd2712 to your computer and use it in GitHub Desktop.
Save williballenthin/adf1fe24e1c07f0e5a0f3a0938cd2712 to your computer and use it in GitHub Desktop.
#100DaysOfYara (2023)
import "dotnet"
rule DotnetStartupHook {
meta:
description = "might be a .NET startup hook module"
author = "William Ballenthin <william.ballenthin@mandiant.com>"
strings:
$a1 = "StartupHook"
$a2 = "Initialize"
condition:
uint16(0) == 0x5A4D
and dotnet.is_dotnet
and all of them
}
rule Nuitka {
meta:
description = "Python code compiled and packaged with Nuitka"
author = "William Ballenthin <william.ballenthin@mandiant.com>"
strings:
// https://github.com/Nuitka/Nuitka/blob/f87667fec2748a735834fc699daa20cedfb8f2c7/nuitka/build/static_src/InspectPatcher.c#L218
$a1 = "nuitka_types_patch"
// https://github.com/Nuitka/Nuitka/blob/f87667fec2748a735834fc699daa20cedfb8f2c7/nuitka/build/static_src/MetaPathBasedLoader.c#L1173
$a2 = "O:is_package"
// https://github.com/Nuitka/Nuitka/blob/f87667fec2748a735834fc699daa20cedfb8f2c7/nuitka/build/static_src/HelpersConstantsBlob.c#L1229
$a3 = "Error, corrupted constants object"
condition:
uint16(0) == 0x5A4D
and all of them
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment