### Install Interactsh Server Source: https://context7.com/projectdiscovery/interactsh/llms.txt Installs the Interactsh server using Go. This command fetches and installs the latest version of the server binary. ```bash go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-server@latest ``` -------------------------------- ### Interactsh Server Basic Setup Source: https://context7.com/projectdiscovery/interactsh/llms.txt Demonstrates basic setup and configuration options for the Interactsh server. This includes setting domains, IP addresses, authentication, custom ports, TLS settings, storage, and logging. ```bash # Basic server with a domain (requires DNS setup) interactsh-server -domain interact.example.com # Server with multiple domains interactsh-server -d "oast.pro,oast.me" # Specify public IP address interactsh-server -domain interact.example.com -ip 192.168.1.100 # IPv4 and IPv6 support interactsh-server -d oast.pro -ip "192.0.2.1,2001:db8::1" # Enable authentication with auto-generated token interactsh-server -domain interact.example.com -auth # Enable authentication with custom token interactsh-server -domain interact.example.com -token YOUR_SECRET_TOKEN # Custom ports interactsh-server -domain interact.example.com \ -dns-port 53 \ -http-port 80 \ -https-port 443 \ -smtp-port 25 \ -ldap-port 389 # Skip ACME (disable TLS) interactsh-server -domain interact.example.com -skip-acme # Use custom SSL certificate interactsh-server -domain interact.example.com \ -cert /path/to/cert.pem \ -privkey /path/to/key.pem # Enable disk-based storage interactsh-server -domain interact.example.com \ -disk \ -disk-path /var/lib/interactsh # Set data eviction period (days) interactsh-server -domain interact.example.com -eviction 7 # Disable eviction (keep data indefinitely) interactsh-server -domain interact.example.com -no-eviction # Enable debug mode with verbose output interactsh-server -domain interact.example.com -debug -verbose # Enable metrics endpoint interactsh-server -domain interact.example.com -metrics ``` -------------------------------- ### Install Interactsh CLI Client (Go) Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Installs the Interactsh CLI client using Go. Requires Go 1.20 or later. This command fetches the latest version of the client and installs it globally. ```bash go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest ``` -------------------------------- ### Bash: Interactsh CLI Basic Usage and Options Source: https://context7.com/projectdiscovery/interactsh/llms.txt Provides examples of using the `interactsh-client` command-line tool for generating payloads, polling for interactions, and customizing its behavior. Covers installation, basic execution, generating multiple payloads, specifying servers, authentication with tokens, output redirection, verbose logging, protocol filtering, custom polling intervals, session management, pattern matching, and including ASN information. ```bash # Install the client go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest # Basic run - generates 1 payload and polls for interactions interactsh-client # Generate multiple payloads interactsh-client -n 5 # Use a specific server interactsh-client -server hackwithautomation.com # Use multiple servers (comma-separated) interactsh-client -server "oast.pro,oast.live,oast.me" # Connect to a protected server with token interactsh-client -server hackwithautomation.com -token YOUR_TOKEN # Output interactions to file interactsh-client -o interactions.txt # Output in JSON Lines format interactsh-client -json -o interactions.jsonl # Verbose mode with full request/response interactsh-client -v # Filter by protocol interactsh-client -dns-only # Only DNS interactions interactsh-client -http-only # Only HTTP interactions interactsh-client -smtp-only # Only SMTP interactions # Custom poll interval (seconds) interactsh-client -poll-interval 10 # Store payloads to file interactsh-client -n 10 -payload-store -payload-store-file payloads.txt # Resume from session file interactsh-client -session-file interact.session # Match/filter interactions by pattern interactsh-client -match ".*test.*" -filter ".*ignore.*" # Include ASN information in output interactsh-client -json -asn ``` -------------------------------- ### Interactsh Server Command-Line Options Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Demonstrates how to start the Interactsh server with custom domains, a custom HTTP index file, and a directory for static file hosting. ```bash interactsh-server -d oast.pro,oast.me ``` ```bash interactsh-server -d hackwithautomation.com -http-index banner.html ``` ```bash interactsh-server -d hackwithautomation.com -http-directory ./paylods ``` -------------------------------- ### Deploy Interactsh Application with Ansible Source: https://github.com/projectdiscovery/interactsh/blob/main/deploy/README.md This Ansible playbook deploys the Interactsh application to a remote server. It handles the installation of necessary system packages, Docker, and starts the Interactsh container. Environment-specific parameters should be configured in the `vars` section of the `deploy.yaml` file. ```bash ansible-playbook deploy.yaml ansible-playbook deploy.yaml --extra-vars "container_tag=v1.1.2" ``` -------------------------------- ### Run Interactsh Server Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Starts the interactsh-server instance. The server automatically detects system IP addresses for DNS and service binding. ```bash interactsh-server -domain INTERACTSH_DOMAIN ``` -------------------------------- ### Interactsh Server with Custom SSL Certificate Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This command demonstrates how to start the Interactsh server using custom SSL certificate and private key files for a specified domain. It ensures secure communication by using provided certificate files instead of relying on automatic certificate generation. ```console $ interactsh-server -d hackwithautomation.com -cert hackwithautomation.com.crt -privkey hackwithautomation.com.key ``` -------------------------------- ### Dynamic HTTP Response Configuration and Example Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This section explains how to enable and use the dynamic HTTP response feature in Interactsh server, allowing custom responses based on query parameters. It includes an example using curl to demonstrate the functionality. ```console $ curl -i 'https://hackwithautomation.com/x?status=307&body=this+is+example+body&delay=1&header=header1:value1&header=header1:value12' HTTP/2 307 header1: value1 header1: value12 server: hackwithautomation.com x-interactsh-version: 1.0.7 content-type: text/plain; charset=utf-8 content-length: 20 date: Tue, 13 Sep 2022 12:31:05 GMT this is example body ``` -------------------------------- ### Enable LDAP Interaction Logging Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Starts the Interactsh server with the LDAP flag enabled to ensure complete logging of LDAP search queries. ```console interactsh-server -domain hackwithautomation.com -sa -ldap ``` -------------------------------- ### Define Custom DNS Records Source: https://context7.com/projectdiscovery/interactsh/llms.txt Uses a YAML configuration file to define custom DNS records (A, AAAA, MX, TXT) and demonstrates how to start the server with these records. ```yaml - fqdn: aws.interact.example.com. type: A data: 169.254.169.254 - fqdn: alibaba.interact.example.com. type: A data: 100.100.100.200 - fqdn: ipv6test.interact.example.com. type: AAAA data: "2001:db8::1" - fqdn: mail.interact.example.com. type: MX data: "10 mail.example.com." - fqdn: _dmarc.interact.example.com. type: TXT data: "v=DMARC1; p=none" ``` ```bash interactsh-server -domain interact.example.com -custom-records custom-records.yaml dig aws.interact.example.com dig alibaba.interact.example.com ``` -------------------------------- ### GET /{path}.{ext} - Automatic Format Responses Source: https://context7.com/projectdiscovery/interactsh/llms.txt The server automatically returns specific content types based on the file extension in the path. ```APIDOC ## GET /{path}.{ext} ### Description Returns a response formatted as JSON or XML based on the file extension. ### Method GET ### Endpoint /{path}.{ext} ### Parameters #### Path Parameters - **ext** (string) - Required - The extension (e.g., 'json' or 'xml') determines the response format. ### Request Example curl 'https://interact.example.com/test.json' ### Response #### Success Response (200) - **data** (object/xml) - Reflected correlation data in the requested format. ``` -------------------------------- ### Interactsh Server with FTP Enabled Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This command starts the Interactsh server with the FTP protocol enabled, skipping automatic certificate generation and enabling debug mode for a specified domain. It shows the server listening on multiple services including FTP. ```console $ sudo go run . -ftp -skip-acme -debug -domain localhost ``` -------------------------------- ### Interactsh Server with Responder Enabled Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This command starts the Interactsh server with the Responder service enabled for a specified domain. It leverages the previously built 'interactsh' Docker image to expose various network services. ```bash sudo interactsh-server -responder -d localhost ``` -------------------------------- ### GET /s/{path} - Static File Hosting Source: https://context7.com/projectdiscovery/interactsh/llms.txt Serves static files from a configured directory for use in security testing payloads. ```APIDOC ## GET /s/{filename} ### Description Serves a static file from the directory configured via the -http-directory flag. ### Method GET ### Endpoint /s/{filename} ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the file to retrieve from the server's static directory. ### Request Example curl https://interact.example.com/s/xss.js ### Response #### Success Response (200) - **content** (file) - The contents of the requested file. ``` -------------------------------- ### Go: Start Polling for Interactions with Callback Source: https://context7.com/projectdiscovery/interactsh/llms.txt Initiates polling for captured interactions from the Interactsh server at a configurable interval. Each interaction is processed by a provided callback function, which handles different protocol types like DNS, HTTP, SMTP, and LDAP. This requires the interactsh client library. ```go package main import ( "fmt" "net/http" "time" "github.com/projectdiscovery/interactsh/pkg/client" "github.com/projectdiscovery/interactsh/pkg/server" ) func main() { c, err := client.New(client.DefaultOptions) if err != nil { panic(err) } defer c.Close() // Start polling with 5-second interval err = c.StartPolling(5*time.Second, func(interaction *server.Interaction) { fmt.Printf("[%s] %s interaction from %s\n", interaction.FullId, interaction.Protocol, interaction.RemoteAddress, ) fmt.Printf(" Timestamp: %s\n", interaction.Timestamp.Format(time.RFC3339)) // Handle different protocol types switch interaction.Protocol { case "dns": fmt.Printf(" DNS Query Type: %s\n", interaction.QType) fmt.Printf(" Raw Request:\n%s\n", interaction.RawRequest) case "http", "https": fmt.Printf(" HTTP Request:\n%s\n", interaction.RawRequest) fmt.Printf(" HTTP Response:\n%s\n", interaction.RawResponse) case "smtp": fmt.Printf(" SMTP From: %s\n", interaction.SMTPFrom) fmt.Printf(" Raw Request:\n%s\n", interaction.RawRequest) case "ldap": fmt.Printf(" LDAP Request:\n%s\n", interaction.RawRequest) } }) if err != nil { panic(err) } defer c.StopPolling() // Generate and trigger an interaction url := c.URL() fmt.Printf("Testing payload: %s\n", url) http.Get("https://" + url) // Wait for interactions to be captured time.Sleep(10 * time.Second) } ``` -------------------------------- ### GET /poll Source: https://context7.com/projectdiscovery/interactsh/llms.txt Retrieves captured interactions for a registered client. The interaction data is returned in an encrypted format. ```APIDOC ## GET /poll ### Description Polls the server for captured interactions associated with a specific correlation ID. ### Method GET ### Endpoint /poll ### Query Parameters - **id** (string) - Required - The correlation ID - **secret** (string) - Required - The secret key associated with the ID ### Response #### Success Response (200) - **data** (array) - AES-encrypted interaction data - **aes_key** (string) - RSA-encrypted AES key - **tlddata** (array) - Unencrypted root TLD data - **extra** (array) - Unencrypted extra data #### Response Example { "data": ["ENCRYPTED_INTERACTION_1"], "aes_key": "BASE64_ENCRYPTED_AES_KEY", "tlddata": [], "extra": [] } ``` -------------------------------- ### GET /x - Dynamic HTTP Response Source: https://context7.com/projectdiscovery/interactsh/llms.txt The server can return custom HTTP responses based on query parameters, including status codes, custom bodies, headers, and delays. ```APIDOC ## GET /x ### Description Returns a custom HTTP response based on provided query parameters. ### Method GET ### Endpoint /x ### Parameters #### Query Parameters - **status** (integer) - Optional - HTTP status code to return. - **body** (string) - Optional - Custom response body. - **delay** (integer) - Optional - Delay in seconds before responding. - **header** (string) - Optional - Custom headers in format 'Key:Value'. - **b64_body** (string) - Optional - Base64 encoded response body. ### Request Example curl -i 'https://interact.example.com/x?status=307&body=custom+body&delay=1&header=X-Custom:value1' ### Response #### Success Response (200/Custom) - **headers** (object) - Custom headers provided. - **body** (string) - The reflected or custom body content. ``` -------------------------------- ### Initialize Interactsh Client Source: https://context7.com/projectdiscovery/interactsh/llms.txt Demonstrates how to create a new Interactsh client instance using default or custom configurations. The client handles RSA key generation and server registration for secure communication. ```go package main import ( "fmt" "time" "github.com/projectdiscovery/interactsh/pkg/client" "github.com/projectdiscovery/interactsh/pkg/server" ) func main() { // Create client with default options (connects to public servers) c, err := client.New(client.DefaultOptions) if err != nil { panic(err) } defer c.Close() // Create client with custom options customClient, err := client.New(&client.Options{ ServerURL: "https://your-server.com", Token: "your-auth-token", // For protected servers DisableHTTPFallback: false, // Retry with HTTP if HTTPS fails CorrelationIdLength: 20, // Default: 20 CorrelationIdNonceLength: 13, // Default: 13 KeepAliveInterval: time.Minute, // Session keepalive }) if err != nil { panic(err) } defer customClient.Close() fmt.Println("Client created successfully") } ``` -------------------------------- ### Implement OOB Testing Workflow with Go Client Source: https://context7.com/projectdiscovery/interactsh/llms.txt Demonstrates how to use the Interactsh Go library to generate payloads, poll for interactions, and handle incoming callbacks for DNS and HTTP protocols. ```go package main import ( "fmt" "net/http" "net" "time" "github.com/projectdiscovery/interactsh/pkg/client" "github.com/projectdiscovery/interactsh/pkg/server" ) func main() { c, err := client.New(client.DefaultOptions) if err != nil { panic(err) } interactions := make(chan *server.Interaction, 100) err = c.StartPolling(2*time.Second, func(interaction *server.Interaction) { interactions <- interaction }) if err != nil { panic(err) } httpPayload := c.URL() dnsPayload := c.URL() fmt.Printf("HTTP Payload: https://%s\n", httpPayload) fmt.Printf("DNS Payload: %s\n", dnsPayload) go func() { resp, _ := http.Get("https://" + httpPayload + "/test") resp.Body.Close() }() go func() { net.LookupHost(dnsPayload) }() timeout := time.After(30 * time.Second) for { select { case interaction := <-interactions: fmt.Printf("Protocol: %s, ID: %s\n", interaction.Protocol, interaction.FullId) case <-timeout: c.StopPolling() c.Close() return } } } ``` -------------------------------- ### Enable FTP and SMB Services Source: https://context7.com/projectdiscovery/interactsh/llms.txt Deploys additional protocol listeners for FTP and SMB to facilitate advanced out-of-band testing scenarios. ```bash interactsh-server -domain interact.example.com -ftp -auth interactsh-server -domain interact.example.com -ftp -ftp-port 2121 -ftps-port 9900 -ftp-dir /var/ftp interactsh-server -domain interact.example.com -smb interactsh-server -domain interact.example.com -smb -smb-port 4445 interactsh-server -domain interact.example.com -responder ``` -------------------------------- ### Enable Wildcard Domain Mode Source: https://context7.com/projectdiscovery/interactsh/llms.txt Configures the server to capture interactions across all subdomains and demonstrates how to connect a client using the generated token. ```bash interactsh-server -domain interact.example.com -wildcard export INTERACTSH_MAX_SHARED_INTERACTIONS=50000 interactsh-server -domain interact.example.com -wildcard interactsh-client -server interact.example.com -token 699c55544ce1604c... ``` -------------------------------- ### Configure Self-Hosted Server Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Connects the client to a custom, self-hosted interactsh server using the -server flag. ```bash interactsh-client -server hackwithautomation.com ``` -------------------------------- ### Client Library - Creating a New Client Source: https://context7.com/projectdiscovery/interactsh/llms.txt This snippet demonstrates how to create a new Interactsh client instance, connecting to an Interactsh server and setting up secure communication. ```APIDOC ## Client Library - Creating a New Client ### Description The `client.New()` function creates a new Interactsh client instance that connects to an Interactsh server, generates RSA keys for secure communication, and registers with the server to receive interaction data. ### Method `client.New()` ### Parameters #### Options (struct) - **ServerURL** (string) - Optional - The URL of the Interactsh server to connect to. Defaults to public servers if not provided. - **Token** (string) - Optional - Authentication token for protected servers. - **DisableHTTPFallback** (bool) - Optional - If true, retries with HTTP if HTTPS fails. Defaults to false. - **CorrelationIdLength** (int) - Optional - The length of the correlation ID. Defaults to 20. - **CorrelationIdNonceLength** (int) - Optional - The length of the correlation ID nonce. Defaults to 13. - **KeepAliveInterval** (time.Duration) - Optional - The interval for session keep-alive messages. Defaults to 1 minute. ### Request Example ```go package main import ( "fmt" "time" "github.com/projectdiscovery/interactsh/pkg/client" ) func main() { // Create client with default options (connects to public servers) c, err := client.New(client.DefaultOptions) if err != nil { panic(err) } defer c.Close() // Create client with custom options customClient, err := client.New(&client.Options{ ServerURL: "https://your-server.com", Token: "your-auth-token", // For protected servers DisableHTTPFallback: false, // Retry with HTTP if HTTPS fails CorrelationIdLength: 20, // Default: 20 CorrelationIdNonceLength: 13, // Default: 13 KeepAliveInterval: time.Minute, // Session keepalive }) if err != nil { panic(err) } defer customClient.Close() fmt.Println("Client created successfully") } ``` ### Response #### Success Response - **client.Client** (*client.Client) - A new Interactsh client instance. - **error** (error) - An error if the client creation fails. ``` -------------------------------- ### Configure Server with IPv4 and IPv6 Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Enables dual-stack support by specifying both IPv4 and IPv6 addresses using the -ip flag, allowing the server to respond with appropriate A and AAAA records. ```bash interactsh-server -d oast.pro -ip 192.0.2.1,2001:db8::1 ``` -------------------------------- ### Enable Verbose Logging Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Runs the client in verbose mode to capture full request and response details, saving the output to a specified text file for later analysis. ```console interactsh-client -v -o interactsh-logs.txt ``` -------------------------------- ### Run Default Interactsh Client Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Executes the interactsh-client with default settings to generate a unique OOB payload and monitor interactions. ```console interactsh-client ``` -------------------------------- ### Interactsh CLI Client Help Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Displays the help message for the interactsh-client tool, showing all available flags and their descriptions. This is useful for understanding the tool's capabilities and options. ```bash interactsh-client -h ``` -------------------------------- ### Go: Save and Restore Interactsh Client Sessions Source: https://context7.com/projectdiscovery/interactsh/llms.txt Demonstrates how to manage Interactsh client sessions by saving the current session information to a file and restoring it upon client restart. This allows for uninterrupted polling and correlation ID persistence. It utilizes the interactsh client library and YAML for session storage. ```go package main import ( "fmt" "os" "time" "github.com/projectdiscovery/interactsh/pkg/client" "github.com/projectdiscovery/interactsh/pkg/options" "github.com/projectdiscovery/interactsh/pkg/server" "gopkg.in/yaml.v3" ) func main() { sessionFile := "interact.session" // Check if session file exists var sessionInfo *options.SessionInfo if data, err := os.ReadFile(sessionFile); err == nil { yaml.Unmarshal(data, &sessionInfo) fmt.Println("Resuming existing session...") } // Create client with session info (if available) c, err := client.New(&client.Options{ ServerURL: "oast.pro", SessionInfo: sessionInfo, KeepAliveInterval: time.Minute, }) if err != nil { panic(err) } // Generate payload URL url := c.URL() fmt.Printf("Payload URL: %s\n", url) // Start polling c.StartPolling(5*time.Second, func(interaction *server.Interaction) { fmt.Printf("Received: %s from %s\n", interaction.Protocol, interaction.RemoteAddress) }) // Save session before exit if err := c.SaveSessionTo(sessionFile); err != nil { fmt.Printf("Failed to save session: %v\n", err) } time.Sleep(30 * time.Second) c.StopPolling() // Note: Don't call c.Close() if you want to resume the session later } ``` -------------------------------- ### Host Static Files for Payloads Source: https://context7.com/projectdiscovery/interactsh/llms.txt Configures the server to serve static files from a local directory, enabling easy access to security payloads like XSS or XXE files. ```bash interactsh-server -domain interact.example.com -http-directory ./payloads interactsh-server -domain interact.example.com -http-index custom_index.html interactsh-server -domain interact.example.com -default-http-response response.html ``` -------------------------------- ### Deploy Interactsh via Docker Source: https://context7.com/projectdiscovery/interactsh/llms.txt Provides commands to run the Interactsh client and server components using Docker containers. ```bash docker run projectdiscovery/interactsh-client:latest docker run projectdiscovery/interactsh-client:latest -server your-server.com -n 5 -v docker run -p 53:53/udp -p 53:53/tcp -p 80:80 -p 443:443 projectdiscovery/interactsh-server:latest -domain interact.example.com ``` -------------------------------- ### Connect to Protected Server Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Authenticates with a self-hosted interactsh server that requires a token for access. ```bash interactsh-client -server hackwithautomation.com -token XXX ``` -------------------------------- ### Configure PDCP API Key for Interactsh CLI Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Demonstrates two methods for configuring the PDCP API key with the Interactsh CLI client. The API key is required for authentication with protected Interactsh servers. Users can obtain a free API key from cloud.projectdiscovery.io. ```bash ./interactsh-client -auth ``` ```bash ./interactsh-client -auth= ``` -------------------------------- ### Interactsh Server with SMB Enabled Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This command enables the Samba (SMB) protocol for the Interactsh server, skipping automatic certificate generation and enabling debug mode for a specified domain. This allows Interactsh to simulate an SMB share. ```console $ sudo interactsh-server -smb -skip-acme -debug -domain localhost ``` -------------------------------- ### Configure Server with Multiple Domains Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Allows running a single interactsh-server instance across multiple domain names by providing a comma-separated list to the -d flag. ```bash interactsh-server -d oast.pro,oast.me ``` -------------------------------- ### Deploy Interactsh Server with Docker Source: https://context7.com/projectdiscovery/interactsh/llms.txt Deploys an Interactsh server container with volume persistence for disk storage. It maps necessary ports for DNS, HTTP, and HTTPS, and requires a domain for operation. ```bash docker run -p 53:53/udp -p 53:53/tcp -p 80:80 -p 443:443 -v /data/interactsh:/data projectdiscovery/interactsh-server:latest -domain interact.example.com -disk -disk-path /data ``` -------------------------------- ### Build Interactsh Docker Image Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This command builds a Docker image for Interactsh and tags it as 'interactsh'. This image is required to run the Responder service integration with Interactsh. ```bash docker build . -t interactsh ``` -------------------------------- ### Integrate with Notify Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Pipes the output of the interactsh-client into the notify tool to receive real-time alerts on external platforms. ```bash interactsh-client | notify ``` -------------------------------- ### Configure Dynamic HTTP Responses Source: https://context7.com/projectdiscovery/interactsh/llms.txt Demonstrates how to use curl to trigger custom HTTP status codes, headers, delays, and encoded bodies via query parameters or path segments. ```bash curl -i 'https://interact.example.com/x?status=307&body=custom+body&delay=1&header=X-Custom:value1&header=X-Another:value2' curl 'https://interact.example.com/b64_body:SGVsbG8gV29ybGQ=/' curl 'https://interact.example.com/x?b64_body=SGVsbG8gV29ybGQ=' curl 'https://interact.example.com/test.json' curl 'https://interact.example.com/test.xml' ``` -------------------------------- ### Interactsh Server API - Register Endpoint Source: https://context7.com/projectdiscovery/interactsh/llms.txt Shows how to register a client with the Interactsh server using the /register API endpoint. This involves sending the client's public key, a secret key, and a correlation ID. ```bash # Register a client with the server curl -X POST https://interact.example.com/register \ -H "Content-Type: application/json" \ -H "Authorization: YOUR_TOKEN" \ -d '{ "public-key": "BASE64_ENCODED_RSA_PUBLIC_KEY", "secret-key": "UUID_SECRET_KEY", "correlation-id": "c23b2la0kl1krjcrdj10" }' ``` -------------------------------- ### Client Library - Generating Payload URLs Source: https://context7.com/projectdiscovery/interactsh/llms.txt This snippet shows how to generate unique payload URLs using the Interactsh client library, which are essential for OOB interaction testing. ```APIDOC ## Client Library - Generating Payload URLs ### Description The `client.URL()` method generates unique payload URLs that can be used for OOB testing. Each URL contains a correlation ID and nonce that identifies interactions back to your client session. ### Method `client.URL()` ### Endpoint N/A (This is a client-side method) ### Parameters None ### Request Example ```go package main import ( "fmt" "net/http" "github.com/projectdiscovery/interactsh/pkg/client" ) func main() { c, err := client.New(client.DefaultOptions) if err != nil { panic(err) } defer c.Close() // Generate a single payload URL payloadURL := c.URL() fmt.Printf("Generated payload: %s\n", payloadURL) // Output: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro // Generate multiple payloads for different tests for i := 0; i < 5; i++ { url := c.URL() fmt.Printf("Payload %d: %s\n", i+1, url) } // Use the payload in HTTP requests testURL := "https://" + payloadURL resp, err := http.Get(testURL) if err != nil { fmt.Printf("Request error: %v\n", err) return } resp.Body.Close() fmt.Printf("Request sent to: %s (Status: %d)\n", testURL, resp.StatusCode) } ``` ### Response #### Success Response - **string** - A unique payload URL (e.g., `c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro`). #### Response Example ``` Generated payload: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro Payload 1: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro Payload 2: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro Payload 3: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro Payload 4: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro Payload 5: c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro Request sent to: https://c23b2la0kl1krjcrdj10cndmnioyyyyyn.oast.pro (Status: 200) ``` ``` -------------------------------- ### Enable Wildcard Interaction Mode Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Configures the Interactsh server to support wildcard domains, allowing multiple clients to receive shared interactions. The buffer size for shared interactions can be adjusted using the INTERACTSH_MAX_SHARED_INTERACTIONS environment variable. ```console interactsh-server -domain hackwithautomation.com -wildcard ``` ```console export INTERACTSH_MAX_SHARED_INTERACTIONS=50000 interactsh-server -domain hackwithautomation.com -wildcard ``` -------------------------------- ### Generate Interactsh Payload URLs Source: https://context7.com/projectdiscovery/interactsh/llms.txt Shows how to generate unique OOB payload URLs using the client instance. These URLs are used to trigger external interactions that the server captures and reports back to the client. ```go package main import ( "fmt" "net/http" "github.com/projectdiscovery/interactsh/pkg/client" ) func main() { c, err := client.New(client.DefaultOptions) if err != nil { panic(err) } defer c.Close() // Generate a single payload URL payloadURL := c.URL() fmt.Printf("Generated payload: %s\n", payloadURL) // Generate multiple payloads for different tests for i := 0; i < 5; i++ { url := c.URL() fmt.Printf("Payload %d: %s\n", i+1, url) } // Use the payload in HTTP requests testURL := "https://" + payloadURL resp, err := http.Get(testURL) if err != nil { fmt.Printf("Request error: %v\n", err) return } resp.Body.Close() fmt.Printf("Request sent to: %s (Status: %d)\n", testURL, resp.StatusCode) } ``` -------------------------------- ### Deploy Interactsh Server with Docker Compose Source: https://context7.com/projectdiscovery/interactsh/llms.txt Defines an Interactsh server service using Docker Compose, including port mapping for multiple protocols and authentication configuration. ```yaml version: '3' services: interactsh: image: projectdiscovery/interactsh-server:latest ports: - "53:53/udp" - "53:53/tcp" - "80:80" - "443:443" - "25:25" - "587:587" - "389:389" command: -domain interact.example.com -auth restart: unless-stopped ``` -------------------------------- ### POST /register Source: https://context7.com/projectdiscovery/interactsh/llms.txt Registers a new client with the Interactsh server by providing a public key, secret key, and a unique correlation ID for encrypted communication. ```APIDOC ## POST /register ### Description Registers a client with the server to enable encrypted interaction tracking. ### Method POST ### Endpoint /register ### Request Body - **public-key** (string) - Required - Base64-encoded RSA public key - **secret-key** (string) - Required - UUID for secret verification - **correlation-id** (string) - Required - Unique ID for correlation ### Request Example { "public-key": "BASE64_ENCRYPTED_RSA_PUBLIC_KEY", "secret-key": "UUID_SECRET_KEY", "correlation-id": "c23b2la0kl1krjcrdj10" } ### Response #### Success Response (200) - **message** (string) - Confirmation of successful registration #### Response Example { "message": "registration successful" } ``` -------------------------------- ### Interactsh Server API - Poll Endpoint Source: https://context7.com/projectdiscovery/interactsh/llms.txt Demonstrates how to poll the Interactsh server for captured interactions using the /poll endpoint. This requires the client's correlation ID and secret key for authentication and data retrieval. ```bash # Poll for interactions curl "https://interact.example.com/poll?id=CORRELATION_ID&secret=SECRET_KEY" \ -H "Authorization: YOUR_TOKEN" ``` -------------------------------- ### Interactsh Client Configuration Source: https://context7.com/projectdiscovery/interactsh/llms.txt Configures the interactsh client with custom correlation ID length for shorter payloads. This is useful for optimizing payload size. ```bash interactsh-client -cidl 4 -cidn 6 ``` -------------------------------- ### POST /deregister Source: https://context7.com/projectdiscovery/interactsh/llms.txt Removes a client registration and cleans up associated data from the server. ```APIDOC ## POST /deregister ### Description Deletes the client registration and associated interaction data. ### Method POST ### Endpoint /deregister ### Request Body - **correlation-id** (string) - Required - The correlation ID to remove - **secret-key** (string) - Required - The secret key for validation ### Request Example { "correlation-id": "c23b2la0kl1krjcrdj10", "secret-key": "UUID_SECRET_KEY" } ### Response #### Success Response (200) - **message** (string) - Confirmation of successful deregistration ``` -------------------------------- ### Add Grafana Agent for Monitoring with Ansible Source: https://github.com/projectdiscovery/interactsh/blob/main/deploy/README.md This Ansible playbook integrates the Grafana agent to collect node metrics and logs for your project. Before running, ensure you export the necessary Grafana Cloud credentials and URLs as environment variables. The playbook then applies these configurations using `grafana_agent.yaml`. ```bash export GRAFANA_CLOUD=**** export PROM_URL=**** export PROM_PASS==**** export PROM_USERNAME==**** ansible-playbook grafana_agent.yaml ``` -------------------------------- ### Interactsh Server API - Register Request Structure (Go) Source: https://context7.com/projectdiscovery/interactsh/llms.txt Defines the Go struct for the registration request payload used with the /register API endpoint. It includes fields for public key, secret key, and correlation ID. ```go // Go example - Registration request structure type RegisterRequest struct { PublicKey string `json:"public-key"` // Base64-encoded RSA public key SecretKey string `json:"secret-key"` // UUID for secret verification CorrelationID string `json:"correlation-id"` // Unique ID for correlation } ``` -------------------------------- ### Customize Payload Length Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Configures the length of the correlation ID (cidl) and nonce token (cidn) for the Interactsh server and client. Both the server and client must use identical lengths to ensure successful interaction correlation. ```console interactsh-server -d hackwithautomation.com -cidl 4 -cidn 6 ``` ```console interactsh-client -s hackwithautomation.com -cidl 4 -cidn 6 ``` -------------------------------- ### Interactsh Server API - Deregister Endpoint Source: https://context7.com/projectdiscovery/interactsh/llms.txt Shows how to deregister a client from the Interactsh server using the /deregister API endpoint. This requires the client's correlation ID and secret key to remove the registration and associated data. ```bash # Deregister a client curl -X POST https://interact.example.com/deregister \ -H "Content-Type: application/json" \ -H "Authorization: YOUR_TOKEN" \ -d '{ "correlation-id": "c23b2la0kl1krjcrdj10", "secret-key": "UUID_SECRET_KEY" }' ``` -------------------------------- ### Manage Interactsh Sessions Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md Uses the -sf flag to save or resume an interactsh session, allowing for polling interactions even after the client process is terminated. ```console interactsh-client -sf interact.session ``` -------------------------------- ### Nginx Reverse Proxy Configuration for Interactsh Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This Nginx configuration forwards HTTP, HTTPS, SMTP, and DNS traffic to the Interactsh server. It assumes Interactsh services are running on specific internal ports and configures Nginx to listen on standard external ports. ```nginx http { server { listen 443 ssl; server_name mysite.com; ssl_certificate /etc/nginx/interactsh.pem; ssl_certificate_key /etc/nginx/interactsh.key; location / { proxy_pass https://interachsh.mysite.com:80/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } } stream { # smtp server { listen 25; proxy_pass interachsh.mysite.com:8025; } # dns server { listen 53; proxy_pass interachsh.mysite.com:8053; } server { listen 53 udp; proxy_pass interachsh.mysite.com:8053; } } ``` -------------------------------- ### Interactsh FTP Interaction Log Source: https://github.com/projectdiscovery/interactsh/blob/main/README.md This log entry captures an FTP interaction, showing a user login attempt. It includes details like the protocol, unique ID, raw request, remote address, and timestamp, useful for debugging and security analysis. ```json {"protocol":"ftp","unique-id":"","full-id":"","raw-request":"USER test\ntest logging in","remote-address":"127.0.0.1:51564","timestamp":"2022-09-29T00:49:42.212323+02:00"} ``` -------------------------------- ### Interactsh Server API - Poll Response Structure (Go) Source: https://context7.com/projectdiscovery/interactsh/llms.txt Defines the Go struct for the poll response payload from the /poll API endpoint. It includes fields for encrypted interaction data, the AES key, and other relevant data. ```go // Go example - Poll response structure type PollResponse struct { Data []string `json:"data"` // AES-encrypted interaction data AESKey string `json:"aes_key"` // RSA-encrypted AES key TLDData []string `json:"tlddata,omitempty"` // Root TLD interactions (unencrypted) Extra []string `json:"extra"` // Extra data (unencrypted) } // Interaction data structure (after decryption) type Interaction struct { Protocol string `json:"protocol"` // http, https, dns, smtp, ldap, ftp, smb UniqueID string `json:"unique-id"` // Unique subdomain ID FullId string `json:"full-id"` // Full subdomain path QType string `json:"q-type"` // DNS query type (A, AAAA, MX, etc.) RawRequest string `json:"raw-request"` // Raw request data RawResponse string `json:"raw-response"` // Raw response data SMTPFrom string `json:"smtp-from"` // SMTP FROM field RemoteAddress string `json:"remote-address"` // Client IP address Timestamp time.Time `json:"timestamp"` // Interaction timestamp } ``` -------------------------------- ### Define Deregister Request Structure in Go Source: https://context7.com/projectdiscovery/interactsh/llms.txt Defines the Go struct used for handling deregistration requests, including fields for correlation and secret keys. ```go type DeregisterRequest struct { CorrelationID string `json:"correlation-id"` SecretKey string `json:"secret-key"` } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.