Esempio n. 1
0
    def set_pane(self):
        status = JTextArea()
        status.setLineWrap(True)
        status.setText("Nothing selected")
        self.status = status

        request_list_pane = JScrollPane()
        scanner_pane = JSplitPane(JSplitPane.VERTICAL_SPLIT, request_list_pane,
                                  self.tabbed_pane)
        self.pane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                               JScrollPane(self.tree), scanner_pane)
        self.pane.setDividerLocation(310)
        self.pane.getLeftComponent().setMinimumSize(Dimension(310, 300))
Esempio n. 2
0
 def run(self):
     frame = JFrame('SplitPane4',
                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
     button = self.button
     frame.add(
         JSplitPane(
             JSplitPane.VERTICAL_SPLIT, button('Top'),
             JSplitPane(
                 JSplitPane.HORIZONTAL_SPLIT,
                 button('Left'),
                 button('Right'),
             )))
     frame.pack()
     frame.setVisible(1)
Esempio n. 3
0
    def getUiComponent(self):
        """Burp uses this method to obtain the component that should be used as
        the contents of the custom tab when it is displayed.
        Returns a awt.Component.
        """
        # GUI happens here
        from javax.swing import (JPanel, JSplitPane, JLabel, JList,
                                 JScrollPane, ListSelectionModel)
        from java.awt import BorderLayout
        panel = JPanel(BorderLayout())

        # create a list and then JList out of it.
        colors = [
            "red", "orange", "yellow", "green", "cyan", "blue", "pink",
            "magenta", "gray", "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
        ]
        list1 = JList(colors)
        # set the selection mode to single items
        # ListSelectionModel.SINGLE_SELECTION = 0
        # https://docs.oracle.com/javase/8/docs/api/constant-values.html
        list1.selectionMode = ListSelectionModel.SINGLE_SELECTION

        # create splitpane - horizontal split
        spl = JSplitPane(JSplitPane.HORIZONTAL_SPLIT, JScrollPane(list1),
                         JLabel("right pane"))

        panel.add(spl)
        return panel
    def __init__(self, channels):
        JFrame.__init__(self, "Informa Example News Client")
        self.setSize(400, 400)
        self.addWindowListener(BasicWindowMonitor())

        self.channels = channels
        self.channel_dict = None

        self.channelTree = None
        self.channelPanel = None
        self.itemTable = None

        self.mediator = MainMediator(self)

        # items (in table)
        itemScrollPane = JScrollPane(self.getItemTable())

        # channels (as tree)
        channelScrollPane = JScrollPane(self.getChannelTree())

        # put together channel info with item table
        ch_and_items = JPanel()
        ch_and_items.setLayout(BorderLayout())
        ch_and_items.add(self.getChannelPanel(), BorderLayout.NORTH)
        ch_and_items.add(itemScrollPane, BorderLayout.CENTER)

        # final step
        sp = JSplitPane(JSplitPane.HORIZONTAL_SPLIT, channelScrollPane,
                        ch_and_items)
        # print "dividerLocation", sp.getDividerLocation()
        # sp.setDividerLocation(0.5)
        self.getContentPane().add(sp, BorderLayout.CENTER)
Esempio n. 5
0
    def __init__(self, callbacks, log):
        '''
        Creates GUI objects, registers right-click handlers, and adds the 
        extension's tab to the Burp UI.
        '''

        # Create split pane with top and bottom panes

        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self.bottom_pane = UiBottomPane(callbacks, log)
        self.top_pane = UiTopPane(callbacks, self.bottom_pane, log)
        self.bottom_pane.setLogTable(self.top_pane.logTable)
        self._splitpane.setLeftComponent(self.top_pane)
        self._splitpane.setRightComponent(self.bottom_pane)

        # Create right-click handler

        self.log = log
        rc_handler = RightClickHandler(callbacks, log)
        callbacks.registerContextMenuFactory(rc_handler)

        # Add the plugin's custom tab to Burp's UI

        callbacks.customizeUiComponent(self._splitpane)
        callbacks.addSuiteTab(self)
Esempio n. 6
0
 def setup_edit_area(self, split_orientation=None):
     '''
     Check if the ATF text area is being displayed in a split editor.
     If so, resets to normal JScrollPane. If not, splits the screen.
     '''
     if isinstance(self.container, JSplitPane):
         # If Nammu is already displaying a split pane, reset to original
         # setup
         self.container = JScrollPane(self.edit_area)
         self.container.setRowHeaderView(self.line_numbers_area)
         self.container.setVisible(True)
         self.add(self.container, BorderLayout.CENTER)
     else:
         # If there is not a split pane, create both panels and setup view
         main_editor = JScrollPane(self.edit_area)
         main_editor.setRowHeaderView(self.line_numbers_area)
         secondary_editor = JScrollPane(self.secondary_area)
         secondary_editor.setRowHeaderView(self.secondary_line_numbers)
         self.container = JSplitPane(split_orientation, main_editor,
                                     secondary_editor)
         self.container.setDividerSize(5)
         self.container.setVisible(True)
         self.container.setDividerLocation(0.5)
         self.container.setResizeWeight(0.5)
         self.add(self.container, BorderLayout.CENTER)
Esempio n. 7
0
    def show_exper_info(self):
        # sb = br.SimilarityBuilder()
        # cab = br.CollectionArchetypeBuilder()
        #
        # for hseg in self.exper.hsegs() :
        #     all_file_dict = hseg.file_dict()
        #     all_file_dict.update(hseg.cell_file_dict())
        #     all_file_dict.update(hseg.bin_file_dict())
        #     cab.add_collection(hseg.name, all_file_dict)
        #
        # hseg_at, hseg_at_deviations = cab.get_archetype_info()
        #
        # at_str = ''
        # for val in hseg_at :
        #     at_str += str(val) + '\n'

        chf_panel = self.make_chf_panel()
        hseg_tree_panel = self.make_hseg_tree_panel()

        self.split_pane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)

        self.split_pane.setOneTouchExpandable(True)
        self.split_pane.setContinuousLayout(True)
        self.split_pane.setResizeWeight(0.5)

        self.split_pane.add(chf_panel)
        self.split_pane.add(hseg_tree_panel)
        self.main_panel.add(self.split_pane, 'grow')
        self.revalidate()
