GregTampa

Untitled

Nov 25th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* These rules match on all stage 1 samples from the Symantec report. Tested on Windows 7 x64, Windows 2003 and Windows 2008 R2 - known to generate False Positives on Windows XP. Please check out this URL for a report with Yara rules for the other stages: https://securelist.com/files/2014/11/Kaspersky_Lab_whitepaper_Regin_platform_eng.pdf */
  2.  
  3. rule Regin_APT_KernelDriver_Generic_A {
  4.     meta:
  5.         description = "Generic rule for Regin APT kernel driver Malware - Symantec http://t.co/qu53359Cb2"
  6.         author = "@Malwrsignatures - included in APT Scanner THOR"
  7.         date = "23.11.14"
  8.         hash1 = "187044596bc1328efa0ed636d8aa4a5c"
  9.         hash2 = "06665b96e293b23acc80451abb413e50"
  10.         hash3 = "d240f06e98c8d3e647cbf4d442d79475"
  11.     strings:
  12.         $m0 = { 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 b8 }
  13.         $m1 = { 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20 6d 6f 64 65 2e }
  14.        
  15.         $s0 = "atapi.sys" fullword wide
  16.         $s1 = "disk.sys" fullword wide
  17.         $s3 = "h.data" fullword ascii
  18.         $s4 = "\\system32" fullword ascii
  19.         $s5 = "\\SystemRoot" fullword ascii
  20.         $s6 = "system" fullword ascii
  21.         $s7 = "temp" fullword ascii
  22.         $s8 = "windows" fullword ascii
  23.  
  24.         $x1 = "LRich6" fullword ascii
  25.         $x2 = "KeServiceDescriptorTable" fullword ascii    
  26.     condition:
  27.         $m0 at 0 and $m1 and   
  28.         all of ($s*) and 1 of ($x*)
  29. }
  30.  
  31. rule Regin_APT_KernelDriver_Generic_B {
  32.     meta:
  33.         description = "Generic rule for Regin APT kernel driver Malware - Symantec http://t.co/qu53359Cb2"
  34.         author = "@Malwrsignatures - included in APT Scanner THOR"
  35.         date = "23.11.14"
  36.         hash1 = "ffb0b9b5b610191051a7bdf0806e1e47"
  37.         hash2 = "bfbe8c3ee78750c3a520480700e440f8"
  38.         hash3 = "b29ca4f22ae7b7b25f79c1d4a421139d"
  39.         hash4 = "06665b96e293b23acc80451abb413e50"
  40.         hash5 = "2c8b9d2885543d7ade3cae98225e263b"
  41.         hash6 = "4b6b86c7fec1c574706cecedf44abded"
  42.         hash7 = "187044596bc1328efa0ed636d8aa4a5c"
  43.         hash8 = "d240f06e98c8d3e647cbf4d442d79475"
  44.         hash9 = "6662c390b2bbbd291ec7987388fc75d7"
  45.         hash10 = "1c024e599ac055312a4ab75b3950040a"
  46.         hash11 = "ba7bb65634ce1e30c1e5415be3d1db1d"
  47.         hash12 = "b505d65721bb2453d5039a389113b566"
  48.         hash13 = "b269894f434657db2b15949641a67532"
  49.     strings:
  50.         $m0 = { 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 b8 }
  51.         $s1 = { 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20 6d 6f 64 65 2e }
  52.         $s2 = "H.data" fullword ascii nocase
  53.         $s3 = "INIT" fullword ascii
  54.         $s4 = "ntoskrnl.exe" fullword ascii
  55.        
  56.         $v1 = "\\system32" fullword ascii
  57.         $v2 = "\\SystemRoot" fullword ascii
  58.         $v3 = "KeServiceDescriptorTable" fullword ascii
  59.        
  60.         $w1 = "\\system32" fullword ascii
  61.         $w2 = "\\SystemRoot" fullword ascii    
  62.         $w3 = "LRich6" fullword ascii
  63.        
  64.         $x1 = "_snprintf" fullword ascii
  65.         $x2 = "_except_handler3" fullword ascii
  66.        
  67.         $y1 = "mbstowcs" fullword ascii
  68.         $y2 = "wcstombs" fullword ascii
  69.         $y3 = "KeGetCurrentIrql" fullword ascii
  70.        
  71.         $z1 = "wcscpy" fullword ascii
  72.         $z2 = "ZwCreateFile" fullword ascii
  73.         $z3 = "ZwQueryInformationFile" fullword ascii
  74.         $z4 = "wcslen" fullword ascii
  75.         $z5 = "atoi" fullword ascii
  76.     condition:
  77.         $m0 at 0 and all of ($s*) and
  78.         ( all of ($v*) or all of ($w*) or all of ($x*) or all of ($y*) or all of ($z*) )
  79.         and filesize < 20KB
  80. }
  81.  
  82. rule Regin_APT_KernelDriver_Generic_C {
  83.     meta:
  84.         description = "Generic rule for Regin APT kernel driver Malware - Symantec http://t.co/qu53359Cb2"
  85.         author = "@Malwrsignatures - included in APT Scanner THOR"
  86.         date = "23.11.14"
  87.         hash1 = "e0895336617e0b45b312383814ec6783556d7635"
  88.         hash2 = "732298fa025ed48179a3a2555b45be96f7079712"     
  89.     strings:
  90.         $m0 = { 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 b8 }
  91.    
  92.         $s0 = "KeGetCurrentIrql" fullword ascii
  93.         $s1 = "5.2.3790.0 (srv03_rtm.030324-2048)" fullword wide
  94.         $s2 = "usbclass" fullword wide
  95.        
  96.         $x1 = "PADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDING" ascii
  97.         $x2 = "Universal Serial Bus Class Driver" fullword wide
  98.         $x3 = "5.2.3790.0" fullword wide
  99.        
  100.         $y1 = "LSA Shell" fullword wide
  101.         $y2 = "0Richw" fullword ascii      
  102.     condition:
  103.         $m0 at 0 and all of ($s*) and
  104.         ( all of ($x*) or all of ($y*) )
  105.         and filesize < 20KB
  106. }
  107.  
  108. rule Regin_sig_svcsstat {
  109.     meta:
  110.         description = "Detects svcstat from Regin report - file svcsstat.exe_sample"
  111.         author = "@Malwrsignatures"
  112.         date = "25.11.14"
  113.         score = 70
  114.         hash = "5164edc1d54f10b7cb00a266a1b52c623ab005e2"
  115.     strings:
  116.         $s0 = "Service Control Manager" fullword ascii
  117.         $s1 = "_vsnwprintf" fullword ascii
  118.         $s2 = "Root Agency" fullword ascii
  119.         $s3 = "Root Agency0" fullword ascii
  120.         $s4 = "StartServiceCtrlDispatcherA" fullword ascii
  121.         $s5 = "\\\\?\\UNC" fullword ascii
  122.         $s6 = "%ls%ls" fullword wide
  123.     condition:
  124.         all of them and filesize < 15KB and filesize > 10KB
  125. }
Advertisement
Add Comment
Please, Sign In to add comment