<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# Network Protocol Templates — API Reference

## Nuclei TCP Protocol

```bash
# TCP scan with template
nuclei -u 192.168.1.10 -t tcp-template.yaml -json

# Specify port
nuclei -u 192.168.1.10 -t tcp-template.yaml -p 3306

# Bulk host scan
nuclei -l hosts.txt -t tcp-template.yaml -json -o results.json
```

## TCP Template Fields

| Field | Type | Description |
|-------|------|-------------|
| `inputs` | list | Sequence of data to send and read |
| `inputs[].data` | string | Data to send (supports hex with `\x` prefix) |
| `inputs[].read` | int | Bytes to read after sending |
| `host` | list | Target host(s) with `{{Hostname}}` |
| `port` | int | Target port number |
| `read-size` | int | Default bytes to read from connection |
| `tls` | bool | Use TLS for the connection |

## SSL/TLS Template Fields

| Field | Type | Description |
|-------|------|-------------|
| `address` | string | Target address (`{{Host}}:{{Port}}`) |
| `min_version` | string | Minimum TLS version to negotiate |
| `max_version` | string | Maximum TLS version to negotiate |
| `cipher_suites` | list | Specific cipher suites to test |

## SSL DSL Helper Variables

| Variable | Description |
|----------|-------------|
| `subject_cn` | Certificate common name |
| `subject_org` | Certificate organization |
| `issuer_cn` | Issuer common name |
| `issuer_org` | Issuer organization |
| `not_before` | Certificate start date |
| `not_after` | Certificate expiry date |
| `serial` | Certificate serial number |
| `dns_names` | Subject alternative names |

## DNS Template Fields

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | DNS query name (`{{FQDN}}`) |
| `type` | string | Query type: A, AAAA, MX, NS, TXT, CNAME, AXFR |
| `class` | string | Query class (default: IN) |
| `recursion` | bool | Enable recursive resolution |
| `resolvers` | list | Custom DNS resolvers |

## Common Network Ports

| Port | Service | Protocol |
|------|---------|----------|
| 21 | FTP | TCP |
| 22 | SSH | TCP |
| 25 | SMTP | TCP |
| 53 | DNS | TCP/UDP |
| 110 | POP3 | TCP |
| 143 | IMAP | TCP |
| 443 | HTTPS | TCP |
| 3306 | MySQL | TCP |
| 5432 | PostgreSQL | TCP |
| 6379 | Redis | TCP |
| 27017 | MongoDB | TCP |
