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

Added detection of PyInstaller #748

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cpdetect/compiler_detector/compiler_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ ReturnCode CompilerDetector::getAllSignatures()
{
toolInfo.addTool(
DetectionMethod::YARA_RULE,
metaToStrength(rule.getMeta("language")),
metaToStrength(rule.getMeta("strength")),
ladislav-zezula marked this conversation as resolved.
Show resolved Hide resolved
toolType,
nameMeta->getStringValue(),
version,
Expand Down
36 changes: 36 additions & 0 deletions support/yara_patterns/tools/pe/x64/installers.yara
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,42 @@

import "pe"

rule pyinstaller_27
{
meta:
tool = "I"
name = "PyInstaller"
version = "2.7"
strength = "high"
strings:
$s00 = "Cannot GetProcAddress for PySys_SetObject"
$s01 = "Error coping %s"
$s02 = "Error loading Python DLL: %s (error code %d)"
$s03 = "PYTHONHOME"
condition:
pe.number_of_resources > 0 and
@s00 < pe.sections[2].raw_data_offset and
all of them
}

rule pyinstaller_3x
{
meta:
tool = "I"
name = "PyInstaller"
version = "3.x"
strength = "high"
strings:
$s00 = "Failed to get address for PySys_SetObject"
$s01 = "Error copying %s"
$s02 = "Error loading Python DLL '%s'"
$s03 = "pyi-windows-manifest-filename"
condition:
pe.number_of_resources > 0 and
@s00 < pe.sections[2].raw_data_offset and
all of them
}

rule winrar_sfx_392b1
{
meta:
Expand Down
36 changes: 36 additions & 0 deletions support/yara_patterns/tools/pe/x86/installers.yara
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,42 @@ rule exemplar_installer {
$1 at pe.entry_point
}

rule pyinstaller_27
{
meta:
tool = "I"
name = "PyInstaller"
version = "2.7"
strength = "high"
strings:
$s00 = "Cannot GetProcAddress for PySys_SetObject"
$s01 = "Error coping %s"
$s02 = "Error loading Python DLL: %s (error code %d)"
$s03 = "PYTHONHOME"
condition:
pe.number_of_resources > 0 and
@s00 < pe.sections[2].raw_data_offset and
all of them
}

rule pyinstaller_3x
{
meta:
tool = "I"
name = "PyInstaller"
version = "3.x"
strength = "high"
strings:
$s00 = "Failed to get address for PySys_SetObject"
$s01 = "Error copying %s"
$s02 = "Error loading Python DLL '%s'"
$s03 = "pyi-windows-manifest-filename"
condition:
pe.number_of_resources > 0 and
@s00 < pe.sections[2].raw_data_offset and
all of them
}

rule installanywhere_61 {
meta:
tool = "I"
Expand Down