mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-22 06:05:33 -06:00
fix configuration file lookup
This commit is contained in:
parent
777d7eea86
commit
cec2015f8d
4 changed files with 26 additions and 10 deletions
19
bin/burp-ui
19
bin/burp-ui
|
|
@ -2,6 +2,7 @@
|
|||
# -*- coding: utf8 -*-
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
from optparse import OptionParser
|
||||
|
||||
sys.path.append('{0}/..'.format(os.path.join(os.path.dirname(os.path.realpath(__file__)))))
|
||||
|
|
@ -21,12 +22,20 @@ if __name__ == '__main__':
|
|||
app.config['DEBUG'] = d
|
||||
|
||||
if options.config:
|
||||
conf = options.config
|
||||
if os.path.isfile(options.config):
|
||||
conf = options.config
|
||||
app.config['CFG'] = conf
|
||||
else:
|
||||
raise IOError('File not found: \'{0}\''.format(options.config))
|
||||
else:
|
||||
conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'burpui.cfg')
|
||||
conf_files = ['/etc/burp/burpui.cfg', os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'share', 'burpui', 'etc', 'burpui.cfg')]
|
||||
for p in conf_files:
|
||||
app.logger.debug('Trying file \'%s\'', p)
|
||||
if os.path.isfile(p):
|
||||
app.config['CFG'] = p
|
||||
app.logger.debug('Using file \'%s\'', p)
|
||||
break
|
||||
|
||||
app.config['CFG'] = conf
|
||||
|
||||
bui.setup(conf)
|
||||
bui.setup(app.config['CFG'])
|
||||
bui.run(d)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
__title__ = 'burp-ui'
|
||||
__author__ = 'Benjamin SANS (Ziirish)'
|
||||
__license__ = 'BSD 3-clause'
|
||||
|
||||
import os
|
||||
|
||||
from flask import Flask
|
||||
from flask.ext.login import LoginManager
|
||||
from burpui.server import Server as BurpUI
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config['CFG'] = os.path.join(app.root_path, '../burpui.cfg')
|
||||
|
||||
app.config['CFG'] = None
|
||||
|
||||
app.secret_key = 'VpgOXNXAgcO81xFPyWj07ppN6kExNZeCDRShseNzFKV7ZCgmW2/eLn6xSlt7pYAVBj12zx2Vv9Kw3Q3jd1266A=='
|
||||
app.jinja_env.globals.update(isinstance=isinstance,list=list)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@
|
|||
from flask.ext.login import UserMixin
|
||||
from burpui.misc.auth.interface import BUIhandler, BUIuser
|
||||
|
||||
import simpleldap
|
||||
try:
|
||||
import simpleldap
|
||||
except ImportError:
|
||||
raise ImportError('Unable to load \'simpleldap\' module')
|
||||
|
||||
import ConfigParser
|
||||
|
||||
class LdapLoader:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ g_ssl = False
|
|||
g_sslcert = ''
|
||||
g_sslkey = ''
|
||||
g_version = 1
|
||||
g_auth = 'ldap'
|
||||
g_auth = 'basic'
|
||||
|
||||
class Server:
|
||||
def __init__(self, app=None):
|
||||
|
|
@ -24,6 +24,9 @@ class Server:
|
|||
if not conf:
|
||||
conf = self.app.config['CFG']
|
||||
|
||||
if not conf:
|
||||
raise IOError('No configuration file found')
|
||||
|
||||
config = ConfigParser.ConfigParser({'bport': g_burpport, 'bhost': g_burphost, 'port': g_port,
|
||||
'bind': g_bind, 'refresh': g_refresh, 'ssl': g_ssl, 'sslcert': g_sslcert,
|
||||
'sslkey': g_sslkey, 'version': g_version, 'auth': g_auth})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue