Ollama Enum#21271
Conversation
dwelch-r7
left a comment
There was a problem hiding this comment.
If you rebase this on master the tests should pass now
| ) | ||
| running = [] | ||
| local_models = list_running_models | ||
| local_models['models'].each do |model| |
There was a problem hiding this comment.
local_models can be nil, we either need to add nil checks for all the results from the helper functions or I think I'd prefer raising early so we know something hasn't gone quite right
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Metasploit auxiliary HTTP scanner module to detect Ollama instances and enumerate installed/running LLM models (including basic model details), along with usage documentation.
Changes:
- Introduced
auxiliary/scanner/http/ollama_infoto query Ollama APIs (/api/ps,/api/tags,/api/show) and print a model table. - Added helper parsing/formatting for sizes, temperature, and system prompt.
- Added module documentation with a Docker-based repro scenario and sample output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| modules/auxiliary/scanner/http/ollama_info.rb | Implements the Ollama scanner and model enumeration/output formatting. |
| documentation/modules/auxiliary/scanner/http/ollama_info.md | Documents how to build/run a sample Ollama container and validate the module output. |
|
|
@h00die the failing rspec tests are not your fault, and have been fixed. Unfortunately, to get the new spec tests, you need to rebase or push another commit. Locally everything passes when I rebase, so hopefully the tests will start passing when you address the copilot suggestions. My results when rebasing and testing locally: |
Co-authored-by: Copilot <[email protected]>
This PR adds an ollama LLM scanner. It'll connect to Ollama instances, and enumerate which LLMs are installed and details about them.
Verification
List the steps needed to make sure this thing works
use auxiliary/scanner/http/ollama_infoset rhosts [IPs]run