Skip to content

Instantly share code, notes, and snippets.

@shellcromancer
Created January 15, 2022 05:35
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 shellcromancer/da08abd6e254c83c12dd9f69512ea872 to your computer and use it in GitHub Desktop.
Save shellcromancer/da08abd6e254c83c12dd9f69512ea872 to your computer and use it in GitHub Desktop.
YARA rule to detect the SHA1 hashing algorithm.
rule alg_crypto_sha1 {
meta:
description = "Identify constants for the SHA1 hashing algorithm."
author = "@shellcromancer <root@shellcromancer.io>"
version = "0.1"
date = "2022-01-14"
reference = "https://en.wikipedia.org/wiki/SHA-1"
implementation = "https://cs.opensource.google/go/go/+/master:src/crypto/sha1/sha1block_amd64.s"
strings:
$init0 = { 67452301 }
$init1 = { efcdcb89 }
$init2 = { 98Badcfe }
$init3 = { 10325476 }
$init4 = { c3d2e1f0 }
$k0 = { 5a827999 }
$k1 = { 6ed9eba1 }
$k2 = { 8f1bbcdc }
$k3 = { ca62c1d6 }
condition:
2 of ($init*) or 2 of ($k*)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment