# Vulnerability Scanning

```bash
# Basic Setup
setg [HOST]
workspace -a [suitable-name]

# nmap for basic recon
db_nmap -sS -sV -O [HOST]
hosts
services
```

## **Searching for Exploits**

{% code overflow="wrap" %}

```bash
# Manual Exploit Search
search type:exploit name:[name]
# Searches for relevant exploits based on the detected services. This process can be time-consuming.

# Searchsploit
searchsploit [name]
# Uses the searchsploit tool to find local exploit suggestions based on the service names.
```

{% endcode %}

### Eternal Blue Exploit

{% code overflow="wrap" %}

```bash
# Scan for vulnerability
use scanner/smb/smb_ms17_010

# Attempt to exploit
use windows/smb/ms17_010_eternalblue
```

{% endcode %}

## Automatic Exploit Matching

{% embed url="<https://github.com/hahwul/metasploit-autopwn>" %}

{% code overflow="wrap" %}

```bash
# Move the autopwn plugin
sudo mv db_autopwn.rb /usr/share/metasploit-framework/plugins

# Load the plugin
load db_autopwn

# Run the autopwn tool
db_autopwn -p -t -PI [PORT]
# This automatically scans the database and matches found services to possible exploit modules.
```

{% endcode %}

## Analyzing Vulnerabilities

{% code overflow="wrap" %}

```bash
# Auto Analysis
analyze
# Automatically analyzes open ports to determine possible exploits.

# List Vulnerabilities
vulns
# Displays a list of any vulnerabilities identified during the scan.
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://security.navidnaf.com/ollivanders/metasploit-framework/vulnerability-scanning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
