Skip to content

Commit eac849b

Browse files
committed
Merge branch 'community'
2 parents 0311143 + e73b6eb commit eac849b

51 files changed

Lines changed: 2082 additions & 1256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AUTHORS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ The PRIMARY AUTHORS are:
99
* Francisco Amato
1010
* Franco Linares
1111
* Micaela Ranea Sánchez
12+
* Ezequiel Tavella
13+
* Joaquín López Pereyra
14+
* Martín Rocha
1215

1316
Project contributors
1417

1518
* Andrés López Luksenberg
1619
* Juan Urbano
1720
* Elian Gidoni
1821
* Andres Tarantini
19-
* Ezequiel Tavella
2022
* Martin Tartarelli
2123
* Ronald Iraheta

RELEASE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Please run ./faraday.py --update
1010
New features in the latest update
1111
=====================================
1212

13+
Apr 04, 2016
14+
---
15+
* Added cli mode (see wiki for usage instructions)
16+
* Support for multiple Faraday instances in the same host
17+
* Fixed bug for editing web vulns in bulk
18+
* Fixed bug for select all in web UI
19+
* Fixed bugs in Qualys, ZAP, nikto, w3af, openVas plugins
20+
* Added some new scripts and helpers
21+
22+
1323
Feb 26, 2016:
1424
---
1525
* Fixed bug in pip debian

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.17
1+
1.0.18

apis/rest/api.py

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
77
'''
88

9+
import socket
910
import threading
1011
import logging
11-
import requests
12-
import json
1312
import base64
1413

1514
from flask import Flask, request, jsonify
@@ -50,7 +49,24 @@ def startAPIs(plugin_manager, model_controller, mapper_manager, hostname, port):
5049
app = Flask('APISController')
5150

5251
_http_server = HTTPServer(WSGIContainer(app))
53-
_http_server.listen(port, address=hostname)
52+
while True:
53+
try:
54+
_http_server.listen(port, address=hostname)
55+
logger.getLogger().info(
56+
"REST API server configured on %s" % str(
57+
CONF.getApiRestfulConInfo()))
58+
break
59+
except socket.error as exception:
60+
if exception.errno == 98:
61+
# Port already in use
62+
# Let's try the next one
63+
port += 1
64+
if port > 65535:
65+
raise Exception("No ports available!")
66+
CONF.setApiRestfulConInfoPort(port)
67+
CONF.saveConfig()
68+
else:
69+
raise exception
5470

5571
routes = [r for c in _rest_controllers for r in c.getRoutes()]
5672

@@ -325,48 +341,6 @@ def clearActivePlugins(self):
325341
return self.ok("active plugins cleared")
326342

327343

328-
class PluginControllerAPIClient(object):
329-
def __init__(self, hostname, port):
330-
self.hostname = hostname
331-
self.port = port
332-
self.url_input = "http://%s:%d/cmd/input" % (self.hostname, self.port)
333-
self.url_output = "http://%s:%d/cmd/output" % (self.hostname, self.port)
334-
self.url_active_plugins = "http://%s:%d/cmd/active-plugins" % (self.hostname, self.port)
335-
self.headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
336-
337-
def send_cmd(self, cmd):
338-
data = {"cmd": cmd}
339-
new_cmd = cmd
340-
output_file = None
341-
try:
342-
response = requests.post(self.url_input,
343-
data=json.dumps(data),
344-
headers=self.headers)
345-
346-
if response.status_code == 200:
347-
json_response = response.json()
348-
if "cmd" in json_response.keys():
349-
if json_response.get("cmd") is not None:
350-
new_cmd = json_response.get("cmd")
351-
if "custom_output_file" in json_response.keys():
352-
output_file = json_response.get("custom_output_file")
353-
except:
354-
new_cmd = cmd
355-
finally:
356-
return new_cmd, output_file
357-
358-
def send_output(self, cmd, output_file):
359-
output_file = open(output_file)
360-
output = base64.b64encode(output_file.read())
361-
data = {"cmd": cmd, "output": output}
362-
response = requests.post(self.url_output,
363-
data=json.dumps(data),
364-
headers=self.headers)
365-
if response.status_code != 200:
366-
return False
367-
return True
368-
369-
370344
class Route(object):
371345
""" Route class, abstracts information about:
372346
path, handler and methods """

apis/rest/client.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'''
88
import requests
99
import json
10+
import base64
1011

1112

1213
class RestApiClient(object):
@@ -81,3 +82,49 @@ def createNote(self, name, text, parent_id):
8182
def createCred(self, username, password, parent_id):
8283
return self._create(
8384
"cred", username=username, password=password, parent_id=parent_id)
85+
86+
87+
class PluginControllerAPIClient(object):
88+
def __init__(self, hostname, port):
89+
self.hostname = hostname
90+
self.port = port
91+
self.url_input = "http://%s:%d/cmd/input" % (self.hostname, self.port)
92+
self.url_output = "http://%s:%d/cmd/output" % (self.hostname, self.port)
93+
self.url_active_plugins = "http://%s:%d/cmd/active-plugins" % (self.hostname, self.port)
94+
self.headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
95+
96+
def send_cmd(self, cmd):
97+
data = {"cmd": cmd}
98+
new_cmd = cmd
99+
output_file = None
100+
try:
101+
response = requests.post(self.url_input,
102+
data=json.dumps(data),
103+
headers=self.headers)
104+
105+
if response.status_code == 200:
106+
json_response = response.json()
107+
if "cmd" in json_response.keys():
108+
if json_response.get("cmd") is not None:
109+
new_cmd = json_response.get("cmd")
110+
if "custom_output_file" in json_response.keys():
111+
output_file = json_response.get("custom_output_file")
112+
except:
113+
new_cmd = cmd
114+
finally:
115+
return new_cmd, output_file
116+
117+
def send_output(self, cmd, output_file=None):
118+
# output_file could be None, when there is
119+
# no output to send
120+
output = ""
121+
if output_file:
122+
output_file = open(output_file)
123+
output = base64.b64encode(output_file.read())
124+
data = {"cmd": cmd, "output": output}
125+
response = requests.post(self.url_output,
126+
data=json.dumps(data),
127+
headers=self.headers)
128+
if response.status_code != 200:
129+
return False
130+
return True

auth/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

auth/manager.py

Lines changed: 0 additions & 125 deletions
This file was deleted.

auth/users.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

bin/fplugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python2.7
22
# -*- coding: utf-8 -*-
33

44
'''

0 commit comments

Comments
 (0)