Skip to content

Nuclei disconnecting early when pinging to Interactsh URL (HTTP) #6631

@dwisiswant0

Description

@dwisiswant0

Nuclei disconnecting early when pinging to Interactsh URL (HTTP).

Template:

id: ping-server

info:
  name: ping-server
  author: ping-server
  severity: critical
  description: ping-server
  tags: test,ssrf

http:
  - method: GET
    path:
      - "{{BaseURL}}/?url=http://{{interactsh-url}}"
    matchers-condition: and
    matchers:
      - type: word
        part: interactsh_protocol
        words:
          - "dns"
          - "http"

Server:

#!/usr/bin/env python3

"""
Simple HTTP server that sends GET requests to URLs provided as parameters.
"""

from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qs
import urllib.request
import json

class RequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        parsed_path = urlparse(self.path)
        query_params = parse_qs(parsed_path.query)
        if 'url' not in query_params:
            self.send_response(400)
            self.send_header('Content-type', 'application/json')
            self.end_headers()
            response = {
                'error': 'Missing required parameter: url',
                'usage': 'Send GET request to /?url=<target_url>'
            }
            self.wfile.write(json.dumps(response, indent=2).encode())
            return
        
        target_url = query_params['url'][0]
        
        try:
            with urllib.request.urlopen(target_url, timeout=10) as response:
                status_code = response.status
                content = response.read().decode('utf-8')
                headers = dict(response.headers)
            
            self.send_response(200)
            self.send_header('Content-type', 'application/json')
            self.end_headers()
            
            result = {
                'success': True,
                'target_url': target_url,
                'status_code': status_code,
                'headers': headers,
                'content': content[:500] + '...' if len(content) > 500 else content
            }
            self.wfile.write(json.dumps(result, indent=2).encode())
            
        except Exception as e:
            self.send_response(500)
            self.send_header('Content-type', 'application/json')
            self.end_headers()
            error_response = {
                'success': False,
                'target_url': target_url,
                'error': str(e)
            }
            self.wfile.write(json.dumps(error_response, indent=2).encode())

def run_server(port=1231):
    server_address = ('', port)
    httpd = HTTPServer(server_address, RequestHandler)
    print(f'Starting server on port {port}...')
    print(f'Usage: http://localhost/:{port}/?url=<target_url>')
    print(f'Example: http://localhost/:{port}/?url=https://api.github.com/')
    httpd.serve_forever()

if __name__ == '__main__':
    run_server()

Slack thread: /archives/C09FG4BPS7Q/p1760947003207529

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions