Ejemplo n.º 1
0
 def on_publishButton__clicked(self, released=True):
     if not released:
         return
     curPublisher = self._getPublisher()
     outFile = unicode(self.outputFileEdit_.text())
     progressDialog = ProgressDialog(curPublisher, self._plugin, self)
     result = progressDialog.publish(self._dsi, outFile)
Ejemplo n.º 2
0
 def write_payload(self, fullpath, start, stop):
     
     step = self.dataBankTab.mainWindow.dbankGenStep.text()
     prepend = self.dataBankTab.mainWindow.dbankGenPre.text()
     postpend = self.dataBankTab.mainWindow.dbankGenPost.text()
     
     
     try:
         f = open(fullpath, "w")
         self.Progress = ProgressDialog()
         for item in range(int(start), int(stop), int(step)):
             f.write(prepend + str(item) + postpend +"\n")   
     
         self.dataBankTab.fill_payload_combo_box()
         
         # Display a message since small payload generation will not show the progress dialog.
         message = "Payload Generated"
         dialog = SimpleDialog(message)
         dialog.exec_()
         
     except Exception as e:
         message = "An error occured:\n%s" % (e)
         dialog = SimpleDialog(message)
         dialog.exec_()
         
         # Remove the file created on error so a blank payload is not listed in the payload list
         os.remove(fullpath)
     
     finally:
         self.Progress.close()
Ejemplo n.º 3
0
    def __init__(self, framework, parent=None):
        super(DiffDialog, self).__init__(parent)
        self.setupUi(self)

        self.framework = framework
        self.Progress = ProgressDialog()
        self.framework.subscribe_add_differ_response_id(
            self.differ_add_response_id)

        # Create progress dialog
        self.customButton.clicked.connect(self.custom_diff)
        self.leftTree.itemSelectionChanged.connect(self.diff_items)
        self.rightTree.itemSelectionChanged.connect(self.diff_items)
        self.clearButton.clicked.connect(self.clear_items)

        self.Data = None
        self.cursor = None
        self.framework.subscribe_database_events(self.db_attach,
                                                 self.db_detach)
Ejemplo n.º 4
0
    def __init__(self, framework, parent=None):
        super(ConfigDialog, self).__init__(parent)
        self.setupUi(self)

        self.framework = framework
        self.payloads_dir = os.path.join(self.framework.get_data_dir(), 'payloads')
        self.Progress = ProgressDialog()

        self.buttonBox.clicked.connect(self.handle_buttonBox_clicked)

        self.checkBoxUseProxy.stateChanged.connect(self.handle_useProxy_stateChanged)
        self.browserCustomUserAgentCheckBox.stateChanged.connect(self.handle_browserCustomUserAgent_stateChanged)
        self.spiderExcludeDangerouPathCheckBox.stateChanged.connect(self.handle_spiderExcludeDangerouPath_stateChanged)
        self.framework.subscribe_raft_config_populated(self.configuration_populated)

        self.dataBankTab = DataBankTab.DataBankTab(self.framework, self)
        
        self.dbankFuzzFileAddButton.clicked.connect(self.add_fuzz_file)
        self.dbankFuzzFileDelButton.clicked.connect(self.del_fuzz_file)
        
        self.dbankGenButton.clicked.connect(self.generate_payload)
Ejemplo n.º 5
0
    def __init__(self, framework, parent=None):
        super(SearchDialog, self).__init__(parent)
        self.setupUi(self)

        self.connect(self, SIGNAL('finished()'), self.finishedHandler)

        self.framework = framework

        # progress dialog
        self.Progress = ProgressDialog(self)
        QObject.connect(self.Progress, SIGNAL('canceled()'),
                        self.canceledHandler)

        self.searchRequestResponse = RequestResponseWidget(
            self.framework, self.searchTabWidget,
            self.searchSearchControlPlaceholder, self)

        self.searchResultsModel = ResponsesDataModel.ResponsesDataModel(
            self.framework, self)
        self.searchResultsTree.setModel(self.searchResultsModel)
        self.searchResultsTree.clicked.connect(self.fill_bottom)
        self.searchResultsTree.doubleClicked.connect(
            self.response_item_double_clicked)
        self.searchResultsTree.setSortingEnabled(True)
        self.searchResultsTree.sortByColumn(0, Qt.AscendingOrder)

        self.thread = SearchThread(self.framework, self.searchResultsModel)
        self.thread.start(QThread.LowestPriority)
        self.finished.connect(self.finishedHandler)
        self.searchPushButton.pressed.connect(self.startSearch)
        self.connect(self, SIGNAL('searchFinished()'),
                     self.searchFinishedHandler, Qt.QueuedConnection)
        # Create context menu
        self.resultsContextMenu = ResponsesContextMenuWidget(
            self.framework, self.searchResultsModel, self.searchResultsTree,
            self)
        self.resultsContextMenu.set_currentChanged_callback(self.fill_bottom)
Ejemplo n.º 6
0
    def __init__(self, dbfilename = '', parent=None):
        super(RaftMain, self).__init__(parent)
        if MAC:
            qt_mac_set_native_menubar(False)
        self.setupUi(self)

        # hide currently unimplemented features
        self.reqTabRawRequestTab.hide()
        self.reqTabRawRequestTab.setParent(None)
        self.wfUnusedSequenceTab.hide()
        self.wfUnusedSequenceTab.setParent(None)

        # initialize framework
        self.framework = Framework(self)

        # default filename is temp.raftdb
        if dbfilename:
            self.dbfilename = dbfilename
        else:
            self.dbfilename = self.framework.get_temp_db_filename()

        # restore settings
        self.restore_settings()

        # Create progress dialog
        self.Progress = ProgressDialog()

        # add helper and utility singletons
        # TODO: should be base extractor and that loads/returns appropriate type
        self.contentExtractor = BaseExtractor.BaseExtractor()
        self.framework.setContentExtractor(self.contentExtractor)

        # Create actions for items
        self.responsesDataTree.doubleClicked.connect(self.response_item_double_clicked)
        self.fillingDataTree = False
        self.responsesDataTree.clicked.connect(self.fill_bottom)
        self.responsesDataTree.activated.connect(self.fill_bottom)
        self.responsesDataTree.setSortingEnabled(True)
        self.responsesDataTree.sortByColumn(0, Qt.AscendingOrder)
        
        #analysis tab connections
        self.mainAnalysisTreeWidget.clicked.connect(self.analysistree_handle_click)
        self.mainAnalysisTreeWidget.activated.connect(self.analysistree_handle_click)
        self.mainAnalysisTreeWidget.expanded.connect(self.analysistree_handle_expand)
        
        self.cookiesTabIndex = self.mainTabWidget.indexOf(self.tabMainCookies)
        self.mainTabWidget.currentChanged.connect(self.main_tab_change)
        
        # Toolbar buttons and actions
        self.actionButtonOpen.triggered.connect(self.open_file)
        self.actionZoomIn.triggered.connect(self.zoom_in)
        self.actionZoomOut.triggered.connect(self.zoom_out)
        self.actionDiff.triggered.connect(self.diff)
        self.actionAnalyze.triggered.connect(self.analyze_content)
        self.actionSequence.triggered.connect(self.display_sequence)
        self.actionConfig.triggered.connect(self.display_config)
        self.actionSearch.triggered.connect(self.display_search)
        self.actionBrowser.triggered.connect(self.launch_browser)
        
        # Create the actions for the buttons
        # self.connect(self.encodeButton, SIGNAL("clicked()"), self.encode_values)
        # self.connect(self.encodeWrapButton, SIGNAL("clicked()"), self.wrap_encode)
        # self.connect(self.decodeButton, SIGNAL("clicked()"), self.decode_values)
        # self.connect(self.decodeWrapButton, SIGNAL("clicked()"), self.wrap_decode)
        
        # Actions for Menus
        self.actionNew_Project.triggered.connect(self.new_project)
        self.actionOpen.triggered.connect(self.open_file)
        self.actionSave_As.triggered.connect(self.save_as)
        self.actionImport_RaftCaptureXml.triggered.connect(lambda x: self.import_raft('raft_capture_xml'))
        self.actionImport_BurpLog.triggered.connect(lambda x: self.import_burp('burp_log'))
        self.actionImport_BurpState.triggered.connect(lambda x: self.import_burp('burp_state'))
        self.actionImport_BurpXml.triggered.connect(lambda x: self.import_burp('burp_xml'))
        self.actionImport_Burp_Vuln_XML.triggered.connect(lambda x: self.import_burp('burp_vuln_xml'))
        self.actionImport_AppScan_XML.triggered.connect(lambda x: self.import_appscan('appscan_xml'))
        self.actionImport_WebScarab.triggered.connect(self.import_webscarab)
        self.actionImport_ParosMessages.triggered.connect(lambda x: self.import_paros('paros_message'))
        self.actionRefresh_Responses.triggered.connect(self.refresh_responses)
        self.actionClear_Responses.triggered.connect(self.clear_responses)
        self.actionExport_Settings.triggered.connect(self.export_settings)
        self.actionImport_Settings.triggered.connect(self.import_settings)

        self.actionEncoder_Decoder.triggered.connect(self.detach_encoder)

        # Actions for configuration
        self.actionConfiguration_BlackHoleNetwork.triggered.connect(lambda x: self.raft_config_toggle('black_hole_network', x))
        self.actionAbout_RAFT.triggered.connect(self.display_about)
        self.actionAnalysisConfiguration.triggered.connect(self.display_analysis_config)

        # Declare, but do not fill, list of analyzers
        self.analyzerlist = AnalyzerList(self.framework)

        self.setup_others()