Re-implemented /api/listeners/options GET Rest call
parent
38054a8cc9
commit
48116d35d6
9
empire
9
empire
|
@ -703,11 +703,12 @@ def start_restful_api(startEmpire=False, suppress=False, username=None, password
|
|||
@app.route('/api/listeners/options', methods=['GET'])
|
||||
def get_listener_options():
|
||||
"""
|
||||
-- Is this deprecated? -bneg
|
||||
Returns JSON describing the current listener options.
|
||||
Returns JSON describing the current listener options
|
||||
"""
|
||||
#return jsonify({'listeneroptions' : [main.listeners.options]})
|
||||
return jsonify({'listeneroptions':'Deprecated. Retrieve from /api/listeners/[name]'})
|
||||
optionsRaw = execute_db_query(conn, 'SELECT options FROM listeners')
|
||||
options = pickle.loads(optionsRaw[0][0])
|
||||
|
||||
return jsonify({'listeneroptions' : options})
|
||||
|
||||
|
||||
@app.route('/api/listeners', methods=['POST'])
|
||||
|
|
|
@ -366,6 +366,20 @@ class Listeners:
|
|||
else:
|
||||
return None
|
||||
|
||||
def get_listener_options(self):
|
||||
"""
|
||||
Return the options for a listener type
|
||||
"""
|
||||
cur = self.conn.cursor()
|
||||
cur.execute('SELECT options FROM listeners')
|
||||
results = cur.fetchall()
|
||||
cur.close()
|
||||
|
||||
if results:
|
||||
return results[0][0]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def get_listener_names(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue