mardi 19 janvier 2021

Preserve format from command to flask webserver

I have made a website, where you can use searchsploit. It is a flask server, thats just execute the command and then return it to the website. My problem is, when the output returns to the webpage, the formatting is just very hard to read, how do i preserve the format? Thanks

from flask import Flask
app = Flask(__name__)

def run_command(command):
   return subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).stdout.read()

@app.route('/<command>')
def command_server(command):
    return run_command(command)



Aucun commentaire:

Enregistrer un commentaire