Skip to content

Commit

Permalink
Validate memory_search PROCESS_IDS using regex
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed Jan 22, 2024
1 parent 6ca4c11 commit f8bdb02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/post/multi/gather/memory_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ def run
return
end

if process_ids && !process_ids.match?(/^(\s*\d(\s*,\s*\d+\s*)*)*$/)
print_error 'PROCESS_IDS is not a comma-separated list of integers'
return
end

print_status "Running module against - #{session.info} (#{session.session_host}). This might take a few seconds..."

print_status 'Getting target processes...'
Expand Down

0 comments on commit f8bdb02

Please sign in to comment.