Esempio n. 8
0
 def registerExtenderCallbacks(self, callbacks):
     # keep a reference to our callbacks object
     self._callbacks = callbacks
     # obtain an extension helpers object
     self._helpers = callbacks.getHelpers()
     # set our extension name
     callbacks.setExtensionName("sensitive")
     # create the log and a lock on which to synchronize when adding log entries
     self._log = ArrayList()
     self._lock = Lock()
     self._urls = []
     # main split pane
     self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
     # table of log entries
     logTable = Table(self)
     scrollPane = JScrollPane(logTable)
     self._splitpane.setLeftComponent(scrollPane)
     # tabs with request/response viewers
     tabs = JTabbedPane()
     self._requestViewer = callbacks.createMessageEditor(self, False)
     self._responseViewer = callbacks.createMessageEditor(self, False)
     tabs.addTab("Request", self._requestViewer.getComponent())
     tabs.addTab("Response", self._responseViewer.getComponent())
     self._splitpane.setRightComponent(tabs)
     # customize our UI components
     callbacks.customizeUiComponent(self._splitpane)
     callbacks.customizeUiComponent(logTable)
     callbacks.customizeUiComponent(scrollPane)
     callbacks.customizeUiComponent(tabs)
     # add the custom tab to Burp's UI
     callbacks.addSuiteTab(self)
     # register ourselves as an HTTP listener
     callbacks.registerHttpListener(self)
     return
Esempio n. 9
0
    def buildRequestTable(self, state, callbacks):
        """
        Builds the request list on the results page on the right.
        """
        splitpane = JSplitPane()
        splitpane.setDividerLocation(1000)

        endpointTable = Table(state.endpointTableModel)
        endpointTable.setDefaultRenderer(Class.forName('java.lang.Object'),
                                         CellHighlighterRenderer(state))

        endpointTable.getColumnModel().getColumn(0).setPreferredWidth(15)
        endpointTable.getColumnModel().getColumn(1).setPreferredWidth(500)
        endpointTable.setAutoCreateRowSorter(True)
        endpointTable.addMouseListener(TableMouseAdapter())

        endpointView = JScrollPane(endpointTable)
        callbacks.customizeUiComponent(endpointTable)
        callbacks.customizeUiComponent(endpointView)

        requestTable = Table(state.requestTableModel)
        requestTable.getColumnModel().getColumn(0).setPreferredWidth(500)

        requestView = JScrollPane(requestTable)
        callbacks.customizeUiComponent(requestTable)
        callbacks.customizeUiComponent(requestView)

        splitpane.setLeftComponent(endpointView)
        splitpane.setRightComponent(requestView)

        return splitpane
Esempio n. 10
0
    def getUiComponent(self):
        """Burp uses this method to obtain the component that should be used as
        the contents of the custom tab when it is displayed.
        Returns a awt.Component.
        """
        # GUI happens here
        from javax.swing import (JPanel, JSplitPane, JLabel, JList,
                                 JScrollPane, ListSelectionModel)
        from java.awt import BorderLayout
        panel = JPanel(BorderLayout())

        # create a list and then JList out of it.
        colors = [
            "red", "orange", "yellow", "green", "cyan", "blue", "pink",
            "magenta", "gray", "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
        ]

        def listSelect(event):
            """Add the selected index to the label."""
            label1.text += "-" + colors[list1.selectedIndex]

        # create a list and assign the valueChanged
        list1 = JList(colors, valueChanged=listSelect)
        list1.selectionMode = ListSelectionModel.SINGLE_SELECTION

        # create splitpane - horizontal split
        label1 = JLabel("right pane")
        spl = JSplitPane(JSplitPane.HORIZONTAL_SPLIT, JScrollPane(list1),
                         label1)

        panel.add(spl)
        return panel
Esempio n. 11
0
    def __init__(self, extender, controller, editable):

        self._extender = extender
        self._callbacks = extender.callbacks
        self._helpers = extender.helpers

        self._controller = controller

        self._text_editor = self._callbacks.createTextEditor()
        self._text_editor.setEditable(editable)
        self._editable = editable

        self._component = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
        self._component.setLeftComponent(self._text_editor.getComponent())
        self._component.setRightComponent(self.createButtonPane())
        self._component.setResizeWeight(0.8)

        self.message_type = None
        self._is_request = None
        self._encoder = None
        self._original_json = None
        self._content_info = None
        self._request_content_info = None
        self._request = None
        self._original_content = None
Esempio n. 12
0
    def __init__(self, title, size, location, data, closable=0):
        JInternalFrame.__init__(self,
                                title,
                                resizable=1,
                                closable=closable,
                                maximizable=1,
                                iconifiable=1,
                                size=size)
        self.setLocation(location)

        #-----------------------------------------------------------------------
        # Create the JTree, with only 1 item selectable
        # Note: Secondary value is a dictionary
        #-----------------------------------------------------------------------
        tree = self.cellTree(data)
        tree.getSelectionModel().setSelectionMode(
            TreeSelectionModel.SINGLE_TREE_SELECTION)

        self.status = JLabel('Nothing selected', font=MONOFONT)
        pane = self.add(
            JSplitPane(JSplitPane.HORIZONTAL_SPLIT, JScrollPane(tree),
                       JScrollPane(self.status)))
        pane.setDividerLocation(size.width >> 1)
        tree.addTreeSelectionListener(cellTSL(tree, pane, data))

        self.setVisible(1)
    def start(self):

        self.frame = JDialog()
        #self.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
        self.frame.setLocation(0, 1500)
        self.frame.setSize(1000, 200)

        self.tableDataModel = DefaultTableModel([], [
            "URL", "Code", "Content-Length", "Location", "Mutated Id",
            "Orig Id"
        ])
        self.jtable = JTable(self.tableDataModel)

        scrollPane = JScrollPane(self.jtable)
        self.jtable.setFillsViewportHeight(True)

        messageEditorOrig = self.callbacks.createMessageEditor(None, False)
        messageEditorModified = self.callbacks.createMessageEditor(
            None, False)
        self.editorSplitPane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                                          messageEditorOrig.getComponent(),
                                          messageEditorModified.getComponent())
        self.editorSplitPane.setResizeWeight(0.5)

        splitPane = JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane,
                               self.editorSplitPane)
        splitPane.setResizeWeight(0.5)

        class TableSelector(ListSelectionListener):
            def __init__(self, plugin):
                self.plugin = plugin

            def valueChanged(self, event):
                if not event.getValueIsAdjusting():
                    selectedRowIndex = self.plugin.jtable.getSelectedRows()[0]

                    self.plugin._rowSelected(selectedRowIndex)

        self.jtable.getSelectionModel().addListSelectionListener(
            TableSelector(self))

        self.frame.add(splitPane)
        self.frame.setVisible(True)

        self.callbacks.registerHttpListener(self)
        self.callbacks.setExtensionName("Custom Plugin")
        return
