def generate_payload(self): """ Generate a payload file and place it in the payloads directory. Payloads will be one item per line. """ filename = self.dataBankTab.mainWindow.dbankGenPayloadName.text() start = self.dataBankTab.mainWindow.dbankGenStart.text() stop = self.dataBankTab.mainWindow.dbankGenStop.text() step = self.dataBankTab.mainWindow.dbankGenStep.text() prepend = self.dataBankTab.mainWindow.dbankGenPre.text() postpend = self.dataBankTab.mainWindow.dbankGenPost.text() if filename == "": message = "You didn't specify a filename" dialog = SimpleDialog(message) dialog.exec_() return() if start == "": message = "You didn't specify a start of the range" dialog = SimpleDialog(message) dialog.exec_() return() if stop == "": message = "You didn't specify a end of the range" dialog = SimpleDialog(message) dialog.exec_() return() fullpath = self.payloads_dir + "/" + filename if os.path.exists(fullpath): message = "File already exists. Would you like to overwrite?" response = ConfirmDialog.display_confirm_dialog(self, message) if response == False: return() self.write_payload(fullpath, start, stop)
def del_fuzz_file(self): # Gets the current name of the file selected in the combobox filename = self.dataBankTab.mainWindow.dbankPayloadsBox.currentText() path = self.payloads_dir message = "Are you sure you want to delete: {0}".format(filename) response = ConfirmDialog.display_confirm_dialog(self, message) if response == True: os.remove(path + "/" + filename) self.dataBankTab.fill_payload_combo_box() # Clear the items from the textedit self.dataBankTab.mainWindow.dbankFuzzValuesEdit.clear()
def del_function_file(self): # Gets the current name of the file selected in the combobox filename = self.mainWindow.wfFunctionsComboBox.currentText() path = self.functions_dir message = "Are you sure you want to delete: {0}".format(filename) response = ConfirmDialog.display_confirm_dialog(self.mainWindow, message) if response == True: os.remove(os.path.join(path,filename)) self.fill_function_combo_box() # Clear the items from the scintilla widget #ToDo: This should be the default data for the function self.functionsEditScintilla.clear()