Skip to content

Commit

Permalink
Fix how port forwards are listed
Browse files Browse the repository at this point in the history
Fixes #18291
  • Loading branch information
zeroSteiner committed Oct 6, 2023
1 parent 8de942d commit d46e80f
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,16 +431,17 @@ def cmd_portfwd(*args)
cnt = 0

# Enumerate each TCP relay
service.each_tcp_relay { |lhost, lport, rhost, rport, opts|
next if (opts['MeterpreterRelay'] == nil)

direction = 'Forward'
direction = 'Reverse' if opts['Reverse'] == true
service.each_tcp_relay do |lhost, lport, rhost, rport, opts|
next unless opts['MeterpreterRelay']

table << [cnt + 1, "#{netloc(rhost, rport)}", "#{netloc(lhost, lport)}", direction]
if opts['Reverse']
table << [cnt + 1, "#{netloc(rhost, rport)}", "#{netloc(lhost, lport)}", 'Reverse']
else
table << [cnt + 1, "#{netloc(lhost, lport)}", "#{netloc(rhost, rport)}", 'Forward']
end

cnt += 1
}
end

print_line
if cnt > 0
Expand Down

0 comments on commit d46e80f

Please sign in to comment.