Skip to content

Commit

Permalink
Land #16615, Solicited multicast-address creation bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gwillcox-r7 committed Jun 7, 2022
2 parents 5e69de4 + c33f284 commit a983bbd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/msf/core/exploit/remote/ipv6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@ def ipv6_linklocaladdr(mac)
# which is from DDniele Belluci
def ipv6_soll_mcast_addr6(addr)
h = addr.split(':')[-2, 2]
m = []
m << 'ff'
m << (h[0].to_i(16) & 0xff).to_s(16)
m << ((h[1].to_i(16) & (0xff << 8)) >> 8).to_s(16)
m << (h[1].to_i(16) & 0xff).to_s(16)
'ff02::1:' + [m[0,2].join, m[2,2].join].join(':')
m = []
x = h[0]
x[0..1] = 'ff'
m << x
x = h[1]
x.sub!(/^0*/, "")
m << x
'ff02::1:' + m.join(':')
end

# From Jon Hart's Racket::L3::Misc#soll_mcast_mac()
Expand Down

0 comments on commit a983bbd

Please sign in to comment.