forked from ziirish/burp-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbui-agent
executable file
·47 lines (41 loc) · 1.42 KB
/
bui-agent
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import os
import logging
from optparse import OptionParser
sys.path.append('{0}/..'.format(os.path.join(os.path.dirname(os.path.realpath(__file__)))))
from burpui.agent import BUIAgent as Agent
if __name__ == '__main__':
"""
Main function
"""
parser = OptionParser()
parser.add_option('-v', '--verbose', dest='log', help='increase output verbosity (e.g., -vv is more than -v)', action='count')
parser.add_option('-l', '--logfile', dest='logfile', help='where to store logs', metavar='LOGFILE')
parser.add_option('-c', '--config', dest='config', help='configuration file', metavar='CONFIG')
(options, args) = parser.parse_args()
if options.config:
if os.path.isfile(options.config):
conf = options.config
else:
raise IOError('File not found: \'{0}\''.format(options.config))
else:
root = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'..',
'share',
'burpui',
'etc'
)
conf_files = [
'/etc/burp/buiagent.cfg',
os.path.join(root, 'buiagent.cfg'),
os.path.join(root, 'buiagent.sample.cfg')
]
for p in conf_files:
if os.path.isfile(p):
conf = p
break
agent = Agent(conf, options.log, options.logfile)
agent.run()