Esempio n. 14
0
    def initGui(self):
        def make_game_selector():
            self.gameChanger = False

            def dbChange(evt):
                if evt.source.text:
                    self.gamedb = GameDB(evt.source.text)
                    self.gameChanger = True

            def idChange(evt):
                if evt.source.text:
                    self.gameid = evt.source.text
                    self.gameChanger = True

            def turnChange(evt):
                if evt.source.text:
                    self.turnid = evt.source.text
                    self.gameChanger = True

            selector = JPanel()
            selector.add(JLabel("DB:"))
            selector.add(textfield(self.gamedb.dbfile, dbChange))
            selector.add(JLabel("Game ID:"))
            selector.add(textfield(self.gameid, idChange))
            selector.add(JLabel("Turn ID:"))
            selector.add(textfield(self.turnid, turnChange))
            return JScrollPane(selector)

        def make_content_panel():
            self.contentPanel = JPanel(GridLayout(1, 0, 5, 5))
            self.render()
            return JScrollPane(self.contentPanel)

        def save(self, txt, filename):
            pass

        def make_code_editor():
            import inspect
            panel = JPanel(BorderLayout(2, 2))
            self.codeArea = JTextArea()
            self.codeArea.text = self.scoringModule and inspect.getsource(
                self.scoringModule) or ""
            panel.add(JScrollPane(self.codeArea), BorderLayout.CENTER)
            return panel

        self.frame.contentPane.add(make_game_selector(), BorderLayout.NORTH)
        #        self.frame.contentPane.add(make_content_panel(), BorderLayout.WEST)
        #        self.frame.contentPane.add(make_code_editor(),   BorderLayout.CENTER)
        pane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT, make_content_panel(),
                          make_code_editor())
        pane.setDividerLocation(self.frame.width / 2)
        self.frame.contentPane.add(pane)
        reloadButton = JButton("Reload")

        def reload(evt):
            self.reload()

        reloadButton.addActionListener(reload)
        self.frame.contentPane.add(reloadButton, BorderLayout.SOUTH)
Esempio n. 15
0
 def run(self):
     frame = JFrame('SplitPane1',
                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
     frame.add(
         JSplitPane(JSplitPane.HORIZONTAL_SPLIT, JButton('Left'),
                    JButton('Right')))
     frame.pack()
     frame.setVisible(1)
Esempio n. 16
0
    def registerExtenderCallbacks(self, callbacks):

        # set our extension name
        callbacks.setExtensionName("Hello world extension")

        # obtain our output and error streams
        stdout = PrintWriter(callbacks.getStdout(), True)
        stderr = PrintWriter(callbacks.getStderr(), True)

        # write a message to our output stream
        stdout.println("Hello output")

        # write a message to our error stream
        stderr.println("Hello errors")

        # write a message to the Burp alerts tab
        callbacks.issueAlert("Hello alerts")

        #create and populate a jtable:
        initial_row = [
            'http', 'www.meetup.com',
            'PyMNtos-Twin-Cities-Python-User-Group/events/267977020/', '', '',
            ''
        ]
        self.fileTable = JTable(ResourceTableModel(initial_row))
        # set up the Tab:

        self.infoPanel = JPanel()
        footerPanel = JPanel()

        footerPanel.add(JLabel("by mcgyver5 "))
        self._chooseFileButton = JButton("OPEN Local FILE",
                                         actionPerformed=self.fileButtonClick)
        self.infoPanel.add(JLabel("INFORMATION PANE"))

        self.infoPanel.add(self._chooseFileButton)
        scrollpane = JScrollPane(self.fileTable)
        ## this is a split inside the top component
        topPane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        topPane.setTopComponent(self.infoPanel)
        topPane.setBottomComponent(scrollpane)
        self._chooseFileButton.setEnabled(True)
        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self._splitpane.setTopComponent(topPane)
        self._splitpane.setBottomComponent(footerPanel)
        callbacks.addSuiteTab(self)
Esempio n. 17
0
 def addCenterPane(self, atfAreaView, consoleView):
     splitPane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
     splitPane.setTopComponent(atfAreaView)
     splitPane.setBottomComponent(consoleView)
     splitPane.setDividerSize(5)
     self.getContentPane().add(splitPane, BorderLayout.CENTER)
     # Make console's high remain smaller compared to edit area
     splitPane.setResizeWeight(0.9)
Esempio n. 18
0
 def run(self):
     frame = JFrame('SplitPane2',
                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
     frame.add(
         JSplitPane(JSplitPane.VERTICAL_SPLIT, JButton('Top'),
                    JButton('Bottom')))
     frame.pack()
     frame.setVisible(1)
Esempio n. 19
0
    def initializeGUI(self):
        # table panel of scope entries
        self._url_table = Table(self)
        table_popup = JPopupMenu();
        remove_item_menu = JMenuItem(self._remove_description, actionPerformed=self.removeFromScope)
        table_popup.add(remove_item_menu)
        self._url_table.setComponentPopupMenu(table_popup)
        self._url_table.addMouseListener(TableMouseListener(self._url_table))
        scrollPane = JScrollPane(self._url_table)

        # setting panel              

        ##  locate checkboxes
        ### for constants, see: https://portswigger.net/burp/extender/api/constant-values.html#burp.IBurpExtenderCallbacks.TOOL_PROXY          
        self._checkboxes = {
            2:    JCheckBox('Target'),
            4:    JCheckBox('Proxy'),
            8:    JCheckBox('Spider'),
            16:   JCheckBox('Scanner'),
            32:   JCheckBox('Intruder'),            
            64:   JCheckBox('Repeater'),
            128:  JCheckBox('Sequencer'),
            1024: JCheckBox('Extender')
        }
        checkboxes_components = {0: dict(zip(range(1,len(self._checkboxes) + 1), self._checkboxes.values()))}

        self._label_value_regex_now_1 = JLabel("(1) Regex for the value to store: ")
        self._label_value_regex_now_2 = JLabel("")
        self._label_value_regex = JLabel("(1) New regex:")
        self._form_value_regex = JTextField("", 64)
        self._button_value_regex = JButton('Update', actionPerformed=self.updateTokenSourceRegex)        
        self._label_header_now_1 = JLabel("(2) Header for sending the value: ")
        self._label_header_now_2 = JLabel("")
        self._label_header = JLabel("(2) New header key: ")
        self._form_header = JTextField("", 64)
        self._button_header = JButton('Update', actionPerformed=self.updateHeaderName)
        self._label_add_url = JLabel("Add this URL: ")
        self._form_add_url = JTextField("", 64)
        self._button_add_url = JButton('Add', actionPerformed=self.addURLDirectly)
                
        ## logate regex settings
        ui_components_for_settings_pane = {
            0: { 0: JLabel("Local Settings:") },
            1: { 0: self._label_value_regex_now_1, 1: self._label_value_regex_now_2 },
            2: { 0: self._label_value_regex, 1: self._form_value_regex, 2: self._button_value_regex},
            3: { 0: self._label_header_now_1, 1: self._label_header_now_2 },
            4: { 0: self._label_header, 1: self._form_header, 2: self._button_header},
            5: { 0: {'item': JSeparator(JSeparator.HORIZONTAL), 'width': 3, }},
            6: { 0: JLabel("General Settings:") },
            7: { 0: self._label_add_url, 1: self._form_add_url, 2: self._button_add_url},
            8: { 0: JLabel("Use this extender in:"), 1: {'item': self.compose_ui(checkboxes_components), 'width': 3} }
        }
        # build a split panel & set UI component
        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self._splitpane.setResizeWeight(0.85)
        self._splitpane.setLeftComponent(scrollPane)
        self._splitpane.setRightComponent(self.compose_ui(ui_components_for_settings_pane))
        self._callbacks.customizeUiComponent(self._splitpane)
Esempio n. 20
0
 def __init__(self, script, callbacks):
     self.script = script
     self.layout = BorderLayout()
     self.editingPanel = ScriptEditingPanel(callbacks, script)
     self.outputPanel = ScriptOutputPanel(callbacks, script)
     self.splitPane = JSplitPane(JSplitPane.VERTICAL_SPLIT, dividerSize=10)
     self.splitPane.topComponent = self.editingPanel
     self.splitPane.bottomComponent = self.outputPanel
     self.add(self.splitPane, BorderLayout.CENTER)
Esempio n. 21
0
 def __init__(self, dir=None, filetree_label=None, texteditor_factory=None):
     if not dir: dir = os.getcwd()
     self._filetree = FileTree(dir=dir, label=filetree_label)
     self._payloadview = PayloadView(texteditor_factory=texteditor_factory)
     self.this = JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                            self._filetree.this, self._payloadview.this)
     self.this.setOneTouchExpandable(True)
     self._filetree.add_tree_selection_listener(self._tree_listener)
     self.this.getRightComponent().setVisible(False)
Esempio n. 22
0
    def registerExtenderCallbacks(self, callbacks):

        self._callbacks = callbacks
        self._helpers = callbacks.getHelpers()
        #self.context = None

        # main split pane
        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self._splitpane2 = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)

        # Table of RequestLists
        requestTable = TableOne(self)
        scrollPane = JScrollPane(requestTable)
        self._splitpane.setLeftComponent(scrollPane)

        # Request List
        self._reqstack = ArrayList()
        self._lock = Lock()

        # tabs with request/response viewers
        tabs = JTabbedPane()
        self._requestViewer = callbacks.createMessageEditor(self, False)
        self._responseViewer = callbacks.createMessageEditor(self, False)
        tabs.addTab("Request", self._requestViewer.getComponent())
        tabs.addTab("Response", self._responseViewer.getComponent())
        self._splitpane.setRightComponent(tabs)

        # customize our UI components
        callbacks.customizeUiComponent(self._splitpane)
        callbacks.customizeUiComponent(requestTable)
        callbacks.customizeUiComponent(scrollPane)
        callbacks.customizeUiComponent(tabs)

        # Extention Name and Info
        callbacks.setExtensionName("ReqSquared")
        callbacks.registerContextMenuFactory(self)

        # Initialize tab
        callbacks.addSuiteTab(self)

        # IntruderPayloadGeneratorFactory
        #callbacks.registerIntruderPayloadGeneratorFactory(self)

        return
Esempio n. 23
0
    def _refresh_queries(self, payload):
        """
        Refresh the textarea content with a new payload, if present

        :param payload:
        :return: None
        """
        graphql_tabs = []
        for i in range(0, self.this.getTabCount()):
            if self.this.getTitleAt(i).startswith("GraphQL #"):
                graphql_tabs.append(self.this.getTitleAt(i))

        if payload:
            # Check if the payload contains a GraphQL query object
            queries = self._graphql_queries(payload)
            if queries:
                # Generate and append GraphQL tab to the tabs
                for query_key in queries.keys():
                    qname = "gql_query#%s" % query_key
                    vname = "gql_variables#%s" % query_key
                    tname = "GraphQL #%s" % query_key
                    queryeditor = self._create_texteditor(name=qname,
                                                          label="Query:")
                    self._textareas[qname].setText(queries[query_key]['query'])
                    variableseditor = self._create_texteditor(
                        name=vname, label="Variables:")
                    this = self._get_tab_component_by_name(tname)
                    if tname in graphql_tabs:
                        graphql_tabs.remove(tname)
                    if not this:
                        this = JSplitPane(JSplitPane.VERTICAL_SPLIT,
                                          queryeditor, variableseditor)
                    self.this.addTab(tname, this)
                    this.setOneTouchExpandable(True)
                    this.setDividerLocation(0.66)
                    if 'variables' in queries[query_key]:
                        this.getBottomComponent().setVisible(True)
                        self._textareas[vname].setText(
                            json.dumps(queries[query_key]['variables'],
                                       indent=4))
                    else:
                        this.getBottomComponent().setVisible(False)
                        self._textareas[vname].setText("{}")

        # Remove empty graphql tabs
        try:
            for tab in graphql_tabs:
                for i in range(0, self.this.getTabCount()):
                    if self.this.getTitleAt(i) == tab:
                        self.this.remove(i)
        except:
            # Do nothing if you cannot remove an entry
            pass

        inherits_popup_menu(self.this)
    def registerExtenderCallbacks(self, callbacks):

        # keep a reference to our callbacks object
        self._callbacks = callbacks

        # obtain an extension helpers object
        self._helpers = callbacks.getHelpers()

        # set our extension name
        callbacks.setExtensionName("CrownJewelFinder")

        # create the log and a lock on which to synchronize when adding log entries
        self._log = ArrayList()
        self._lock = Lock()

        # main split pane
        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)

        # tabs with request/response viewers
        tabs = JTabbedPane()
        self._requestViewer = callbacks.createMessageEditor(self, False)
        self._responseViewer = callbacks.createMessageEditor(self, False)
        tabs.addTab("Request", self._requestViewer.getComponent())
        tabs.addTab("Response", self._responseViewer.getComponent())
        self._splitpane.setRightComponent(tabs)
        # table of log entries
        logTable = Table(self)
        scrollPane = JScrollPane(logTable)
        self._splitpane.setLeftComponent(scrollPane)
        # customize our UI components
        callbacks.customizeUiComponent(self._splitpane)
        callbacks.customizeUiComponent(logTable)
        callbacks.customizeUiComponent(scrollPane)
        callbacks.customizeUiComponent(tabs)

        #Compile RegEx Patterns
        regex = "[A-Z0-9]{5,20}"
        self.myre = re.compile(regex, re.DOTALL)

        # restore burp state
        self.file = ''
        #file = java.io.File('E:/Projects/CPF/Burp-States-Dump/Iteration3-1June2015/172.24.101.42/2015.06.01_08.17.burp')
        #print file.__class__
        #print file.exists()
        #callbacks.restoreState(file)

        #get Request/Response from history
        #reqres = callbacks.getProxyHistory()
        #print len(reqres)
        #self.RetrievInterestingRequests(callbacks, reqres)
        # add the custom tab to Burp's UI
        callbacks.addSuiteTab(self)
        self.doInterestingThings()
        #self.fileInput()
        return
