Skip to content

Commit

Permalink
Land rapid7#16058, fix stack trace in local_exploit_suggester when se…
Browse files Browse the repository at this point in the history
…ssion is invalid
  • Loading branch information
timwr committed Jan 18, 2022
2 parents ad9517b + 2bb5eda commit dd66b83
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/post/multi/recon/local_exploit_suggester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ def is_module_wanted?(mod)
end

def setup
return unless session

print_status "Collecting local exploits for #{session.session_type}..."
# Initializes an array
@local_exploits = []

# Collects exploits into an array
@local_exploits = []
framework.exploits.each do |name, _obj|
mod = framework.exploits.create name
next unless mod
Expand Down Expand Up @@ -167,14 +169,14 @@ def is_check_interesting?(checkcode)
end

def print_status(msg='')
super("#{session.session_host} - #{msg}")
super(session ? "#{session.session_host} - #{msg}" : msg)
end

def print_good(msg='')
super("#{session.session_host} - #{msg}")
super(session ? "#{session.session_host} - #{msg}" : msg)
end

def print_error(msg='')
super("#{session.session_host} - #{msg}")
super(session ? "#{session.session_host} - #{msg}" : msg)
end
end

0 comments on commit dd66b83

Please sign in to comment.