mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-15 14:16:08 -06:00
lint
This commit is contained in:
parent
b23a107a62
commit
7f2832d1fa
81 changed files with 399 additions and 396 deletions
|
|
@ -12,8 +12,7 @@ jQuery/Bootstrap
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from argparse import REMAINDER, ArgumentParser
|
||||||
from argparse import ArgumentParser, REMAINDER
|
|
||||||
|
|
||||||
ROOT = os.path.dirname(os.path.realpath(__file__))
|
ROOT = os.path.dirname(os.path.realpath(__file__))
|
||||||
# Try to load modules from our current env first
|
# Try to load modules from our current env first
|
||||||
|
|
@ -79,7 +78,7 @@ def parse_args(mode=True, name=None):
|
||||||
unknown = []
|
unknown = []
|
||||||
|
|
||||||
if options.version:
|
if options.version:
|
||||||
from burpui.desc import __title__, __version__, __release__
|
from burpui.desc import __release__, __title__, __version__
|
||||||
|
|
||||||
ver = "{}: v{}".format(mname or __title__, __version__)
|
ver = "{}: v{}".format(mname or __title__, __version__)
|
||||||
if options.log:
|
if options.log:
|
||||||
|
|
@ -153,6 +152,7 @@ def server(options=None, unknown=None):
|
||||||
|
|
||||||
def agent(options=None):
|
def agent(options=None):
|
||||||
import trio
|
import trio
|
||||||
|
|
||||||
from burpui.engines.agent import BUIAgent as Agent
|
from burpui.engines.agent import BUIAgent as Agent
|
||||||
from burpui.utils import lookup_file
|
from burpui.utils import lookup_file
|
||||||
|
|
||||||
|
|
@ -172,6 +172,7 @@ def agent(options=None):
|
||||||
|
|
||||||
def monitor(options=None):
|
def monitor(options=None):
|
||||||
import trio
|
import trio
|
||||||
|
|
||||||
from burpui.engines.monitor import MonitorPool
|
from burpui.engines.monitor import MonitorPool
|
||||||
from burpui.utils import lookup_file
|
from burpui.utils import lookup_file
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import pickle # noqa
|
import pickle # noqa
|
||||||
|
from urllib.parse import quote, unquote, urljoin, urlparse # noqa
|
||||||
from urllib.parse import unquote, quote, urlparse, urljoin # noqa
|
|
||||||
|
|
||||||
text_type = str
|
text_type = str
|
||||||
string_types = (str,)
|
string_types = (str,)
|
||||||
|
|
|
||||||
|
|
@ -8,22 +8,22 @@
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import hashlib
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
import hashlib
|
|
||||||
|
|
||||||
from flask import Blueprint, Response, request, current_app, session, abort, g
|
|
||||||
from flask_restx import Api as ApiPlus
|
|
||||||
from flask_login import current_user
|
|
||||||
from importlib import import_module
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
|
from flask import Blueprint, Response, abort, current_app, g, request, session
|
||||||
|
from flask_login import current_user
|
||||||
|
from flask_restx import Api as ApiPlus
|
||||||
|
|
||||||
from .._compat import to_bytes
|
from .._compat import to_bytes
|
||||||
from ..desc import __version__, __release__, __url__, __doc__
|
from ..config import config
|
||||||
|
from ..desc import __doc__, __release__, __url__, __version__
|
||||||
from ..engines.server import BUIServer # noqa
|
from ..engines.server import BUIServer # noqa
|
||||||
from ..exceptions import BUIserverException
|
from ..exceptions import BUIserverException
|
||||||
from ..config import config
|
|
||||||
from ..tools.logging import logger
|
from ..tools.logging import logger
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
|
|
|
||||||
|
|
@ -7,20 +7,21 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from . import api
|
import json
|
||||||
|
|
||||||
|
from flask import current_app
|
||||||
|
from flask_babel import gettext
|
||||||
|
from flask_login import current_user
|
||||||
|
|
||||||
from ..engines.server import BUIServer # noqa
|
from ..engines.server import BUIServer # noqa
|
||||||
from ..sessions import session_manager
|
|
||||||
from ..misc.acl.meta import meta_grants
|
from ..misc.acl.meta import meta_grants
|
||||||
|
from ..sessions import session_manager
|
||||||
from ..utils import NOTIF_OK
|
from ..utils import NOTIF_OK
|
||||||
from .custom import fields, Resource
|
from . import api
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
# from ..exceptions import BUIserverException
|
# from ..exceptions import BUIserverException
|
||||||
|
|
||||||
from flask import current_app
|
|
||||||
from flask_login import current_user
|
|
||||||
from flask_babel import gettext
|
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("admin", "Admin methods")
|
ns = api.namespace("admin", "Admin methods")
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from . import api
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from .custom import Resource
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from . import api
|
||||||
|
from .custom import Resource
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("backup", "Backup methods")
|
ns = api.namespace("backup", "Backup methods")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,17 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from . import api, cache_key, force_refresh
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from .custom import fields, Resource
|
|
||||||
from ..decorators import browser_cache
|
|
||||||
from ..ext.cache import cache
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
|
|
||||||
from flask_restx.marshalling import marshal
|
|
||||||
from flask_restx import inputs
|
|
||||||
from flask import current_app, request
|
from flask import current_app, request
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
from flask_restx import inputs
|
||||||
|
from flask_restx.marshalling import marshal
|
||||||
|
|
||||||
|
from ..decorators import browser_cache
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from ..ext.cache import cache
|
||||||
|
from . import api, cache_key, force_refresh
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("client", "Client methods")
|
ns = api.namespace("client", "Client methods")
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,18 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from . import api, cache_key, force_refresh
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from .custom import fields, Resource
|
|
||||||
from .client import ClientLabels
|
|
||||||
from ..ext.cache import cache
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
from ..decorators import browser_cache
|
|
||||||
from ..filter import mask
|
|
||||||
|
|
||||||
from flask import current_app, g
|
from flask import current_app, g
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
|
||||||
|
from ..decorators import browser_cache
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from ..ext.cache import cache
|
||||||
|
from ..filter import mask
|
||||||
|
from . import api, cache_key, force_refresh
|
||||||
|
from .client import ClientLabels
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("clients", "Clients methods")
|
ns = api.namespace("clients", "Clients methods")
|
||||||
|
|
||||||
|
|
@ -229,7 +229,7 @@ class RunningBackup(Resource):
|
||||||
res = [x for x in res if x in allowed]
|
res = [x for x in res if x in allowed]
|
||||||
running = False
|
running = False
|
||||||
if isinstance(res, dict):
|
if isinstance(res, dict):
|
||||||
for (_, run) in res.items():
|
for _, run in res.items():
|
||||||
running = running or (len(run) > 0)
|
running = running or (len(run) > 0)
|
||||||
if running:
|
if running:
|
||||||
break
|
break
|
||||||
|
|
@ -776,7 +776,7 @@ class AllClients(Resource):
|
||||||
else:
|
else:
|
||||||
for serv in bui.client.servers:
|
for serv in bui.client.servers:
|
||||||
grants[serv] = "all"
|
grants[serv] = "all"
|
||||||
for (serv, clients) in grants.items():
|
for serv, clients in grants.items():
|
||||||
if not isinstance(clients, list):
|
if not isinstance(clients, list):
|
||||||
clients = clients_cache.get(serv, [])
|
clients = clients_cache.get(serv, [])
|
||||||
ret += [{"name": x, "agent": serv} for x in clients]
|
ret += [{"name": x, "agent": serv} for x in clients]
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,15 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import flask_restx.fields
|
import flask_restx.fields
|
||||||
|
|
||||||
from flask_restx.fields import * # noqa # pylint: disable=locally-disabled, wildcard-import, unused-wildcard-import
|
from flask_restx.fields import * # noqa # pylint: disable=locally-disabled, wildcard-import, unused-wildcard-import
|
||||||
|
|
||||||
from .my_fields import (
|
from .my_fields import (
|
||||||
DateTime,
|
|
||||||
DateTimeHuman,
|
|
||||||
BackupNumber,
|
BackupNumber,
|
||||||
SafeString,
|
DateTime,
|
||||||
|
DateTimeHuman, # noqa
|
||||||
LocalizedString,
|
LocalizedString,
|
||||||
) # noqa
|
SafeString,
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = flask_restx.fields.__all__ + (
|
__all__ = flask_restx.fields.__all__ + (
|
||||||
DateTime,
|
DateTime,
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,15 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
import arrow
|
import arrow
|
||||||
|
from flask import escape
|
||||||
|
from flask_babel import gettext as _
|
||||||
|
from flask_restx import fields
|
||||||
|
from tzlocal import get_localzone
|
||||||
|
|
||||||
from ...ext.i18n import get_locale
|
from ...ext.i18n import get_locale
|
||||||
|
|
||||||
from flask_restx import fields
|
|
||||||
from flask_babel import gettext as _
|
|
||||||
from flask import escape
|
|
||||||
from tzlocal import get_localzone
|
|
||||||
|
|
||||||
TZ = str(get_localzone())
|
TZ = str(get_localzone())
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,22 +7,22 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from . import api, cache_key, force_refresh
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from .custom import fields, Resource
|
|
||||||
from .client import ClientLabels
|
|
||||||
from ..filter import mask
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
from ..decorators import browser_cache
|
|
||||||
from ..ext.cache import cache
|
|
||||||
from ..ext.i18n import LANGUAGES
|
|
||||||
|
|
||||||
from flask import flash, get_flashed_messages, url_for, current_app, session
|
|
||||||
from flask_login import current_user
|
|
||||||
|
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from flask import current_app, flash, get_flashed_messages, session, url_for
|
||||||
|
from flask_login import current_user
|
||||||
|
|
||||||
|
from ..decorators import browser_cache
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from ..ext.cache import cache
|
||||||
|
from ..ext.i18n import LANGUAGES
|
||||||
|
from ..filter import mask
|
||||||
|
from . import api, cache_key, force_refresh
|
||||||
|
from .client import ClientLabels
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("misc", "Misc methods")
|
ns = api.namespace("misc", "Misc methods")
|
||||||
|
|
||||||
|
|
@ -213,7 +213,7 @@ class Counters(Resource):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
found = False
|
found = False
|
||||||
for (_, cls) in running.items():
|
for _, cls in running.items():
|
||||||
if client in cls:
|
if client in cls:
|
||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
|
|
@ -346,7 +346,7 @@ class Live(Resource):
|
||||||
else:
|
else:
|
||||||
running = bui.client.is_one_backup_running()
|
running = bui.client.is_one_backup_running()
|
||||||
if isinstance(running, dict):
|
if isinstance(running, dict):
|
||||||
for (serv, clients) in running.items():
|
for serv, clients in running.items():
|
||||||
for client in clients:
|
for client in clients:
|
||||||
# ACL
|
# ACL
|
||||||
if mask.has_filters(current_user) and not mask.is_client_allowed(
|
if mask.has_filters(current_user) and not mask.is_client_allowed(
|
||||||
|
|
@ -533,15 +533,15 @@ class About(Resource):
|
||||||
srv = bui.client.get_server_version(server)
|
srv = bui.client.get_server_version(server)
|
||||||
multi = {}
|
multi = {}
|
||||||
if isinstance(cli, dict):
|
if isinstance(cli, dict):
|
||||||
for (name, val) in cli.items():
|
for name, val in cli.items():
|
||||||
multi[name] = {"client": val}
|
multi[name] = {"client": val}
|
||||||
if isinstance(srv, dict):
|
if isinstance(srv, dict):
|
||||||
for (name, val) in srv.items():
|
for name, val in srv.items():
|
||||||
multi[name]["server"] = val
|
multi[name]["server"] = val
|
||||||
if not multi:
|
if not multi:
|
||||||
res["burp"].append({"client": cli, "server": srv})
|
res["burp"].append({"client": cli, "server": srv})
|
||||||
else:
|
else:
|
||||||
for (name, val) in multi.items():
|
for name, val in multi.items():
|
||||||
tmp = val
|
tmp = val
|
||||||
tmp.update({"name": name})
|
tmp.update({"name": name})
|
||||||
res["burp"].append(tmp)
|
res["burp"].append(tmp)
|
||||||
|
|
@ -841,7 +841,7 @@ class History(Resource):
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
grants[serv] = "all"
|
grants[serv] = "all"
|
||||||
for (serv, clients) in grants.items():
|
for serv, clients in grants.items():
|
||||||
if not isinstance(clients, list):
|
if not isinstance(clients, list):
|
||||||
if data and serv in data:
|
if data and serv in data:
|
||||||
clients = data[serv].keys()
|
clients = data[serv].keys()
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from flask import session, current_app, request
|
from flask import current_app, request, session
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from werkzeug.datastructures import MultiDict
|
from werkzeug.datastructures import MultiDict
|
||||||
|
|
||||||
from . import api
|
|
||||||
from ..engines.server import BUIServer # noqa
|
from ..engines.server import BUIServer # noqa
|
||||||
from ..ext.i18n import LANGUAGES
|
from ..ext.i18n import LANGUAGES
|
||||||
from .custom import fields, Resource
|
from . import api
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("preferences", "Preferences methods")
|
ns = api.namespace("preferences", "Preferences methods")
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,20 @@
|
||||||
"""
|
"""
|
||||||
import select
|
import select
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from . import api
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from .custom import fields, Resource
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
|
|
||||||
from zlib import adler32
|
|
||||||
from time import gmtime, strftime, time
|
from time import gmtime, strftime, time
|
||||||
from flask import Response, send_file, make_response, after_this_request, current_app
|
from zlib import adler32
|
||||||
|
|
||||||
|
from flask import Response, after_this_request, current_app, make_response, send_file
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from flask_restx import inputs
|
from flask_restx import inputs
|
||||||
from werkzeug.datastructures import Headers
|
from werkzeug.datastructures import Headers
|
||||||
from werkzeug.exceptions import HTTPException
|
from werkzeug.exceptions import HTTPException
|
||||||
|
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from . import api
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("restore", "Restore methods")
|
ns = api.namespace("restore", "Restore methods")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
|
|
||||||
# This is a submodule we can also use "from ..api import api"
|
# This is a submodule we can also use "from ..api import api"
|
||||||
from . import api, cache_key, force_refresh
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from .custom import fields, Resource
|
|
||||||
from ..filter import mask
|
|
||||||
from ..ext.cache import cache
|
|
||||||
from ..decorators import browser_cache
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
|
|
||||||
from flask import current_app, g
|
from flask import current_app, g
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
|
||||||
|
from ..decorators import browser_cache
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from ..ext.cache import cache
|
||||||
|
from ..filter import mask
|
||||||
|
from . import api, cache_key, force_refresh
|
||||||
|
from .custom import Resource, fields
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
ns = api.namespace("servers", "Servers methods")
|
ns = api.namespace("servers", "Servers methods")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,27 +9,28 @@
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from . import api
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from ..ext.cache import cache
|
|
||||||
from .custom import Resource
|
|
||||||
from .._compat import unquote
|
|
||||||
from ..utils import NOTIF_INFO
|
|
||||||
|
|
||||||
from flask_babel import gettext as _, refresh
|
|
||||||
from flask import (
|
from flask import (
|
||||||
jsonify,
|
|
||||||
request,
|
|
||||||
url_for,
|
|
||||||
current_app,
|
current_app,
|
||||||
g,
|
g,
|
||||||
session,
|
jsonify,
|
||||||
render_template_string,
|
render_template_string,
|
||||||
|
request,
|
||||||
|
session,
|
||||||
|
url_for,
|
||||||
)
|
)
|
||||||
|
from flask_babel import gettext as _
|
||||||
|
from flask_babel import refresh
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from flask_restx import inputs
|
from flask_restx import inputs
|
||||||
from jinja2 import Environment, meta
|
from jinja2 import Environment, meta
|
||||||
|
|
||||||
|
from .._compat import unquote
|
||||||
from ..datastructures import ImmutableMultiDict, MultiDict
|
from ..datastructures import ImmutableMultiDict, MultiDict
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..ext.cache import cache
|
||||||
|
from ..utils import NOTIF_INFO
|
||||||
|
from . import api
|
||||||
|
from .custom import Resource
|
||||||
|
|
||||||
TEMPLATE_EXCLUDES = ["client", "agent"]
|
TEMPLATE_EXCLUDES = ["client", "agent"]
|
||||||
|
|
||||||
|
|
@ -1026,7 +1027,6 @@ class ClientSettings(Resource):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
class PathExpander(Resource):
|
class PathExpander(Resource):
|
||||||
|
|
||||||
parser = ns.parser()
|
parser = ns.parser()
|
||||||
parser.add_argument("path", required=True, help="No 'path' provided")
|
parser.add_argument("path", required=True, help="No 'path' provided")
|
||||||
parser.add_argument("source", required=False, help="Which file is it included in")
|
parser.add_argument("source", required=False, help="Which file is it included in")
|
||||||
|
|
|
||||||
|
|
@ -10,36 +10,36 @@
|
||||||
import os
|
import os
|
||||||
import select
|
import select
|
||||||
import struct
|
import struct
|
||||||
|
from datetime import timedelta
|
||||||
from . import api, cache_key, force_refresh
|
|
||||||
from .misc import History
|
|
||||||
from .custom import Resource
|
|
||||||
from .client import node_fields
|
|
||||||
from .clients import RunningBackup, ClientsReport, RunningClients
|
|
||||||
from ..engines.server import BUIServer # noqa
|
|
||||||
from ..ext.cache import cache
|
|
||||||
from ..config import config
|
|
||||||
from ..decorators import browser_cache
|
|
||||||
from ..tasks import perform_restore, load_all_tree, delete_client, force_scheduling_now
|
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
from zlib import adler32
|
from zlib import adler32
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
url_for,
|
|
||||||
Response,
|
Response,
|
||||||
current_app,
|
|
||||||
after_this_request,
|
after_this_request,
|
||||||
send_file,
|
current_app,
|
||||||
request,
|
|
||||||
g,
|
g,
|
||||||
|
request,
|
||||||
|
send_file,
|
||||||
session,
|
session,
|
||||||
|
url_for,
|
||||||
)
|
)
|
||||||
from flask_babel import gettext as _
|
from flask_babel import gettext as _
|
||||||
from flask_restx import inputs
|
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from datetime import timedelta
|
from flask_restx import inputs
|
||||||
from werkzeug.datastructures import Headers
|
from werkzeug.datastructures import Headers
|
||||||
|
|
||||||
|
from ..config import config
|
||||||
|
from ..decorators import browser_cache
|
||||||
|
from ..engines.server import BUIServer # noqa
|
||||||
|
from ..ext.cache import cache
|
||||||
|
from ..tasks import delete_client, force_scheduling_now, load_all_tree, perform_restore
|
||||||
|
from . import api, cache_key, force_refresh
|
||||||
|
from .client import node_fields
|
||||||
|
from .clients import ClientsReport, RunningBackup, RunningClients
|
||||||
|
from .custom import Resource
|
||||||
|
from .misc import History
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .ext.ws import socketio # noqa
|
from .ext.ws import socketio # noqa
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,19 @@ jQuery/Bootstrap
|
||||||
|
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
|
||||||
import time
|
import time
|
||||||
import logging
|
|
||||||
|
|
||||||
from .desc import __version__, __release__
|
from .desc import __release__, __version__
|
||||||
from .extensions import (
|
from .extensions import (
|
||||||
create_celery,
|
create_celery,
|
||||||
create_db,
|
create_db,
|
||||||
create_websocket,
|
create_websocket,
|
||||||
parse_db_setting,
|
|
||||||
get_redis_server,
|
get_redis_server,
|
||||||
|
parse_db_setting,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -53,18 +53,19 @@ def create_app(conf=None, verbose=0, logfile=None, **kwargs):
|
||||||
:returns: A :class:`burpui.engines.server.BUIServer` object
|
:returns: A :class:`burpui.engines.server.BUIServer` object
|
||||||
"""
|
"""
|
||||||
from flask import g, request, session
|
from flask import g, request, session
|
||||||
from flask_login import LoginManager
|
|
||||||
from flask_babel import gettext
|
from flask_babel import gettext
|
||||||
from .thirdparty.flask_bower import Bower
|
from flask_login import LoginManager
|
||||||
from .utils import ReverseProxied, lookup_file, is_uuid
|
|
||||||
from .tools.logging import logger
|
|
||||||
from .security import basic_login_from_request
|
|
||||||
from .engines.server import BUIServer as BurpUI
|
from .engines.server import BUIServer as BurpUI
|
||||||
from .sessions import session_manager
|
|
||||||
from .filter import mask
|
|
||||||
from .ext.cache import cache
|
from .ext.cache import cache
|
||||||
from .ext.i18n import babel, get_locale
|
from .ext.i18n import babel, get_locale
|
||||||
|
from .filter import mask
|
||||||
from .misc.auth.handler import BUIanon
|
from .misc.auth.handler import BUIanon
|
||||||
|
from .security import basic_login_from_request
|
||||||
|
from .sessions import session_manager
|
||||||
|
from .thirdparty.flask_bower import Bower
|
||||||
|
from .tools.logging import logger
|
||||||
|
from .utils import ReverseProxied, is_uuid, lookup_file
|
||||||
|
|
||||||
gunicorn = kwargs.get("gunicorn", True)
|
gunicorn = kwargs.get("gunicorn", True)
|
||||||
unittest = kwargs.get("unittest", False)
|
unittest = kwargs.get("unittest", False)
|
||||||
|
|
@ -179,6 +180,7 @@ def create_app(conf=None, verbose=0, logfile=None, **kwargs):
|
||||||
"false",
|
"false",
|
||||||
]:
|
]:
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
|
|
||||||
from .ext.session import sess
|
from .ext.session import sess
|
||||||
|
|
||||||
host, port, pwd = get_redis_server(app)
|
host, port, pwd = get_redis_server(app)
|
||||||
|
|
@ -299,7 +301,7 @@ def create_app(conf=None, verbose=0, logfile=None, **kwargs):
|
||||||
|
|
||||||
if not celery_worker:
|
if not celery_worker:
|
||||||
from .api import api, apibp
|
from .api import api, apibp
|
||||||
from .routes import view, mypad
|
from .routes import mypad, view
|
||||||
|
|
||||||
app.jinja_env.globals.update(
|
app.jinja_env.globals.update(
|
||||||
isinstance=isinstance,
|
isinstance=isinstance,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ jQuery/Bootstrap
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
if os.getenv("BUI_MODE") in ["server", "ws"] or "websocket" in sys.argv:
|
if os.getenv("BUI_MODE") in ["server", "ws"] or "websocket" in sys.argv:
|
||||||
|
|
@ -59,10 +60,11 @@ app = create_app(
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .extensions import create_db
|
|
||||||
from .ext.sql import db
|
|
||||||
from flask_migrate import Migrate
|
from flask_migrate import Migrate
|
||||||
|
|
||||||
|
from .ext.sql import db
|
||||||
|
from .extensions import create_db
|
||||||
|
|
||||||
# This may have been reseted by create_app
|
# This may have been reseted by create_app
|
||||||
if isinstance(app.database, bool):
|
if isinstance(app.database, bool):
|
||||||
app.config["WITH_SQL"] = app.database
|
app.config["WITH_SQL"] = app.database
|
||||||
|
|
@ -470,13 +472,14 @@ def setup_burp(
|
||||||
if msg:
|
if msg:
|
||||||
_die(msg, "setup-burp")
|
_die(msg, "setup-burp")
|
||||||
|
|
||||||
from .misc.parser.utils import Config
|
|
||||||
from .misc.backend.utils.constant import BURP_LISTEN_OPTION, BURP_BIND_MULTIPLE
|
|
||||||
from .app import get_redis_server
|
|
||||||
from .config import BUIConfig
|
|
||||||
import difflib
|
import difflib
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from .app import get_redis_server
|
||||||
|
from .config import BUIConfig
|
||||||
|
from .misc.backend.utils.constant import BURP_BIND_MULTIPLE, BURP_LISTEN_OPTION
|
||||||
|
from .misc.parser.utils import Config
|
||||||
|
|
||||||
if monitor:
|
if monitor:
|
||||||
monconf = BUIConfig(monitor)
|
monconf = BUIConfig(monitor)
|
||||||
monconf_orig = []
|
monconf_orig = []
|
||||||
|
|
@ -595,10 +598,11 @@ def setup_burp(
|
||||||
if redis:
|
if redis:
|
||||||
try:
|
try:
|
||||||
# detect missing modules
|
# detect missing modules
|
||||||
import redis as redis_client # noqa
|
|
||||||
import celery # noqa
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
import celery # noqa
|
||||||
|
import redis as redis_client # noqa
|
||||||
|
|
||||||
if (
|
if (
|
||||||
"redis" not in app.conf.options["Production"]
|
"redis" not in app.conf.options["Production"]
|
||||||
or "redis" in app.conf.options["Production"]
|
or "redis" in app.conf.options["Production"]
|
||||||
|
|
@ -974,7 +978,6 @@ exclude_comp=gz
|
||||||
bconfagent = os.devnull
|
bconfagent = os.devnull
|
||||||
|
|
||||||
if not os.path.exists(bconfagent):
|
if not os.path.exists(bconfagent):
|
||||||
|
|
||||||
agenttpl = """
|
agenttpl = """
|
||||||
password = abcdefgh
|
password = abcdefgh
|
||||||
"""
|
"""
|
||||||
|
|
@ -1039,9 +1042,9 @@ def diag(client, host, tips):
|
||||||
if msg:
|
if msg:
|
||||||
_die(msg, "diag")
|
_die(msg, "diag")
|
||||||
|
|
||||||
|
from .app import get_redis_server
|
||||||
from .misc.backend.utils.constant import BURP_LISTEN_OPTION
|
from .misc.backend.utils.constant import BURP_LISTEN_OPTION
|
||||||
from .misc.parser.utils import Config
|
from .misc.parser.utils import Config
|
||||||
from .app import get_redis_server
|
|
||||||
|
|
||||||
def _value_in_option(value, option, section="Production"):
|
def _value_in_option(value, option, section="Production"):
|
||||||
if section not in app.conf.options:
|
if section not in app.conf.options:
|
||||||
|
|
@ -1057,10 +1060,11 @@ def diag(client, host, tips):
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
# detect missing modules
|
# detect missing modules
|
||||||
import redis as redis_client # noqa
|
|
||||||
import celery # noqa
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
import celery # noqa
|
||||||
|
import redis as redis_client # noqa
|
||||||
|
|
||||||
rhost, rport, _ = get_redis_server(app)
|
rhost, rport, _ = get_redis_server(app)
|
||||||
ret = -1
|
ret = -1
|
||||||
for res in socket.getaddrinfo(
|
for res in socket.getaddrinfo(
|
||||||
|
|
@ -1345,9 +1349,10 @@ def diag(client, host, tips):
|
||||||
)
|
)
|
||||||
def sysinfo(verbose, load):
|
def sysinfo(verbose, load):
|
||||||
"""Returns a couple of system informations to help debugging."""
|
"""Returns a couple of system informations to help debugging."""
|
||||||
from .desc import __release__, __version__
|
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
from .desc import __release__, __version__
|
||||||
|
|
||||||
msg = None
|
msg = None
|
||||||
if load:
|
if load:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import codecs
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import codecs
|
|
||||||
import configobj
|
import configobj
|
||||||
import validate
|
import validate
|
||||||
|
|
||||||
|
|
@ -114,7 +115,6 @@ class BUIConfig(dict):
|
||||||
found = False
|
found = False
|
||||||
for line in ori:
|
for line in ori:
|
||||||
if re.match(r"^\s*(#|;)+\s*\[{}\]".format(section), line):
|
if re.match(r"^\s*(#|;)+\s*\[{}\]".format(section), line):
|
||||||
|
|
||||||
config.write("[{}]\n".format(section))
|
config.write("[{}]\n".format(section))
|
||||||
found = True
|
found = True
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,8 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import time
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import time
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,13 +29,13 @@ def browser_cache(expires=None):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from wsgiref.handlers import format_date_time
|
from wsgiref.handlers import format_date_time
|
||||||
|
|
||||||
from flask import g
|
from flask import g
|
||||||
from flask_restx.utils import unpack
|
from flask_restx.utils import unpack
|
||||||
|
|
||||||
def cache_decorator(view):
|
def cache_decorator(view):
|
||||||
@wraps(view)
|
@wraps(view)
|
||||||
def cache_func(*args, **kwargs):
|
def cache_func(*args, **kwargs):
|
||||||
|
|
||||||
resp, code, headers = unpack(view(*args, **kwargs))
|
resp, code, headers = unpack(view(*args, **kwargs))
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,22 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import struct
|
|
||||||
import sys
|
|
||||||
import ssl
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import ssl
|
||||||
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
import trio
|
import trio
|
||||||
|
|
||||||
from functools import partial
|
|
||||||
|
|
||||||
from ..exceptions import BUIserverException
|
|
||||||
from ..misc.backend.interface import BUIbackend
|
|
||||||
from .._compat import pickle, to_bytes, to_unicode
|
from .._compat import pickle, to_bytes, to_unicode
|
||||||
from ..config import config
|
from ..config import config
|
||||||
from ..desc import __version__
|
from ..desc import __version__
|
||||||
|
from ..exceptions import BUIserverException
|
||||||
|
from ..misc.backend.interface import BUIbackend
|
||||||
|
|
||||||
# TODO: sendfile is not yet supported by trio
|
# TODO: sendfile is not yet supported by trio
|
||||||
# try:
|
# try:
|
||||||
|
|
@ -269,8 +268,8 @@ class BUIAgent(BUIbackend):
|
||||||
if j["args"]:
|
if j["args"]:
|
||||||
if "pickled" in j and j["pickled"]:
|
if "pickled" in j and j["pickled"]:
|
||||||
# de-serialize arguments if needed
|
# de-serialize arguments if needed
|
||||||
import hmac
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import hmac
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
|
|
||||||
pickles = to_bytes(j["args"])
|
pickles = to_bytes(j["args"])
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,24 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import ssl
|
|
||||||
import trio
|
|
||||||
import json
|
|
||||||
import math
|
|
||||||
import struct
|
|
||||||
import logging
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
|
import math
|
||||||
|
import ssl
|
||||||
|
import struct
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from itertools import count
|
from itertools import count
|
||||||
|
|
||||||
|
import trio
|
||||||
from async_generator import asynccontextmanager
|
from async_generator import asynccontextmanager
|
||||||
|
|
||||||
|
from .._compat import to_bytes, to_unicode
|
||||||
|
from ..config import config
|
||||||
|
from ..desc import __version__
|
||||||
from ..exceptions import BUIserverException
|
from ..exceptions import BUIserverException
|
||||||
from ..misc.backend.utils.burp2 import Monitor
|
from ..misc.backend.utils.burp2 import Monitor
|
||||||
from ..config import config
|
|
||||||
from .._compat import to_bytes, to_unicode
|
|
||||||
from ..tools.logging import logger
|
from ..tools.logging import logger
|
||||||
from ..desc import __version__
|
|
||||||
|
|
||||||
|
|
||||||
CONNECTION_COUNTER = count()
|
CONNECTION_COUNTER = count()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,22 +7,21 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import logging # noqa
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import logging # noqa
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from ..tools.logging import logger
|
|
||||||
from ..misc.auth.handler import UserAuthHandler
|
|
||||||
from ..misc.acl.handler import ACLloader
|
|
||||||
from ..misc.audit.handler import BUIauditLoader
|
|
||||||
from ..config import config
|
|
||||||
from ..plugins import PluginManager
|
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
|
||||||
|
from ..config import config
|
||||||
|
from ..misc.acl.handler import ACLloader
|
||||||
|
from ..misc.audit.handler import BUIauditLoader
|
||||||
|
from ..misc.auth.handler import UserAuthHandler
|
||||||
|
from ..plugins import PluginManager
|
||||||
|
from ..tools.logging import logger
|
||||||
|
|
||||||
BUI_DEFAULTS = {
|
BUI_DEFAULTS = {
|
||||||
"Global": {
|
"Global": {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
"""
|
"""
|
||||||
from flask_caching import Cache
|
from flask_caching import Cache
|
||||||
|
|
||||||
|
|
||||||
cache = Cache(
|
cache = Cache(
|
||||||
config={
|
config={
|
||||||
"CACHE_TYPE": "simple",
|
"CACHE_TYPE": "simple",
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,9 @@
|
||||||
from flask import request, session
|
from flask import request, session
|
||||||
from flask_babel import Babel
|
from flask_babel import Babel
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from ..config import config
|
|
||||||
from .._compat import to_unicode
|
from .._compat import to_unicode
|
||||||
|
from ..config import config
|
||||||
|
|
||||||
babel = Babel()
|
babel = Babel()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from ..config import config
|
|
||||||
from flask_socketio import SocketIO
|
from flask_socketio import SocketIO
|
||||||
|
|
||||||
|
from ..config import config
|
||||||
|
|
||||||
options = {}
|
options = {}
|
||||||
options["async_mode"] = config.get("WS_ASYNC_MODE", "gevent")
|
options["async_mode"] = config.get("WS_ASYNC_MODE", "gevent")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,10 @@ def create_db(myapp, cli=False, unittest=False, create=True, celery_worker=False
|
||||||
"""
|
"""
|
||||||
if myapp.config["WITH_SQL"]:
|
if myapp.config["WITH_SQL"]:
|
||||||
try:
|
try:
|
||||||
from .ext.sql import db
|
|
||||||
from sqlalchemy.exc import OperationalError
|
from sqlalchemy.exc import OperationalError
|
||||||
from sqlalchemy_utils.functions import database_exists
|
from sqlalchemy_utils.functions import database_exists
|
||||||
|
|
||||||
|
from .ext.sql import db
|
||||||
from .models import lazy_loading
|
from .models import lazy_loading
|
||||||
|
|
||||||
lazy_loading()
|
lazy_loading()
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from .ext.i18n import LANGUAGES, get_locale
|
|
||||||
|
|
||||||
from flask_wtf import FlaskForm
|
|
||||||
from flask_babel import lazy_gettext as __
|
from flask_babel import lazy_gettext as __
|
||||||
from wtforms import StringField, PasswordField, BooleanField, SelectField, validators
|
from flask_wtf import FlaskForm
|
||||||
|
from wtforms import BooleanField, PasswordField, SelectField, StringField, validators
|
||||||
|
|
||||||
|
from .ext.i18n import LANGUAGES, get_locale
|
||||||
|
|
||||||
|
|
||||||
class LoginForm(FlaskForm):
|
class LoginForm(FlaskForm):
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
from .meta import meta_grants, BUIaclGrant
|
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN, __
|
||||||
from .interface import BUIaclLoader
|
from .interface import BUIaclLoader
|
||||||
from ...utils import NOTIF_OK, NOTIF_WARN, NOTIF_ERROR, __
|
from .meta import BUIaclGrant, meta_grants
|
||||||
|
|
||||||
|
|
||||||
class ACLloader(BUIaclLoader):
|
class ACLloader(BUIaclLoader):
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import os
|
import os
|
||||||
|
from collections import OrderedDict
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
from .interface import BUIacl, BUIaclLoader
|
from .interface import BUIacl, BUIaclLoader
|
||||||
from .meta import meta_grants
|
from .meta import meta_grants
|
||||||
|
|
||||||
from importlib import import_module
|
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
|
|
||||||
class ACLloader(BUIaclLoader):
|
class ACLloader(BUIaclLoader):
|
||||||
section = name = "ACL"
|
section = name = "ACL"
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,8 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from abc import ABCMeta, abstractmethod, abstractproperty
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from abc import ABCMeta, abstractmethod, abstractproperty
|
||||||
|
|
||||||
|
|
||||||
class BUIaclLoader(object, metaclass=ABCMeta):
|
class BUIaclLoader(object, metaclass=ABCMeta):
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from .interface import BUIacl
|
import fnmatch
|
||||||
from ...utils import make_list
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
from ...config import config
|
from ...config import config
|
||||||
from ...ext.cache import cache
|
from ...ext.cache import cache
|
||||||
|
from ...utils import make_list
|
||||||
import re
|
from .interface import BUIacl
|
||||||
import json
|
|
||||||
import fnmatch
|
|
||||||
|
|
||||||
PARSE_EXCLUDE_KEYS = ["agents", "clients", "ro", "rw", "order", "exclude"]
|
PARSE_EXCLUDE_KEYS = ["agents", "clients", "ro", "rw", "order", "exclude"]
|
||||||
PARSE_RESERVED_KEYS = ["ro", "rw", "order", "exclude"]
|
PARSE_RESERVED_KEYS = ["ro", "rw", "order", "exclude"]
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import re
|
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
from .interface import BUIaudit, BUIauditLogger as BUIauditLoggerInterface
|
|
||||||
from ...tools.logging import logger as parent_logger
|
from ...tools.logging import logger as parent_logger
|
||||||
|
from .interface import BUIaudit
|
||||||
|
from .interface import BUIauditLogger as BUIauditLoggerInterface
|
||||||
|
|
||||||
|
|
||||||
class BUIauditLoader(BUIaudit):
|
class BUIauditLoader(BUIaudit):
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import os
|
|
||||||
import inspect
|
import inspect
|
||||||
|
import os
|
||||||
from .interface import BUIaudit, BUIauditLogger as BUIauditLoggerInterface
|
|
||||||
|
|
||||||
from importlib import import_module
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
|
||||||
|
from .interface import BUIaudit
|
||||||
|
from .interface import BUIauditLogger as BUIauditLoggerInterface
|
||||||
|
|
||||||
|
|
||||||
class BUIauditLoader(BUIaudit):
|
class BUIauditLoader(BUIaudit):
|
||||||
"""See :class:`burpui.misc.audit.interface.BUIaudit`"""
|
"""See :class:`burpui.misc.audit.interface.BUIaudit`"""
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from flask_login import AnonymousUserMixin
|
from flask_login import AnonymousUserMixin
|
||||||
from .interface import BUIhandler, BUIuser, BUIloader
|
|
||||||
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN, __
|
|
||||||
from werkzeug.security import check_password_hash, generate_password_hash
|
from werkzeug.security import check_password_hash, generate_password_hash
|
||||||
|
|
||||||
|
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN, __
|
||||||
|
from .interface import BUIhandler, BUIloader, BUIuser
|
||||||
|
|
||||||
|
|
||||||
class BasicLoader(BUIloader):
|
class BasicLoader(BUIloader):
|
||||||
"""The :class:`burpui.misc.auth.basic.BasicLoader` class loads the *Basic*
|
"""The :class:`burpui.misc.auth.basic.BasicLoader` class loads the *Basic*
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import os
|
import os
|
||||||
|
from collections import OrderedDict
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
|
from flask import session
|
||||||
|
from flask_login import AnonymousUserMixin
|
||||||
|
|
||||||
from ...sessions import session_manager
|
from ...sessions import session_manager
|
||||||
from ...utils import is_uuid
|
from ...utils import is_uuid
|
||||||
from .interface import BUIhandler, BUIuser
|
|
||||||
from ..acl.interface import BUIacl
|
from ..acl.interface import BUIacl
|
||||||
|
from .interface import BUIhandler, BUIuser
|
||||||
from importlib import import_module
|
|
||||||
from flask import session
|
|
||||||
from collections import OrderedDict
|
|
||||||
from flask_login import AnonymousUserMixin
|
|
||||||
|
|
||||||
ACL_METHODS = BUIacl.__abstractmethods__
|
ACL_METHODS = BUIacl.__abstractmethods__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from flask_login import UserMixin, AnonymousUserMixin
|
|
||||||
from abc import ABCMeta, abstractmethod, abstractproperty
|
from abc import ABCMeta, abstractmethod, abstractproperty
|
||||||
|
|
||||||
|
from flask_login import AnonymousUserMixin, UserMixin
|
||||||
|
|
||||||
from ...tools.logging import logger
|
from ...tools.logging import logger
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
|
import ssl
|
||||||
|
|
||||||
from flask_login import AnonymousUserMixin
|
from flask_login import AnonymousUserMixin
|
||||||
|
|
||||||
from .interface import BUIhandler, BUIuser, BUIloader
|
|
||||||
from ...utils import __
|
from ...utils import __
|
||||||
|
from .interface import BUIhandler, BUIloader, BUIuser
|
||||||
import ssl
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ldap3 import (
|
from ldap3 import (
|
||||||
Server,
|
|
||||||
Connection,
|
|
||||||
Tls,
|
|
||||||
ALL,
|
ALL,
|
||||||
RESTARTABLE,
|
|
||||||
AUTO_BIND_TLS_BEFORE_BIND,
|
|
||||||
AUTO_BIND_NONE,
|
AUTO_BIND_NONE,
|
||||||
|
AUTO_BIND_TLS_BEFORE_BIND,
|
||||||
|
RESTARTABLE,
|
||||||
SIMPLE,
|
SIMPLE,
|
||||||
|
Connection,
|
||||||
|
Server,
|
||||||
|
Tls,
|
||||||
)
|
)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError("Unable to load 'ldap3' module")
|
raise ImportError("Unable to load 'ldap3' module")
|
||||||
|
|
@ -74,7 +74,7 @@ class LdapLoader(BUIloader):
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
for (opt, key) in mapping.items():
|
for opt, key in mapping.items():
|
||||||
setattr(self, opt, conf.safe_get(key, "force_string", section=self.section))
|
setattr(self, opt, conf.safe_get(key, "force_string", section=self.section))
|
||||||
|
|
||||||
if self.validate and self.validate.lower() in ["none", "optional", "required"]:
|
if self.validate and self.validate.lower() in ["none", "optional", "required"]:
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import pwd
|
import pwd
|
||||||
import pam
|
|
||||||
|
|
||||||
|
import pam
|
||||||
from flask_login import AnonymousUserMixin
|
from flask_login import AnonymousUserMixin
|
||||||
from .interface import BUIhandler, BUIuser, BUIloader
|
|
||||||
from ...utils import __
|
from ...utils import __
|
||||||
|
from .interface import BUIhandler, BUIloader, BUIuser
|
||||||
|
|
||||||
|
|
||||||
class LocalLoader(BUIloader):
|
class LocalLoader(BUIloader):
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,26 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import re
|
|
||||||
import os
|
|
||||||
import socket
|
|
||||||
import time
|
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import time
|
||||||
from .interface import BUIbackend
|
|
||||||
from ..parser.burp1 import Parser
|
|
||||||
from ...utils import human_readable as _hr, BUIcompress, utc_to_local
|
|
||||||
from ...security import sanitize_string
|
|
||||||
from ...exceptions import BUIserverException
|
|
||||||
from ..._compat import unquote, to_unicode, to_bytes
|
|
||||||
|
|
||||||
from shlex import quote
|
from shlex import quote
|
||||||
|
|
||||||
|
from ..._compat import to_bytes, to_unicode, unquote
|
||||||
|
from ...exceptions import BUIserverException
|
||||||
|
from ...security import sanitize_string
|
||||||
|
from ...utils import BUIcompress
|
||||||
|
from ...utils import human_readable as _hr
|
||||||
|
from ...utils import utc_to_local
|
||||||
|
from ..parser.burp1 import Parser
|
||||||
|
from .interface import BUIbackend
|
||||||
|
|
||||||
|
|
||||||
class Burp(BUIbackend):
|
class Burp(BUIbackend):
|
||||||
"""The :class:`burpui.misc.backend.burp1.Burp` class provides a consistent
|
"""The :class:`burpui.misc.backend.burp1.Burp` class provides a consistent
|
||||||
|
|
@ -510,7 +511,7 @@ class Burp(BUIbackend):
|
||||||
|
|
||||||
found = False
|
found = False
|
||||||
# this method is not optimal, but it is easy to read and to maintain
|
# this method is not optimal, but it is easy to read and to maintain
|
||||||
for (key, regex) in lookup_easy.items():
|
for key, regex in lookup_easy.items():
|
||||||
reg = re.search(regex, line)
|
reg = re.search(regex, line)
|
||||||
if reg:
|
if reg:
|
||||||
found = True
|
found = True
|
||||||
|
|
@ -526,7 +527,7 @@ class Burp(BUIbackend):
|
||||||
tmp = reg.group(1).split(":")
|
tmp = reg.group(1).split(":")
|
||||||
tmp.reverse()
|
tmp.reverse()
|
||||||
fields = [0] * 4
|
fields = [0] * 4
|
||||||
for (i, val) in enumerate(tmp):
|
for i, val in enumerate(tmp):
|
||||||
fields[i] = int(val)
|
fields[i] = int(val)
|
||||||
seconds = 0
|
seconds = 0
|
||||||
seconds += fields[0]
|
seconds += fields[0]
|
||||||
|
|
@ -543,7 +544,7 @@ class Burp(BUIbackend):
|
||||||
if found:
|
if found:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for (key, regex) in lookup_complex.items():
|
for key, regex in lookup_complex.items():
|
||||||
reg = re.search(regex, line)
|
reg = re.search(regex, line)
|
||||||
if reg:
|
if reg:
|
||||||
# self.logger.debug("match[1]: '{0}'".format(reg.group(1)))
|
# self.logger.debug("match[1]: '{0}'".format(reg.group(1)))
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,21 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import re
|
|
||||||
import os
|
|
||||||
import time
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import time
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
from ..._compat import to_unicode
|
||||||
|
from ...exceptions import BUIserverException
|
||||||
|
from ...utils import human_readable as _hr
|
||||||
|
from ...utils import utc_to_local
|
||||||
|
from ..parser.burp2 import Parser
|
||||||
from .burp1 import Burp as Burp1
|
from .burp1 import Burp as Burp1
|
||||||
from .interface import BUIbackend
|
from .interface import BUIbackend
|
||||||
from .utils.burp2 import Monitor
|
from .utils.burp2 import Monitor
|
||||||
from .utils.constant import BURP_REVERSE_COUNTERS, BURP_STATUS_FORMAT_V2
|
from .utils.constant import BURP_REVERSE_COUNTERS, BURP_STATUS_FORMAT_V2
|
||||||
from ..parser.burp2 import Parser
|
|
||||||
from ...utils import human_readable as _hr, utc_to_local
|
|
||||||
from ...exceptions import BUIserverException
|
|
||||||
from ..._compat import to_unicode
|
|
||||||
|
|
||||||
|
|
||||||
# Some functions are the same as in Burp1 backend
|
# Some functions are the same as in Burp1 backend
|
||||||
|
|
@ -301,7 +301,7 @@ class Burp(Burp1):
|
||||||
result[name] = counter["count"]
|
result[name] = counter["count"]
|
||||||
else:
|
else:
|
||||||
result[name] = {}
|
result[name] = {}
|
||||||
for (key, val) in counts.items():
|
for key, val in counts.items():
|
||||||
if val in counter:
|
if val in counter:
|
||||||
result[name][key] = counter[val]
|
result[name][key] = counter[val]
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
||||||
from ...tools.logging import logger
|
from ...tools.logging import logger
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import re
|
|
||||||
import socket
|
|
||||||
import errno
|
import errno
|
||||||
import json
|
import json
|
||||||
|
import re
|
||||||
|
import socket
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from werkzeug.datastructures import ImmutableMultiDict as _ImmutableMultiDict
|
from werkzeug.datastructures import ImmutableMultiDict as _ImmutableMultiDict
|
||||||
|
|
||||||
from .interface import BUIbackend
|
from ..._compat import pickle, to_bytes, to_unicode
|
||||||
from ..parser.interface import BUIparser
|
|
||||||
from ...exceptions import BUIserverException
|
|
||||||
from ..._compat import pickle, to_unicode, to_bytes
|
|
||||||
from ...decorators import implement
|
|
||||||
from ...datastructures import ImmutableMultiDict
|
from ...datastructures import ImmutableMultiDict
|
||||||
|
from ...decorators import implement
|
||||||
|
from ...exceptions import BUIserverException
|
||||||
|
from ..parser.interface import BUIparser
|
||||||
|
from .interface import BUIbackend
|
||||||
|
|
||||||
INTERFACE_METHODS = BUIbackend.__abstractmethods__
|
INTERFACE_METHODS = BUIbackend.__abstractmethods__
|
||||||
PARSER_INTERFACE_METHODS = BUIparser.__abstractmethods__
|
PARSER_INTERFACE_METHODS = BUIparser.__abstractmethods__
|
||||||
|
|
@ -556,8 +555,8 @@ class NClient(BUIbackend):
|
||||||
):
|
):
|
||||||
"""See :func:`burpui.misc.backend.interface.BUIbackend.store_conf_cli`"""
|
"""See :func:`burpui.misc.backend.interface.BUIbackend.store_conf_cli`"""
|
||||||
# serialize data as it is a nested dict
|
# serialize data as it is a nested dict
|
||||||
import hmac
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import hmac
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
if not isinstance(data, (_ImmutableMultiDict, ImmutableMultiDict)):
|
if not isinstance(data, (_ImmutableMultiDict, ImmutableMultiDict)):
|
||||||
|
|
@ -599,8 +598,8 @@ class NClient(BUIbackend):
|
||||||
def store_conf_srv(self, data, conf=None, agent=None):
|
def store_conf_srv(self, data, conf=None, agent=None):
|
||||||
"""See :func:`burpui.misc.backend.interface.BUIbackend.store_conf_srv`"""
|
"""See :func:`burpui.misc.backend.interface.BUIbackend.store_conf_srv`"""
|
||||||
# serialize data as it is a nested dict
|
# serialize data as it is a nested dict
|
||||||
import hmac
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import hmac
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
if not isinstance(data, (_ImmutableMultiDict, ImmutableMultiDict)):
|
if not isinstance(data, (_ImmutableMultiDict, ImmutableMultiDict)):
|
||||||
|
|
|
||||||
|
|
@ -7,26 +7,26 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import json
|
|
||||||
import ssl
|
import ssl
|
||||||
import time
|
|
||||||
import trio
|
|
||||||
import struct
|
import struct
|
||||||
|
import time
|
||||||
from asyncio import iscoroutinefunction
|
from asyncio import iscoroutinefunction
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from .burp2 import Burp as Burp2
|
import trio
|
||||||
from .interface import BUIbackend, BUIBACKEND_INTERFACE_METHODS
|
|
||||||
from .utils.constant import BURP_STATUS_FORMAT_V2
|
from ..._compat import to_bytes, to_unicode
|
||||||
from ..parser.burp2 import Parser
|
|
||||||
from ...exceptions import BUIserverException
|
|
||||||
from ...decorators import implement, usetriorun
|
from ...decorators import implement, usetriorun
|
||||||
from ...utils import utc_to_local
|
from ...exceptions import BUIserverException
|
||||||
from ..._compat import to_unicode, to_bytes
|
|
||||||
from ...tools.logging import logger
|
from ...tools.logging import logger
|
||||||
|
from ...utils import utc_to_local
|
||||||
|
from ..parser.burp2 import Parser
|
||||||
|
from .burp2 import Burp as Burp2
|
||||||
|
from .interface import BUIBACKEND_INTERFACE_METHODS, BUIbackend
|
||||||
|
from .utils.constant import BURP_STATUS_FORMAT_V2
|
||||||
|
|
||||||
BUI_DEFAULTS = {
|
BUI_DEFAULTS = {
|
||||||
"Parallel": {
|
"Parallel": {
|
||||||
|
|
@ -136,7 +136,6 @@ class Connector:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
async def status(self, query, timeout=None, cache=True):
|
async def status(self, query, timeout=None, cache=True):
|
||||||
|
|
||||||
request = {
|
request = {
|
||||||
"query": query,
|
"query": query,
|
||||||
"timeout": timeout,
|
"timeout": timeout,
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,10 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import datetime
|
||||||
|
import json
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from select import select
|
from select import select
|
||||||
|
|
||||||
from ...._compat import to_bytes, to_unicode
|
from ...._compat import to_bytes, to_unicode
|
||||||
|
|
@ -21,8 +20,8 @@ from ....tools.logging import logger
|
||||||
from .constant import (
|
from .constant import (
|
||||||
BURP_LIST_BATCH,
|
BURP_LIST_BATCH,
|
||||||
BURP_MINIMAL_VERSION,
|
BURP_MINIMAL_VERSION,
|
||||||
BURP_STATUS_FORMAT_V2,
|
|
||||||
BURP_STATUS_DELIMITER,
|
BURP_STATUS_DELIMITER,
|
||||||
|
BURP_STATUS_FORMAT_V2,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,18 @@
|
||||||
:synopsis: Burp-UI configuration file parser for Burp1.
|
:synopsis: Burp-UI configuration file parser for Burp1.
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
import re
|
|
||||||
import os
|
|
||||||
import json
|
|
||||||
import codecs
|
import codecs
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
from .doc import Doc
|
|
||||||
from .utils import Config
|
|
||||||
from .openssl import OSSLConf, OSSLAuth
|
|
||||||
from ...exceptions import BUIserverException
|
from ...exceptions import BUIserverException
|
||||||
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN
|
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN
|
||||||
|
from .doc import Doc
|
||||||
|
from .openssl import OSSLAuth, OSSLConf
|
||||||
|
from .utils import Config
|
||||||
|
|
||||||
|
|
||||||
class Parser(Doc):
|
class Parser(Doc):
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
:synopsis: Burp-UI configuration file parser for Burp2.
|
:synopsis: Burp-UI configuration file parser for Burp2.
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
|
from ..backend.utils.constant import BURP_BIND_MULTIPLE, BURP_LISTEN_OPTION
|
||||||
from .burp1 import Parser as Burp1
|
from .burp1 import Parser as Burp1
|
||||||
from ..backend.utils.constant import BURP_LISTEN_OPTION, BURP_BIND_MULTIPLE
|
|
||||||
|
|
||||||
|
|
||||||
def __(string):
|
def __(string):
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
:synopsis: Burp-UI configuration file parser OpenSSL configuration.
|
:synopsis: Burp-UI configuration file parser OpenSSL configuration.
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
|
import codecs
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import codecs
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
|
|
||||||
from ...tools.logging import logger
|
from ...tools.logging import logger
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,18 @@
|
||||||
|
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
|
import codecs
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import codecs
|
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from copy import copy
|
|
||||||
from hashlib import md5
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from copy import copy
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
from hashlib import md5
|
||||||
|
|
||||||
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN
|
|
||||||
from ...security import sanitize_string
|
|
||||||
from ...datastructures import MultiDict
|
from ...datastructures import MultiDict
|
||||||
|
from ...security import sanitize_string
|
||||||
|
from ...utils import NOTIF_ERROR, NOTIF_OK, NOTIF_WARN
|
||||||
|
|
||||||
RESET_IDENTIFIER = "_reset_bui_CUSTOM"
|
RESET_IDENTIFIER = "_reset_bui_CUSTOM"
|
||||||
BEGIN_TEMPLATES = "BURP-UI TEMPLATES"
|
BEGIN_TEMPLATES = "BURP-UI TEMPLATES"
|
||||||
|
|
@ -1514,7 +1512,6 @@ class Config(File):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _parse(self):
|
def _parse(self):
|
||||||
|
|
||||||
orig = self.files.copy()
|
orig = self.files.copy()
|
||||||
for root, conf in orig.items():
|
for root, conf in orig.items():
|
||||||
conf.parse()
|
conf.parse()
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,10 @@
|
||||||
"""
|
"""
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from .ext.sql import db
|
|
||||||
from flask import current_app, session
|
from flask import current_app, session
|
||||||
|
|
||||||
from .engines.server import BUIServer # noqa
|
from .engines.server import BUIServer # noqa
|
||||||
|
from .ext.sql import db
|
||||||
|
|
||||||
app = current_app # type: BUIServer
|
app = current_app # type: BUIServer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,34 +7,34 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import re
|
|
||||||
import math
|
import math
|
||||||
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
request,
|
|
||||||
render_template,
|
|
||||||
redirect,
|
|
||||||
url_for,
|
|
||||||
abort,
|
|
||||||
flash,
|
|
||||||
Blueprint,
|
Blueprint,
|
||||||
session,
|
abort,
|
||||||
current_app,
|
current_app,
|
||||||
|
flash,
|
||||||
g,
|
g,
|
||||||
|
redirect,
|
||||||
|
render_template,
|
||||||
|
request,
|
||||||
|
session,
|
||||||
|
url_for,
|
||||||
)
|
)
|
||||||
from flask_login import login_user, login_required, logout_user, current_user
|
from flask_babel import gettext as _
|
||||||
from flask_babel import gettext as _, refresh as refresh_babel
|
from flask_babel import refresh as refresh_babel
|
||||||
|
from flask_login import current_user, login_required, login_user, logout_user
|
||||||
|
|
||||||
from .desc import __url__, __doc__
|
|
||||||
from .engines.server import BUIServer # noqa
|
|
||||||
from .sessions import session_manager
|
|
||||||
from ._compat import quote
|
from ._compat import quote
|
||||||
from .forms import LoginForm
|
from .desc import __doc__, __url__
|
||||||
|
from .engines.server import BUIServer # noqa
|
||||||
from .exceptions import BUIserverException
|
from .exceptions import BUIserverException
|
||||||
|
from .forms import LoginForm
|
||||||
|
from .security import is_safe_url, sanitize_string
|
||||||
|
from .sessions import session_manager
|
||||||
from .utils import human_readable as _hr
|
from .utils import human_readable as _hr
|
||||||
from .security import sanitize_string, is_safe_url
|
|
||||||
|
|
||||||
|
|
||||||
bui = current_app # type: BUIServer
|
bui = current_app # type: BUIServer
|
||||||
view = Blueprint("view", "burpui", template_folder="templates")
|
view = Blueprint("view", "burpui", template_folder="templates")
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from ._compat import to_unicode, urlparse, urljoin
|
from ._compat import to_unicode, urljoin, urlparse
|
||||||
|
|
||||||
|
|
||||||
def sanitize_string(string, strict=True, paranoid=False):
|
def sanitize_string(string, strict=True, paranoid=False):
|
||||||
|
|
@ -45,7 +45,7 @@ def basic_login_from_request(request, app):
|
||||||
return None
|
return None
|
||||||
auth = request.authorization
|
auth = request.authorization
|
||||||
if auth:
|
if auth:
|
||||||
from flask import session, g
|
from flask import g, session
|
||||||
|
|
||||||
app.logger.debug("Found Basic user: {}".format(auth.username))
|
app.logger.debug("Found Basic user: {}".format(auth.username))
|
||||||
refresh = True
|
refresh = True
|
||||||
|
|
@ -55,6 +55,7 @@ def basic_login_from_request(request, app):
|
||||||
user = app.uhandler.user(auth.username, refresh)
|
user = app.uhandler.user(auth.username, refresh)
|
||||||
if user and user.active and user.login(auth.password):
|
if user and user.active and user.login(auth.password):
|
||||||
from flask_login import login_user
|
from flask_login import login_user
|
||||||
|
|
||||||
from .sessions import session_manager
|
from .sessions import session_manager
|
||||||
|
|
||||||
if "login" in session and session["login"] != auth.username:
|
if "login" in session and session["login"] != auth.username:
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import datetime
|
||||||
import re
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
import datetime
|
|
||||||
|
|
||||||
from flask import session, request
|
from flask import request, session
|
||||||
|
|
||||||
# used for completion
|
# used for completion
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -9,21 +9,21 @@ jQuery/Bootstrap
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from time import gmtime, sleep, strftime
|
||||||
|
|
||||||
from flask import current_app
|
|
||||||
from datetime import timedelta, datetime
|
|
||||||
from celery.schedules import crontab
|
from celery.schedules import crontab
|
||||||
from celery.utils.log import get_task_logger
|
from celery.utils.log import get_task_logger
|
||||||
from time import gmtime, strftime, sleep
|
from flask import current_app
|
||||||
|
|
||||||
from burpui._compat import to_unicode # noqa
|
from burpui._compat import to_unicode # noqa
|
||||||
|
from burpui.api.client import ClientTreeAll # noqa
|
||||||
from burpui.config import config # noqa
|
from burpui.config import config # noqa
|
||||||
from burpui.ext.tasks import celery # noqa
|
|
||||||
from burpui.ext.cache import cache # noqa
|
|
||||||
from burpui.sessions import session_manager # noqa
|
|
||||||
from burpui.engines.server import BUIServer # noqa
|
from burpui.engines.server import BUIServer # noqa
|
||||||
from burpui.exceptions import BUIserverException, TooManyRecordsException # noqa
|
from burpui.exceptions import BUIserverException, TooManyRecordsException # noqa
|
||||||
from burpui.api.client import ClientTreeAll # noqa
|
from burpui.ext.cache import cache # noqa
|
||||||
|
from burpui.ext.tasks import celery # noqa
|
||||||
|
from burpui.sessions import session_manager # noqa
|
||||||
from burpui.utils import NOTIF_ERROR
|
from burpui.utils import NOTIF_ERROR
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
4
burpui/thirdparty/flask_bower.py
vendored
4
burpui/thirdparty/flask_bower.py
vendored
|
|
@ -342,9 +342,10 @@ library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from flask import abort, json, send_file, Blueprint, current_app, url_for
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from flask import Blueprint, abort, current_app, json, send_file, url_for
|
||||||
|
|
||||||
|
|
||||||
def validate_parameter(param):
|
def validate_parameter(param):
|
||||||
if ".." in param or param.startswith("/"):
|
if ".." in param or param.startswith("/"):
|
||||||
|
|
@ -421,7 +422,6 @@ def overlay_url_for(endpoint, filename=None, **values):
|
||||||
default_url_for_args["filename"] = filename
|
default_url_for_args["filename"] = filename
|
||||||
|
|
||||||
if endpoint == "static" or endpoint.endswith(".static"):
|
if endpoint == "static" or endpoint.endswith(".static"):
|
||||||
|
|
||||||
if os.path.sep in filename:
|
if os.path.sep in filename:
|
||||||
filename_parts = filename.split(os.path.sep)
|
filename_parts = filename.split(os.path.sep)
|
||||||
component = filename_parts[0]
|
component = filename_parts[0]
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,13 @@
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import os
|
import datetime
|
||||||
import math
|
import math
|
||||||
|
import os
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
import datetime
|
|
||||||
import zipfile
|
|
||||||
import tarfile
|
import tarfile
|
||||||
|
import zipfile
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
NOTIF_OK = 0
|
NOTIF_OK = 0
|
||||||
|
|
|
||||||
14
docs/_themes/flask_theme_support.py
vendored
14
docs/_themes/flask_theme_support.py
vendored
|
|
@ -1,18 +1,18 @@
|
||||||
# flasky extensions. flasky pygments style based on tango style
|
# flasky extensions. flasky pygments style based on tango style
|
||||||
from pygments.style import Style
|
from pygments.style import Style
|
||||||
from pygments.token import (
|
from pygments.token import (
|
||||||
Keyword,
|
|
||||||
Name,
|
|
||||||
Comment,
|
Comment,
|
||||||
String,
|
|
||||||
Error,
|
Error,
|
||||||
|
Generic,
|
||||||
|
Keyword,
|
||||||
|
Literal,
|
||||||
|
Name,
|
||||||
Number,
|
Number,
|
||||||
Operator,
|
Operator,
|
||||||
Generic,
|
|
||||||
Whitespace,
|
|
||||||
Punctuation,
|
|
||||||
Other,
|
Other,
|
||||||
Literal,
|
Punctuation,
|
||||||
|
String,
|
||||||
|
Whitespace,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@
|
||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
|
import sys
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from logging.config import fileConfig
|
||||||
|
|
||||||
from alembic import context
|
from alembic import context
|
||||||
from sqlalchemy import engine_from_config, pool
|
from sqlalchemy import engine_from_config, pool
|
||||||
from logging.config import fileConfig
|
|
||||||
import logging
|
|
||||||
|
|
||||||
# this is the Alembic Config object, which provides
|
# this is the Alembic Config object, which provides
|
||||||
# access to the values within the .ini file in use.
|
# access to the values within the .ini file in use.
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ Create Date: 2016-07-18 11:22:27.613921
|
||||||
revision = "225d9b2f0fb1"
|
revision = "225d9b2f0fb1"
|
||||||
down_revision = None
|
down_revision = None
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ Create Date: 2018-10-03 11:47:20.028686
|
||||||
revision = "4445080944ee"
|
revision = "4445080944ee"
|
||||||
down_revision = "695dcbd29d4f"
|
down_revision = "695dcbd29d4f"
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ Create Date: 2017-02-12 14:51:38.147422
|
||||||
revision = "56de018f4d88"
|
revision = "56de018f4d88"
|
||||||
down_revision = "fc07e3fa0086"
|
down_revision = "fc07e3fa0086"
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ Create Date: 2018-10-02 13:56:57.660204
|
||||||
revision = "695dcbd29d4f"
|
revision = "695dcbd29d4f"
|
||||||
down_revision = "56de018f4d88"
|
down_revision = "56de018f4d88"
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ Create Date: 2016-08-30 11:47:35.513396
|
||||||
revision = "7f317474332d"
|
revision = "7f317474332d"
|
||||||
down_revision = "225d9b2f0fb1"
|
down_revision = "225d9b2f0fb1"
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ Create Date: 2017-01-30 16:09:53.367166
|
||||||
revision = "fc07e3fa0086"
|
revision = "fc07e3fa0086"
|
||||||
down_revision = "7f317474332d"
|
down_revision = "7f317474332d"
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,9 @@ jQuery/Bootstrap
|
||||||
|
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import logging
|
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
ROOT = os.path.dirname(os.path.realpath(__file__))
|
ROOT = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
@ -63,7 +62,7 @@ def parse_args(name=None):
|
||||||
|
|
||||||
if options.version:
|
if options.version:
|
||||||
from burpui_agent import __title__
|
from burpui_agent import __title__
|
||||||
from burpui_agent.desc import __version__, __release__
|
from burpui_agent.desc import __release__, __version__
|
||||||
|
|
||||||
ver = "{}: v{}".format(mname or __title__, __version__)
|
ver = "{}: v{}".format(mname or __title__, __version__)
|
||||||
if options.log:
|
if options.log:
|
||||||
|
|
@ -84,9 +83,9 @@ def main():
|
||||||
|
|
||||||
def agent(options=None):
|
def agent(options=None):
|
||||||
import trio
|
import trio
|
||||||
|
from burpui_agent._compat import patch_json
|
||||||
from burpui_agent.engines.agent import BUIAgent as Agent
|
from burpui_agent.engines.agent import BUIAgent as Agent
|
||||||
from burpui_agent.utils import lookup_file
|
from burpui_agent.utils import lookup_file
|
||||||
from burpui_agent._compat import patch_json
|
|
||||||
|
|
||||||
patch_json()
|
patch_json()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
# only used to build the package
|
# only used to build the package
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
@ -126,9 +126,9 @@ from burpui_agent.desc import (
|
||||||
__author__,
|
__author__,
|
||||||
__author_email__,
|
__author_email__,
|
||||||
__description__,
|
__description__,
|
||||||
|
__license__,
|
||||||
__url__,
|
__url__,
|
||||||
__version__,
|
__version__,
|
||||||
__license__,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
name = __title__
|
name = __title__
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,9 @@ jQuery/Bootstrap
|
||||||
|
|
||||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import logging
|
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
ROOT = os.path.dirname(os.path.realpath(__file__))
|
ROOT = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
@ -63,7 +62,7 @@ def parse_args(name=None):
|
||||||
|
|
||||||
if options.version:
|
if options.version:
|
||||||
from burpui_monitor import __title__
|
from burpui_monitor import __title__
|
||||||
from burpui_monitor.desc import __version__, __release__
|
from burpui_monitor.desc import __release__, __version__
|
||||||
|
|
||||||
ver = "{}: v{}".format(mname or __title__, __version__)
|
ver = "{}: v{}".format(mname or __title__, __version__)
|
||||||
if options.log:
|
if options.log:
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
# only used to build the package
|
# only used to build the package
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
@ -128,9 +128,9 @@ from burpui_monitor.desc import (
|
||||||
__author__,
|
__author__,
|
||||||
__author_email__,
|
__author_email__,
|
||||||
__description__,
|
__description__,
|
||||||
|
__license__,
|
||||||
__url__,
|
__url__,
|
||||||
__version__,
|
__version__,
|
||||||
__license__,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
name = __title__
|
name = __title__
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import shutil
|
import shutil
|
||||||
|
import sys
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
# only used to build the package
|
# only used to build the package
|
||||||
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
|
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
|
||||||
|
|
@ -18,7 +18,6 @@ Burp-UI Meta package for ##TPL## requirements
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from burpui_##TPL## import __author__, __author_email__, __description__, \
|
from burpui_##TPL## import __author__, __author_email__, __description__, \
|
||||||
__url__, __title__, __version__, __license__
|
|
||||||
name = __title__
|
name = __title__
|
||||||
author = __author__
|
author = __author__
|
||||||
author_email = __author_email__
|
author_email = __author_email__
|
||||||
|
|
|
||||||
18
setup.py
18
setup.py
|
|
@ -2,16 +2,16 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from subprocess import check_output, call, STDOUT
|
|
||||||
from distutils import log
|
from distutils import log
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from setuptools import setup, find_packages
|
from subprocess import STDOUT, call, check_output
|
||||||
from setuptools.command.develop import develop
|
|
||||||
from setuptools.command.sdist import sdist
|
from setuptools import find_packages, setup
|
||||||
from setuptools.command.install import install
|
|
||||||
from setuptools.command.bdist_egg import bdist_egg
|
from setuptools.command.bdist_egg import bdist_egg
|
||||||
|
from setuptools.command.develop import develop
|
||||||
from setuptools.command.egg_info import egg_info
|
from setuptools.command.egg_info import egg_info
|
||||||
|
from setuptools.command.install import install
|
||||||
|
from setuptools.command.sdist import sdist
|
||||||
|
|
||||||
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)))
|
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)))
|
||||||
DEVNULL = open(os.devnull, "wb")
|
DEVNULL = open(os.devnull, "wb")
|
||||||
|
|
@ -248,10 +248,10 @@ sys.path.insert(0, os.path.join(ROOT))
|
||||||
from burpui.desc import (
|
from burpui.desc import (
|
||||||
__author__,
|
__author__,
|
||||||
__author_email__,
|
__author_email__,
|
||||||
__description__,
|
__description__, # noqa
|
||||||
__url__,
|
|
||||||
__title__,
|
__title__,
|
||||||
) # noqa
|
__url__,
|
||||||
|
)
|
||||||
|
|
||||||
name = __title__
|
name = __title__
|
||||||
author = __author__
|
author = __author__
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
import pytest
|
|
||||||
import os
|
import os
|
||||||
import tempfile
|
|
||||||
import shutil
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from burpui import create_app as BUIinit # noqa
|
from burpui import create_app as BUIinit # noqa
|
||||||
from burpui.misc.parser.burp2 import Parser # noqa
|
from burpui.misc.parser.burp2 import Parser # noqa
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import os
|
import os
|
||||||
|
from urllib.request import urlopen
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
from urllib.request import urlopen
|
|
||||||
|
|
||||||
from burpui import create_app
|
from burpui import create_app
|
||||||
|
|
||||||
|
|
@ -26,8 +25,8 @@ def app():
|
||||||
|
|
||||||
|
|
||||||
def test_server_is_up_and_running(live_server):
|
def test_server_is_up_and_running(live_server):
|
||||||
import socket
|
|
||||||
import errno
|
import errno
|
||||||
|
import socket
|
||||||
|
|
||||||
try:
|
try:
|
||||||
url = url_for("view.home", _external=True)
|
url = url_for("view.home", _external=True)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
import pytest
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from burpui.app import create_app
|
from burpui.app import create_app
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
import pytest
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from burpui.app import create_app
|
from burpui.app import create_app
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
import pytest
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from burpui.app import create_app
|
from burpui.app import create_app
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
from tempfile import mkstemp
|
||||||
|
|
||||||
import configobj
|
import configobj
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from burpui.config import BUIConfig
|
||||||
|
|
||||||
# import validate
|
# import validate
|
||||||
|
|
||||||
from tempfile import mkstemp
|
|
||||||
|
|
||||||
from burpui.config import BUIConfig
|
|
||||||
|
|
||||||
TEST_CONFIG = b"""
|
TEST_CONFIG = b"""
|
||||||
[Global]
|
[Global]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
import pytest
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from burpui.app import create_app
|
from burpui.app import create_app
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from burpui.misc.parser.utils import OptionMulti, OptionInt
|
from burpui.misc.parser.utils import OptionInt, OptionMulti
|
||||||
|
|
||||||
|
|
||||||
def test_confsrv(parser):
|
def test_confsrv(parser):
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
import mockredis
|
|
||||||
|
|
||||||
|
import mockredis
|
||||||
|
import pytest
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from burpui.app import create_app
|
from burpui.app import create_app
|
||||||
|
|
@ -75,10 +75,11 @@ def test_current_session(app):
|
||||||
# with c.session_transaction() as sess:
|
# with c.session_transaction() as sess:
|
||||||
# sess['authenticated'] = True
|
# sess['authenticated'] = True
|
||||||
|
|
||||||
from burpui.sessions import session_manager
|
from datetime import datetime
|
||||||
|
|
||||||
from burpui.ext.sql import db
|
from burpui.ext.sql import db
|
||||||
from burpui.models import Session
|
from burpui.models import Session
|
||||||
from datetime import datetime
|
from burpui.sessions import session_manager
|
||||||
|
|
||||||
session_manager.store_session("toto")
|
session_manager.store_session("toto")
|
||||||
assert session_manager.session_expired() is False
|
assert session_manager.session_expired() is False
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
import pytest
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from burpui.app import create_app
|
from burpui.app import create_app
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue