コード例 #1
0
ファイル: hunt_methodology.py プロジェクト: gazcbm/HUNT
    def set_settings(self):
        self.settings = JPanel()
        layout = GroupLayout(self.settings)
        self.settings.setLayout(layout)
        layout.setAutoCreateGaps(True)

        load_file_button = JButton("Load JSON File")
        load_file_button.setActionCommand("load")
        load_file_button.addActionListener(SettingsAction(self, load_file_button, None))
        save_file_button = JButton("Save JSON File")
        save_file_button.setActionCommand("save")
        save_file_button.addActionListener(SettingsAction(None, save_file_button, self.tabbed_panes))

        horizontal_group1 = layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        horizontal_group1.addComponent(load_file_button)
        horizontal_group1.addComponent(save_file_button)

        horizontal_group = layout.createSequentialGroup()
        horizontal_group.addGroup(horizontal_group1)

        layout.setHorizontalGroup(horizontal_group)

        vertical_group1 = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        vertical_group1.addComponent(load_file_button)
        vertical_group2 = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        vertical_group2.addComponent(save_file_button)

        vertical_group = layout.createSequentialGroup()
        vertical_group.addGroup(vertical_group1)
        vertical_group.addGroup(vertical_group2)

        layout.setVerticalGroup(vertical_group)
コード例 #2
0
    def initUI(self):
        self.tab = JPanel()

        # UI for Output
        self.outputLabel = JLabel("AutoRecon Log:")
        self.outputLabel.setFont(Font("Tahoma", Font.BOLD, 14))
        self.outputLabel.setForeground(Color(255, 102, 52))
        self.logPane = JScrollPane()
        self.outputTxtArea = JTextArea()
        self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12))
        self.outputTxtArea.setLineWrap(True)
        self.logPane.setViewportView(self.outputTxtArea)
        self.clearBtn = JButton("Clear Log", actionPerformed=self.clearLog)
        self.exportBtn = JButton("Export Log", actionPerformed=self.exportLog)
        self.parentFrm = JFileChooser()

        # Layout
        layout = GroupLayout(self.tab)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        self.tab.setLayout(layout)

        layout.setHorizontalGroup(layout.createParallelGroup().addGroup(
            layout.createSequentialGroup().addGroup(
                layout.createParallelGroup().addComponent(
                    self.outputLabel).addComponent(self.logPane).addComponent(
                        self.clearBtn).addComponent(self.exportBtn))))

        layout.setVerticalGroup(layout.createParallelGroup().addGroup(
            layout.createParallelGroup().addGroup(
                layout.createSequentialGroup().addComponent(
                    self.outputLabel).addComponent(self.logPane).addComponent(
                        self.clearBtn).addComponent(self.exportBtn))))
コード例 #3
0
 def __init__(self, callbacks):
     super(SpyTab, self).__init__(GroupLayout(self))
     self._callbacks = callbacks
     config = Config(self._callbacks, self)
     about = About(self._callbacks)
     # plugs = Plugins(self._callbacks)
     self.tabs = [config, about]
     self.j_tabs = self.build_ui()
     self.add(self.j_tabs)
コード例 #4
0
ファイル: Burp-WebTech.py プロジェクト: zcomtenten/webtech
    def registerExtenderCallbacks(self, callbacks):
        self.callbacks = callbacks
        self.helpers = callbacks.getHelpers()
        callbacks.setExtensionName("WebTech")
        self.out = callbacks.getStdout()
        self.callbacks.printOutput("Sucessfully loaded WebTech {}".format(VERSION))

        try:
            self.webtech = WebTech(options={'json': True})
        except UpdateInBurpException as e:
            #self.callbacks.printOutput(e)
            for db_file in databases:
                db = self.callbacks.makeHttpRequest(
                    'raw.githubusercontent.com', # we are hardcoding this since there isn't a nice api for that
                    443,
                    True,
                    self.helpers.buildHttpRequest(URL(db_file[0]))
                );
                db = db.tostring()
                save_database_file(db[db.index("\r\n\r\n") + len("\r\n\r\n"):], db_file[1])
            self.webtech = WebTech(options={'json': True})

        # define all checkboxes
        self.cbPassiveChecks = self.defineCheckBox("Enable Passive Scanner Checks")
        self.cbActiveChecks = self.defineCheckBox("Enable Active Scanner Checks", True, False)
        self.btnSave = JButton("Set as default", actionPerformed=self.saveConfig)
        self.btnRestore = JButton("Restore", actionPerformed=self.restoreConfig)
        self.grpConfig = JPanel()
        self.grpConfig.add(self.btnSave)
        self.grpConfig.add(self.btnRestore)
        self.restoreConfig()

        # definition of config tab
        self.tab = JPanel()
        layout = GroupLayout(self.tab)
        self.tab.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        layout.setHorizontalGroup(
            layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup()
                      .addComponent(self.cbPassiveChecks)
                      .addComponent(self.cbActiveChecks)
                      )
            .addGroup(layout.createParallelGroup()
                      .addComponent(self.grpConfig, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                      )
        )
        layout.setVerticalGroup(
            layout.createSequentialGroup()
            .addComponent(self.cbPassiveChecks)
            .addComponent(self.cbActiveChecks)
            .addComponent(self.grpConfig, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        )

        callbacks.registerScannerCheck(self)
        callbacks.addSuiteTab(self)
コード例 #5
0
    def __init__(self):
        TrafficMod.__init__(self)
        self.setLayout(BorderLayout())

        settings_panel = JPanel()
        # settings_panel.setBorder(LineBorder(Color.RED))
        layout = GroupLayout(settings_panel)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        settings_panel.setLayout(layout)
        self.add(settings_panel)

        # Horizontal group
        horizontal = layout.createParallelGroup()
        layout.setHorizontalGroup(
            layout.createSequentialGroup().addGroup(horizontal))
        self.horizontal_layout = horizontal

        # Vertical group
        vertical = layout.createSequentialGroup()
        layout.setVerticalGroup(vertical)
        self.vertical_layout = vertical

        # Main title, label only
        main_title = JLabel(self.title)
        main_title.setFont(get_title_font(main_title))
        horizontal.addGroup(
            layout.createSequentialGroup().addComponent(main_title))
        vertical.addGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(main_title))

        # Profile name
        name_lbl = JLabel("Profile Name")
        name_lbl.setToolTipText("The name of this profile")
        horizontal.addGroup(
            layout.createSequentialGroup().addComponent(name_lbl).addComponent(
                self.name_textfield))
        vertical.addGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(
                    name_lbl).addComponent(self.name_textfield))

        # Profile description
        descr_lbl = JLabel("Description")
        horizontal.addGroup(layout.createSequentialGroup().addComponent(
            descr_lbl).addComponent(self.descr_textarea))
        vertical.addGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(
                    descr_lbl).addComponent(self.descr_textarea))

        layout.linkSize(SwingConstants.HORIZONTAL, name_lbl, descr_lbl)
コード例 #6
0
    def registerExtenderCallbacks(self, this_callbacks):
        global callbacks, helpers, checkbox_perHost, checkbox_common, checkbox_ssh, checkbox_key, checkbox_php, checkbox_sql
        callbacks = this_callbacks

        ui_label = JLabel('Scans to perform:')
        checkbox_perHost = self.defineCheckBox('Scan once per domain (web root only, not every subdirectory)')
        checkbox_common = self.defineCheckBox('Interesting files')
        checkbox_ssh = self.defineCheckBox('SSH private keys')
        checkbox_key = self.defineCheckBox('.key files')
        checkbox_php = self.defineCheckBox('PHP file scans')
        checkbox_sql = self.defineCheckBox('SQL file scans')

        self.tab = JPanel()
        layout = GroupLayout(self.tab)
        self.tab.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)

        layout.setHorizontalGroup(
            layout.createSequentialGroup()
                .addComponent(ui_label)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                          .addComponent(checkbox_common)
                          .addComponent(checkbox_ssh)
                          .addComponent(checkbox_key)
                          .addComponent(checkbox_php)
                          .addComponent(checkbox_sql))
                .addComponent(checkbox_perHost)
        )
        layout.setVerticalGroup(
            layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                          .addComponent(ui_label)
                          .addComponent(checkbox_common)
                          .addComponent(checkbox_perHost))
                .addComponent(checkbox_ssh)
                .addComponent(checkbox_key)
                .addComponent(checkbox_php)
                .addComponent(checkbox_sql)
        )

        helpers = callbacks.getHelpers()

        callbacks.setExtensionName("Interesting Files Scanner")
        callbacks.registerScannerCheck(FileScanner())
        callbacks.addSuiteTab(self)

        print 'Interesting Files Scanner'
        print 'Created by Sven Fassbender (@mezdanak, @modzero) v' + VERSION
        print 'https://github.com/modzero/interestingFileScanner'

        return
コード例 #7
0
    def registerExtenderCallbacks(self, callbacks):
        self.callbacks = callbacks
        self.helpers = callbacks.helpers

        self.checkboxEnable = JCheckBox('Enabled')
        self.checkboxEnable.setSelected(False)
        self.checkboxEnable.setEnabled(True)

        self.scriptpane = JTextPane()
        self.scriptpane.setFont(Font('Monospaced', Font.PLAIN, 11))

        self.scrollpane = JScrollPane()
        self.scrollpane.setViewportView(self.scriptpane)

        self.tab = JPanel()
        layout = GroupLayout(self.tab)
        self.tab.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)

        layout.setHorizontalGroup(layout.createParallelGroup().addComponent(
            self.checkboxEnable).addComponent(self.scrollpane))
        layout.setVerticalGroup(layout.createSequentialGroup().addComponent(
            self.checkboxEnable).addComponent(self.scrollpane))

        self._code = compile('', '<string>', 'exec')
        self._script = ''

        script = callbacks.loadExtensionSetting('script')

        if script:
            script = base64.b64decode(script)

            self.scriptpane.document.insertString(
                self.scriptpane.document.length, script, SimpleAttributeSet())

            self._script = script
            try:
                self._code = compile(script, '<string>', 'exec')
            except Exception as e:
                traceback.print_exc(file=self.callbacks.getStderr())

        callbacks.setExtensionName("Python Scripter (modified)")
        callbacks.registerSessionHandlingAction(self)
        callbacks.registerExtensionStateListener(self)
        callbacks.registerHttpListener(self)
        callbacks.customizeUiComponent(self.getUiComponent())
        callbacks.addSuiteTab(self)

        self.scriptpane.requestFocus()
        return
コード例 #8
0
	def registerExtenderCallbacks(self, callbacks):
		self._callbacks = callbacks
		self._helpers = callbacks.getHelpers()
		self._stdout = PrintWriter(callbacks.getStdout(), True)

		callbacks.setExtensionName("Argument Injection Hammer")	
		self._create_brute_payloads()

		self._stdout.println('==================================')	
		self._stdout.println("        ,")
		self._stdout.println("       /(  ___________")
		self._stdout.println("      |  >:===========`")
		self._stdout.println("       )(")
		self._stdout.println('== AIH "" Hammer Smash Party =====')
		self._stdout.println('== Neil Bergman - NCC Group  =====')
		self._stdout.println('==================================')

		self._checkbox_brute = self._define_check_box("Brute-force Short Argument Flags", False)
		self._button_save = JButton("Save Configuration", actionPerformed=self._save_config)

		self.tab = JPanel()
		layout = GroupLayout(self.tab)
		self.tab.setLayout(layout)
		layout.setAutoCreateGaps(True)
		layout.setAutoCreateContainerGaps(True)
		layout.setHorizontalGroup(
			layout.createSequentialGroup().addGroup(
				layout.createParallelGroup()
				.addComponent(self._checkbox_brute)
				
			).addGroup(
				layout.createParallelGroup()
				.addComponent(self._button_save)
			)
		)
		layout.setVerticalGroup(
			layout.createSequentialGroup().addGroup(
				layout.createParallelGroup()
				.addComponent(self._checkbox_brute)
			).addGroup(
				layout.createParallelGroup()
				.addComponent(self._button_save)
			)
		)
		callbacks.addSuiteTab(self)
		self._restore_config()

		callbacks.registerScannerCheck(self)
		return
コード例 #9
0
    def __init__(self):
        TrafficMod.__init__(self)
        self.setLayout(FlowLayout(FlowLayout.LEADING))

        settings_panel = JPanel()
        layout = GroupLayout(settings_panel)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        settings_panel.setLayout(layout)
        self.add(settings_panel)

        # Horizontal group
        horizontal = layout.createParallelGroup()
        layout.setHorizontalGroup(
            layout.createSequentialGroup().addGroup(horizontal))

        # Vertical group
        vertical = layout.createSequentialGroup()
        layout.setVerticalGroup(vertical)

        # Main title, label only
        main_title = JLabel(self.title)
        main_title.setFont(Font(main_title.getFont().getName(), Font.BOLD, 14))
        horizontal.addGroup(
            layout.createSequentialGroup().addComponent(main_title))
        vertical.addGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(main_title))

        # Duplicate percentage
        percent_lbl = JLabel("Duplicate %")
        horizontal.addGroup(layout.createSequentialGroup().addComponent(
            percent_lbl).addComponent(self.duplicate_percent))
        vertical.addGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(
                    percent_lbl).addComponent(self.duplicate_percent))

        # Duplicate percentage correlation
        corr_lbl = JLabel("Correlation %")
        horizontal.addGroup(
            layout.createSequentialGroup().addComponent(corr_lbl).addComponent(
                self.duplicate_percent_correlation))
        vertical.addGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(
                    corr_lbl).addComponent(self.duplicate_percent_correlation))

        layout.linkSize(SwingConstants.HORIZONTAL, corr_lbl, percent_lbl)
コード例 #10
0
ファイル: gui.py プロジェクト: PortSwigger/python-scripter
    def _create_output_panel(self):
        self.outputPanel = JPanel()
        self.outputEditor = self.callbacks.createTextEditor()
        self.outputEditor.editable = False
        self.outputText = self.outputEditor.component
        self.clearOutputButton = JButton('Clear',
                                         actionPerformed=self.clear_stdout)
        self.outputButtonGroup = ButtonGroup()
        self.outputFileRadioButton = JRadioButton(
            'Save to File:', actionPerformed=self.save_file_output)
        self.outputUIRadioButton = JRadioButton(
            'Show in UI:', selected=True, actionPerformed=self.view_ui_output)
        self.outputFileTextField = JTextField(50,
                                              enabled=False,
                                              disabledTextColor=Color.black)
        self.outputFileBrowseButton = JButton(
            'Browse...', enabled=False, actionPerformed=self.set_output_file)

        self.outputButtonGroup.add(self.outputFileRadioButton)
        self.outputButtonGroup.add(self.outputUIRadioButton)

        outputLayout = GroupLayout(self.outputPanel,
                                   autoCreateGaps=True,
                                   autoCreateContainerGaps=True)
        outputLayout.setHorizontalGroup(
            outputLayout.createParallelGroup().addGroup(
                outputLayout.createSequentialGroup().addComponent(
                    self.outputFileRadioButton).addComponent(
                        self.outputFileTextField, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE).addComponent(
                            self.outputFileBrowseButton)).addComponent(
                                self.outputUIRadioButton).addComponent(
                                    self.outputText).addComponent(
                                        self.clearOutputButton))

        outputLayout.setVerticalGroup(
            outputLayout.createSequentialGroup().addGroup(
                outputLayout.createParallelGroup().addComponent(
                    self.outputFileRadioButton).addComponent(
                        self.outputFileTextField, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE).addComponent(
                            self.outputFileBrowseButton)).addComponent(
                                self.outputUIRadioButton).addComponent(
                                    self.outputText).addComponent(
                                        self.clearOutputButton))
        self.outputPanel.layout = outputLayout
コード例 #11
0
ファイル: gui.py プロジェクト: PortSwigger/python-scripter
    def _create_error_panel(self):
        self.errorPanel = JPanel()
        self.errorEditor = self.callbacks.createTextEditor()
        self.errorEditor.editable = False
        self.errorText = self.errorEditor.component
        self.clearErrorButton = JButton('Clear',
                                        actionPerformed=self.clear_stderr)

        errorLayout = GroupLayout(self.errorPanel,
                                  autoCreateGaps=True,
                                  autoCreateContainerGaps=True)
        errorLayout.setHorizontalGroup(
            errorLayout.createParallelGroup().addComponent(
                self.errorText).addComponent(self.clearErrorButton))
        errorLayout.setVerticalGroup(
            errorLayout.createSequentialGroup().addComponent(
                self.errorText).addComponent(self.clearErrorButton))
        self.errorPanel.layout = errorLayout
コード例 #12
0
    def registerExtenderCallbacks(self, callbacks):
        self.callbacks = callbacks
        self.helpers = callbacks.getHelpers()
        callbacks.setExtensionName("WebTech")
        self.out = callbacks.getStdout()
        self.callbacks.printOutput("Sucessfully loaded WebTech {}".format(VERSION))

        self.webtech = WebTech(options={'json': True})

        # define all checkboxes
        self.cbPassiveChecks = self.defineCheckBox("Enable Passive Scanner Checks")
        self.cbActiveChecks = self.defineCheckBox("Enable Active Scanner Checks", True, False)
        self.btnSave = JButton("Set as default", actionPerformed=self.saveConfig)
        self.btnRestore = JButton("Restore", actionPerformed=self.restoreConfig)
        self.grpConfig = JPanel()
        self.grpConfig.add(self.btnSave)
        self.grpConfig.add(self.btnRestore)
        self.restoreConfig()

        # definition of config tab
        self.tab = JPanel()
        layout = GroupLayout(self.tab)
        self.tab.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        layout.setHorizontalGroup(
            layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup()
                      .addComponent(self.cbPassiveChecks)
                      .addComponent(self.cbActiveChecks)
                      )
            .addGroup(layout.createParallelGroup()
                      .addComponent(self.grpConfig, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                      )
        )
        layout.setVerticalGroup(
            layout.createSequentialGroup()
            .addComponent(self.cbPassiveChecks)
            .addComponent(self.cbActiveChecks)
            .addComponent(self.grpConfig, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        )

        callbacks.registerScannerCheck(self)
        callbacks.addSuiteTab(self)
コード例 #13
0
ファイル: gui.py プロジェクト: PortSwigger/python-scripter
    def __init__(self, callbacks, script):
        super(ScriptEditingPanel, self).__init__()
        self.callbacks = callbacks
        self.script = script
        self.enabledCheckbox = JCheckBox('Enabled',
                                         self.script.enabled,
                                         itemStateChanged=self.enabled_changed,
                                         alignmentX=Component.LEFT_ALIGNMENT)
        self.scriptEditor = callbacks.createTextEditor()
        self.scriptEditor.text = script.content
        self.scriptText = self.scriptEditor.component
        self.loadButton = JButton('Load', actionPerformed=self.load)
        self.compileButton = JButton('Compile',
                                     actionPerformed=self.compile,
                                     enabled=False)

        editingLayout = GroupLayout(self,
                                    autoCreateGaps=True,
                                    autoCreateContainerGaps=True)
        editingLayout.setHorizontalGroup(editingLayout.createParallelGroup(
        ).addGroup(editingLayout.createSequentialGroup().addComponent(
            self.enabledCheckbox).addPreferredGap(UNRELATED)).addGroup(
                editingLayout.createParallelGroup().addComponent(
                    self.scriptText)).addGroup(
                        editingLayout.createSequentialGroup().addComponent(
                            self.loadButton).addComponent(self.compileButton)))

        editingLayout.setVerticalGroup(editingLayout.createSequentialGroup(
        ).addGroup(editingLayout.createParallelGroup().addComponent(
            self.enabledCheckbox)).addGroup(
                editingLayout.createSequentialGroup().addComponent(
                    self.scriptText)).addGroup(
                        editingLayout.createParallelGroup().addComponent(
                            self.loadButton).addComponent(self.compileButton)))
        self.layout = editingLayout
        BurpUI.get_textarea(
            self.scriptEditor).document.addDocumentListener(self)
        self.compile(None)
コード例 #14
0
    def registerExtenderCallbacks(self, callbacks):
        self.callbacks = callbacks
        self.helpers = callbacks.getHelpers()
        callbacks.setExtensionName("Missing Scanner Checks")
        self.out = callbacks.getStdout()

        # define all checkboxes
        self.cbPassiveChecks = self.defineCheckBox("Passive Scanner Checks")
        self.cbDOMXSS = self.defineCheckBox("DOM XSS", False)
        self.cbDOMXSSSources = self.defineCheckBox("Sources", False)
        self.cbDOMXSSSinks = self.defineCheckBox("Sinks")
        self.cbDOMXSSjQuerySinks = self.defineCheckBox("jQuery Sinks", False)
        self.grpDOMXSSSettings = JPanel()
        self.grpDOMXSSSettings.add(self.cbDOMXSSSources)
        self.grpDOMXSSSettings.add(self.cbDOMXSSSinks)
        self.grpDOMXSSSettings.add(self.cbDOMXSSjQuerySinks)
        self.cbSTS = self.defineCheckBox("Strict Transport Security")
        self.lblSTSMin = JLabel("Minimum acceptable max-age")
        self.inSTSMin = JTextField(
            str(STSMinimum), 9, actionPerformed=self.setSTSMinimum
        )  # TODO: actionPerformed only fires on enter key - focus lost would be better
        self.inSTSMin.setToolTipText(
            "Enter the minimum max-age value which is considered as acceptable. Press return to change setting!"
        )
        self.grpSTSSettings = JPanel()
        self.grpSTSSettings.add(self.lblSTSMin)
        self.grpSTSSettings.add(self.inSTSMin)
        self.cbXCTO = self.defineCheckBox("Content Sniffing")
        self.cbXXP = self.defineCheckBox(
            "Client-side XSS Filter Configuration")
        self.cbRedirToHTTPS = self.defineCheckBox(
            "Redirection from HTTP to HTTPS")
        self.btnSave = JButton("Set as default",
                               actionPerformed=self.saveConfig)
        self.btnRestore = JButton("Restore",
                                  actionPerformed=self.restoreConfig)
        self.grpConfig = JPanel()
        self.grpConfig.add(self.btnSave)
        self.grpConfig.add(self.btnRestore)
        self.restoreConfig()

        # definition of config tab
        self.tab = JPanel()
        layout = GroupLayout(self.tab)
        self.tab.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(
            layout.createParallelGroup().addComponent(self.cbPassiveChecks)
        ).addGroup(layout.createParallelGroup().addComponent(
            self.cbDOMXSS).addComponent(self.cbSTS).addComponent(
                self.cbXCTO).addComponent(self.cbXXP).addComponent(
                    self.cbRedirToHTTPS)).addGroup(
                        layout.createParallelGroup().addComponent(
                            self.grpDOMXSSSettings, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.PREFERRED_SIZE,
                            GroupLayout.PREFERRED_SIZE).addComponent(
                                self.grpSTSSettings,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.grpConfig, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.PREFERRED_SIZE)))
        layout.setVerticalGroup(layout.createSequentialGroup().addGroup(
            layout.createParallelGroup().addComponent(
                self.cbPassiveChecks).addComponent(self.cbDOMXSS).addComponent(
                    self.grpDOMXSSSettings, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE)).addGroup(
                        layout.createParallelGroup().addComponent(
                            self.cbSTS).addComponent(
                                self.grpSTSSettings,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)).addComponent(
                                    self.cbXCTO).addComponent(
                                        self.cbXXP).addComponent(
                                            self.cbRedirToHTTPS).addComponent(
                                                self.grpConfig,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.PREFERRED_SIZE))

        self.domXSSSourcesRE = re.compile(
            "(location\s*[\[.])|([.\[]\s*[\"']?\s*(arguments|dialogArguments|innerHTML|write(ln)?|open(Dialog)?|showModalDialog|cookie|URL|documentURI|baseURI|referrer|name|opener|parent|top|content|self|frames)\W)|(localStorage|sessionStorage|Database)"
        )
        # NOTE: done some optimizations here, original RE caused too much noise
        # - added leading dot in the first part - original recognized "<a href=..." etc.
        # - removed "value" in first part
        self.domXSSSinksRE = re.compile(
            "(\.(src|href|data|location|code|action)\s*[\"'\]]*\s*\+?\s*=)|((replace|assign|navigate|getResponseHeader|open(Dialog)?|showModalDialog|eval|evaluate|execCommand|execScript|setTimeout|setInterval)\s*[\"'\]]*\s*\()"
        )
        self.domXSSjQuerySinksRE = re.compile(
            "after\(|\.append\(|\.before\(|\.html\(|\.prepend\(|\.replaceWith\(|\.wrap\(|\.wrapAll\(|\$\(|\.globalEval\(|\.add\(|jQUery\(|\$\(|\.parseHTML\("
        )
        self.headerSTSRE = re.compile(
            "^Strict-Transport-Security:.*?max-age=\"?(\d+)\"?",
            re.I)  # TODO: multiple max-age directives cause confusion!
        self.headerXCTORE = re.compile(
            "^X-Content-Type-Options:\s*nosniff\s*$", re.I)
        self.headerXXP = re.compile(
            "^X-XSS-Protection:\s*(\d)(?:\s*;\s*mode\s*=\s*\"?(block)\"?)?",
            re.I)
        self.headerLocationHTTPS = re.compile(
            "^(?:Content-)?Location:\s*(https://.*)$", re.I)

        callbacks.registerScannerCheck(self)
        callbacks.addSuiteTab(self)
コード例 #15
0
    def __init__(self, ui):
        JSplitPane.__init__(self, JSplitPane.HORIZONTAL_SPLIT)
        self._ui = ui

        # create the executor object
        self._executor = Executor(self, ui.callbacks)

        ####
        # start Left Top split layout
        jLeftTopPanel = JPanel()
        jMenuPanel = JPanel()

        #Load button
        self.jLoad = JButton(Strings.jLoad_text)
        self.jLoad.addActionListener(self)
        #File name text field
        self.jFileName = JTextField(Strings.jFileName_default, 30)
        self.jFileName.setHorizontalAlignment(JTextField.CENTER)
        self.jFileName.setEditable(False)
        #Save button
        self.jSave = JButton(Strings.jSave_text)
        self.jSave.addActionListener(self)
        #Exit button
        self.jExit = JButton(Strings.jExit_text)
        self.jExit.addActionListener(self)
        #Wiki button (URL)
        self.jWiki = JButton(Strings.jWiki_title)
        self.jWiki.setToolTipText(Strings.jWiki_tooltip)
        self.jWiki.addActionListener(self)
        # make it borderless
        self.jWiki.setBorder(EmptyBorder(0, 0, 0, 0))
        self.jWiki.setBorderPainted(False)
        self.jWiki.setContentAreaFilled(False)

        #Console text area
        jConsoleText = JTextArea()
        jConsoleText.setEditable(0)
        jConsoleText.setWrapStyleWord(1)
        jConsoleText.setRows(10)
        #set initial text
        jConsoleText.setText(Strings.jConsoleText_help)
        #make scrollable
        jScrollConsolePane = JScrollPane()
        jScrollConsolePane.setViewportView(jConsoleText)

        jMenuPanelLayout = GroupLayout(jMenuPanel)
        jMenuPanel.setLayout(jMenuPanelLayout)
        jMenuPanelLayout.setHorizontalGroup(
            jMenuPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).
            addGroup(jMenuPanelLayout.createSequentialGroup().addContainerGap(
            ).addComponent(self.jLoad).addComponent(
                self.jFileName).addPreferredGap(
                    LayoutStyle.ComponentPlacement.RELATED).addComponent(
                        self.jSave).addPreferredGap(
                            LayoutStyle.ComponentPlacement.RELATED).
                     addComponent(self.jWiki).addPreferredGap(
                         LayoutStyle.ComponentPlacement.RELATED).addComponent(
                             self.jExit).addContainerGap()))
        jMenuPanelLayout.setVerticalGroup(
            jMenuPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    jMenuPanelLayout.createSequentialGroup().addGroup(
                        jMenuPanelLayout.createParallelGroup(
                            GroupLayout.Alignment.BASELINE).addComponent(
                                self.jLoad).addComponent(
                                    self.jFileName, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE).addComponent(
                                        self.jSave).addComponent(
                                            self.jWiki).addComponent(
                                                self.jExit))))

        jLeftTopPanelLayout = GroupLayout(jLeftTopPanel)
        jLeftTopPanel.setLayout(jLeftTopPanelLayout)
        jLeftTopPanelLayout.setHorizontalGroup(
            jLeftTopPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addComponent(
                    jMenuPanel, GroupLayout.DEFAULT_SIZE,
                    GroupLayout.DEFAULT_SIZE,
                    GroupLayout.DEFAULT_SIZE).addComponent(
                        jScrollConsolePane, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE, 32767))
        jLeftTopPanelLayout.setVerticalGroup(
            jLeftTopPanelLayout.
            createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                GroupLayout.Alignment.TRAILING,
                jLeftTopPanelLayout.createSequentialGroup().addComponent(
                    jMenuPanel, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.DEFAULT_SIZE,
                    GroupLayout.PREFERRED_SIZE).addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED).addComponent(
                            jScrollConsolePane, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, 32767)))
        # end Left Top split layout
        ####

        ####
        # start Left Down split layout
        jLeftDownPanel = JPanel()
        jMenu2Panel = JPanel()

        #Clear button
        self.jClear = JButton(Strings.jClear_text)
        self.jClear.setToolTipText(Strings.jClear_tooltip)
        self.jClear.addActionListener(self)

        #Run button
        self.jRun = JButton(Strings.jRun_text)
        self.jRun.setToolTipText(Strings.jRun_tooltip)
        self.jRun.addActionListener(self)

        #Variables text area
        jVarsPane = JTextPane()
        jVarsPane.setFont(Font('Monospaced', Font.PLAIN, 11))
        jVarsPane.addFocusListener(self)
        # set initial value
        jVarsPane.setText(Strings.jVarsPane_header)
        # make scrollable
        jScrollpaneLeftDown = JScrollPane()
        jScrollpaneLeftDown.setViewportView(jVarsPane)

        jMenu2PanelLayout = GroupLayout(jMenu2Panel)
        jMenu2Panel.setLayout(jMenu2PanelLayout)
        jMenu2PanelLayout.setHorizontalGroup(
            jMenu2PanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    jMenu2PanelLayout.createSequentialGroup().addContainerGap(
                    ).addComponent(self.jClear).addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED, 100,
                        32767).addComponent(self.jRun).addContainerGap()))
        jMenu2PanelLayout.setVerticalGroup(
            jMenu2PanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    jMenu2PanelLayout.createSequentialGroup().addGroup(
                        jMenu2PanelLayout.createParallelGroup(
                            GroupLayout.Alignment.BASELINE).addComponent(
                                self.jClear).addComponent(self.jRun))))
        jLeftDownPanelLayout = GroupLayout(jLeftDownPanel)
        jLeftDownPanel.setLayout(jLeftDownPanelLayout)
        jLeftDownPanelLayout.setHorizontalGroup(
            jLeftDownPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addComponent(
                    jMenu2Panel, GroupLayout.DEFAULT_SIZE,
                    GroupLayout.DEFAULT_SIZE,
                    GroupLayout.DEFAULT_SIZE).addComponent(
                        jScrollpaneLeftDown, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE, 32767))
        jLeftDownPanelLayout.setVerticalGroup(
            jLeftDownPanelLayout.
            createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                GroupLayout.Alignment.TRAILING,
                jLeftDownPanelLayout.createSequentialGroup().addComponent(
                    jMenu2Panel, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.DEFAULT_SIZE,
                    GroupLayout.PREFERRED_SIZE).addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED).addComponent(
                            jScrollpaneLeftDown, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, 32767)))
        # end Left Down split layout
        ####

        ####
        # start Left layout
        jSplitPaneLeft = JSplitPane(JSplitPane.VERTICAL_SPLIT, jLeftTopPanel,
                                    jLeftDownPanel)
        jSplitPaneLeft.setDividerLocation(300)
        # end Left layout
        ####

        ####
        # start Right layout
        jScriptPane = JTextPane()
        jScriptPane.setFont(Font('Monospaced', Font.PLAIN, 11))
        # set initial value
        jScriptPane.setText(Strings.jScriptPane_header)
        #jScriptPane.addMouseListener(self)

        jScrollPaneRight = JScrollPane()
        jScrollPaneRight.setViewportView(jScriptPane)
        # end Right layout
        ####

        self.setLeftComponent(jSplitPaneLeft)
        self.setRightComponent(jScrollPaneRight)
        self.setDividerLocation(450)

        #Exported variables
        self.jConsoleText = jConsoleText
        self.jScrollConsolePane = jScrollConsolePane
        self.jScriptPane = jScriptPane
        self.jVarsPane = jVarsPane
コード例 #16
0
ファイル: UI.py プロジェクト: bbhunter/SQLi-Query-Tampering
    def initComponents(self):
        TabbedPane1 = JTabbedPane()
        GeneratorScrollPane = JScrollPane()
        GeneratorPanel = JPanel()
        jlbl1 = JLabel()
        jlbl2 = JLabel()
        spanePayloadList = JScrollPane()
        self.listPayloads = JList()
        pastePayloadButton = JButton(
            actionPerformed=self.pastePayloadButtonAction)
        loadPayloadButton = JButton(
            actionPerformed=self.loadPayloadButtonAction)
        removePayloadButton = JButton(
            actionPerformed=self.removePayloadButtonAction)
        clearPayloadButton = JButton(
            actionPerformed=self.clearPayloadButtonAction)
        self.textNewPayload = JTextField()
        addPayloadButton = JButton(actionPerformed=self.addPayloadButtonAction)
        jSeparator1 = JSeparator()
        jlbl3 = JLabel()
        jlbl4 = JLabel()
        self.chkGeneral = JCheckBox(actionPerformed=self.OnCheck)
        self.chkMAXDB = JCheckBox(actionPerformed=self.OnCheck)
        self.chkMSSQL = JCheckBox(actionPerformed=self.OnCheck)
        self.chkMSAccess = JCheckBox(actionPerformed=self.OnCheck)
        self.chkPostgres = JCheckBox(actionPerformed=self.OnCheck)
        self.chkOracle = JCheckBox(actionPerformed=self.OnCheck)
        self.chkSqlite = JCheckBox(actionPerformed=self.OnCheck)
        self.chkMysql = JCheckBox(actionPerformed=self.OnCheck)
        jlbl5 = JLabel()
        toClipboardButton = JButton(
            actionPerformed=self.toClipboardButtonAction)
        toFileButton = JButton(actionPerformed=self.toFileButtonAction)
        ProcessorScrollPane = JScrollPane()
        ProcessorPanel = JPanel()
        jLabel1 = JLabel()
        self.comboProcessorTech = JComboBox(
            itemStateChanged=self.comboProcessorTechAction)
        jSeparator2 = JSeparator()
        jLabel2 = JLabel()
        jLabel3 = JLabel()
        jScrollPane1 = JScrollPane()
        self.textPlainPayload = JTextArea()
        jLabel4 = JLabel()
        jScrollPane2 = JScrollPane()
        self.textTamperedPayload = JTextArea()
        tamperPayloadButton = JButton(
            actionPerformed=self.tamperPayloadButtonAction)

        jlbl1.setForeground(Color(255, 102, 51))
        jlbl1.setFont(Font(jlbl1.getFont().toString(), 1, 14))
        jlbl1.setText("User-Defiend Payloads")

        jlbl2.setText(
            "This payload type lets you configure a simple list of strings that are used as payloads."
        )

        spanePayloadList.setViewportView(self.listPayloads)
        self.extender.PayloadList = self.readPayloadsListFile()
        self.listPayloads.setListData(self.extender.PayloadList)

        pastePayloadButton.setText("Paste")

        loadPayloadButton.setText("Load")

        removePayloadButton.setText("Remove")

        clearPayloadButton.setText("Clear")

        self.textNewPayload.setToolTipText("")

        addPayloadButton.setText("Add")

        jlbl3.setForeground(Color(255, 102, 51))
        jlbl3.setFont(Font(jlbl3.getFont().toString(), 1, 14))
        jlbl3.setText("Tamper Techniques")

        jlbl4.setText(
            "You can select the techniques that you want to perform processing tasks on each user-defined payload"
        )

        self.chkGeneral.setText("General")
        varName = 'SQLiQueryTampering_{}'.format(self.chkGeneral.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkGeneral.setSelected(int(state))

        self.chkMAXDB.setText("SAP MAX DB")
        varName = 'SQLiQueryTampering_{}'.format(self.chkMAXDB.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkMAXDB.setSelected(int(state))

        self.chkMSSQL.setText("MS SQL Server")
        varName = 'SQLiQueryTampering_{}'.format(self.chkMSSQL.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkMSSQL.setSelected(int(state))

        self.chkMSAccess.setText("MS Access")
        varName = 'SQLiQueryTampering_{}'.format(self.chkMSAccess.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkMSAccess.setSelected(int(state))

        self.chkPostgres.setText("Postgres SQL")
        varName = 'SQLiQueryTampering_{}'.format(self.chkPostgres.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkPostgres.setSelected(int(state))

        self.chkOracle.setText("Oracle")
        varName = 'SQLiQueryTampering_{}'.format(self.chkOracle.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkOracle.setSelected(int(state))

        self.chkSqlite.setText("Sqlite")
        varName = 'SQLiQueryTampering_{}'.format(self.chkSqlite.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkSqlite.setSelected(int(state))

        self.chkMysql.setText("MySql")
        varName = 'SQLiQueryTampering_{}'.format(self.chkMysql.text)
        state = self.extender.callbacks.loadExtensionSetting(varName)
        if state: self.chkMysql.setSelected(int(state))

        jlbl5.setText("[?] Save the Generated/Tampered Payloads to :")

        toClipboardButton.setText("Clipboard")

        toFileButton.setText("File")

        GeneratorPanelLayout = GroupLayout(GeneratorPanel)
        GeneratorPanel.setLayout(GeneratorPanelLayout)
        GeneratorPanelLayout.setHorizontalGroup(
            GeneratorPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).
            addGroup(GeneratorPanelLayout.createSequentialGroup(
            ).addContainerGap().addGroup(
                GeneratorPanelLayout.createParallelGroup(
                    GroupLayout.Alignment.TRAILING).addComponent(
                        jlbl2, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE).addComponent(
                            jlbl4, GroupLayout.Alignment.LEADING,
                            GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE).addComponent(
                                jSeparator1, GroupLayout.Alignment.LEADING).
                addGroup(GeneratorPanelLayout.createSequentialGroup().addGap(
                    6, 6, 6).addGroup(
                        GeneratorPanelLayout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).addGroup(
                                GeneratorPanelLayout.createSequentialGroup(
                                ).addGroup(
                                    GeneratorPanelLayout.createParallelGroup(
                                        GroupLayout.Alignment.LEADING,
                                        False).addComponent(
                                            removePayloadButton,
                                            GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE).addComponent(
                                                clearPayloadButton,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE).addComponent(
                                                    loadPayloadButton,
                                                    GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE,
                                                    Short.MAX_VALUE).
                                    addComponent(pastePayloadButton,
                                                 GroupLayout.DEFAULT_SIZE,
                                                 GroupLayout.DEFAULT_SIZE,
                                                 Short.MAX_VALUE).addComponent(
                                                     addPayloadButton,
                                                     GroupLayout.DEFAULT_SIZE,
                                                     GroupLayout.DEFAULT_SIZE,
                                                     Short.MAX_VALUE)).
                                addGap(21, 21, 21).addGroup(
                                    GeneratorPanelLayout.createParallelGroup(
                                        GroupLayout.Alignment.LEADING).
                                    addComponent(
                                        self.textNewPayload).addComponent(
                                            spanePayloadList))).addComponent(
                                                jlbl1).addComponent(jlbl3).
                        addGroup(GeneratorPanelLayout.createSequentialGroup(
                        ).addGroup(
                            GeneratorPanelLayout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.chkGeneral).addComponent(
                                        self.chkMSSQL)
                        ).addGap(18, 18, 18).addGroup(
                            GeneratorPanelLayout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.chkPostgres).addComponent(
                                        self.chkMAXDB)
                        ).addGap(18, 18, 18).addGroup(
                            GeneratorPanelLayout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.chkMSAccess).addComponent(
                                        self.chkOracle)
                        ).addGap(18, 18, 18).addGroup(
                            GeneratorPanelLayout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.chkSqlite).addComponent(self.chkMysql)
                        )).addGroup(GeneratorPanelLayout.createSequentialGroup(
                        ).addComponent(jlbl5).addPreferredGap(
                            LayoutStyle.ComponentPlacement.
                            UNRELATED).addComponent(toClipboardButton).addGap(
                                18, 18,
                                18).addComponent(toFileButton,
                                                 GroupLayout.PREFERRED_SIZE,
                                                 97, GroupLayout.PREFERRED_SIZE
                                                 ))))).addContainerGap()))
        GeneratorPanelLayout.setVerticalGroup(
            GeneratorPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).
            addGroup(GeneratorPanelLayout.createSequentialGroup(
            ).addContainerGap().addComponent(jlbl1).addPreferredGap(
                LayoutStyle.ComponentPlacement.RELATED).addComponent(
                    jlbl2, GroupLayout.PREFERRED_SIZE, 21,
                    GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).addGroup(
                        GeneratorPanelLayout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).addComponent(
                                spanePayloadList, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE).
                        addGroup(GeneratorPanelLayout.createSequentialGroup(
                        ).addComponent(pastePayloadButton).addPreferredGap(
                            LayoutStyle.ComponentPlacement.RELATED
                        ).addComponent(loadPayloadButton).addPreferredGap(
                            LayoutStyle.ComponentPlacement.RELATED
                        ).addComponent(removePayloadButton).addPreferredGap(
                            LayoutStyle.ComponentPlacement.RELATED).
                                 addComponent(clearPayloadButton))).
                     addPreferredGap(
                         LayoutStyle.ComponentPlacement.RELATED).addGroup(
                             GeneratorPanelLayout.createParallelGroup(
                                 GroupLayout.Alignment.BASELINE).addComponent(
                                     self.textNewPayload,
                                     GroupLayout.PREFERRED_SIZE,
                                     GroupLayout.DEFAULT_SIZE,
                                     GroupLayout.PREFERRED_SIZE).
                             addComponent(addPayloadButton)).addPreferredGap(
                                 LayoutStyle.ComponentPlacement.UNRELATED).
                     addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, 10,
                                  GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                      LayoutStyle.ComponentPlacement.RELATED).
                     addComponent(jlbl3).addPreferredGap(
                         LayoutStyle.ComponentPlacement.UNRELATED
                     ).addComponent(jlbl4).addPreferredGap(
                         LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                             GeneratorPanelLayout.createParallelGroup(
                                 GroupLayout.Alignment.BASELINE).addComponent(
                                     self.chkGeneral).addComponent(
                                         self.chkMAXDB).addComponent(
                                             self.chkOracle).addComponent(
                                                 self.chkSqlite)).
                     addPreferredGap(
                         LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                             GeneratorPanelLayout.createParallelGroup(
                                 GroupLayout.Alignment.BASELINE).addComponent(
                                     self.chkMSSQL).addComponent(
                                         self.chkPostgres).addComponent(
                                             self.chkMSAccess).addComponent(
                                                 self.chkMysql)
                         ).addGap(18, 18, 18).addGroup(
                             GeneratorPanelLayout.createParallelGroup(
                                 GroupLayout.Alignment.BASELINE).addComponent(
                                     jlbl5).addComponent(toClipboardButton).
                             addComponent(toFileButton)).addGap(20, 20, 20)))

        GeneratorScrollPane.setViewportView(GeneratorPanel)

        TabbedPane1.addTab("Generator", GeneratorScrollPane)

        varName = 'SQLiQueryTampering_comboProcessorTech'
        state = self.extender.callbacks.loadExtensionSetting(varName)

        for item in self.extender.getTamperFuncsName():
            self.comboProcessorTech.addItem(item)

        if state: self.comboProcessorTech.setSelectedIndex(int(state))

        jLabel1.setText("Processor Technique :")

        jLabel2.setText(
            "Modify Plain Payloads based on the selected Processor Technique. Write one payload per line."
        )

        jLabel3.setText("Plain Payloads:")

        self.textPlainPayload.setColumns(20)
        self.textPlainPayload.setRows(5)
        jScrollPane1.setViewportView(self.textPlainPayload)

        jLabel4.setText("Tampered Payloads:")

        self.textTamperedPayload.setColumns(20)
        self.textTamperedPayload.setRows(5)
        jScrollPane2.setViewportView(self.textTamperedPayload)

        tamperPayloadButton.setText("Tamper Payloads")

        ProcessorPanelLayout = GroupLayout(ProcessorPanel)
        ProcessorPanel.setLayout(ProcessorPanelLayout)
        ProcessorPanelLayout.setHorizontalGroup(
            ProcessorPanelLayout.
            createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                GroupLayout.Alignment.TRAILING,
                ProcessorPanelLayout.createSequentialGroup().addContainerGap(
                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(
                        tamperPayloadButton).addContainerGap(
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            ).addGroup(ProcessorPanelLayout.createSequentialGroup(
            ).addContainerGap().addGroup(
                ProcessorPanelLayout.createParallelGroup(
                    GroupLayout.Alignment.LEADING).addComponent(jSeparator2).
                addComponent(jScrollPane1).addComponent(jScrollPane2).addGroup(
                    ProcessorPanelLayout.createSequentialGroup().addGroup(
                        ProcessorPanelLayout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).addComponent(
                                jLabel3).addComponent(jLabel4).addGroup(
                                    ProcessorPanelLayout.createSequentialGroup(
                                    ).addComponent(jLabel1).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.
                                        UNRELATED).addComponent(
                                            self.comboProcessorTech,
                                            GroupLayout.PREFERRED_SIZE, 286,
                                            GroupLayout.PREFERRED_SIZE)).
                        addComponent(jLabel2)).addGap(
                            0, 78, Short.MAX_VALUE))).addContainerGap()))
        ProcessorPanelLayout.setVerticalGroup(
            ProcessorPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    ProcessorPanelLayout.createSequentialGroup().addGap(
                        33, 33, 33).addGroup(
                            ProcessorPanelLayout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).
                            addComponent(jLabel1).addComponent(
                                self.comboProcessorTech,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE)).addGap(
                                    18, 18, 18).addComponent(
                                        jSeparator2,
                                        GroupLayout.PREFERRED_SIZE, 10,
                                        GroupLayout.PREFERRED_SIZE).addGap(
                                            12, 12,
                                            12).addComponent(jLabel2).addGap(
                                                18, 18, 18).
                    addComponent(jLabel3).addPreferredGap(
                        LayoutStyle.ComponentPlacement.UNRELATED).addComponent(
                            jScrollPane1, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                LayoutStyle.ComponentPlacement.UNRELATED).
                    addComponent(jLabel4).addPreferredGap(
                        LayoutStyle.ComponentPlacement.UNRELATED).addComponent(
                            jScrollPane2, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                LayoutStyle.ComponentPlacement.UNRELATED).
                    addComponent(tamperPayloadButton).addGap(36, 36, 36)))

        ProcessorScrollPane.setViewportView(ProcessorPanel)

        TabbedPane1.addTab("Processor", ProcessorScrollPane)

        self.mainPanel = JPanel()
        layout = GroupLayout(self.mainPanel)
        self.mainPanel.setLayout(layout)
        layout.setHorizontalGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addComponent(
                    TabbedPane1, GroupLayout.DEFAULT_SIZE, 701,
                    Short.MAX_VALUE))
        layout.setVerticalGroup(
            layout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addComponent(TabbedPane1))

        TabbedPane1.getAccessibleContext().setAccessibleName("Generator")
コード例 #17
0
    def __init__(self, callbacks, table=None):

        self.callbacks = callbacks
        self.jScrollPane1 = JScrollPane()
        self.jPanel1 = JPanel()
        self.labelName = JLabel("Name")
        self.textName = JTextField()
        self.labelSeverity = JLabel("Severity")
        self.textSeverity = JTextField()
        self.labelHost = JLabel("Host")
        self.labelPath = JLabel("Path")
        self.textHost = JTextField()
        self.textPath = JTextField()
        self.tabIssue = JTabbedPane()
        self.textAreaDescription = JTextArea()
        self.textAreaRemediation = JTextArea()
        # JScrollPanes to hold the two jTextAreas
        # put the textareas in JScrollPanes
        self.jsPaneDescription = JScrollPane(self.textAreaDescription)
        self.jsPaneRemediation = JScrollPane(self.textAreaRemediation)
        self.panelRequest = self.callbacks.createMessageEditor(None, False)
        self.panelResponse = self.callbacks.createMessageEditor(None, False)

        self.loadPanel(self.defaultIssue)

        # buttons
        self.buttonNewIssue = JButton("New Issue",
                                      actionPerformed=self.newIssueAction)
        self.buttonDeleteIssue = JButton(
            "Delete Issue", actionPerformed=self.deleteIssueAction)
        self.buttonImport = JButton("Import",
                                    actionPerformed=self.importAction)
        self.buttonExport = JButton("Export",
                                    actionPerformed=self.exportAction)

        if table is not None:
            self.tableIssue = table
        else:
            from IssueTable import IssueTable
            self.tableIssue = IssueTable()

        # wrap the table in a scrollpane
        self.jScrollPane1.setViewportView(self.tableIssue)

        # top panel containing the table
        from java.awt import Color
        self.jPanel1.setBorder(BorderFactory.createLineBorder(Color(0, 0, 0)))

        # create the labels and textfields
        self.textName.editable = False
        self.textName.setBackground(Color.LIGHT_GRAY)

        self.textSeverity.editable = False
        self.textSeverity.setBackground(Color.LIGHT_GRAY)

        self.textHost.editable = False
        self.textHost.setBackground(Color.LIGHT_GRAY)

        self.textPath.editable = False
        self.textPath.setBackground(Color.LIGHT_GRAY)

        # description textarea
        self.textAreaDescription.editable = False
        self.textAreaDescription.setLineWrap(True)
        self.textAreaDescription.setWrapStyleWord(True)
        self.tabIssue.addTab("Description", self.jsPaneDescription)

        # remediation textarea
        self.textAreaRemediation.editable = False
        self.textAreaRemediation.setLineWrap(True)
        self.textAreaRemediation.setWrapStyleWord(True)
        self.tabIssue.addTab("Remediation", self.jsPaneRemediation)

        # request tab
        self.panelRequest.setMessage("", True)
        self.tabIssue.addTab("Request", self.panelRequest.getComponent())

        # response tab
        self.panelResponse.setMessage("", False)
        self.tabIssue.addTab("Response", self.panelResponse.getComponent())

        # from java.lang import Short
        # jpanel1 is the bottom panel
        jPanel1Layout = GroupLayout(self.jPanel1)
        self.jPanel1.setLayout(jPanel1Layout)
        jPanel1Layout.setHorizontalGroup(
            # GroupLayout.Alignment.CENTER centers the group, in this case it
            # centers the buttons
            jPanel1Layout.createParallelGroup(
                GroupLayout.Alignment.CENTER
            ).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.LEADING).
                addGroup(jPanel1Layout.createSequentialGroup().addGroup(
                    jPanel1Layout.createParallelGroup(
                        GroupLayout.Alignment.TRAILING).addComponent(
                            self.labelHost).addComponent(self.labelName)
                ).addPreferredGap(
                    LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                        jPanel1Layout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).addGroup(
                                jPanel1Layout.createSequentialGroup(
                                ).addComponent(self.textName).addPreferredGap(
                                    LayoutStyle.ComponentPlacement.UNRELATED).
                                addComponent(
                                    self.labelSeverity).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.
                                        RELATED).addComponent(
                                            self.textSeverity,
                                            GroupLayout.PREFERRED_SIZE, 186,
                                            GroupLayout.PREFERRED_SIZE)).
                        addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE, 330,
                                GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                    LayoutStyle.ComponentPlacement.RELATED
                                ).addComponent(self.labelPath).addPreferredGap(
                                    LayoutStyle.ComponentPlacement.RELATED).
                            addComponent(self.textPath)))).addComponent(
                                self.tabIssue)).addContainerGap()
                       ).addGroup(
                           jPanel1Layout.createSequentialGroup().addComponent(
                               self.buttonNewIssue).addComponent(
                                   self.buttonDeleteIssue).addComponent(
                                       self.buttonImport).addComponent(
                                           self.buttonExport)))

        # link size of buttons
        from javax.swing import SwingConstants
        jPanel1Layout.linkSize(SwingConstants.HORIZONTAL, [
            self.buttonDeleteIssue, self.buttonExport, self.buttonImport,
            self.buttonNewIssue
        ])

        jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(
        ).addGroup(
            jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelName).addComponent(
                            self.textName, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE).addComponent(
                                self.labelSeverity).addComponent(
                                    self.textSeverity,
                                    GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.textHost, GroupLayout.PREFERRED_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE).addComponent(
                            self.labelPath).addComponent(
                                self.textPath, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.labelHost)).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(self.tabIssue).addPreferredGap(
                LayoutStyle.ComponentPlacement.RELATED).addGroup(
                    jPanel1Layout.createParallelGroup().addComponent(
                        self.buttonNewIssue).addComponent(
                            self.buttonDeleteIssue).addComponent(
                                self.buttonImport).addComponent(
                                    self.buttonExport)).addContainerGap()))

        # create the main panel
        self.panel = JSplitPane(JSplitPane.VERTICAL_SPLIT)

        # set the top component
        self.panel.leftComponent = self.jScrollPane1
        self.panel.rightComponent = self.jPanel1
        self.panel.setDividerLocation(150)
コード例 #18
0
    def initUI(self):

        layout = GroupLayout(self.pane)
        self.pane.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)

        bc = settings.getBool("boot.use", False)
        self.useBs = JCheckBox("Use bootstrap", bc)
        binLabel = JLabel("Bootstrap file: ")
        self.binTxt = JTextField()
        self.binTxt.text = settings.getString("boot.path", "")
        self.binBtn = JButton("Load", actionPerformed=mplab_chooseBootstrap)

        entryLabel = JLabel("Bootstrap entry address (if bin): ")
        self.entryTxt = JTextField()
        self.entryTxt.text = settings.getString("boot.entry_adr", "")

        prjLabel = JLabel("Bootstrap project: ")
        self.prjTxt = JTextField()
        self.prjTxt.text = settings.getString("boot.prj", "")

        loadLabel = JLabel("Bootstrap load address (if bin): ")

        self.loadTxt = JTextField()
        self.loadTxt.text = settings.getString("boot.load_adr", "")

        layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(
            layout.createParallelGroup().addComponent(
                self.useBs).addComponent(prjLabel).addComponent(binLabel).
            addComponent(entryLabel).addComponent(loadLabel)).addGroup(
                layout.createParallelGroup()
                #                .addComponent(self.useBs)
                .addComponent(self.prjTxt).addComponent(
                    self.binTxt).addComponent(self.entryTxt).addComponent(
                        self.loadTxt)).addGroup(
                            layout.createParallelGroup().addComponent(
                                self.binBtn)))

        layout.setVerticalGroup(layout.createSequentialGroup().addGroup(
            layout.createParallelGroup().addComponent(self.useBs)
        ).addGroup(
            layout.createParallelGroup().addComponent(prjLabel).addComponent(
                self.prjTxt, GroupLayout.PREFERRED_SIZE,
                GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        ).addGroup(
            layout.createParallelGroup().addComponent(binLabel).addComponent(
                self.binTxt, GroupLayout.PREFERRED_SIZE,
                GroupLayout.DEFAULT_SIZE,
                GroupLayout.PREFERRED_SIZE).addComponent(self.binBtn)
        ).addGroup(
            layout.createParallelGroup().addComponent(entryLabel).addComponent(
                self.entryTxt, GroupLayout.PREFERRED_SIZE,
                GroupLayout.DEFAULT_SIZE,
                GroupLayout.PREFERRED_SIZE)).addGroup(
                    layout.createParallelGroup().addComponent(
                        loadLabel).addComponent(self.loadTxt,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE)))
        self.panel.add(self.pane, BorderLayout.CENTER)
コード例 #19
0
    def __init__(self):
        self.listModel = DefaultListModel()

        self.cbTitle = JLabel("Out-of-band Payloads")
        self.cbTitle.setFont(self.cbTitle.getFont().deriveFont(14.0))
        self.cbTitle.setFont(self.cbTitle.getFont().deriveFont(Font.BOLD))

        self.cbSubTitle = JLabel(
            "Add payloads to active scanner that interact "
            "with out-of-band services (e.g., XSSHunter)")
        self.cbSubTitle.setFont(self.cbSubTitle.getFont().deriveFont(12.0))

        self.cbList = JList(self.listModel)
        self.cbList.setCellRenderer(ListRenderer())
        self.cbList.setVisibleRowCount(10)

        self.listScrollPane = JScrollPane(self.cbList)
        self.cbText = JTextField(actionPerformed=self.add_element)
        self.cbRemoveButton = JButton("Remove",
                                      actionPerformed=self.remove_element)
        self.cbLoadButton = JButton("Load...", actionPerformed=self.add_file)
        self.cbPasteButton = JButton("Paste",
                                     actionPerformed=self.paste_elements)
        self.cbClearButton = JButton("Clear",
                                     actionPerformed=self.clear_elements)

        self.cbAddButton = JButton("Add", actionPerformed=self.add_element)

        self.cbDropDownLabel = JLabel("Payload Encoding: ")
        self.cbDropDown = JComboBox()
        self.cbDropDown.addItem("Non URL Encoded")
        self.cbDropDown.addItem("URL Encoded")
        self.cbDropDown.addItem("Both (two requests per payload)")

        self.grpOOB = JPanel()

        grpLayout = GroupLayout(self.grpOOB)
        self.grpOOB.setLayout(grpLayout)
        grpLayout.linkSize(SwingConstants.HORIZONTAL, self.cbRemoveButton,
                           self.cbLoadButton, self.cbPasteButton,
                           self.cbClearButton, self.cbAddButton)
        grpLayout.setAutoCreateGaps(True)
        grpLayout.setAutoCreateContainerGaps(True)
        grpLayout.setHorizontalGroup(
            grpLayout.createSequentialGroup().addGroup(
                grpLayout.createParallelGroup().addComponent(
                    self.cbTitle).addGroup(
                        grpLayout.createParallelGroup().addComponent(
                            self.cbRemoveButton).addComponent(
                                self.cbLoadButton).addComponent(
                                    self.cbPasteButton).addComponent(
                                        self.cbClearButton)).addComponent(
                                            self.cbAddButton).
                addComponent(self.cbDropDownLabel)).addGroup(
                    grpLayout.createParallelGroup().addComponent(
                        self.cbSubTitle).addComponent(
                            self.listScrollPane).addComponent(
                                self.cbText).addComponent(self.cbDropDown)))
        grpLayout.setVerticalGroup(grpLayout.createSequentialGroup().addGroup(
            grpLayout.createParallelGroup().addComponent(self.cbTitle)
        ).addGroup(grpLayout.createParallelGroup().addComponent(
            self.cbSubTitle)).addGroup(
                grpLayout.createParallelGroup().addGroup(
                    grpLayout.createSequentialGroup().addComponent(
                        self.cbPasteButton).addComponent(
                            self.cbLoadButton).addComponent(
                                self.cbRemoveButton).addComponent(
                                    self.cbClearButton)).addComponent(
                                        self.listScrollPane)
            ).addGroup(grpLayout.createParallelGroup().addComponent(
                self.cbAddButton).addComponent(self.cbText)).addGroup(
                    grpLayout.createParallelGroup().addComponent(
                        self.cbDropDownLabel).addComponent(self.cbDropDown)))

        # Tab Layout
        self.tab = JPanel()
        tabLayout = GroupLayout(self.tab)
        self.tab.setLayout(tabLayout)
        tabLayout.setAutoCreateGaps(True)
        tabLayout.setAutoCreateContainerGaps(True)
        tabLayout.setHorizontalGroup(
            tabLayout.createSequentialGroup().addGroup(
                tabLayout.createParallelGroup().addComponent(
                    self.grpOOB, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)))
        tabLayout.setVerticalGroup(tabLayout.createSequentialGroup().addGroup(
            tabLayout.createParallelGroup().addComponent(
                self.grpOOB, GroupLayout.PREFERRED_SIZE,
                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)))
コード例 #20
0
ファイル: burp_extension.py プロジェクト: cc06/tplmap
    def __initLayout__(self):
        self._levelComboBox = JComboBox()
        levelComboBoxSize = Dimension(300, 30)
        self._levelComboBox.setPreferredSize(levelComboBoxSize)
        self._levelComboBox.setMaximumSize(levelComboBoxSize)
        for level in range(0, 6):
            self._levelComboBox.addItem(str(level))

        self._techRenderedCheckBox = JCheckBox('Rendered', True)
        self._techTimebasedCheckBox = JCheckBox('Time-based', True)

        self._plugin_groups = {}
        for plugin in plugins:
            parent = plugin.__base__.__name__
            if not self._plugin_groups.has_key(parent):
                self._plugin_groups[parent] = []
            self._plugin_groups[parent].append(plugin)
        self._pluginCheckBoxes = []
        for pluginGroup in self._plugin_groups.values():
            for plugin in pluginGroup:
                self._pluginCheckBoxes.append(PluginCheckBox(plugin))

        self._positionReplaceCheckBox = JCheckBox('Replace', True)
        self._positionAppendCheckBox = JCheckBox('Append', False)

        displayItems = ({
            'label':
            'Level',
            'components': (self._levelComboBox, ),
            'description':
            'Level of code context escape to perform (1-5, Default:0).'
        }, {
            'label':
            'Techniques',
            'components': (
                self._techRenderedCheckBox,
                self._techTimebasedCheckBox,
            ),
            'description':
            'Techniques R(endered) T(ime-based blind). Default: RT.'
        }, {
            'label':
            'Template Engines',
            'components':
            self._pluginCheckBoxes,
            'description':
            'Force back-end template engine to this value(s).'
        }, {
            'label':
            'Payload position',
            'components': (
                self._positionReplaceCheckBox,
                self._positionAppendCheckBox,
            ),
            'description':
            'Scan payload position. This feature only appears in BurpExtension.'
        })

        layout = GroupLayout(self)
        self.setLayout(layout)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)

        labelWidth = 200
        hgroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        vgroup = layout.createSequentialGroup()
        for displayItem in displayItems:
            label = JLabel(displayItem.get('label'))
            label.setToolTipText(displayItem.get('description'))
            _hgroup = layout.createSequentialGroup().addComponent(
                label, labelWidth, labelWidth, labelWidth)
            _vgroup = layout.createParallelGroup(
                GroupLayout.Alignment.BASELINE).addComponent(label)
            for component in displayItem.get('components'):
                _hgroup.addComponent(component)
                _vgroup.addComponent(component)
            hgroup.addGroup(_hgroup)
            vgroup.addGroup(_vgroup)

        layout.setHorizontalGroup(hgroup)
        layout.setVerticalGroup(vgroup)
コード例 #21
0
    def createTabGUI(self):
        """ Create GUI for this tabbed pane """

        # panel for the whole tab
        self.firstTab = JPanel()

        # name of the extention
        self.titleTop = JLabel("Timing Attack")
        self.titleTop.setFont(Font("Tahoma", 1, 14))
        self.titleTop.setForeground(Color(255, 102, 51))

        # info about the extention
        self.infoTop = JLabel(
            "Timing Attack is a open source extention to inform how long the system takes to respond for a valid and an invalid authentication."
        )
        self.infoTop.setFont(Font("Tahoma", 0, 11))

        # labels and inputs on top half
        self.addTitle = JLabel("Enter a Valid and an Invalid Username")
        self.addTitle.setFont(Font("Tahoma", 1, 13))
        self.addTitle.setForeground(Color(255, 102, 51))
        self.validUsername = JLabel("Valid Username")
        self.validUsername.setFont(Font("Tahoma", 0, 12))
        self.invalidUsername = JLabel("Invalid Username")
        self.invalidUsername.setFont(Font("Tahoma", 0, 12))
        self.parameter = JLabel("Parameter")
        self.parameter.setFont(Font("Tahoma", 0, 12))
        self.average = JLabel("Sample Size")
        self.average.setFont(Font("Tahoma", 0, 12))
        self.addValid = JTextField("")
        self.addInvalid = JTextField("")
        self.addParameter = JTextField("")
        self.addAverage = JTextField("")
        self.submitButton1 = JButton("Submit",
                                     actionPerformed=self.timeTwoUsers)

        # result on top left
        self.resultTitle = JLabel("Result")
        self.resultTitle.setFont(Font("Tahoma", 1, 13))
        self.resultTitle.setForeground(Color(255, 102, 51))
        self.showResults = JTextArea("")
        self.showResults.setEditable(False)
        self.showResultsScroll = JScrollPane(self.showResults)
        self.twoUserViewResult = JButton("View Results",
                                         actionPerformed=self.showResultsTop)
        self.twoUserViewReq = JButton("View Request",
                                      actionPerformed=self.showRequestTop)
        self.twoUserViewValidResponse = JButton(
            "View Valid Response", actionPerformed=self.showValidResponseTop)
        self.twoUserViewInvalidResponse = JButton(
            "View Invalid Response",
            actionPerformed=self.showInvalidResponseTop)
        # Set top buttons to invisible until a request is submitted
        self.twoUserViewResult.setVisible(False)
        self.twoUserViewReq.setVisible(False)
        self.twoUserViewValidResponse.setVisible(False)
        self.twoUserViewInvalidResponse.setVisible(False)

        # labels, inputs and file on bottom half
        self.addTitleFile = JLabel("Input Username File")
        self.addTitleFile.setFont(Font("Tahoma", 1, 13))
        self.addTitleFile.setForeground(Color(255, 102, 51))
        self.inputFileButton = JButton("Choose File...",
                                       actionPerformed=self.chooseFile)
        self.separatorList = JLabel("Separator")
        self.separatorList.setFont(Font("Tahoma", 0, 12))
        self.parameterList = JLabel("Parameter")
        self.parameterList.setFont(Font("Tahoma", 0, 12))
        self.averageList = JLabel("Sample Size")
        self.averageList.setFont(Font("Tahoma", 0, 12))
        self.addSeparatorList = JTextField("")
        self.addParameterList = JTextField("")
        self.addAverageList = JTextField("")
        self.submitButton2 = JButton("Submit",
                                     actionPerformed=self.timeUserList)

        # result on bottom left
        self.resultTitleList = JLabel("Result")
        self.resultTitleList.setFont(Font("Tahoma", 1, 13))
        self.resultTitleList.setForeground(Color(255, 102, 51))
        self.showResultsList = JTextArea("")
        self.showResultsList.setEditable(False)
        self.showResultsListScroll = JScrollPane(self.showResultsList)
        self.downloadResultList = JButton("Download Display",
                                          actionPerformed=self.downloadResults)
        self.listViewResults = JButton("View Results",
                                       actionPerformed=self.showListResults)
        self.listViewReq = JButton("View Request",
                                   actionPerformed=self.showListRequest)
        self.listViewResponses = JButton(
            "View Responses", actionPerformed=self.showListResponses)
        # Set list buttons to invisible until a request is submitted
        self.downloadResultList.setVisible(False)
        self.listViewResults.setVisible(False)
        self.listViewReq.setVisible(False)
        self.listViewResponses.setVisible(False)

        # something wrong?
        self.somethingWrong = JLabel("Something Wrong?")
        self.debugOn = False
        self.viewDebug = JButton("View debug output",
                                 actionPerformed=self.showDebug)
        self.debugText = JTextArea("")
        self.debugTextScroll = JScrollPane(self.debugText)
        self.debugTextScroll.setVisible(False)

        # layout
        layout = GroupLayout(self.firstTab)
        self.firstTab.setLayout(layout)

        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            # whole layout
            .addGroup(
                layout.createSequentialGroup().addGap(15)
                # title + description
                .addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(
                            self.titleTop).addComponent(self.infoTop)
                    # titles
                    .addGroup(
                        layout.createSequentialGroup()
                        # title left
                        .addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.addTitle)).addGap(168)
                        # title right
                        .addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.resultTitle))).
                    addGroup(
                        layout.createSequentialGroup()
                        # left
                        .addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.validUsername).addComponent(
                                        self.invalidUsername).addComponent(
                                            self.parameter).addComponent(
                                                self.average).addComponent(
                                                    self.addTitleFile).
                            addComponent(self.inputFileButton).addComponent(
                                self.separatorList).addComponent(
                                    self.parameterList).addComponent(
                                        self.averageList).addComponent(
                                            self.somethingWrong)).addGap(12).
                        addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.addValid, GroupLayout.PREFERRED_SIZE,
                                    200,
                                    GroupLayout.PREFERRED_SIZE).addComponent(
                                        self.addInvalid,
                                        GroupLayout.PREFERRED_SIZE, 200,
                                        GroupLayout.PREFERRED_SIZE).
                            addComponent(
                                self.addParameter,
                                GroupLayout.PREFERRED_SIZE, 200,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.addAverage,
                                    GroupLayout.PREFERRED_SIZE, 80,
                                    GroupLayout.PREFERRED_SIZE).addComponent(
                                        self.submitButton1).addComponent(
                                            self.addSeparatorList,
                                            GroupLayout.PREFERRED_SIZE, 200,
                                            GroupLayout.PREFERRED_SIZE).
                            addComponent(
                                self.addParameterList,
                                GroupLayout.PREFERRED_SIZE, 200,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.addAverageList,
                                    GroupLayout.PREFERRED_SIZE, 80,
                                    GroupLayout.PREFERRED_SIZE).addComponent(
                                        self.submitButton2).addComponent(
                                            self.viewDebug)).addGap(50)
                        # right
                        .addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.showResultsScroll,
                                    GroupLayout.PREFERRED_SIZE, 600,
                                    GroupLayout.PREFERRED_SIZE).
                            addGroup(layout.createSequentialGroup().addGroup(
                                layout.createParallelGroup(
                                    GroupLayout.Alignment.LEADING).
                                addComponent(self.twoUserViewResult)
                            ).addGap(15).addGroup(
                                layout.createParallelGroup(
                                    GroupLayout.Alignment.LEADING).
                                addComponent(
                                    self.twoUserViewReq)).addGap(15).addGroup(
                                        layout.createParallelGroup(
                                            GroupLayout.Alignment.LEADING).
                                        addComponent(
                                            self.twoUserViewValidResponse)
                                    ).addGap(15).addGroup(
                                        layout.createParallelGroup(
                                            GroupLayout.Alignment.LEADING).
                                        addComponent(
                                            self.twoUserViewInvalidResponse))).
                            addComponent(self.resultTitleList).addComponent(
                                self.showResultsListScroll,
                                GroupLayout.PREFERRED_SIZE, 600,
                                GroupLayout.PREFERRED_SIZE).addGroup(
                                    layout.createSequentialGroup().addGroup(
                                        layout.createParallelGroup(
                                            GroupLayout.Alignment.LEADING).
                                        addComponent(self.downloadResultList)).
                                    addGap(15).addGroup(
                                        layout.createParallelGroup(
                                            GroupLayout.Alignment.LEADING).
                                        addComponent(self.listViewResults)
                                    ).addGap(15).addGroup(
                                        layout.createParallelGroup(
                                            GroupLayout.Alignment.LEADING).
                                        addComponent(self.listViewReq)
                                    ).addGap(15).addGroup(
                                        layout.createParallelGroup(
                                            GroupLayout.Alignment.LEADING).
                                        addComponent(self.listViewResponses)
                                    )).addGap(10).addComponent(
                                        self.debugTextScroll,
                                        GroupLayout.PREFERRED_SIZE, 300,
                                        GroupLayout.PREFERRED_SIZE))))))

        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            # whole layout
            .addGroup(
                layout.createSequentialGroup().addGap(15).addComponent(
                    self.titleTop).addGap(10).addComponent(
                        self.infoTop).addGap(10)
                # titles
                .addGroup(
                    layout.createSequentialGroup()
                    # left
                    .addGroup(
                        layout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).addComponent(
                                self.addTitle).addGap(25)
                        # right
                        .addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.LEADING).addComponent(
                                    self.resultTitle))))
                # top half
                .addGroup(
                    layout.createSequentialGroup()
                    # left top half
                    .addGroup(
                        layout.createParallelGroup(
                            GroupLayout.Alignment.BASELINE).
                        addGroup(layout.createSequentialGroup().addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.validUsername).addGap(5).addComponent(
                                        self.addValid,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.invalidUsername).addGap(
                                        5).addComponent(
                                            self.addInvalid,
                                            GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.parameter).addGap(5).addComponent(
                                        self.addParameter,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.average).addGap(5).addComponent(
                                        self.addAverage,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.submitButton1))).addGap(5)
                        # right top half
                        .addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.showResultsScroll,
                                    GroupLayout.PREFERRED_SIZE, 200,
                                    GroupLayout.PREFERRED_SIZE)))).addGap(5)
                # buttons + titles
                .addGroup(layout.createSequentialGroup().addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.BASELINE).addComponent(
                            self.twoUserViewResult).addGap(20).addComponent(
                                self.twoUserViewReq).addGap(20).addComponent(
                                    self.twoUserViewValidResponse).addGap(20).
                    addComponent(
                        self.twoUserViewInvalidResponse)).addGap(10).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.addTitleFile).addGap(25).addComponent(
                                        self.resultTitleList))).addGap(3)
                # bottom half
                .addGroup(
                    layout.createSequentialGroup()
                    # left bottom half
                    .addGroup(
                        layout.createParallelGroup(
                            GroupLayout.Alignment.BASELINE).
                        addGroup(layout.createSequentialGroup().addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.inputFileButton)
                        ).addGap(10).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.separatorList).addGap(5).addComponent(
                                        self.addSeparatorList,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.parameterList).addGap(5).addComponent(
                                        self.addParameterList,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.averageList).addGap(5).addComponent(
                                        self.addAverageList,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                        ).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.submitButton2)
                        )).addGap(5).addGroup(
                            layout.createParallelGroup(
                                GroupLayout.Alignment.BASELINE).addComponent(
                                    self.showResultsListScroll,
                                    GroupLayout.PREFERRED_SIZE, 200,
                                    GroupLayout.PREFERRED_SIZE)))).addGap(5)
                # right bottom half
                .addGroup(layout.createSequentialGroup().addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.BASELINE).addComponent(
                            self.downloadResultList).addGap(10).addComponent(
                                self.listViewResults).addGap(10).addComponent(
                                    self.listViewReq).addGap(10).addComponent(
                                        self.listViewResponses))).addGap(30)
                # something wrong section
                .addGroup(layout.createSequentialGroup().addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.BASELINE).addComponent(
                            self.somethingWrong).addGap(10).addComponent(
                                self.viewDebug).addGap(10).addComponent(
                                    self.debugTextScroll,
                                    GroupLayout.PREFERRED_SIZE, 150,
                                    GroupLayout.PREFERRED_SIZE)))))
        return
コード例 #22
0
    def __init__(self):
        self.jScrollPane1 = JScrollPane()
        self.jTable1 = JTable()
        self.jPanel1 = JPanel()
        self.labelName = JLabel()
        self.textName = JTextField()
        self.labelSeverity = JLabel()
        self.comboSeverity = None
        self.labelHost = JLabel()
        self.labelPath = JLabel()
        self.textHost = JTextField()
        self.textPath = JTextField()
        self.tabIssue = JTabbedPane()
        self.panelDescription = JPanel()
        self.panelRequest = JPanel()
        self.panelResponse = JPanel()
        self.panelRemediation = JPanel()

        # setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)

        # setting up the table
        # initial data in the table
        tableData = [[None, None, None, None, None],
                     [None, None, None, None, None],
                     [None, None, None, None, None]]
        tableColumns = ["#", "Issue Type/Name", "Severity", "Host", "Path"]
        # create the table model
        tableModel = table.DefaultTableModel(tableData, tableColumns)
        # model.types = array.array([java.lang.Integer.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class], java.lang.Class)
        # model.canEdit = array.array([False, False, False, False, False], java.lang.Boolean)
        # public Class getColumnClass(int columnIndex) {
        # return types [columnIndex]
        # }
        #
        # public boolean isCellEditable(int rowIndex, int columnIndex) {
        # return canEdit [columnIndex]
        # }

        # set the table model
        # if this fails, we have to use
        self.jTable1.setModel(tableModel)
        self.jTable1.setAutoCreateRowSorter(True)

        # wrap the table in a scrollpane
        self.jScrollPane1.setViewportView(self.jTable1)

        # top panel containing the table
        from java.awt import Color
        self.jPanel1.setBorder(BorderFactory.createLineBorder(Color(0, 0, 0)))

        # create the labels and textfields
        self.labelName.text = "Issue Type/Name"
        self.textName.text = "Issue Name/Type"
        self.labelSeverity.text = "Severity"
        # create and populate the combobox
        self.comboSeverity = JComboBox(
            ["Critical", "High", "Medium", "Low", "Info"])

        self.labelHost.text = "Host"
        self.labelPath.text = "Path"
        self.textHost.text = "Issue Host"
        self.textPath.text = "Issue Path"

        from java.lang import Short
        # description panel
        panelDescriptionLayout = GroupLayout(self.panelDescription)
        self.panelDescription.setLayout(panelDescriptionLayout)
        panelDescriptionLayout.setHorizontalGroup(
            panelDescriptionLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelDescriptionLayout.setVerticalGroup(
            panelDescriptionLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Description", self.panelDescription)

        # request tab
        panelRequestLayout = GroupLayout(self.panelRequest)
        self.panelRequest.setLayout(panelRequestLayout)
        panelRequestLayout.setHorizontalGroup(
            panelRequestLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelRequestLayout.setVerticalGroup(
            panelRequestLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Request", self.panelRequest)

        # response tab
        panelResponseLayout = GroupLayout(self.panelResponse)
        self.panelResponse.setLayout(panelResponseLayout)
        panelResponseLayout.setHorizontalGroup(
            panelResponseLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelResponseLayout.setVerticalGroup(
            panelResponseLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Response", self.panelResponse)

        # remediation tab
        panelRemediationLayout = GroupLayout(self.panelRemediation)
        self.panelRemediation.setLayout(panelRemediationLayout)
        panelRemediationLayout.setHorizontalGroup(
            panelRemediationLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelRemediationLayout.setVerticalGroup(
            panelRemediationLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Remediation", self.panelRemediation)

        # jpanel1?
        jPanel1Layout = GroupLayout(self.jPanel1)
        self.jPanel1.setLayout(jPanel1Layout)
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).
            addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.LEADING).
                addGroup(jPanel1Layout.createSequentialGroup().addGroup(
                    jPanel1Layout.createParallelGroup(
                        GroupLayout.Alignment.TRAILING).addComponent(
                            self.labelHost).addComponent(
                                self.labelSeverity).addComponent(
                                    self.labelName)
                ).addPreferredGap(
                    LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                        jPanel1Layout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).
                        addComponent(self.textName).addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.comboSeverity, GroupLayout.PREFERRED_SIZE,
                                98, GroupLayout.PREFERRED_SIZE).addGap(
                                    0, 0, Short.MAX_VALUE)).
                        addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE, 330,
                                GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).
                            addComponent(self.labelPath).addPreferredGap(
                                LayoutStyle.ComponentPlacement.RELATED
                            ).addComponent(self.textPath)))).addComponent(
                                self.tabIssue)).addContainerGap()))

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).
            addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelName).addComponent(
                            self.textName, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelSeverity).addComponent(
                            self.comboSeverity, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelHost).addComponent(
                            self.labelPath).addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.textPath, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)).
                     addPreferredGap(
                         LayoutStyle.ComponentPlacement.RELATED).addComponent(
                             self.tabIssue).addContainerGap()))

        # create the main panel
        self.panel = JPanel()
        layout = GroupLayout(self.panel)
        self.panel.setLayout(layout)
        layout.setAutoCreateGaps(True)

        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addContainerGap().addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(
                            self.jPanel1, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE).addComponent(
                                self.jScrollPane1)).addContainerGap()))
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addContainerGap().addComponent(
                    self.jScrollPane1, GroupLayout.PREFERRED_SIZE, 119,
                    GroupLayout.PREFERRED_SIZE).addGap(
                        18, 18,
                        18).addComponent(self.jPanel1,
                                         GroupLayout.DEFAULT_SIZE,
                                         GroupLayout.DEFAULT_SIZE,
                                         Short.MAX_VALUE).addContainerGap()))
コード例 #23
0
ファイル: NBPanel.py プロジェクト: sethludwig/Parsia-Code
    def __init__(self):
        self.jScrollPane1 = JScrollPane()
        self.jTable1 = JTable()
        self.jPanel1 = JPanel()
        self.labelName = JLabel()
        self.textName = JTextField()
        self.labelSeverity = JLabel()
        self.comboSeverity = None
        self.labelHost = JLabel()
        self.labelPath = JLabel()
        self.textHost = JTextField()
        self.textPath = JTextField()
        self.tabIssue = JTabbedPane()
        self.panelDescription = JPanel()
        self.panelRequest = JPanel()
        self.panelResponse = JPanel()
        self.panelRemediation = JPanel()

        # setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)

        # setting up the table
        # initial data in the table
        tableData = [
            [3, "Issue3", "Severity3", "Host3", "Path3"],
            [1, "Issue1", "Severity1", "Host1", "Path1"],
            [2, "Issue2", "Severity2", "Host2", "Path2"],
        ]
        tableHeadings = ["#", "Issue Type/Name", "Severity", "Host", "Path"]
        from IssueTable import IssueTable
        self.jTable1 = IssueTable(tableData, tableHeadings)

        # wrap the table in a scrollpane
        self.jScrollPane1.setViewportView(self.jTable1)

        # top panel containing the table
        from java.awt import Color
        self.jPanel1.setBorder(BorderFactory.createLineBorder(Color(0, 0, 0)))

        # create the labels and textfields
        self.labelName.text = "Issue Type/Name"
        self.textName.text = "Issue Name/Type"
        self.textName.editable = False
        self.labelSeverity.text = "Severity"
        # create and populate the combobox
        self.comboSeverity = JComboBox(
            ["Critical", "High", "Medium", "Low", "Info"])

        self.labelHost.text = "Host"
        self.labelPath.text = "Path"
        self.textHost.text = "Issue Host"
        self.textHost.editable = False
        self.textPath.text = "Issue Path"
        self.textPath.editable = False

        from java.lang import Short
        # description panel
        panelDescriptionLayout = GroupLayout(self.panelDescription)
        self.panelDescription.setLayout(panelDescriptionLayout)
        panelDescriptionLayout.setHorizontalGroup(
            panelDescriptionLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelDescriptionLayout.setVerticalGroup(
            panelDescriptionLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Description", self.panelDescription)

        # request tab
        panelRequestLayout = GroupLayout(self.panelRequest)
        self.panelRequest.setLayout(panelRequestLayout)
        panelRequestLayout.setHorizontalGroup(
            panelRequestLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelRequestLayout.setVerticalGroup(
            panelRequestLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Request", self.panelRequest)

        # response tab
        panelResponseLayout = GroupLayout(self.panelResponse)
        self.panelResponse.setLayout(panelResponseLayout)
        panelResponseLayout.setHorizontalGroup(
            panelResponseLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelResponseLayout.setVerticalGroup(
            panelResponseLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Response", self.panelResponse)

        # remediation tab
        panelRemediationLayout = GroupLayout(self.panelRemediation)
        self.panelRemediation.setLayout(panelRemediationLayout)
        panelRemediationLayout.setHorizontalGroup(
            panelRemediationLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelRemediationLayout.setVerticalGroup(
            panelRemediationLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Remediation", self.panelRemediation)

        # jpanel1?
        jPanel1Layout = GroupLayout(self.jPanel1)
        self.jPanel1.setLayout(jPanel1Layout)
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).
            addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.LEADING).
                addGroup(jPanel1Layout.createSequentialGroup().addGroup(
                    jPanel1Layout.createParallelGroup(
                        GroupLayout.Alignment.TRAILING).addComponent(
                            self.labelHost).addComponent(
                                self.labelSeverity).addComponent(
                                    self.labelName)
                ).addPreferredGap(
                    LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                        jPanel1Layout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).
                        addComponent(self.textName).addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.comboSeverity, GroupLayout.PREFERRED_SIZE,
                                98, GroupLayout.PREFERRED_SIZE).addGap(
                                    0, 0, Short.MAX_VALUE)).
                        addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE, 330,
                                GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).
                            addComponent(self.labelPath).addPreferredGap(
                                LayoutStyle.ComponentPlacement.RELATED
                            ).addComponent(self.textPath)))).addComponent(
                                self.tabIssue)).addContainerGap()))

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).
            addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelName).addComponent(
                            self.textName, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelSeverity).addComponent(
                            self.comboSeverity, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelHost).addComponent(
                            self.labelPath).addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.textPath, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)).
                     addPreferredGap(
                         LayoutStyle.ComponentPlacement.RELATED).addComponent(
                             self.tabIssue).addContainerGap()))

        # create the main panel
        self.panel = JPanel()
        layout = GroupLayout(self.panel)
        self.panel.setLayout(layout)
        layout.setAutoCreateGaps(True)

        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addContainerGap().addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(
                            self.jPanel1, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE).addComponent(
                                self.jScrollPane1)).addContainerGap()))
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addContainerGap().addComponent(
                    self.jScrollPane1, GroupLayout.PREFERRED_SIZE, 119,
                    GroupLayout.PREFERRED_SIZE).addGap(
                        18, 18,
                        18).addComponent(self.jPanel1,
                                         GroupLayout.DEFAULT_SIZE,
                                         GroupLayout.DEFAULT_SIZE,
                                         Short.MAX_VALUE).addContainerGap()))
