Skip to content

Commit

Permalink
Add detection against NPPSpy and AgentRacoon
Browse files Browse the repository at this point in the history
  • Loading branch information
ditekshen committed Dec 19, 2023
1 parent b1368cc commit f2338ca
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions data/yara/CAPE/AgentRacoon.yar
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
rule AgentRacoon {
meta:
author = "ditekShen"
description = "Detects AgentRacoon"
cape_type = "AgentRacoon Payload"
strings:
$s1 = "UdpClient" fullword ascii
$s2 = "IPEndPoint" fullword ascii
$s3 = "get_Client" fullword ascii
$s4 = "set_ReceiveTimeout" fullword ascii
$s5 = "Command failed:" wide
$s6 = "uploaded" wide
$s7 = "downloaded" wide
$s8 = ".telemetry." wide
$s9 = "xn--" wide
condition:
uint16(0) == 0x5a4d and 4 of them
}
24 changes: 24 additions & 0 deletions data/yara/CAPE/NPPSpy.yar
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import "pe"

rule NPPSpy {
meta:
author = "ditekShen"
description = "Detects NPPSpy / Ntospy"
cape_type = "NPPSpy Payload"
strings:
$s1 = "ntskrnl.dll" fullword ascii
$s2 = "PasswordStealing.dll" fullword ascii
$s3 = "ntoskrnl.dll" fullword ascii
$s4 = "\\programdata\\packag~" ascii
$s5 = "NPPSPY.dll" fullword ascii
$s6 = "MSControll.dll" fullword ascii
$s7 = "\\Windows\\Temp\\" ascii
$s8 = "\\NPPSpy\\" ascii
// hunt
$s9 = "NPGetCaps" fullword ascii
$s10 = "NPLogonNotify" fullword ascii
// C:\Users\GrzegorzTworek\source\repos\NPPSpy\x64\Release\NPPSPY.pdb
$path = "\\GrzegorzTworek\\" ascii
condition:
uint16(0) == 0x5a4d and ((pe.is_dll() and filesize < 110KB and pe.number_of_exports == 2 and ((pe.exports("NPGetCaps") and pe.exports("NPLogonNotify")) or (1 of ($s*) and (pe.exports("NPGetCaps") or pe.exports("NPLogonNotify"))))) or (($path) and any of ($s*)))
}

0 comments on commit f2338ca

Please sign in to comment.