11 lines
311 B
Python
11 lines
311 B
Python
#!/usr/bin/env python
|
|
from flask import Flask, Response
|
|
import subprocess
|
|
|
|
server = Flask(__name__)
|
|
|
|
@server.route('/whois/<domain>')
|
|
def whois(domain):
|
|
whois_cmd = subprocess.run(['/usr/bin/whois', domain], capture_output=True)
|
|
return Response(whois_cmd.stdout.decode('utf-8'), mimetype="text/plain")
|
|
|