Esempio n. 25
0
        def registerExtenderCallbacks(self, callbacks):
            self._callbacks = callbacks
            self._helpers = callbacks.getHelpers()
            callbacks.setExtensionName("JS issues processor")
            #callbacks.registerHttpListener(self)

            self._issues = ArrayList()
            #self._lock = Lock()

            # main split pane
            self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
            
            # table of log entries
            logTable = Table(self)
            scrollPane = JScrollPane(logTable)
            self._splitpane.setLeftComponent(scrollPane)

            self._texteditor = callbacks.createTextEditor()

            #self._text = JTextArea(5, 80)
            textpane = JScrollPane(self._texteditor.getComponent())

            self._splitpane.setRightComponent(textpane)

            callbacks.customizeUiComponent(self._splitpane)
            callbacks.customizeUiComponent(logTable)
            #callbacks.customizeUiComponent()
            callbacks.customizeUiComponent(textpane)
            


            callbacks.addSuiteTab(self)

            print("[+] Reading current scanner issues")

            issues = callbacks.getScanIssues("https://www.example.com/")

            ip = IssueParser()

            for i in issues:
                if re.match("^The JavaScript file",i.getIssueName()):
                    #print(i.getIssueName())
                    #print(i.getUrl().toString())

                    ip.parseIssue(i)
                    #self._lock.acquire()
                    row = self._issues.size()
                    self._issues.add(IssueEntry(i) )
                    self.fireTableRowsInserted(row, row)
                    #self._lock.release()

            print("JS Libs Report:")
            print(ip.genReport())

            return
Esempio n. 26
0
    def registerExtenderCallbacks(self, callbacks):
        # PDB debugging: connect sys.stdout and sys.stderr to Burp
        # sys.stdout = callbacks.getStdout()
        # sys.stderr = callbacks.getStderr()

        # keep a reference to our callbacks object
        self._callbacks = callbacks

        # obtain an extension helpers object
        self._helpers = callbacks.getHelpers()

        # set extension name
        callbacks.setExtensionName("To Do")

        # create the log and a lock on which to synchronize when adding
        # log entries
        self._log = ArrayList()
        self._lock = Lock()

        # main split pane
        self._splitpane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)

        # Configuration Tab
        self.initConfigTab()

        # table of to do entries
        logTable = Table(self)
        scrollPane = JScrollPane(logTable)
        self._splitpane.setLeftComponent(scrollPane)

        # Config tab
        self.tabs = JTabbedPane()
        self._configuration = self._callbacks.createMessageEditor(self, False)
        self.tabs.addTab("Configuration", self._configuration.getComponent())
        self._splitpane.setRightComponent(self.panel)

        # customize our UI components
        callbacks.customizeUiComponent(self._splitpane)
        callbacks.customizeUiComponent(logTable)
        callbacks.customizeUiComponent(scrollPane)

        # add the custom tab to Burp's UI
        callbacks.addSuiteTab(self)

        # register ourselves as an HTTP listener
        callbacks.registerHttpListener(self)

        # initialize tabs
        self.initTabs()

        # Print thank you, contact info, etc
        print("Thank you for installing Burp To Do List")
        print("created by Chris Lockard")
        print("https://github.com/chrislockard/BurpToDoList")
        return
