Fix pack order
parent
366cb2ff08
commit
a9d733f9fe
|
@ -132,7 +132,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
def crc16(buf, crc=0)
|
def crc16(buf, crc=0)
|
||||||
buf.each_byte{|x| crc = ((crc << 8) ^ @@CCITT_16[( crc >> 8) ^ x]) & 0xffff }
|
buf.each_byte{|x| crc = ((crc << 8) ^ @@CCITT_16[( crc >> 8) ^ x]) & 0xffff }
|
||||||
[crc].pack("n")
|
[crc].pack("v")
|
||||||
end
|
end
|
||||||
|
|
||||||
def unlock_check
|
def unlock_check
|
||||||
|
@ -164,7 +164,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
header = "HAP"
|
header = "HAP"
|
||||||
header += "\xe5\x01" # random session ID
|
header += "\xe5\x01" # random session ID
|
||||||
header += crc16(data)
|
header += crc16(data)
|
||||||
header += [data.length].pack("n")
|
header += [data.length].pack("v")
|
||||||
authpacket = header + data
|
authpacket = header + data
|
||||||
|
|
||||||
@udp_sock.sendto(authpacket, rhost, rport.to_i)
|
@udp_sock.sendto(authpacket, rhost, rport.to_i)
|
||||||
|
|
Loading…
Reference in New Issue