コード例 #24
0
    def registerExtenderCallbacks(self, callbacks):
        print "Load:" + self._name + " " + self._version

        self.callbacks = callbacks
        self.helpers = callbacks.helpers

        #Create Tab layout
        self.jVarsPane = JTextPane()
        self.jVarsPane.setFont(Font('Monospaced', Font.PLAIN, 11))
        self.jVarsPane.addFocusListener(self)

        self.jMenuPanel = JPanel()
        self.jLeftUpPanel = JPanel()

        self.jEnable = JCheckBox()
        self.jEnable.setFont(Font('Monospaced', Font.BOLD, 11))
        self.jEnable.setForeground(Color(0, 0, 204))
        self.jEnable.setText(self._name)
        self.jEnable.addActionListener(self)

        self.jDocs = JLabel()
        self.jDocs.setFont(Font('Monospaced', Font.PLAIN, 11))
        self.jDocs.setForeground(Color(51, 102, 255))
        self.jDocs.setText(Strings.docs_titel)
        self.jDocs.setToolTipText(Strings.docs_tooltip)
        self.jDocs.addMouseListener(self)

        self.jConsoleText = JTextArea()
        self.jConsoleText.setFont(Font('Monospaced', Font.PLAIN, 10))
        self.jConsoleText.setBackground(Color(244, 246, 247))
        self.jConsoleText.setEditable(0)
        self.jConsoleText.setWrapStyleWord(1)
        self.jConsoleText.setRows(10)
        self.jScrollConsolePane = JScrollPane()
        self.jScrollConsolePane.setViewportView(self.jConsoleText)
        #set initial text
        self.jConsoleText.setText(Strings.console_disable)

        self.jMenuPanelLayout = GroupLayout(self.jMenuPanel)
        self.jMenuPanel.setLayout(self.jMenuPanelLayout)
        self.jMenuPanelLayout.setHorizontalGroup(
            self.jMenuPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    self.jMenuPanelLayout.createSequentialGroup().addComponent(
                        self.jEnable).addPreferredGap(
                            LayoutStyle.ComponentPlacement.RELATED, 205,
                            32767).addComponent(self.jDocs)))

        self.jMenuPanelLayout.setVerticalGroup(
            self.jMenuPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    self.jMenuPanelLayout.createSequentialGroup().addGroup(
                        self.jMenuPanelLayout.createParallelGroup(
                            GroupLayout.Alignment.BASELINE).addComponent(
                                self.jEnable).addComponent(self.jDocs)).addGap(
                                    0, 7, 32767)))

        self.jConsolePane = JPanel()
        self.jConsoleLayout = GroupLayout(self.jConsolePane)
        self.jConsolePane.setLayout(self.jConsoleLayout)
        self.jConsoleLayout.setHorizontalGroup(
            self.jConsoleLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addComponent(
                    self.jScrollConsolePane))
        self.jConsoleLayout.setVerticalGroup(
            self.jConsoleLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGroup(
                    GroupLayout.Alignment.TRAILING,
                    self.jConsoleLayout.createSequentialGroup().addComponent(
                        self.jScrollConsolePane, GroupLayout.DEFAULT_SIZE, 154,
                        32767).addContainerGap()))
        self.jLeftUpPanelLayout = GroupLayout(self.jLeftUpPanel)
        self.jLeftUpPanel.setLayout(self.jLeftUpPanelLayout)
        self.jLeftUpPanelLayout.setHorizontalGroup(
            self.jLeftUpPanelLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addComponent(
                    self.jConsolePane, GroupLayout.DEFAULT_SIZE,
                    GroupLayout.DEFAULT_SIZE,
                    32767).addComponent(self.jMenuPanel,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE))
        self.jLeftUpPanelLayout.setVerticalGroup(
            self.jLeftUpPanelLayout.
            createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                GroupLayout.Alignment.TRAILING,
                self.jLeftUpPanelLayout.createSequentialGroup().addComponent(
                    self.jMenuPanel, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.DEFAULT_SIZE,
                    GroupLayout.PREFERRED_SIZE).addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED).addComponent(
                            self.jConsolePane, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, 32767)))

        self.jScrollpaneLeftDown = JScrollPane()
        self.jScrollpaneLeftDown.setViewportView(self.jVarsPane)

        self.jSplitPaneLeft = JSplitPane(JSplitPane.VERTICAL_SPLIT,
                                         self.jLeftUpPanel,
                                         self.jScrollpaneLeftDown)
        self.jSplitPaneLeft.setDividerLocation(300)

        self.jScriptPane = JTextPane()
        self.jScriptPane.setFont(Font('Monospaced', Font.PLAIN, 11))
        self.jScriptPane.addMouseListener(self)

        self.JScrollPaneRight = JScrollPane()
        self.JScrollPaneRight.setViewportView(self.jScriptPane)

        self.jSplitPane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                                     self.jSplitPaneLeft,
                                     self.JScrollPaneRight)
        self.jSplitPane.setDividerLocation(400)

        #Load saved saved settings
        ##Load vars
        vars = callbacks.loadExtensionSetting(self._varsStorage)
        if vars:
            vars = base64.b64decode(vars)
        else:
            # try to load the example
            try:
                with open("examples/Simple-CSRF-vars.py") as fvars:
                    vars = fvars.read()
            # load the default text
            except:
                vars = Strings.vars

        ## initiate the persistant variables
        locals_ = {}
        try:
            exec(vars, {}, locals_)
        except Exception as e:
            print e
        self._vars = locals_

        ## update the vars screen
        self.jVarsPane.document.insertString(self.jVarsPane.document.length,
                                             vars, SimpleAttributeSet())

        ##Load script
        script = callbacks.loadExtensionSetting(self._scriptStorage)
        if script:
            script = base64.b64decode(script)
        else:
            # try to load the example
            try:
                with open("examples/Simple-CSRF-script.py") as fscript:
                    script = fscript.read()
            # load the default text
            except:
                script = Strings.script

        ## compile the rules
        self._script = script
        self._code = ''

        try:
            self._code = compile(script, '<string>', 'exec')
        except Exception as e:
            print(
                '{}\nReload extension after you correct the error.'.format(e))

        ## update the rules screen
        self.jScriptPane.document.insertString(
            self.jScriptPane.document.length, script, SimpleAttributeSet())

        #Register Extension
        callbacks.customizeUiComponent(self.getUiComponent())
        callbacks.addSuiteTab(self)
        callbacks.registerExtensionStateListener(self)
        callbacks.registerHttpListener(self)

        self.jScriptPane.requestFocus()
コード例 #25
0
    def drawPluginUI(self):
        # Create the plugin user interface
        self.pluginTab = JPanel()
        self.uiTitle = JLabel('UPnP BHunter Load, Aim and Fire Console')
        self.uiTitle.setFont(Font('Tahoma', Font.BOLD, 14))
        self.uiTitle.setForeground(Color(250, 100, 0))
        self.uiPanelA = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self.uiPanelA.setMaximumSize(Dimension(2500, 1000))
        self.uiPanelA.setDividerSize(2)
        self.uiPanelB = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self.uiPanelB.setDividerSize(2)
        self.uiPanelA.setBottomComponent(self.uiPanelB)
        self.uiPanelA.setBorder(BorderFactory.createLineBorder(Color.gray))

        # Create and configure labels and text fields
        self.labeltitle_step1 = JLabel("[1st STEP] Discover UPnP Locations")
        self.labeltitle_step1.setFont(Font('Tahoma', Font.BOLD, 14))
        self.labeltitle_step2 = JLabel("[2nd STEP] Select an UPnP Service")
        self.labeltitle_step2.setFont(Font('Tahoma', Font.BOLD, 14))
        self.labeltitle_step3 = JLabel("[3rd STEP] Time to Attack it")
        self.labeltitle_step3.setFont(Font('Tahoma', Font.BOLD, 14))
        self.labelsubtitle_step1 = JLabel(
            "Specify the IP version address in scope and start UPnP discovery")
        self.labelsubtitle_step2 = JLabel(
            "Select which of the found UPnP services will be probed")
        self.labelsubtitle_step3 = JLabel(
            "Select how to test the extracted UPnP SOAP requests having input arguments"
        )
        self.label_step1 = JLabel("Target IP")
        self.label_step2 = JLabel("Found UPnp Services")
        self.label_step3 = JLabel("Send all the extracted SOAP requests     ")
        self.labelstatus = JLabel("             Status")
        self.labelempty_step1 = JLabel("                ")
        self.labelempty_step2 = JLabel("  ")
        self.labelupnp = JLabel("UPnP list")
        self.labelip = JLabel("IP list")
        self.labelLANHOST = JLabel(
            "Send the interesting LANHostConfigManagement SOAP requests     ")
        self.labelWANCONNECTION = JLabel(
            "Send the interesting WANIP/PPPConnection SOAP requests     ")
        self.labelSOAPnum = JLabel("0")
        self.labelLANHOSTnum = JLabel("0")
        self.labelWANCONNECTIONnum = JLabel("0")
        self.labelNoneServiceFound = JLabel("  ")
        self.labelNoneServiceFound.setFont(Font('Tahoma', Font.BOLD, 12))
        self.labelNoneServiceFound.setForeground(Color.red)

        # Create combobox for IP version selection
        self.ip_versions = ["IPv4", "IPv6"]
        self.combo_ipversion = JComboBox(self.ip_versions)
        self.combo_ipversion.setSelectedIndex(0)
        self.combo_ipversion.setEnabled(True)

        # Create and configure progress bar
        self.progressbar = JProgressBar(0, 100)
        self.progressbar.setString("Ready")
        self.progressbar.setStringPainted(True)

        # Create and configure buttons
        self.startbutton = JButton("Start Discovery",
                                   actionPerformed=self.startHunting)
        self.clearbutton = JButton("Clear All", actionPerformed=self.clearAll)
        self.confirmbutton = JButton("Confirm Selection",
                                     actionPerformed=self.selectUPnPService)
        self.intruderbutton = JButton("to Intruder",
                                      actionPerformed=self.sendUPnPToIntruder)
        self.LANrepeaterbutton = JButton(
            "to Repeater", actionPerformed=self.sendLANUPnPToRepeater)
        self.WANrepeaterbutton = JButton(
            "to Repeater", actionPerformed=self.sendWANUPnPToRepeater)
        self.confirmbutton.setEnabled(False)
        self.intruderbutton.setEnabled(False)
        self.LANrepeaterbutton.setEnabled(False)
        self.WANrepeaterbutton.setEnabled(False)

        # Create the combo box, select item at index 0 (first item in list)
        self.upnpservices = ["       "]
        self.upnpcombo_services = JComboBox(self.upnpservices)
        self.upnpcombo_services.setSelectedIndex(0)
        self.upnpcombo_services.setEnabled(False)

        # Class neeeded to handle the combobox in second step panel
        class ComboboxListener(ActionListener):
            def __init__(self, upnpcombo_targets, upnpcombo_services,
                         scope_dict):
                self.upnpcombo_targets = upnpcombo_targets
                self.upnpcombo_services = upnpcombo_services
                self.scope_dict = scope_dict

            def actionPerformed(self, event):
                # Update the location url combobox depending on the IP combobox
                selected_target = self.upnpcombo_targets.getSelectedItem()
                if self.scope_dict and selected_target:
                    self.upnpcombo_services.removeAllItems()
                    for scope_url in self.scope_dict[selected_target]:
                        self.upnpcombo_services.addItem(scope_url)
                    self.upnpcombo_services.setSelectedIndex(0)

        # Create the combo box, select item at index 0 (first item in list)
        self.upnptargets = ["       "]
        self.upnpcombo_targets = JComboBox(self.upnptargets)
        self.upnpcombo_targets.setSelectedIndex(0)
        self.upnpcombo_targets.setEnabled(False)
        self.upnpcombo_targets.addActionListener(
            ComboboxListener(self.upnpcombo_targets, self.upnpcombo_services,
                             self.scope_dict))

        # Configuring first step panel
        self.panel_step1 = JPanel()
        self.panel_step1.setPreferredSize(Dimension(2250, 100))
        self.panel_step1.setBorder(EmptyBorder(10, 10, 10, 10))
        self.panel_step1.setLayout(BorderLayout(15, 15))
        self.titlepanel_step1 = JPanel()
        self.titlepanel_step1.setLayout(BorderLayout())
        self.titlepanel_step1.add(self.labeltitle_step1, BorderLayout.NORTH)
        self.titlepanel_step1.add(self.labelsubtitle_step1)
        self.targetpanel_step1 = JPanel()
        self.targetpanel_step1.add(self.label_step1)
        self.targetpanel_step1.add(self.combo_ipversion)
        self.targetpanel_step1.add(self.startbutton)
        self.targetpanel_step1.add(self.clearbutton)
        self.targetpanel_step1.add(self.labelstatus)
        self.targetpanel_step1.add(self.progressbar)
        self.emptypanel_step1 = JPanel()
        self.emptypanel_step1.setLayout(BorderLayout())
        self.emptypanel_step1.add(self.labelempty_step1, BorderLayout.WEST)

        # Assembling first step panel components
        self.panel_step1.add(self.titlepanel_step1, BorderLayout.NORTH)
        self.panel_step1.add(self.targetpanel_step1, BorderLayout.WEST)
        self.panel_step1.add(self.emptypanel_step1, BorderLayout.SOUTH)
        self.uiPanelA.setTopComponent(self.panel_step1)

        # Configure second step panel
        self.panel_step2 = JPanel()
        self.panel_step2.setPreferredSize(Dimension(2250, 100))
        self.panel_step2.setBorder(EmptyBorder(10, 10, 10, 10))
        self.panel_step2.setLayout(BorderLayout(15, 15))
        self.titlepanel_step2 = JPanel()
        self.titlepanel_step2.setLayout(BorderLayout())
        self.titlepanel_step2.add(self.labeltitle_step2, BorderLayout.NORTH)
        self.titlepanel_step2.add(self.labelsubtitle_step2)
        self.selectpanel_step2 = JPanel()
        self.selectpanel_step2.add(self.labelip)
        self.selectpanel_step2.add(self.upnpcombo_targets)
        self.selectpanel_step2.add(self.labelupnp)
        self.selectpanel_step2.add(self.upnpcombo_services)
        self.selectpanel_step2.add(self.confirmbutton)
        self.emptypanel_step2 = JPanel()
        self.emptypanel_step2.setLayout(BorderLayout())
        self.emptypanel_step2.add(self.labelempty_step2, BorderLayout.WEST)
        self.emptypanel_step2.add(self.labelNoneServiceFound)

        # Assembling second step panel components
        self.panel_step2.add(self.titlepanel_step2, BorderLayout.NORTH)
        self.panel_step2.add(self.selectpanel_step2, BorderLayout.WEST)
        self.panel_step2.add(self.emptypanel_step2, BorderLayout.SOUTH)
        self.uiPanelB.setTopComponent(self.panel_step2)

        # Configuring third step panel
        self.panel_step3 = JPanel()
        self.panel_step3.setPreferredSize(Dimension(2250, 100))
        self.panel_step3.setBorder(EmptyBorder(10, 10, 10, 10))
        self.panel_step3.setLayout(BorderLayout(15, 15))
        self.titlepanel_step3 = JPanel()
        self.titlepanel_step3.setLayout(BorderLayout())
        self.titlepanel_step3.add(self.labeltitle_step3, BorderLayout.NORTH)
        self.titlepanel_step3.add(self.labelsubtitle_step3)
        self.underpanel_step3 = JPanel()

        underlayout = GroupLayout(self.underpanel_step3)
        self.underpanel_step3.setLayout(underlayout)
        underlayout.setAutoCreateGaps(True)
        underlayout.setAutoCreateContainerGaps(True)
        left2right = underlayout.createSequentialGroup()
        firstcolumn = underlayout.createParallelGroup()
        firstcolumn.addComponent(self.label_step3, GroupLayout.PREFERRED_SIZE,
                                 GroupLayout.PREFERRED_SIZE,
                                 GroupLayout.PREFERRED_SIZE)
        firstcolumn.addComponent(self.labelLANHOST, GroupLayout.PREFERRED_SIZE,
                                 GroupLayout.PREFERRED_SIZE,
                                 GroupLayout.PREFERRED_SIZE)
        firstcolumn.addComponent(self.labelWANCONNECTION,
                                 GroupLayout.PREFERRED_SIZE,
                                 GroupLayout.PREFERRED_SIZE,
                                 GroupLayout.PREFERRED_SIZE)
        secondcolumn = underlayout.createParallelGroup()
        secondcolumn.addComponent(self.labelSOAPnum)
        secondcolumn.addComponent(self.labelLANHOSTnum)
        secondcolumn.addComponent(self.labelWANCONNECTIONnum)
        thirdcolumn = underlayout.createParallelGroup()
        thirdcolumn.addComponent(self.intruderbutton)
        thirdcolumn.addComponent(self.LANrepeaterbutton)
        thirdcolumn.addComponent(self.WANrepeaterbutton)
        left2right.addGroup(firstcolumn)
        left2right.addGroup(secondcolumn)
        left2right.addGroup(thirdcolumn)
        top2bottom = underlayout.createSequentialGroup()
        firstrow = underlayout.createParallelGroup()
        firstrow.addComponent(self.label_step3, GroupLayout.PREFERRED_SIZE,
                              GroupLayout.PREFERRED_SIZE,
                              GroupLayout.PREFERRED_SIZE)
        firstrow.addComponent(self.labelSOAPnum)
        firstrow.addComponent(self.intruderbutton)
        secondrow = underlayout.createParallelGroup()
        secondrow.addComponent(self.labelLANHOST, GroupLayout.PREFERRED_SIZE,
                               GroupLayout.PREFERRED_SIZE,
                               GroupLayout.PREFERRED_SIZE)
        secondrow.addComponent(self.labelLANHOSTnum)
        secondrow.addComponent(self.LANrepeaterbutton)
        thirdrow = underlayout.createParallelGroup()
        thirdrow.addComponent(self.labelWANCONNECTION,
                              GroupLayout.PREFERRED_SIZE,
                              GroupLayout.PREFERRED_SIZE,
                              GroupLayout.PREFERRED_SIZE)
        thirdrow.addComponent(self.labelWANCONNECTIONnum)
        thirdrow.addComponent(self.WANrepeaterbutton)
        top2bottom.addGroup(firstrow)
        top2bottom.addGroup(secondrow)
        top2bottom.addGroup(thirdrow)
        underlayout.setHorizontalGroup(left2right)
        underlayout.setVerticalGroup(top2bottom)

        # Assembling thirdd step panel components
        self.panel_step3.add(self.titlepanel_step3, BorderLayout.NORTH)
        self.panel_step3.add(self.underpanel_step3, BorderLayout.WEST)
        self.uiPanelB.setBottomComponent(self.panel_step3)

        # Assembling the group of all panels
        layout = GroupLayout(self.pluginTab)
        self.pluginTab.setLayout(layout)
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addGap(10, 10, 10).addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(
                            self.uiTitle).addGap(15, 15, 15).addComponent(
                                self.uiPanelA)).addContainerGap(
                                    26, Short.MAX_VALUE)))
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addGap(15, 15, 15).addComponent(
                    self.uiTitle).addGap(15, 15, 15).addComponent(
                        self.uiPanelA).addGap(20, 20, 20).addGap(20, 20, 20)))
コード例 #26
0
 def __init__(self, ext):
     self._panel = JPanel()
     layout = GroupLayout(self._panel)
     innerPanel = JPanel()
     innerPanelLayout = GroupLayout(innerPanel)
     self._panel.setLayout(layout)
     innerPanel.setLayout(innerPanelLayout)
     self.labelDojoURL = JLabel("DefectDojo :")
     self.defectDojoURL = JTextField("")
     self.searchConnectButton = JButton('Connect',
                                        actionPerformed=ext.getProducts)
     self.labelApiKey = JLabel("API Key :")
     self.apiKey = JTextField("")
     self.labelUsername = JLabel("Username :"******"admin")
     self.labelProductID = JLabel("Product :")
     self.productID = JTextField(focusLost=ext.getEngagements)
     self.labelProductName = JLabel("Product Name :")
     self.productName = JComboBox()
     self.prodMan = ProdListener(ext)
     self.prodMouse = ProdMouseListener(ext)
     self.productName.addMouseListener(self.prodMouse)
     self.productName.addActionListener(self.prodMan)
     self.labelEngagementID = JLabel("Engagement (In Progress) :")
     self.engagementID = JTextField(focusLost=ext.getTests)
     self.engagementName = JComboBox()
     self.engMan = EngListener(ext)
     self.engagementName.addActionListener(self.engMan)
     self.labelTestID = JLabel("Test :")
     self.testID = JTextField()
     self.testName = JComboBox()
     self.testMan = TestListener(ext)
     self.testName.addActionListener(self.testMan)
     self.search = JTextField()
     self.searchProductButton = JButton('Product Search',
                                        actionPerformed=ext.getProducts)
     innerPanelLayout.setHorizontalGroup(
         innerPanelLayout.createParallelGroup().addGroup(
             GroupLayout.Alignment.TRAILING,
             innerPanelLayout.createSequentialGroup().addContainerGap().
             addGroup(
                 innerPanelLayout.createParallelGroup(
                     GroupLayout.Alignment.TRAILING).
                 addGroup(innerPanelLayout.createParallelGroup().addGroup(
                     innerPanelLayout.createParallelGroup(
                         GroupLayout.Alignment.TRAILING).addGroup(
                             innerPanelLayout.createParallelGroup(
                                 GroupLayout.Alignment.TRAILING).addGroup(
                                     innerPanelLayout.createSequentialGroup(
                                     ).addComponent(
                                         self.labelUsername,
                                         GroupLayout.PREFERRED_SIZE, 168,
                                         GroupLayout.PREFERRED_SIZE).addGap(
                                             105, 105, 105)).
                             addComponent(self.labelProductName,
                                          GroupLayout.Alignment.LEADING,
                                          GroupLayout.PREFERRED_SIZE, 168,
                                          GroupLayout.PREFERRED_SIZE)).
                     addGroup(
                         GroupLayout.Alignment.LEADING,
                         innerPanelLayout.createSequentialGroup().addGroup(
                             innerPanelLayout.createParallelGroup(
                                 GroupLayout.Alignment.TRAILING).
                             addComponent(
                                 self.labelEngagementID,
                                 GroupLayout.Alignment.LEADING,
                                 GroupLayout.PREFERRED_SIZE, 168,
                                 GroupLayout.PREFERRED_SIZE).addComponent(
                                     self.labelDojoURL,
                                     GroupLayout.Alignment.LEADING,
                                     GroupLayout.PREFERRED_SIZE, 168,
                                     GroupLayout.PREFERRED_SIZE)).
                         addPreferredGap(
                             LayoutStyle.ComponentPlacement.RELATED))
                 ).addGroup(innerPanelLayout.createSequentialGroup(
                 ).addGroup(
                     innerPanelLayout.createParallelGroup().addComponent(
                         self.labelTestID, GroupLayout.PREFERRED_SIZE, 168,
                         GroupLayout.PREFERRED_SIZE).addComponent(
                             self.searchProductButton,
                             GroupLayout.PREFERRED_SIZE, 160,
                             GroupLayout.PREFERRED_SIZE)).addPreferredGap(
                                 LayoutStyle.ComponentPlacement.RELATED))).
                 addGroup(
                     GroupLayout.Alignment.LEADING,
                     innerPanelLayout.createSequentialGroup().addComponent(
                         self.labelApiKey, GroupLayout.PREFERRED_SIZE, 168,
                         GroupLayout.PREFERRED_SIZE).addPreferredGap(
                             LayoutStyle.ComponentPlacement.RELATED))).
             addGroup(innerPanelLayout.createParallelGroup().addGroup(
                 innerPanelLayout.createSequentialGroup().addComponent(
                     self.engagementID, GroupLayout.PREFERRED_SIZE, 36,
                     GroupLayout.PREFERRED_SIZE).addGap(
                         18, 18,
                         18).addComponent(self.engagementName,
                                          GroupLayout.PREFERRED_SIZE, 260,
                                          GroupLayout.PREFERRED_SIZE)
             ).addGroup(innerPanelLayout.createSequentialGroup().addGap(
                 54, 54, 54).addGroup(
                     innerPanelLayout.createParallelGroup().addComponent(
                         self.defectDojoURL, GroupLayout.PREFERRED_SIZE,
                         260, GroupLayout.PREFERRED_SIZE).addComponent(
                             self.apiKey, GroupLayout.PREFERRED_SIZE, 260,
                             GroupLayout.PREFERRED_SIZE).addComponent(
                                 self.user, GroupLayout.PREFERRED_SIZE, 260,
                                 GroupLayout.PREFERRED_SIZE).addComponent(
                                     self.productName,
                                     GroupLayout.PREFERRED_SIZE, 260,
                                     GroupLayout.PREFERRED_SIZE)
                 )).addGroup(
                     innerPanelLayout.createSequentialGroup().addComponent(
                         self.testID, GroupLayout.PREFERRED_SIZE, 36,
                         GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).
                     addGroup(innerPanelLayout.createParallelGroup(
                     ).addComponent(
                         self.search, GroupLayout.PREFERRED_SIZE, 260,
                         GroupLayout.PREFERRED_SIZE).addComponent(
                             self.testName, GroupLayout.PREFERRED_SIZE, 260,
                             GroupLayout.PREFERRED_SIZE)))).addGap(
                                 348, 348, 348)))
     innerPanelLayout.setVerticalGroup(innerPanelLayout.createParallelGroup(
     ).addGroup(innerPanelLayout.createSequentialGroup().addContainerGap(
     ).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.LEADING,
             False).addComponent(self.defectDojoURL).addComponent(
                 self.labelDojoURL, GroupLayout.DEFAULT_SIZE,
                 GroupLayout.DEFAULT_SIZE, sys.maxint)
     ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.BASELINE).addComponent(
                 self.apiKey, GroupLayout.PREFERRED_SIZE,
                 GroupLayout.DEFAULT_SIZE,
                 GroupLayout.PREFERRED_SIZE).addComponent(
                     self.labelApiKey, GroupLayout.PREFERRED_SIZE, 19,
                     GroupLayout.PREFERRED_SIZE)
     ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.BASELINE).addComponent(
                 self.user, GroupLayout.PREFERRED_SIZE,
                 GroupLayout.DEFAULT_SIZE,
                 GroupLayout.PREFERRED_SIZE).addComponent(
                     self.labelUsername, GroupLayout.PREFERRED_SIZE, 19,
                     GroupLayout.PREFERRED_SIZE)
     ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.BASELINE).addComponent(
                 self.productName, GroupLayout.PREFERRED_SIZE,
                 GroupLayout.DEFAULT_SIZE,
                 GroupLayout.PREFERRED_SIZE).addComponent(
                     self.labelProductName, GroupLayout.PREFERRED_SIZE, 19,
                     GroupLayout.PREFERRED_SIZE)
     ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.BASELINE).addComponent(
                 self.engagementName, GroupLayout.PREFERRED_SIZE,
                 GroupLayout.DEFAULT_SIZE,
                 GroupLayout.PREFERRED_SIZE).addComponent(
                     self.engagementID, GroupLayout.PREFERRED_SIZE,
                     GroupLayout.DEFAULT_SIZE,
                     GroupLayout.PREFERRED_SIZE).addComponent(
                         self.labelEngagementID, GroupLayout.PREFERRED_SIZE,
                         19, GroupLayout.PREFERRED_SIZE)
     ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.BASELINE).addComponent(
                 self.testName, GroupLayout.PREFERRED_SIZE,
                 GroupLayout.DEFAULT_SIZE,
                 GroupLayout.PREFERRED_SIZE).addComponent(
                     self.testID, GroupLayout.PREFERRED_SIZE,
                     GroupLayout.DEFAULT_SIZE,
                     GroupLayout.PREFERRED_SIZE).addComponent(
                         self.labelTestID, GroupLayout.PREFERRED_SIZE, 19,
                         GroupLayout.PREFERRED_SIZE)
     ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
         innerPanelLayout.createParallelGroup(
             GroupLayout.Alignment.LEADING, False).addComponent(
                 self.search, GroupLayout.DEFAULT_SIZE,
                 GroupLayout.DEFAULT_SIZE, sys.maxint).addComponent(
                     self.searchProductButton)).addContainerGap(
                         131, sys.maxint)))
     layout.setHorizontalGroup(layout.createParallelGroup().addGroup(
         layout.createSequentialGroup().addComponent(
             innerPanel, GroupLayout.PREFERRED_SIZE, 633,
             GroupLayout.PREFERRED_SIZE).addGap(0, 312, sys.maxint)))
     layout.setVerticalGroup(layout.createParallelGroup().addGroup(
         layout.createSequentialGroup().addComponent(
             innerPanel, GroupLayout.PREFERRED_SIZE,
             GroupLayout.DEFAULT_SIZE,
             GroupLayout.PREFERRED_SIZE).addGap(0, 199, sys.maxint)))
コード例 #27
0
ファイル: extender.py プロジェクト: d3xter-lab/Map-Local
    def __init__(self):
        self.jLabel1 = JLabel()
        self.jCheckBox1 = JCheckBox()
        self.jScrollPane1 = JScrollPane()
        self.jTable1 = JTable()
        self.jTabbedPane1 = JTabbedPane()
        self.jPanel1 = JPanel()
        self.jButton1 = JButton("Add")
        self.jButton2 = JButton("Remove")
        self.jLabel2 = JLabel()
        self.jLabel3 = JLabel()
        self.jLabel4 = JLabel()
        self.jLabel5 = JLabel()
        self.jLabel6 = JLabel()
        self.jTextField1 = JTextField()
        self.jTextField2 = JTextField()
        self.jTextField3 = JTextField()
        
        method = ["http", "https"]
        self.jComboBox1 = JComboBox(method)
        
        self.jLabel7 = JLabel()
        self.jLabel8 = JLabel()
        self.jTextField4 = JTextField()
        self.jButton3 = JButton()
        self.jPanel2 = JPanel()
        self.jScrollPane3 = JScrollPane()
        self.jTextArea2 = JTextArea()

        self.jLabel1.setFont(Font("굴림", 1, 12))
        self.jLabel1.setText("Use local files to serve remote locations.")

        self.jCheckBox1.setText("Enable Map Local")
        
        self.jScrollPane1.setViewportView(self.jTable1)

        self.jLabel2.setText("Protocol:")

        self.jLabel3.setText("Host:")

        self.jLabel4.setText("Path:")

        self.jLabel5.setText("Query:")

        self.jLabel6.setText("Map From")

        self.jLabel7.setText("Map To")

        self.jLabel8.setText("Local Path:")

        self.jButton3.setText("Choose")
        
        jPanel1Layout = GroupLayout(self.jPanel1)
        self.jPanel1.setLayout(jPanel1Layout)
        
        from java.lang import Short
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                            .addComponent(self.jLabel3)
                            .addComponent(self.jLabel2)
                            .addComponent(self.jLabel4)
                            .addComponent(self.jLabel5)
                            .addComponent(self.jLabel6))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addComponent(self.jTextField1)
                            .addComponent(self.jTextField2)
                            .addComponent(self.jTextField3)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(self.jComboBox1, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(self.jLabel7))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(30, 30, 30)
                                .addComponent(self.jLabel8)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(self.jTextField4, GroupLayout.DEFAULT_SIZE, 2000, Short.MAX_VALUE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(self.jButton3, GroupLayout.PREFERRED_SIZE, 95, GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(self.jButton1, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(self.jButton2, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 18, Short.MAX_VALUE)))
                .addContainerGap())
        )
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(self.jLabel6)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(self.jLabel2)
                    .addComponent(self.jComboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(self.jLabel3)
                    .addComponent(self.jTextField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(self.jLabel4)
                    .addComponent(self.jTextField2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(self.jLabel5)
                    .addComponent(self.jTextField3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(self.jLabel7)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(self.jLabel8)
                    .addComponent(self.jTextField4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(self.jButton3))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(self.jButton1)
                    .addComponent(self.jButton2))
                .addContainerGap(19, Short.MAX_VALUE))
        )

        self.jTabbedPane1.addTab("Edit Mapping", self.jPanel1)

        self.jTextArea2.setColumns(20)
        self.jTextArea2.setRows(5)
        self.jScrollPane3.setViewportView(self.jTextArea2)

        jPanel2Layout = GroupLayout(self.jPanel2)
        self.jPanel2.setLayout(jPanel2Layout)
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(self.jScrollPane3, GroupLayout.DEFAULT_SIZE, 729, Short.MAX_VALUE)
                .addContainerGap())
        )
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(self.jScrollPane3, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                .addContainerGap())
        )

        self.jTabbedPane1.addTab("Viewer", self.jPanel2)
        
        self.panel = JPanel()
        layout = GroupLayout(self.panel)
        self.panel.setLayout(layout)
        
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(self.jScrollPane1)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addComponent(self.jCheckBox1)
                            .addComponent(self.jLabel1, GroupLayout.PREFERRED_SIZE, 285, GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(self.jTabbedPane1))
                .addContainerGap())
        )
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(self.jLabel1)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(self.jCheckBox1)
                .addGap(18, 18, 18)
                .addComponent(self.jScrollPane1, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(self.jTabbedPane1)
                .addContainerGap())
        )
コード例 #28
0
ファイル: UPnPHunter_Burp.py プロジェクト: t1v0/upnp-hunter
    def drawPluginUI(self):
        # Create the plugin user interface
        self.pluginTab = JPanel()
        self.uiTitle = JLabel('UPnP BHunter Load, Aim and Fire Console')
        self.uiTitle.setFont(Font('Tahoma', Font.BOLD, 14))
        self.uiTitle.setForeground(Color(250, 100, 0))
        self.uiPanelA = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self.uiPanelA.setMaximumSize(Dimension(2500, 1000))
        self.uiPanelA.setDividerSize(2)
        self.uiPanelB = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self.uiPanelB.setDividerSize(2)
        self.uiPanelA.setBottomComponent(self.uiPanelB)
        self.uiPanelA.setBorder(BorderFactory.createLineBorder(Color.gray))

        # Create and configure labels and text fields
        self.labeltitle_step1 = JLabel("[1st STEP] Discover UPnP Locations")
        self.labeltitle_step1.setFont(Font('Tahoma', Font.BOLD, 14))
        self.labeltitle_step2 = JLabel(
            "[2nd STEP] Select a UPnP Service and Action")
        self.labeltitle_step2.setFont(Font('Tahoma', Font.BOLD, 14))
        self.labeltitle_step3 = JLabel("[3rd STEP] Time to Attack it")
        self.labeltitle_step3.setFont(Font('Tahoma', Font.BOLD, 14))
        self.labelsubtitle_step1 = JLabel(
            "Specify the IP version address in scope and start UPnP discovery")
        self.labelsubtitle_step2 = JLabel(
            "Select which of the found UPnP services will be probed")
        self.labelsubtitle_step3 = JLabel(
            "Review and modify the request, then send it to one of the attack tools"
        )
        self.label_step1 = JLabel("Target IP")
        self.label_step2 = JLabel("Found UPnp Services")
        self.labelstatus = JLabel("             Status")
        self.labelempty_step1 = JLabel("                ")
        self.labelempty_step2 = JLabel("  ")
        self.labelupnp = JLabel("UPnP list")
        self.labelip = JLabel("IP list")
        self.labelactions = JLabel("Actions")
        self.labelNoneServiceFound = JLabel("  ")
        self.labelNoneServiceFound.setFont(Font('Tahoma', Font.BOLD, 12))
        self.labelNoneServiceFound.setForeground(Color.red)

        # Create combobox for IP version selection
        self.ip_versions = ["IPv4", "IPv6"]
        self.combo_ipversion = JComboBox(self.ip_versions)
        self.combo_ipversion.setSelectedIndex(0)
        self.combo_ipversion.setEnabled(True)

        # Create and configure progress bar
        self.progressbar = JProgressBar(0, 100)
        self.progressbar.setString("Ready")
        self.progressbar.setStringPainted(True)

        # Create and configure buttons
        self.startbutton = JButton("Start Discovery",
                                   actionPerformed=self.startHunting)
        self.clearbutton = JButton("Clear All", actionPerformed=self.clearAll)
        self.intruderbutton = JButton("Send to Intruder",
                                      actionPerformed=self.sendToIntruder)
        self.repeaterbutton = JButton("Send to Repeater",
                                      actionPerformed=self.sendToRepeater)
        #self.WANrepeaterbutton = JButton("to Repeater", actionPerformed=self.sendWANUPnPToRepeater)
        self.textarea_request = JTextArea(18, 90)
        self.intruderbutton.setEnabled(False)
        self.repeaterbutton.setEnabled(False)

        # Class neeeded to handle the target combobox in second step panel
        class TargetComboboxListener(ActionListener):
            def __init__(self, upnpcombo_targets, upnpcombo_services,
                         ip_service_dict):
                self.upnpcombo_targets = upnpcombo_targets
                self.upnpcombo_services = upnpcombo_services
                self.ip_service_dict = ip_service_dict

            def actionPerformed(self, event):
                try:
                    # Update the location url combobox depending on the IP combobox
                    selected_target = self.upnpcombo_targets.getSelectedItem()
                    if self.ip_service_dict and selected_target:
                        self.upnpcombo_services.removeAllItems()
                        for service_url in self.ip_service_dict[
                                selected_target]:
                            self.upnpcombo_services.addItem(service_url)
                        self.upnpcombo_services.setSelectedIndex(0)
                except BaseException as e:
                    print("[!] Exception selecting service: \"%s\" ") % e

        # Class neeeded to handle the service combobox in second step panel
        class ServiceComboboxListener(ActionListener):
            def __init__(self, upnpcombo_services, upnpcombo_actions,
                         services_dict):
                self.upnpcombo_services = upnpcombo_services
                self.upnpcombo_actions = upnpcombo_actions
                self.services = services_dict

            def actionPerformed(self, event):
                try:
                    # Update the location url combobox depending on the IP combobox
                    selected_service = self.upnpcombo_services.getSelectedItem(
                    )
                    if self.services and selected_service:
                        self.upnpcombo_actions.removeAllItems()
                        actions = self.services[selected_service]
                        for action in actions:
                            self.upnpcombo_actions.addItem(action)
                        self.upnpcombo_actions.setSelectedIndex(0)
                except BaseException as e:
                    print("[!] Exception selecting service: \"%s\" ") % e

        # Class neeeded to handle the action combobox in second step panel
        class ActionComboboxListener(ActionListener):
            def __init__(self, upnpcombo_services, upnpcombo_actions,
                         textarea_request, services_dict):
                self.upnpcombo_services = upnpcombo_services
                self.upnpcombo_actions = upnpcombo_actions
                self.textarea_request = textarea_request
                self.services = services_dict

            def actionPerformed(self, event):
                try:
                    # Update the location url combobox depending on the IP combobox
                    selected_action = self.upnpcombo_actions.getSelectedItem()
                    selected_service = self.upnpcombo_services.getSelectedItem(
                    )
                    if self.services and selected_action:
                        self.textarea_request.setText(
                            self.services[selected_service][selected_action])
                except BaseException as e:
                    print("[!] Exception selecting action: \"%s\" ") % e

        self.upnpactions = ["       "]
        self.upnpcombo_actions = JComboBox(self.upnpactions)
        self.upnpcombo_actions.setSelectedIndex(0)
        self.upnpcombo_actions.setEnabled(False)

        # Create the combo box, select item at index 0 (first item in list)
        self.upnpservices = ["       "]
        self.upnpcombo_services = JComboBox(self.upnpservices)
        self.upnpcombo_services.setSelectedIndex(0)
        self.upnpcombo_services.setEnabled(False)

        # Create the combo box, select item at index 0 (first item in list)
        self.upnptargets = ["       "]
        self.upnpcombo_targets = JComboBox(self.upnptargets)
        self.upnpcombo_targets.setSelectedIndex(0)
        self.upnpcombo_targets.setEnabled(False)

        # Set the action listeners for all the comboboxes
        self.upnpcombo_targets.addActionListener(
            TargetComboboxListener(self.upnpcombo_targets,
                                   self.upnpcombo_services,
                                   self.ip_service_dict))
        self.upnpcombo_services.addActionListener(
            ServiceComboboxListener(self.upnpcombo_services,
                                    self.upnpcombo_actions,
                                    self.services_dict))
        self.upnpcombo_actions.addActionListener(
            ActionComboboxListener(self.upnpcombo_services,
                                   self.upnpcombo_actions,
                                   self.textarea_request, self.services_dict))

        # Configuring first step panel
        self.panel_step1 = JPanel()
        self.panel_step1.setPreferredSize(Dimension(2250, 100))
        self.panel_step1.setBorder(EmptyBorder(10, 10, 10, 10))
        self.panel_step1.setLayout(BorderLayout(15, 15))
        self.titlepanel_step1 = JPanel()
        self.titlepanel_step1.setLayout(BorderLayout())
        self.titlepanel_step1.add(self.labeltitle_step1, BorderLayout.NORTH)
        self.titlepanel_step1.add(self.labelsubtitle_step1)
        self.targetpanel_step1 = JPanel()
        self.targetpanel_step1.add(self.label_step1)
        self.targetpanel_step1.add(self.combo_ipversion)
        self.targetpanel_step1.add(self.startbutton)
        self.targetpanel_step1.add(self.clearbutton)
        self.targetpanel_step1.add(self.labelstatus)
        self.targetpanel_step1.add(self.progressbar)
        self.emptypanel_step1 = JPanel()
        self.emptypanel_step1.setLayout(BorderLayout())
        self.emptypanel_step1.add(self.labelempty_step1, BorderLayout.WEST)

        # Assembling first step panel components
        self.panel_step1.add(self.titlepanel_step1, BorderLayout.NORTH)
        self.panel_step1.add(self.targetpanel_step1, BorderLayout.WEST)
        self.panel_step1.add(self.emptypanel_step1, BorderLayout.SOUTH)
        self.uiPanelA.setTopComponent(self.panel_step1)

        # Configure second step panel
        self.panel_step2 = JPanel()
        self.panel_step2.setPreferredSize(Dimension(2250, 100))
        self.panel_step2.setBorder(EmptyBorder(10, 10, 10, 10))
        self.panel_step2.setLayout(BorderLayout(15, 15))
        self.titlepanel_step2 = JPanel()
        self.titlepanel_step2.setLayout(BorderLayout())
        self.titlepanel_step2.add(self.labeltitle_step2, BorderLayout.NORTH)
        self.titlepanel_step2.add(self.labelsubtitle_step2)
        self.selectpanel_step2 = JPanel()
        self.selectpanel_step2.add(self.labelip)
        self.selectpanel_step2.add(self.upnpcombo_targets)
        self.selectpanel_step2.add(self.labelupnp)
        self.selectpanel_step2.add(self.upnpcombo_services)
        self.selectpanel_step2.add(self.labelactions)
        self.selectpanel_step2.add(self.upnpcombo_actions)
        self.emptypanel_step2 = JPanel()
        self.emptypanel_step2.setLayout(BorderLayout())
        self.emptypanel_step2.add(self.labelempty_step2, BorderLayout.WEST)
        self.emptypanel_step2.add(self.labelNoneServiceFound)

        # Assembling second step panel components
        self.panel_step2.add(self.titlepanel_step2, BorderLayout.NORTH)
        self.panel_step2.add(self.selectpanel_step2, BorderLayout.WEST)
        self.panel_step2.add(self.emptypanel_step2, BorderLayout.SOUTH)
        self.uiPanelB.setTopComponent(self.panel_step2)

        # Configuring third step panel
        self.panel_step3 = JPanel()
        self.panel_step3.setPreferredSize(Dimension(2250, 100))
        self.panel_step3.setBorder(EmptyBorder(10, 10, 10, 10))
        self.panel_step3.setLayout(BorderLayout(15, 15))
        self.titlepanel_step3 = JPanel()
        self.titlepanel_step3.setLayout(BorderLayout())
        self.titlepanel_step3.add(self.labeltitle_step3, BorderLayout.NORTH)
        self.titlepanel_step3.add(self.labelsubtitle_step3)
        self.underpanel_step3 = JPanel()
        self.underpanel_step3.setLayout(BorderLayout())
        self.underpanel_step3.add((JScrollPane(self.textarea_request)),
                                  BorderLayout.NORTH)
        self.actionpanel_step3 = JPanel()
        self.actionpanel_step3.add(self.intruderbutton)
        self.actionpanel_step3.add(self.repeaterbutton)
        self.extrapanel_step3 = JPanel()
        self.extrapanel_step3.setLayout(BorderLayout())
        self.extrapanel_step3.add(self.actionpanel_step3, BorderLayout.WEST)

        # Assembling thirdd step panel components
        self.panel_step3.add(self.titlepanel_step3, BorderLayout.NORTH)
        self.panel_step3.add(self.underpanel_step3, BorderLayout.WEST)
        self.panel_step3.add(self.extrapanel_step3, BorderLayout.SOUTH)
        self.uiPanelB.setBottomComponent(self.panel_step3)

        # Assembling the group of all panels
        layout = GroupLayout(self.pluginTab)
        self.pluginTab.setLayout(layout)
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addGap(10, 10, 10).addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(
                            self.uiTitle).addGap(15, 15, 15).addComponent(
                                self.uiPanelA)).addContainerGap(
                                    26, Short.MAX_VALUE)))
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addGap(15, 15, 15).addComponent(
                    self.uiTitle).addGap(15, 15, 15).addComponent(
                        self.uiPanelA).addGap(20, 20, 20).addGap(20, 20, 20)))
コード例 #29
0
    def registerExtenderCallbacks(self, callbacks):

        self._panel = JPanel()
        self._panel.setLayout(BorderLayout())
        #self._panel.setSize(400,400)

        # sourrounding try\except because Burp is not giving enough info
        try:

            # creating all the UI elements
            # create the split pane
            self._split_pane_horizontal = JSplitPane(
                JSplitPane.HORIZONTAL_SPLIT)
            self._split_panel_vertical = JSplitPane(JSplitPane.VERTICAL_SPLIT)

            # create panels
            self._panel_top = JPanel()
            self._panel_top.setLayout(BorderLayout())
            self._panel_bottom = JPanel()
            self._panel_bottom.setLayout(BorderLayout())
            self._panel_right = JPanel()
            self._panel_right.setLayout(BorderLayout())
            self._panel_request = JPanel()
            self._panel_request.setLayout(BorderLayout())
            self._panel_response = JPanel()
            self._panel_response.setLayout(BorderLayout())

            # create the tabbed pane used to show request\response
            self._tabbed_pane = JTabbedPane(JTabbedPane.TOP)

            # create the tabbed pane used to show aslan++\concretization file
            self._tabbed_pane_editor = JTabbedPane(JTabbedPane.TOP)

            # create the bottom command for selecting the SQL file and
            # generating the model
            self._button_generate = JButton(
                'Generate!', actionPerformed=self._generate_model)
            self._button_save = JButton('Save',
                                        actionPerformed=self._save_model)
            self._button_select_sql = JButton(
                'Select SQL', actionPerformed=self._select_sql_file)
            self._text_field_sql_file = JTextField(20)

            self._panel_bottom_commands = JPanel()
            layout = GroupLayout(self._panel_bottom_commands)
            layout.setAutoCreateGaps(True)
            layout.setAutoCreateContainerGaps(True)
            seq_layout = layout.createSequentialGroup()
            seq_layout.addComponent(self._text_field_sql_file)
            seq_layout.addComponent(self._button_select_sql)
            seq_layout.addComponent(self._button_generate)
            seq_layout.addComponent(self._button_save)
            layout.setHorizontalGroup(seq_layout)

            # create the message editors that will be used to show request and response
            self._message_editor_request = callbacks.createMessageEditor(
                None, True)
            self._message_editor_response = callbacks.createMessageEditor(
                None, True)

            # create the table that will be used to show the messages selected for
            # the translation

            self._columns_names = ('Host', 'Method', 'URL')
            dataModel = NonEditableModel(self._table_data, self._columns_names)
            self._table = JTable(dataModel)
            self._scrollPane = JScrollPane()
            self._scrollPane.getViewport().setView((self._table))

            popmenu = JPopupMenu()
            delete_item = JMenuItem("Delete")
            delete_item.addActionListener(self)
            popmenu.add(delete_item)
            self._table.setComponentPopupMenu(popmenu)
            self._table.addMouseListener(self)

            # add all the elements
            self._panel_request.add(
                self._message_editor_request.getComponent())
            self._panel_response.add(
                self._message_editor_response.getComponent())

            self._tabbed_pane.addTab("Request", self._panel_request)
            self._tabbed_pane.addTab("Response", self._panel_response)

            self._panel_top.add(self._scrollPane, BorderLayout.CENTER)

            self._panel_bottom.add(self._tabbed_pane, BorderLayout.CENTER)
            scroll = JScrollPane(self._panel_bottom)

            self._panel_right.add(self._tabbed_pane_editor,
                                  BorderLayout.CENTER)
            self._panel_right.add(self._panel_bottom_commands,
                                  BorderLayout.PAGE_END)

            self._split_panel_vertical.setTopComponent(self._panel_top)
            self._split_panel_vertical.setBottomComponent(scroll)
            self._split_pane_horizontal.setLeftComponent(
                self._split_panel_vertical)
            self._split_pane_horizontal.setRightComponent(self._panel_right)

            self._panel.addComponentListener(self)
            self._panel.add(self._split_pane_horizontal)

            self._callbacks = callbacks
            callbacks.setExtensionName("WAFEx")
            callbacks.addSuiteTab(self)
            callbacks.registerContextMenuFactory(self)
        except Exception as e:
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print(exc_type, fname, exc_tb.tb_lineno)
コード例 #30
0
ファイル: MainPanel.py プロジェクト: sethludwig/Parsia-Code
    def __init__(self, table=None):
        self.jScrollPane1 = JScrollPane()
        self.jTable1 = JTable()
        self.jPanel1 = JPanel()
        self.labelName = JLabel()
        self.textName = JTextField()
        self.labelSeverity = JLabel()
        self.textSeverity = JTextField()
        self.labelHost = JLabel()
        self.labelPath = JLabel()
        self.textHost = JTextField()
        self.textPath = JTextField()
        self.tabIssue = JTabbedPane()
        self.panelDescription = JPanel()
        self.panelRequest = JPanel()
        self.panelResponse = JPanel()
        self.panelRemediation = JPanel()

        # setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)

        self.jTable1 = table

        # wrap the table in a scrollpane
        self.jScrollPane1.setViewportView(self.jTable1)

        # top panel containing the table
        from java.awt import Color
        self.jPanel1.setBorder(BorderFactory.createLineBorder(Color(0, 0, 0)))

        # create the labels and textfields
        self.labelName.text = "Issue Type/Name"
        self.textName.text = "Issue Name/Type"
        self.textName.editable = False
        self.textName.setBackground(Color.LIGHT_GRAY)

        self.labelSeverity.text = "Severity"
        self.textSeverity.text = ""
        self.textSeverity.editable = False
        self.textSeverity.setBackground(Color.LIGHT_GRAY)

        self.labelHost.text = "Host"
        self.textHost.text = "Issue Host"
        self.textHost.editable = False
        self.textHost.setBackground(Color.LIGHT_GRAY)

        self.labelPath.text = "Path"
        self.textPath.text = "Issue Path"
        self.textPath.editable = False
        self.textPath.setBackground(Color.LIGHT_GRAY)

        from java.lang import Short
        # description panel
        panelDescriptionLayout = GroupLayout(self.panelDescription)
        self.panelDescription.setLayout(panelDescriptionLayout)
        panelDescriptionLayout.setHorizontalGroup(
            panelDescriptionLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelDescriptionLayout.setVerticalGroup(
            panelDescriptionLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Description", self.panelDescription)

        # request tab
        panelRequestLayout = GroupLayout(self.panelRequest)
        self.panelRequest.setLayout(panelRequestLayout)
        panelRequestLayout.setHorizontalGroup(
            panelRequestLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelRequestLayout.setVerticalGroup(
            panelRequestLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Request", self.panelRequest)

        # response tab
        panelResponseLayout = GroupLayout(self.panelResponse)
        self.panelResponse.setLayout(panelResponseLayout)
        panelResponseLayout.setHorizontalGroup(
            panelResponseLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelResponseLayout.setVerticalGroup(
            panelResponseLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Response", self.panelResponse)

        # remediation tab
        panelRemediationLayout = GroupLayout(self.panelRemediation)
        self.panelRemediation.setLayout(panelRemediationLayout)
        panelRemediationLayout.setHorizontalGroup(
            panelRemediationLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 948, Short.MAX_VALUE))
        panelRemediationLayout.setVerticalGroup(
            panelRemediationLayout.createParallelGroup(
                GroupLayout.Alignment.LEADING).addGap(0, 287, Short.MAX_VALUE))
        self.tabIssue.addTab("Remediation", self.panelRemediation)

        # jpanel1?
        jPanel1Layout = GroupLayout(self.jPanel1)
        self.jPanel1.setLayout(jPanel1Layout)
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).
            addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.LEADING).
                addGroup(jPanel1Layout.createSequentialGroup().addGroup(
                    jPanel1Layout.createParallelGroup(
                        GroupLayout.Alignment.TRAILING).addComponent(
                            self.labelHost).addComponent(
                                self.labelSeverity).addComponent(
                                    self.labelName)
                ).addPreferredGap(
                    LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                        jPanel1Layout.createParallelGroup(
                            GroupLayout.Alignment.LEADING).
                        addComponent(self.textName).addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.textSeverity, GroupLayout.PREFERRED_SIZE,
                                98, GroupLayout.PREFERRED_SIZE).addGap(
                                    0, 0, Short.MAX_VALUE)).
                        addGroup(
                            jPanel1Layout.createSequentialGroup().addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE, 330,
                                GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).
                            addComponent(self.labelPath).addPreferredGap(
                                LayoutStyle.ComponentPlacement.RELATED
                            ).addComponent(self.textPath)))).addComponent(
                                self.tabIssue)).addContainerGap()))

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).
            addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(
            ).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelName).addComponent(
                            self.textName, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelSeverity).addComponent(
                            self.textSeverity, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
            ).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(
                jPanel1Layout.createParallelGroup(
                    GroupLayout.Alignment.BASELINE).addComponent(
                        self.labelHost).addComponent(
                            self.labelPath).addComponent(
                                self.textHost, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.textPath, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)).
                     addPreferredGap(
                         LayoutStyle.ComponentPlacement.RELATED).addComponent(
                             self.tabIssue).addContainerGap()))

        # create the main panel
        self.panel = JPanel()
        layout = GroupLayout(self.panel)
        self.panel.setLayout(layout)
        layout.setAutoCreateGaps(True)

        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addContainerGap().addGroup(
                    layout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(
                            self.jPanel1, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE).addComponent(
                                self.jScrollPane1)).addContainerGap()))
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                layout.createSequentialGroup().addContainerGap().addComponent(
                    self.jScrollPane1, GroupLayout.PREFERRED_SIZE, 119,
                    GroupLayout.PREFERRED_SIZE).addGap(
                        18, 18,
                        18).addComponent(self.jPanel1,
                                         GroupLayout.DEFAULT_SIZE,
                                         GroupLayout.DEFAULT_SIZE,
                                         Short.MAX_VALUE).addContainerGap()))