Esempio n. 27
0
    def set_pane(self):
        status = JTextArea()
        status.setLineWrap(True)
        status.setText("Nothing selected")
        self.status = status

        self.pane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                               JScrollPane(self.tree), JTabbedPane())

        self.pane.setDividerLocation(310)
        self.pane.getLeftComponent().setMinimumSize(Dimension(310, 300))
Esempio n. 28
0
    def set_scanner_panes(self):
        for issue in self.issues:
            issue_name = issue["name"]
            issue_param = issue["param"]
            key = issue_name + "." + issue_param

            top_pane = self.create_request_list_pane(issue_name)
            bottom_pane = self.create_tabbed_pane()

            scanner_pane = JSplitPane(JSplitPane.VERTICAL_SPLIT, top_pane,
                                      bottom_pane)
            self.scanner_panes[key] = scanner_pane
Esempio n. 29
0
    def buildMessageViewer(self, state, callbacks):
        """
        Builds the panel that allows users to view requests on the results page.

        Args:
            state: the state object.
            callbacks: the burp callbacks object.
        """

        tabs = JTabbedPane()

        original = JSplitPane()
        original.setDividerLocation(1000)

        modified = JSplitPane()
        modified.setDividerLocation(1000)

        originalRequestEditor = MessageEditorController(state, "original")
        repeatedRequestEditor = MessageEditorController(state, "repeated")

        state.originalRequestViewer = callbacks.createMessageEditor(
            originalRequestEditor, False)
        state.originalResponseViewer = callbacks.createMessageEditor(
            originalRequestEditor, False)

        state.repeatedRequestViewer = callbacks.createMessageEditor(
            repeatedRequestEditor, False)
        state.repeatedResponseViewer = callbacks.createMessageEditor(
            repeatedRequestEditor, False)

        original.setLeftComponent(state.originalRequestViewer.getComponent())
        original.setRightComponent(state.originalResponseViewer.getComponent())

        modified.setLeftComponent(state.repeatedRequestViewer.getComponent())
        modified.setRightComponent(state.repeatedResponseViewer.getComponent())

        tabs.addTab("Original", original)
        tabs.addTab("Modified", modified)

        return tabs
Esempio n. 30
0
    def registerExtenderCallbacks(self, callbacks):

        # set our extension name
        callbacks.setExtensionName("War Story")

        # obtain our output stream
        self._stdout = PrintWriter(callbacks.getStdout(), True)

        # write a message to our output stream
        self._stdout.println("Loading WarStory")

        # write a message to the Burp alerts tab
        callbacks.issueAlert("Hello alerts")
        label = JLabel("INFO PANEL")
        self.infoPanel = JPanel()
        footerPanel = JPanel()
        footerPanel.add(JLabel("by Tim mcgyver5 McGuire"))
        self._chooseFileButton = JButton("OPEN WAR FILE",
                                         actionPerformed=self.fileButtonClick)
        self.infoPanel.add(JLabel("THIS IS INFORMATION PANE"))
        self.infoPanel.add(self._chooseFileButton)
        # iaap.war|web.xml|axServlet|/skuppy/axservlet.do|
        self._chooseFileButton.setEnabled(True)
        initial_row = ['a', 'bb', 'ccc', 'ddd', 'eeee']
        self.fileTable = JTable(ResourceTableModel(initial_row))
        scrollpane = JScrollPane(self.fileTable)

        ## this is a split inside the top component
        topPane = JSplitPane(JSplitPane.VERTICAL_SPLIT)

        topPane.setTopComponent(self.infoPanel)
        topPane.setBottomComponent(scrollpane)

        # split the top panel into a Panel and a JScrollPane

        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self._splitpane.setTopComponent(topPane)
        self._splitpane.setBottomComponent(footerPanel)

        callbacks.addSuiteTab(self)