Skip to content

Commit

Permalink
Merge community
Browse files Browse the repository at this point in the history
  • Loading branch information
micabot committed May 26, 2016
2 parents 126932f + 134f000 commit 2204db2
Show file tree
Hide file tree
Showing 51 changed files with 22,080 additions and 838 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Project contributors
* Martin Tartarelli
* Ronald Iraheta
* Thierry Beauquier
* Brice Samulenok
23 changes: 23 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ Please run ./faraday.py --update
New features in the latest update
=====================================

May 23, 2016:
---
* Removed description from Hosts list in WEB UI
* Fixed sort in Hosts list in WEB UI
* Fixed ports sorting in Host view in WEB UI
* Added search link for OS in Hosts list in WEB UI
* Removed description from Services list in WEB UI
* Added version to Services list in WEB UI
* Modified false values in Hosts list in WEB UI
* Added search links in Services list in WEB UI
* Added scrollbar in Gtk Terminal.
* Added workspace status in Gtk interface
* Added conflict resolution support for the Gtk interface
* Added search entry for workspaces in Gtk
* Added support for 'exit' command inside Faraday's Gtk terminal
* Improved handling of uncaught exceptions in Gtk interface
* Improved text formatting in Gtk's log console
* Fixed several small bugs in Faraday GTK
* Added support for resize workspace bar.
* Added a quote for imported reports in WEB UI.
* Added support for a new type of report in Qualysguard plugin.
* Fixed bugs in plugins: Acunetix - Nmap - Nikto.

Apr 29, 2016:
---
* Added Open services count to Hosts list in WEB UI
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.19
1.0.20
2 changes: 1 addition & 1 deletion config/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<faraday>

<appname>Faraday - Penetration Test IDE</appname>
<version>1.0.19</version>
<version>1.0.20</version>
<debug_status>0</debug_status>
<font>-Misc-Fixed-medium-r-normal-*-12-100-100-100-c-70-iso8859-1</font>
<home_path>~/</home_path>
Expand Down
8 changes: 4 additions & 4 deletions faraday.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,13 @@ def setupLibs():
helpers += ".i386"
else:
logger.fatal("Linux architecture could not be determined.")
exit()
sys.exit()
elif sys.platform == "darwin":
logger.info("OS X detected.")
helpers += ".darwin"
else:
logger.fatal("Plaftorm not supported yet.")
exit()
sys.exit()

if os.path.isfile(FARADAY_BASE_LIB_HELPERS):
os.remove(FARADAY_BASE_LIB_HELPERS)
Expand Down Expand Up @@ -577,7 +577,7 @@ def checkVersion():
if getInstanceConfiguration().getVersion() != None and getInstanceConfiguration().getVersion() != f_version:
logger.warning("You have different version of Faraday since your last run.\nRun ./faraday.py --update to update configuration!")
if query_yes_no('Do you want to close Faraday?', 'yes'):
exit(-1)
sys.exit(-1)

getInstanceConfiguration().setVersion(f_version)
f.close()
Expand All @@ -590,7 +590,7 @@ def checkVersion():
json.dump(doc, doc_file)
except Exception as e:
getLogger("launcher").error("It seems that something's wrong with your version\nPlease contact customer support")
exit(-1)
sys.exit(-1)


def init():
Expand Down
5 changes: 4 additions & 1 deletion gui/customevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ def __init__(self, text):


class ShowExceptionCustomEvent(CustomEvent):
def __init__(self, text, callback):
def __init__(self, text, callback, error_name=None):
CustomEvent.__init__(self, EXCEPTION_ID)
self.text = text
self.exception_objects = [None, text]
self.callback = callback
if error_name is not None:
self.error_name = error_name



class RenameHostsRootCustomEvent(CustomEvent):
Expand Down
78 changes: 70 additions & 8 deletions gui/gtk/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
from dialogs import NotificationsDialog
from dialogs import aboutDialog
from dialogs import helpDialog
from dialogs import ImportantErrorDialog
from dialogs import ConflictsDialog

from mainwidgets import Sidebar
from mainwidgets import ConsoleLog
Expand Down Expand Up @@ -79,15 +81,22 @@ def __init__(self, model_controller, plugin_manager, workspace_manager,
flags=Gio.ApplicationFlags.FLAGS_NONE)

icons = CONF.getImagePath() + "icons/"
self.icon = GdkPixbuf.Pixbuf.new_from_file(icons + "faraday_icon.png")
faraday_icon = icons + "faraday_icon.png"
self.icon = GdkPixbuf.Pixbuf.new_from_file_at_scale(faraday_icon, 16,
16, False)
self.window = None
self.model_controller = model_controller
self.conflicts = self.model_controller.getConflicts()

def getMainWindow(self):
"""Returns the main window. This is none only at the
the startup, the GUI will create one as soon as do_activate() is called
"""
return self.window

def updateConflicts(self):
self.conflicts = self.model_controller.getConflicts()

def createWorkspace(self, name, description="", w_type=""):
"""Pretty much copy/pasted from the QT3 GUI.
Uses the instance of workspace manager passed into __init__ to
Expand Down Expand Up @@ -141,11 +150,17 @@ def do_startup(self):
self.sidebar = Sidebar(self.workspace_manager,
self.changeWorkspace,
self.removeWorkspace,
self.on_new_button,
CONF.getLastWorkspace())

host_count, service_count, vuln_count = self.update_counts()

self.terminal = Terminal(CONF)
self.console_log = ConsoleLog()
self.statusbar = Statusbar(self.on_click_notifications)
self.statusbar = Statusbar(self.on_click_notifications,
self.on_click_conflicts,
host_count, service_count, vuln_count)

self.notificationsModel = Gtk.ListStore(str)

action = Gio.SimpleAction.new("about", None)
Expand Down Expand Up @@ -214,12 +229,26 @@ def do_activate(self):
def postEvent(self, receiver, event):
if receiver is None:
receiver = self.getMainWindow()
if event.type() == 3131:

if event.type() == 3131: # new log event
receiver.emit("new_log", event.text)
if event.type() == 5100:

if event.type() == 3141: # new conflict event
receiver.emit("set_conflict_label", event.nconflicts)

if event.type() == 5100: # new notification event
self.notificationsModel.prepend([event.change.getMessage()])
receiver.emit("new_notif")
if event.type() == 3132:
host_count, service_count, vuln_count = self.update_counts()
receiver.emit("update_ws_info", host_count,
service_count, vuln_count)

if event.type() == 4100 or event.type() == 3140: # newinfo or changews
host_count, service_count, vuln_count = self.update_counts()
receiver.emit("update_ws_info", host_count,
service_count, vuln_count)

if event.type() == 3132: # error
dialog_text = event.text
dialog = Gtk.MessageDialog(self.window, 0,
Gtk.MessageType.INFO,
Expand All @@ -228,6 +257,21 @@ def postEvent(self, receiver, event):
dialog.run()
dialog.destroy()

if event.type() == 3134: # important error, uncaught exception
dialog_text = event.text
dialog = ImportantErrorDialog(self.window, dialog_text)
response = dialog.run()
if response == 42:
error = event.error_name
event.callback(error, *event.exception_objects)
dialog.destroy()

def update_counts(self):
host_count = self.model_controller.getHostsCount()
service_count = self.model_controller.getServicesCount()
vuln_count = self.model_controller.getVulnsCount()
return host_count, service_count, vuln_count

def on_about(self, action, param):
""" Defines what happens when you press 'about' on the menu"""

Expand Down Expand Up @@ -267,11 +311,12 @@ def on_pluginOptions(self, action, param):
self.window)
pluginsOption_window.show_all()

def on_new_button(self, action, params):
def on_new_button(self, action=None, params=None, title=None):
"Defines what happens when you press the 'new' button on the toolbar"
new_workspace_dialog = NewWorkspaceDialog(self.createWorkspace,
self.workspace_manager,
self.sidebar, self.window)
self.sidebar, self.window,
title)
new_workspace_dialog.show_all()

def on_new_terminal_button(self, action, params):
Expand All @@ -295,11 +340,28 @@ def on_click_notifications(self, button):
self.window)
notifications_dialog.show_all()

def on_click_conflicts(self, button=None):
"""Doesn't use the button at all. Shows the conflict dialog"""
self.updateConflicts()
if self.conflicts:
dialog = ConflictsDialog(self.conflicts,
self.window)
dialog.show_all()
self.updateConflicts()

else:
dialog = Gtk.MessageDialog(self.window, 0,
Gtk.MessageType.INFO,
Gtk.ButtonsType.OK,
"No conflicts to fix!")
dialog.run()
dialog.destroy()

def delete_notifications(self):
self.notificationsModel.clear()
self.window.emit("clear_notifications")

def changeWorkspace(self, selection=None):
def changeWorkspace(self, selection):
"""Pretty much copy/pasted from QT3 GUI.
Selection is actually used nowhere, but the connect function is
Sidebar passes it as an argument so well there it is"""
Expand Down
Loading

0 comments on commit 2204db2

Please sign in to comment.