Fix string handling

git-svn-id: file:///home/svn/framework3/trunk@7160 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-10-14 17:51:44 +00:00
parent cd2968a32a
commit ce9bfec34f
1 changed files with 5 additions and 4 deletions

View File

@ -368,6 +368,7 @@ module Exploit::Remote::MSSQL
if(
str[0,5] == "\x02\x00\x21\x00\x27" or # varchar
str[0,5] == "\x02\x00\x08\x00\x27" or
str[0,5] == "\x02\x00\x01\x00\x27" or
str[0,5] == "\x12\x00\x08\x00\x27" or
str[0,5] == "\x12\x00\x09\x00\x27" or
str[0,5] == "\x04\x00\x09\x00\x25" or # varbinary
@ -469,11 +470,11 @@ module Exploit::Remote::MSSQL
when :hex
len = data.slice!(0,1).unpack('C')[0]
row << (len > 0) ? data.slice!(0,len) : ''
row << ((len > 0) ? data.slice!(0,len) : '')
when :string
len = data.slice!(0,1).unpack('C')[0]
row << (len > 0) ? data.slice!(0,len) : ''
row << ((len > 0) ? data.slice!(0,len) : '')
when :datetime
# XXX: convert to unix time
@ -486,11 +487,11 @@ module Exploit::Remote::MSSQL
when :image
len = data.slice!(0,1).unpack('C')[0]
row << (len > 0) ? data.slice!(0,len).unpack("H*")[0] : ''
row << ((len > 0) ? data.slice!(0,len).unpack("H*")[0] : '')
when :binary
len = data.slice!(0,1).unpack('C')[0]
row << (len > 0) ? data.slice!(0,len).unpack("H*")[0] : ''
row << ((len > 0) ? data.slice!(0,len).unpack("H*")[0] : '')
when :unknown
len = data.slice!(0,1).unpack('C')[0]