Notifica la scheda del sistema di notifica¶
Panoramica¶
Notify è un sistema di notifica versatile sviluppato da Project Discovery che permette di inviare notifiche in tempo reale a varie piattaforme e servizi. È progettato per semplificare il flusso di lavoro consentendo agli utenti di reindirizzare l'output di strumenti di sicurezza o file direttamente a più fornitori di notifiche, come Discord, Slack, Telegram e altro ancora.
Ciò che imposta Notify a parte altri strumenti di notifica è la sua integrazione senza soluzione di continuità con i flussi di lavoro di sicurezza e la sua capacità di gestire vari formati di input. Può elaborare l'output di strumenti di sicurezza in tempo reale, filtrare e formattare le notifiche in base a criteri specifici, e inviarle a più destinazioni contemporaneamente. Questo lo rende uno strumento essenziale per l'automazione della sicurezza, permettendo ai professionisti della sicurezza di rimanere informati sui risultati importanti senza monitorare costantemente i loro strumenti.
Informare è comunemente usato nelle tubazioni di sicurezza per avvisare circa le vulnerabilità scoperte, nuovi sottodomini, porte aperte, o qualsiasi altro risultato significativo. La sua flessibilità e facilità di integrazione lo rendono un componente prezioso nei flussi di lavoro di automazione della sicurezza, consentendo la consapevolezza in tempo reale dei problemi di sicurezza.
Installazione¶
Using Go¶
# Install using Go (requires Go 1.20 or later)
go install -v github.com/projectdiscovery/notify/cmd/notify@latest
# Verify installation
notify -version
Using Docker¶
# Pull the latest Docker image
docker pull projectdiscovery/notify:latest
# Run Notify using Docker
docker run -it projectdiscovery/notify:latest -h
Using Homebrew (macOS)¶
Using PDTM (Project Discovery Tools Manager)¶
# Install PDTM first if not already installed
go install -v github.com/projectdiscovery/pdtm/cmd/pdtm@latest
# Install Notify using PDTM
pdtm -i notify
# Verify installation
notify -version
On Kali Linux¶
Uso di base¶
Inviare notifiche¶
# Send a simple notification
echo "Hello, World!"|notify
# Send a notification with a custom message
echo "Hello, World!"|notify -message "Custom message: \\\\{\\\\{data\\\\}\\\\}"
# Send a notification from a file
cat results.txt|notify
# Send a notification with a specific provider
echo "Hello, World!"|notify -provider discord
Provider Selection¶
# Send to a specific provider
echo "Hello, World!"|notify -provider slack
# Send to multiple providers
echo "Hello, World!"|notify -provider slack,discord,telegram
# Send to all configured providers
echo "Hello, World!"|notify -provider all
Opzioni di uscita¶
# Save notification log to a file
echo "Hello, World!"|notify -log-file notify.log
# Enable verbose output
echo "Hello, World!"|notify -v
# Show debug information
echo "Hello, World!"|notify -debug
Configurazione del fornitore¶
Configurazione discord¶
# Set Discord webhook URL
notify -set-discord-webhook https://discord.com/api/webhooks/your-webhook-url
# Set Discord username
notify -set-discord-username "Notify Bot"
# Set Discord avatar URL
notify -set-discord-avatar https://example.com/avatar.png
# Test Discord configuration
echo "Test message"|notify -provider discord
Slack Configuration¶
# Set Slack webhook URL
notify -set-slack-webhook https://hooks.slack.com/services/your-webhook-url
# Set Slack username
notify -set-slack-username "Notify Bot"
# Set Slack channel
notify -set-slack-channel "#security-alerts"
# Test Slack configuration
echo "Test message"|notify -provider slack
Configurazione del telegramma¶
# Set Telegram API token
notify -set-telegram-token your-api-token
# Set Telegram chat ID
notify -set-telegram-chat-id your-chat-id
# Test Telegram configuration
echo "Test message"|notify -provider telegram
Configurazione e-mail¶
# Set email SMTP server
notify -set-email-server smtp.gmail.com:587
# Set email credentials
notify -set-email-username your-email@gmail.com -set-email-password your-password
# Set email sender
notify -set-email-sender "Notify ``<notify@example.com>``"
# Set email recipient
notify -set-email-recipient recipient@example.com
# Test email configuration
echo "Test message"|notify -provider email
Teams Configuration¶
# Set Microsoft Teams webhook URL
notify -set-teams-webhook https://outlook.office.com/webhook/your-webhook-url
# Test Teams configuration
echo "Test message"|notify -provider teams
Configurazione personalizzata Webhook¶
# Set custom webhook URL
notify -set-custom-webhook https://example.com/webhook
# Set custom webhook method
notify -set-custom-method POST
# Set custom webhook headers
notify -set-custom-headers "Content-Type: application/json,Authorization: Bearer token"
# Test custom webhook configuration
echo "Test message"|notify -provider custom
Uso avanzato¶
Formattazione del messaggio¶
# Use custom message format
echo "Vulnerability found!"|notify -message "Alert: \\\\{\\\\{data\\\\}\\\\}"
# Use JSON data in message
echo '\\\\{"severity":"high","vuln":"XSS"\\\\}'|notify -message "\\\\{\\\\{json.severity\\\\}\\\\} severity \\\\{\\\\{json.vuln\\\\}\\\\} found!"
# Use HTML formatting
echo "<b>Bold text</b>"|notify -message "\\\\{\\\\{data\\\\}\\\\}" -format html
Notifica Filtro¶
# Filter notifications by content
echo -e "Error 1\nWarning 2\nError 3"|notify -filter "Error"
# Filter notifications by regex
echo -e "CVE-2021-1234\nCVE-2022-5678"|notify -filter-regex "CVE-202[2-3]-.*"
# Exclude notifications by content
echo -e "Error 1\nWarning 2\nError 3"|notify -exclude "Warning"
# Exclude notifications by regex
echo -e "CVE-2021-1234\nCVE-2022-5678"|notify -exclude-regex "CVE-202[0-1]-.*"
Notifica Gruppo¶
# Group notifications by ID
echo "Finding 1"|notify -id security
echo "Finding 2"|notify -id security
# Group notifications with delay
echo "Finding 1"|notify -id security -delay 60
echo "Finding 2"|notify -id security -delay 60
Notification Throttling¶
# Set notification delay
echo "Finding 1"|notify -delay 5
# Set maximum notifications per minute
echo "Finding 1"|notify -rate-limit 10
Integrazione con altri strumenti¶
Pipeline with Nuclei¶
# Send Nuclei findings to Discord
nuclei -u https://example.com -t cves/ -silent|notify -provider discord
# Send only critical findings to Slack
nuclei -u https://example.com -t cves/ -silent -severity critical|notify -provider slack
# Send findings with custom message format
nuclei -u https://example.com -t cves/ -json -silent|notify -message "Vulnerability found: \\\\{\\\\{json.info.name\\\\}\\\\} (\\\\{\\\\{json.info.severity\\\\}\\\\})"
Pipeline with Subfinder¶
# Send discovered subdomains to Telegram
subfinder -d example.com -silent|notify -provider telegram
# Send subdomains with custom message
subfinder -d example.com -silent|notify -message "New subdomain found: \\\\{\\\\{data\\\\}\\\\}"
Pipeline con HTTPX¶
# Send active HTTP services to Discord
httpx -l domains.txt -silent|notify -provider discord
# Send only specific status codes to Slack
httpx -l domains.txt -silent -status-code 200|notify -provider slack
Pipeline with Naabu¶
# Send open ports to Telegram
naabu -host example.com -silent|notify -provider telegram
# Send specific open ports to Discord
naabu -host example.com -silent -p 80,443,8080|notify -provider discord
Personalizzazione dell'uscita¶
Custom Message Templates¶
# Use simple text template
echo "Finding"|notify -message "New finding: \\\\{\\\\{data\\\\}\\\\}"
# Use JSON data in template
echo '\\\\{"vuln":"XSS","url":"https://example.com"\\\\}'|notify -message "\\\\{\\\\{json.vuln\\\\}\\\\} found at \\\\{\\\\{json.url\\\\}\\\\}"
# Use conditional formatting
echo '\\\\{"severity":"high"\\\\}'|notify -message "\\\\{\\\\{if eq json.severity \"high\"\\\\}\\\\}CRITICAL ALERT\\\\{\\\\{else\\\\}\\\\}Alert\\\\{\\\\{end\\\\}\\\\}: \\\\{\\\\{json.severity\\\\}\\\\} severity finding"
Opzioni di formattazione¶
# Use plain text format
echo "<b>Bold text</b>"|notify -format text
# Use HTML format
echo "<b>Bold text</b>"|notify -format html
# Use Markdown format
echo "**Bold text**"|notify -format markdown
Opzioni di inserimento¶
# Send file as attachment
cat screenshot.png|notify -provider discord -attach screenshot.png
# Send multiple files as attachments
notify -provider discord -attach "screenshot.png,report.pdf" -message "Security findings"
Miscellaneous # Caratteristiche¶
Notifiche Bulk¶
# Send bulk notifications from a file
cat findings.txt|notify
# Process JSON lines
cat findings.jsonl|notify -json-input
Modalità interattiva¶
Health Check¶
# Check provider health
notify -health-check
# Check specific provider health
notify -health-check -provider discord
Risoluzione dei problemi¶
Questioni comuni¶
-
Provider Configuration Issues Traduzione:
-
♪Rate Limits ♪ Traduzione:
-
Message Formatting Issues Traduzione:
-
** Problemi di autenticazione ** Traduzione:
Debugging¶
# Enable verbose mode
echo "Finding"|notify -v
# Show debug information
echo "Finding"|notify -debug
# Check provider configuration
notify -provider-config
Configurazione¶
Configuration File¶
Notifica utilizza un file di configurazione situato a $HOME/.config/notify/provider-config.yaml. È possibile personalizzare varie impostazioni in questo file:
# Example configuration file
discord:
webhook: https://discord.com/api/webhooks/your-webhook-url
username: Notify Bot
avatar: https://example.com/avatar.png
slack:
webhook: https://hooks.slack.com/services/your-webhook-url
username: Notify Bot
channel: "#security-alerts"
telegram:
token: your-api-token
chat_id: your-chat-id
email:
server: smtp.gmail.com:587
username: your-email@gmail.com
password: your-password
sender: "Notify ``<notify@example.com>``"
recipient: recipient@example.com
Variabili ambientali¶
# Set Notify configuration via environment variables
export NOTIFY_DISCORD_WEBHOOK=https://discord.com/api/webhooks/your-webhook-url
export NOTIFY_SLACK_WEBHOOK=https://hooks.slack.com/services/your-webhook-url
export NOTIFY_TELEGRAM_TOKEN=your-api-token
export NOTIFY_TELEGRAM_CHAT_ID=your-chat-id
Riferimento¶
Opzioni di riga di comando¶
Tabella_82_
Opzioni di configurazione del provider¶
Tabella_83_
Provider supportato¶
Tabella_84_
Risorse¶
- [Documentazione ufficiale](URL_78___ GitHub Repository
- Progetto Discovery Discord_
*Questo foglio di scacchi fornisce un riferimento completo per l'utilizzo di Notify, dalle notifiche di base all'integrazione avanzata con altri strumenti. Per le informazioni più aggiornate, consultare sempre la documentazione ufficiale. *