|
| 1 | +import "dotnet" |
| 2 | +rule Extract_MachineKey_SharePoint |
| 3 | +{ |
| 4 | + meta: |
| 5 | + id = "5rgC2cpznLmamBSQ9etlFh" |
| 6 | + fingerprint = "v1_sha256_267976231782f0458c369172e8d922508daf670089ef3c91ad2570fe3600d6c4" |
| 7 | + version = "1.0" |
| 8 | + date = "2025-07-25" |
| 9 | + modified = "2025-07-25" |
| 10 | + status = "RELEASED" |
| 11 | + sharing = "TLP:WHITE" |
| 12 | + source = "BARTBLAZE" |
| 13 | + author = "@bartblaze" |
| 14 | + description = "Identifies webshell that extracts SharePoint's MachineKey configuration." |
| 15 | + category = "TOOL" |
| 16 | + tool = "WEBSHELL" |
| 17 | + reference = "https://x.com/Gi7w0rm/status/1948027800591466773" |
| 18 | + hash = "3461da3a2ddcced4a00f87dcd7650af48f97998a3ac9ca649d7ef3b7332bd997" |
| 19 | + |
| 20 | + strings: |
| 21 | + $xml = "<?xml" nocase |
| 22 | + |
| 23 | + $httpcontext = "HttpContext" fullword |
| 24 | + $validation = "MachineKeyValidation" |
| 25 | +
|
| 26 | + $mks_a = "MachineKeySection" |
| 27 | + $mks_b = "System.Web.Configuration.MachineKeySection" |
| 28 | +
|
| 29 | + $str_a = "-------------------- .NET Properties --------------------" |
| 30 | + $str_b = "Number of Logical Drives:" |
| 31 | + $str_c = "List of Logical Drives:" |
| 32 | + $str_d = "Computer Name:" |
| 33 | + $str_e = "Full path of the system directory:" |
| 34 | + $str_f = "Current Directory:" |
| 35 | + $str_g = "Number of processors on this machine:" |
| 36 | + $str_h = "Number of milliseconds since system start:" |
| 37 | + $str_i = "Username of the user currently logged onto the operating system:" |
| 38 | + $str_j = "Operating System Version:" |
| 39 | + $str_k = ".NET Version:" |
| 40 | + $str_l = "-------------------- Environment Variables --------------------" |
| 41 | +
|
| 42 | + condition: |
| 43 | + not $xml in (0..10) and ( |
| 44 | + ($httpcontext and $validation and any of ($mks_*)) or (any of ($mks_*, $validation) and 8 of ($str_*)) or |
| 45 | + dotnet.guids[0]=="64c708ee-5f26-4eef-b474-651321a0e469" or |
| 46 | + dotnet.guids[0]=="a253a3d9-f7e6-484e-b392-685b0b7a9c5d" or |
| 47 | + dotnet.guids[0]=="ab423cff-901e-4882-9939-bf1b54eddffb" or |
| 48 | + dotnet.guids[0]=="63e8005d-08a3-423d-ab6b-53cc05629d457" or |
| 49 | + dotnet.guids[0]=="de37ec6b-4312-4073-81ea-903f0a340a11" |
| 50 | + ) |
| 51 | +} |
0 commit comments