Skip to content

Commit

Permalink
Land #18431, Fix how port forwards are listed
Browse files Browse the repository at this point in the history
Merge branch 'land-18431' into upstream-master
  • Loading branch information
bwatters-r7 committed Oct 10, 2023
2 parents d427d64 + d46e80f commit 6af8d3f
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

2 comments on commit 6af8d3f

@Semsemq
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Semsemq
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Please sign in to comment.