Skip to content

Commit

Permalink
Fix bug when the cidr of rhosts is 32.
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-m committed Dec 25, 2018
1 parent 83a401e commit 6093d1e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/msf/ui/console/command_dispatcher/exploit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ def cmd_exploit(*args)
end
# For single target or no rhosts option.
else
session = exploit_single(mod, opts)
# avoid bug when the cidr of rhosts is 32, like 8.8.8.8/32
if rhosts_range.length == 1
nmod = mod.replicant
nmod.datastore['RHOST'] = (Rex::Socket.addr_itoa(rhosts_range.ranges.first.start))
end
session = exploit_single(nmod, opts)
# If we were given a session, let's see what we can do with it
if session
any_session = true
Expand Down

0 comments on commit 6093d1e

Please sign in to comment.