def main(): webutils.check_referer() referer, source, categories, files = parse_form() count = import_files(source, categories, files) sys.stdout.write('Content-Type: text/html\r\n') if referer: sys.stdout.write('Refresh: 5;url=%s\r\n' % referer) sys.stdout.write('\r\n') sys.stdout.write("""<html> <head> <title>IVRE Web UI</title> </head> <body style="padding-top: 2%%; padding-left: 2%%"> <h1>%d result%s uploaded</h1> </body> </html>""" % (count, 's' if count > 1 else ''))
def main(): webutils.check_referer() referer, source, categories, files = parse_form() count = import_files(source, categories, files) sys.stdout.write("Content-Type: text/html\r\n") if referer: sys.stdout.write("Refresh: 5;url=%s\r\n" % referer) sys.stdout.write("\r\n") sys.stdout.write( """<html> <head> <title>IVRE Web UI</title> </head> <body style="padding-top: 2%%; padding-left: 2%%"> <h1>%d result%s uploaded</h1> </body> </html>""" % (count, "s" if count > 1 else "") )
import json try: from ivre import utils, webutils, config from ivre.db import db if config.WEB_DEFAULT_INIT_QUERY is None: config.WEB_DEFAULT_INIT_QUERY = db.nmap.flt_empty except Exception as exc: sys.stdout.write('Content-Type: application/javascript\r\n\r\n') sys.stdout.write( 'alert("ERROR: Could not import ivre. Check the server\'s logs!");') sys.stderr.write("IVRE: ERROR: cannot import ivre [%s (%r)].\n" % (exc.message, exc)) sys.exit(0) webutils.check_referer() def main(): # write headers sys.stdout.write(webutils.JS_HEADERS) params = webutils.parse_query_string() query = webutils.query_from_params(params) flt, archive, sortby, unused, skip, limit = webutils.flt_from_query(query) callback = params.get("callback") # type of result action = params.get("action", "") # top values if action.startswith('topvalues:'): field = action[10:]
import json try: from ivre import utils, webutils, config from ivre.db import db except Exception as exc: sys.stdout.write('Content-Type: application/javascript\r\n\r\n') sys.stdout.write( 'alert("ERROR: Could not import ivre. Check the server\'s logs!");' ) sys.stderr.write( "IVRE: ERROR: cannot import ivre [%s (%r)].\n" % (exc.message, exc) ) sys.exit(0) webutils.check_referer() def main(): # write headers sys.stdout.write(webutils.JS_HEADERS) params = webutils.parse_query_string() query = webutils.query_from_params(params) flt, archive, sortby, unused, skip, limit = webutils.flt_from_query(query) if limit is None: limit = config.WEB_LIMIT if config.WEB_MAXRESULTS is not None: limit = min(limit, config.WEB_MAXRESULTS) callback = params.get("callback") # type of result action = params.get("action", "")