Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve stvemillertime

View GitHub Profile
View yara_performance_guidelines.md

This Gist has been transfered into a Github Repo. You'll find the most recent version here.

YARA Performance Guidelines

When creating your rules for YARA keep in mind the following guidelines in order to get the best performance from them. This guide is based on ideas and recommendations by Victor M. Alvarez and WXS.

  • Revision 1.4, October 2020, applies to all YARA versions higher than 3.7
@stvemillertime
stvemillertime / mstscax_ole.yar
Created January 6, 2023 02:14 — forked from edeca/mstscax_ole.yar
Yara rule to detect documents (RTF/CDF/OOXML) using MsTscAx scripting controls
View mstscax_ole.yar
rule terminal_services_scripting {
meta:
author = "David Cannings"
description = "Microsoft Terminal Services Client Control (not safe for scripting)"
ref = "https://twitter.com/joe4security/status/1221765460502421504?s=20%E2%80%9D"
generated_by = "yaml2yara, see https://github.com/nccgroup/yaml2yara/"
strings:
// Parsers will open files without the full 'rtf'
$header_rtf = "{\\rt" nocase
@stvemillertime
stvemillertime / yara_example_1.yar
Created January 6, 2023 02:13 — forked from edeca/yara_example_1.yar
Yara rule to find a string near to other strings
View yara_example_1.yar
import "math"
rule example {
meta:
author = "David Cannings"
description = "Rule example - finding a chunk of code near other known code"
strings:
$chunk = { AA BB CC DD }
$chunk_prologue = { 11 22 33 44 }
@stvemillertime
stvemillertime / high_entropy_pe_rules.yar
Created January 6, 2023 02:13 — forked from edeca/high_entropy_pe_rules.yar
Variations on Yara rules by @greglesnewich
View high_entropy_pe_rules.yar
/*
Original rule from: https://gist.github.com/g-les/0745a9d6cd7f4abb3083a8dee1eaf984
Two variations on the original rule by @greglesnewich.
Conversation on Twitter at: https://twitter.com/edeca/status/1477650229709225990
*/
@stvemillertime
stvemillertime / server.py
Created November 4, 2022 13:51 — forked from ecks/server.py
Carbanak Server
View server.py
import socket
import hashlib
import struct
import time
class IdUid:
def __init__(self):
@stvemillertime
stvemillertime / nozomi_upx.yara
Created October 4, 2022 12:23 — forked from notareverser/nozomi_upx.yara
YARA signatures derived from Nozomi UPX recovery tool https://github.com/NozomiNetworks/upx-recovery-tool
View nozomi_upx.yara
// https://github.com/NozomiNetworks/upx-recovery-tool
rule UPX_nozomi_x86
{
strings: $sig = { 50 e8 ?? ?? 00 00 eb 5a 58 59 97 60 8a 54 24 20 e9 ?? ?? 00 00 60 8b 74 24 24 8b 7c 24 2c 83 cd}
condition: any of them
}
rule UPX_nozomi_x64
{
strings:
@stvemillertime
stvemillertime / 100_days_of_yara.yar
Created September 26, 2022 01:01 — forked from g-les/100_days_of_yara.yar
100 Days of YARA to be updated with rules & ideas as the year progresses
View 100_days_of_yara.yar
/*
Goals for #100DaysofYARA:
better understanding of bitwise operators
use math module beyond general entropy of a section / resource
position specific things beyond what PE module tells us
do some funky stuff with hashing
*/
@stvemillertime
stvemillertime / casing_anomaly.yar
Created September 26, 2022 00:04 — forked from tlansec/casing_anomaly.yar
Casing anomaly YARA rule
View casing_anomaly.yar
rule general_win_runkey_casing_anomaly : General
{
meta:
author = "threatintel@volexity.com"
description = "Looks for files containing to a reference to the HKCU run key where the reference uses unusual casing."
date = "2021-08-03"
hash1 = "c20997c72508bc7340f4ec99fe9eb4f1ccde518e81bda66e7c86632f0748bffa"
memory_suitable = 0
strings:
@stvemillertime
stvemillertime / entropy_functions.yar
Created September 26, 2022 00:03 — forked from tlansec/entropy_functions.yar
Generic rule for suspicious function names
View entropy_functions.yar
import "math"
rule general_vba_high_entropy_function_names : General
{
meta:
author = "threatintel@volexity.com"
description = "Looks for VBA files containing function names that have been randomized based on their entropy."
date = "2022-03-14"
hash1 = "c2badcdfa9b7ece00f245990bb85fb6645c05b155b77deaf2bb7a2a0aacbe49"
memory_suitable = 0
@stvemillertime
stvemillertime / entropy.yar
Created September 26, 2022 00:03 — forked from tlansec/entropy.yar
Print out information about a files entropy
View entropy.yar
// Add as an alias like:
// alias entropy=yara /path/to/entropy.yar $*
// Usage:
// entropy file.bin
import "console"
import "math"
rule entropy