def handle_scan(self, scan, action, tags, notes, store=False):
try:
nmap = self._parseNMap(scan)
enhanced = self._enhance(nmap)
if store: self._store_in_db(nmap, tags=tags, notes=notes)
if action == "json":
returndata = json.dumps(enhanced, indent=2, default=json_util.default)
elif action == "pdf":
returndata = str(base64.b64encode(self._generatePDF(enhanced)), "utf-8")
elif action == "webview":
app = Flask(__name__, template_folder=os.path.join(callLocation, "templates"))
with app.test_request_context("/"):
returndata = render_template(self.html, scan=enhanced)
return returndata
except Exception as e:
traceback.print_exc()
评论列表
文章目录