Skip to content

Commit

Permalink
Docker Usage Documentation (#4155)
Browse files Browse the repository at this point in the history
* Docker usage documentation and links between them

* typo update

---------

Co-authored-by: sandeep <[email protected]>
  • Loading branch information
kchason and ehsandeep authored Sep 16, 2023
1 parent 2d175da commit 5d8f023
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/getting-started/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ title: 'Install'
```bash
docker pull projectdiscovery/nuclei:latest
```

Docker-specific usage instructions can be found [here](./running#running-with-docker).
</Tab>
<Tab title="Github">
```bash
Expand Down
38 changes: 31 additions & 7 deletions docs/getting-started/running.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ title: 'Running Nuclei'

## Running **Nuclei**

Nuclei templates can be primarily executed in two ways,
Nuclei templates can be primarily executed in two ways:

1. **Templates** (`-t/templates`)

As default, all the templates (except nuclei-ignore list) gets executed from default template installation path.
As default, all the templates (except nuclei-ignore list) get executed from the default template installation path.

```sh
nuclei -u https://example.com
```

Custom template directory or multiple template directory can be executed as follows,
Custom template directory or multiple template directory can be executed as follows:

```sh
nuclei -u https://example.com -t cves/ -t exposures/
```

Custom template Github repos are downloaded under `github` directory. Custom repo templates can be passed as follows
Custom template Github repos are downloaded under `github` directory. Custom repo templates can be passed as follows:

```sh
nuclei -u https://example.com -t github/private-repo
```

Similarly, Templates can be executed against list of URLs.
Similarly, Templates can be executed against a list of URLs.

```sh
nuclei -list http_urls.txt
Expand All @@ -41,7 +41,7 @@ nuclei -list http_urls.txt
nuclei -u https://example.com -w workflows/
```

Similarly, Workflows can be executed against list of URLs.
Similarly, Workflows can be executed against a list of URLs.

```sh
nuclei -list http_urls.txt -w workflows/wordpress-workflow.yaml
Expand Down Expand Up @@ -77,7 +77,9 @@ And this example will run all the templates available under `~/nuclei-templates/
nuclei -u https://example.com -tags config -t exposures/
```

Multiple filters works together with AND condition, below example runs all template with `cve` tags AND has `critical` OR `high` severity AND `geeknik` as author of template.
Multiple filters works together with AND condition,
below example runs all templates with `cve` tags
AND has `critical` OR `high` severity AND `geeknik` as author of template.

```sh
nuclei -u https://example.com -tags cve -severity critical,high -author geeknik
Expand Down Expand Up @@ -861,3 +863,25 @@ nuclei -passive -target http_data
```

<Note>Passive mode support is limited for templates having `{{BasedURL}}` or `{{BasedURL/}}` as base path.</Note>

## Running With Docker
If Nuclei was installed within a Docker container based on the [installation instructions](./install),
the executable does not have the context of the host machine. This means that the executable will not be able to access
local files such as those used for input lists or templates. To resolve this, the container should be run with volumes
mapped to the local filesystem to allow access to these files.

### Basic Usage
This example runs a Nuclei container against `google.com`, prints the results to JSON and removes the container once it
has completed:
```sh
docker run --rm projectdiscovery/nuclei -u google.com -jsonl
```

### Using Volumes
This example runs a Nuclei container against a list of URLs, writes the results to a `.jsonl` file and removes the
container once it has completed.
```sh
# This assumes there's a file called `urls.txt` in the current directory
docker run --rm -v ./:/app/ projectdiscovery/nuclei -l /app/urls.txt -jsonl /app/results.jsonl
# The results will be written to `./results.jsonl` on the host machine once the container has completed
```

0 comments on commit 5d8f023

Please sign in to comment.