Ejemplo n.º 1
0
 def sync( self ):
     
     try:
         lib_loc = java.io.File( '%s.tmp' % self.path )
         pwriter = java.io.PrintWriter( lib_loc )
     
         for z in self.libraries:
         
             line = '%s=%s' %( z, self.libraries[ z ] )
             pwriter.println( line )
         
     
         pwriter.close()
         lib_loc.renameTo( java.io.File( self.path ) )
     finally:
         pass
         
         
     data = self.libraries.keys()
     data.sort()
     dlm = swing.DefaultListModel()
     for z in data:
         dlm.addElement( z )
     self.libs.setModel( dlm )
     if len( data ) != 0:
         self.libs.setSelectedIndex( 0 ) 
Ejemplo n.º 2
0
    def __init__(self):
        self.myFrame = swing.JFrame.__init__(self, 'Fragments')

        self.mydlg = EditFragment(self)
        self.mySession = ActiveSession(_session)

        self.myListModel = swing.DefaultListModel()
        self.myList = swing.JList(self.myListModel)
        myMidPanel = swing.JScrollPane(self.myList)

        myTopPanel = swing.JPanel()
        self.myEntry = swing.JTextField(40)
        myTopPanel.add(self.myEntry)
        myTopPanel.add(swing.JButton('Add', actionPerformed=self.AddValue))
        myTopPanel.add(swing.JButton('Trim', actionPerformed=self.TrimValue))
        myTopPanel.add(
            swing.JButton('[Enter]', actionPerformed=self.EnterValue))

        myPanel = swing.JPanel()
        myPanel.add(swing.JButton('Edit', actionPerformed=self.EditValue))
        myPanel.add(swing.JButton('Remove', actionPerformed=self.RemoveValue))
        myPanel.add(swing.JButton('Use', actionPerformed=self.UseValue))
        myPanel.add(
            swing.JButton('Refresh', actionPerformed=self.RefreshSessions))
        myPanel.add(swing.JButton('Save', actionPerformed=self.SaveValue))
        myPanel.add(swing.JButton('Restore', actionPerformed=self.RstValue))

        self.contentPane.add(myTopPanel, awt.BorderLayout.NORTH)
        self.contentPane.add(myMidPanel, awt.BorderLayout.CENTER)
        self.contentPane.add(myPanel, awt.BorderLayout.SOUTH)

        self.pack()
Ejemplo n.º 3
0
    def setListContents(self):

        items = self.names()
        #items.sort()
        mod = swing.DefaultListModel()
        slvalue = self.lbox.getSelectedValue()
        for z in items:
            mod.addElement(z)
        self.lbox.setModel(mod)
        self.dialog.pack()
        if slvalue != None and slvalue in items:
            self.lbox.setSelectedValue(slvalue)
        else:
            if len(items) > 0:
                self.lbox.setSelectedIndex(0)
Ejemplo n.º 4
0
    def __call__(self, event, command):

        self.emacs.keyboardQuit(event)
        if self.jd == None:
            self.createGui()
        #data = self.db.keys()
        #data.sort()
        data = self.libraries.keys()
        data.sort()
        dlm = swing.DefaultListModel()
        for z in data:
            dlm.addElement(z)
        self.libs.setModel(dlm)
        if len(data) != 0:
            self.libs.setSelectedIndex(0)

        jd = self.jd
        jd.validate()
        jd.pack()
        x, y = g.app.gui._calculateCenteredPosition(jd)
        jd.setLocation(x, y)
        jd.show()
        return True
Ejemplo n.º 5
0
    def initGui(self):
        self.tab = swing.JPanel()
        self.titleLabel = swing.JLabel("Burp Importer")
        self.titleLabel.setFont(Font("Tahoma", 1, 16))
        self.titleLabel.setForeground(Color(235, 136, 0))
        self.infoLabel = swing.JLabel(
            "Burp Importer loads a list of URLs or parses output from various automated scanners and populates the sitemap with each successful connection."
        )
        self.infoLabel.setFont(Font("Tahoma", 0, 12))
        self.fileOptionLabel = swing.JLabel("File Load Option")
        self.fileOptionLabel.setFont(Font("Tahoma", 1, 12))
        self.fileDescLabel = swing.JLabel(
            "This option is only used when loading a file to be parsed for http(s) connections.  You can disregard this option and paste a list of URLs in the box below."
        )
        self.fileDescLabel.setFont(Font("Tahoma", 0, 12))
        self.fileDescLabel2 = swing.JLabel(
            "Supported files: .gnamp, .nessus, .txt")
        self.fileDescLabel2.setFont(Font("Tahoma", 0, 12))
        self.parseFileButton = swing.JButton("Load File to Parse",
                                             actionPerformed=self.loadFile)
        self.urlLabel = swing.JLabel("URL List")
        self.urlLabel.setFont(Font("Tahoma", 1, 12))
        self.urlDescLabel = swing.JLabel(
            "URLs in this list should be in the format: protocol://host:port/optional-path"
        )
        self.urlDescLabel.setFont(Font("Tahoma", 0, 12))
        self.urlDescLabel2 = swing.JLabel(
            "Example: https://127.0.0.1:443/index. Port is optional, 80 or 443 will be assumed."
        )
        self.urlDescLabel2.setFont(Font("Tahoma", 0, 12))
        self.pasteButton = swing.JButton("Paste", actionPerformed=self.paste)
        self.loadButton = swing.JButton("Copy List",
                                        actionPerformed=self.setClipboardText)
        self.removeButton = swing.JButton("Remove",
                                          actionPerformed=self.remove)
        self.clearButton = swing.JButton("Clear", actionPerformed=self.clear)
        self.urlListModel = swing.DefaultListModel()
        self.urlList = swing.JList(self.urlListModel)
        self.urlListPane = swing.JScrollPane(self.urlList)
        self.addButton = swing.JButton("Add", actionPerformed=self.addURL)
        self.runLabel = swing.JLabel(
            "<html>Click the <b>RUN</b> button to attempt a connection to each URL in the URL List.  Successful connections will be added to Burp's sitemap.</html>"
        )
        self.runLabel.setFont(Font("Tahoma", 0, 12))
        self.redirectsCheckbox = swing.JCheckBox(
            "Enable: Follow Redirects (301 or 302 Response)")
        self.runButton = swing.JButton("RUN", actionPerformed=self.runClicked)
        self.runButton.setFont(Font("Tahoma", 1, 12))
        self.addUrlField = swing.JTextField("New URL...",
                                            focusGained=self.clearField,
                                            focusLost=self.fillField)
        self.logLabel = swing.JLabel("Log:")
        self.logLabel.setFont(Font("Tahoma", 1, 12))
        self.logPane = swing.JScrollPane()
        self.logArea = swing.JTextArea(
            "Burp Importer Log - Parsing and Run details will be appended here.\n"
        )
        self.logArea.setLineWrap(True)
        self.logPane.setViewportView(self.logArea)
        self.webPortDict = {'80':'http','81':'http','82':'http','83':'http','443':'https','2301':'http','2381':'https','8000':'http','8008':'http','8080':'http','8083':'https','8180':'http','8400':'http',\
        '8443':'https','8834':'https','8888':'http','9001':'http','9043':'https','9080':'http','9090':'http','9100':'http','9443':'https'}
        self.bar = swing.JSeparator(swing.SwingConstants.HORIZONTAL)
        self.bar2 = swing.JSeparator(swing.SwingConstants.HORIZONTAL)
        layout = swing.GroupLayout(self.tab)
        self.tab.setLayout(layout)

        # Credit to Antonio Sánchez and https://github.com/Dionach/HeadersAnalyzer/
        layout.setHorizontalGroup(
            layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING).
            addGroup(layout.createSequentialGroup().addGap(15).addGroup(
                layout.createParallelGroup(
                    swing.GroupLayout.Alignment.LEADING).addComponent(
                        self.titleLabel).addComponent(
                            self.infoLabel).addComponent(
                                self.fileOptionLabel).addComponent(
                                    self.fileDescLabel).addComponent(
                                        self.fileDescLabel2).addComponent(
                                            self.parseFileButton).addComponent(
                                                self.bar).addComponent(
                                                    self.urlLabel).
                addComponent(self.urlDescLabel).addComponent(
                    self.urlDescLabel2).addComponent(self.bar2).addComponent(
                        self.runLabel).addComponent(
                            self.redirectsCheckbox).addComponent(
                                self.runButton).addComponent(
                                    self.logPane,
                                    swing.GroupLayout.PREFERRED_SIZE, 525,
                                    swing.GroupLayout.PREFERRED_SIZE).
                addGroup(layout.createSequentialGroup().addGroup(
                    layout.createParallelGroup(
                        swing.GroupLayout.Alignment.TRAILING).
                    addComponent(self.addButton).addGroup(
                        layout.createParallelGroup(
                            swing.GroupLayout.Alignment.LEADING).addComponent(
                                self.logLabel).addGroup(
                                    layout.createParallelGroup(
                                        swing.GroupLayout.Alignment.TRAILING,
                                        False).addComponent(
                                            self.removeButton,
                                            swing.GroupLayout.DEFAULT_SIZE,
                                            swing.GroupLayout.DEFAULT_SIZE,
                                            lang.Short.MAX_VALUE).addComponent(
                                                self.pasteButton,
                                                swing.GroupLayout.DEFAULT_SIZE,
                                                swing.GroupLayout.DEFAULT_SIZE,
                                                lang.Short.MAX_VALUE).
                                    addComponent(
                                        self.loadButton,
                                        swing.GroupLayout.DEFAULT_SIZE,
                                        swing.GroupLayout.DEFAULT_SIZE,
                                        lang.Short.MAX_VALUE).addComponent(
                                            self.clearButton,
                                            swing.GroupLayout.DEFAULT_SIZE,
                                            swing.GroupLayout.PREFERRED_SIZE,
                                            lang.Short.MAX_VALUE)))
                ).addPreferredGap(
                    swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                        layout.createParallelGroup(
                            swing.GroupLayout.Alignment.LEADING).addComponent(
                                self.urlListPane,
                                swing.GroupLayout.PREFERRED_SIZE, 350,
                                swing.GroupLayout.PREFERRED_SIZE).addComponent(
                                    self.addUrlField,
                                    swing.GroupLayout.PREFERRED_SIZE, 350,
                                    swing.GroupLayout.PREFERRED_SIZE)))).
                     addContainerGap(26, lang.Short.MAX_VALUE)))

        layout.setVerticalGroup(
            layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING).
            addGroup(
                layout.createSequentialGroup().addGap(15).addComponent(
                    self.titleLabel).addGap(10).addComponent(
                        self.infoLabel).addGap(10).addComponent(
                            self.fileOptionLabel).addGap(10).addComponent(
                                self.fileDescLabel).addGap(10).addComponent(
                                    self.fileDescLabel2).addGap(10).
                addComponent(self.parseFileButton).addGap(10).addComponent(
                    self.bar).addComponent(
                        self.urlLabel).addGap(10).addComponent(
                            self.urlDescLabel).addGap(10).
                addComponent(self.urlDescLabel2).addPreferredGap(
                    swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(
                        layout.createParallelGroup(
                            swing.GroupLayout.Alignment.LEADING).
                        addGroup(layout.createSequentialGroup().addGroup(
                            layout.createParallelGroup(
                                swing.GroupLayout.Alignment.LEADING).
                            addGroup(layout.createSequentialGroup(
                            ).addComponent(self.pasteButton).addPreferredGap(
                                swing.LayoutStyle.ComponentPlacement.RELATED
                            ).addComponent(self.loadButton).addPreferredGap(
                                swing.LayoutStyle.ComponentPlacement.RELATED
                            ).addComponent(self.removeButton).addPreferredGap(
                                swing.LayoutStyle.ComponentPlacement.RELATED
                            ).addComponent(self.clearButton)).addComponent(
                                self.urlListPane,
                                swing.GroupLayout.PREFERRED_SIZE, 138,
                                swing.GroupLayout.PREFERRED_SIZE)).addGap(10).
                                 addGroup(
                                     layout.createParallelGroup(
                                         swing.GroupLayout.Alignment.BASELINE).
                                     addComponent(self.addButton).addComponent(
                                         self.addUrlField,
                                         swing.GroupLayout.PREFERRED_SIZE,
                                         swing.GroupLayout.DEFAULT_SIZE,
                                         swing.GroupLayout.PREFERRED_SIZE)))
                    ).addGap(10).addComponent(self.bar2).addComponent(
                        self.runLabel).addGap(10).addComponent(
                            self.redirectsCheckbox).addGap(10).addComponent(
                                self.runButton).addGap(10).
                addComponent(self.logLabel).addPreferredGap(
                    swing.LayoutStyle.ComponentPlacement.RELATED).addGap(
                        8, 8, 8).addComponent(
                            self.logPane, swing.GroupLayout.PREFERRED_SIZE,
                            125,
                            swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                swing.LayoutStyle.ComponentPlacement.RELATED
                            ).addContainerGap(swing.GroupLayout.DEFAULT_SIZE,
                                              lang.Short.MAX_VALUE)))
        return
Ejemplo n.º 6
0
    def __init__(self, movie):
        try:
            self.size = (600, 400)
            self.movie = movie
            self.fps = 30

            # The buttons on the right side

            self.clearButton = swing.JButton(
                COMMAND_CLEAR_IMG, actionPerformed=self.actionPerformed)
            self.addButton = swing.JButton(
                COMMAND_ADD_IMG, actionPerformed=self.actionPerformed)
            self.addDirectoryButton = swing.JButton(
                COMMAND_ADD_DIR, actionPerformed=self.actionPerformed)
            self.deleteButton = swing.JButton(
                COMMAND_DELETE_IMG, actionPerformed=self.actionPerformed)
            self.playButton = swing.JButton(
                COMMAND_PLAY_MOVIE, actionPerformed=self.actionPerformed)
            self.moveUpButton = swing.JButton(
                COMMAND_MOVE_UP, actionPerformed=self.actionPerformed)
            self.moveDownButton = swing.JButton(
                COMMAND_MOVE_DOWN, actionPerformed=self.actionPerformed)
            self.changeFPSButton = swing.JButton(
                COMMAND_CHANGE_FPS, actionPerformed=self.actionPerformed)

            self.buttonpane = swing.JPanel()
            self.buttonpane.setLayout(
                swing.BoxLayout(self.buttonpane, swing.BoxLayout.Y_AXIS))

            self.buttonpane.add(self.clearButton)
            self.buttonpane.add(self.deleteButton)
            self.buttonpane.add(self.addDirectoryButton)
            self.buttonpane.add(self.addButton)
            self.buttonpane.add(self.playButton)
            self.buttonpane.add(self.moveUpButton)
            self.buttonpane.add(self.moveDownButton)
            self.buttonpane.add(self.changeFPSButton)

            # The images on the left side

            self.listModel = swing.DefaultListModel()
            self.list = swing.JList(self.listModel)

            self.listpane = swing.JScrollPane(self.list)
            #self.listpane.setLayout(swing.BoxLayout(self.listpane, swing.BoxLayout.X_AXIS))
            # self.listpane.add(self.list)

            # The splitter pane

            splitterPane = swing.JSplitPane()
            splitterPane.orientation = swing.JSplitPane.HORIZONTAL_SPLIT
            splitterPane.leftComponent = self.listpane
            splitterPane.rightComponent = self.buttonpane
            splitterPane.setDividerSize(SPLITTER_SIZE)
            splitterPane.setDividerLocation(VSPLITTER_LOCATION)
            splitterPane.setResizeWeight(1.0)

            self.add(splitterPane)
            self.addFramesIntoListModel(self.movie)
            self.show()

        except:
            import traceback
            import sys
            a, b, c = sys.exc_info()
            print "FrameSequencerTool exception:"
            traceback.print_exception(a, b, c)
Ejemplo n.º 7
0
#    so we must add one to them at the end.
FirstRow += 1
LastRow += 1

# Debug mode (display amount and first and last row)
if debug:
    print "FirstRow : " + FirstRow.toString()
    print "LastRow  : " + LastRow.toString()
    print "Amount   : " + amount.toString()

while not _session.isStopMacroRequested() and not done:
    screen.sendKeys("[pf5]")
    waitWhileLocked(1)
    screenChars = screen.getScreenAsChars()
    times = 0
    lm = swing.DefaultListModel()
    list = swing.JList(lm)
    while times < amount:
        prtdev = java.lang.StringBuffer()
        fillWithValues(9 + times, 7, 10, prtdev)
        status = java.lang.StringBuffer()
        fillWithValues(9 + times, 19, 4, status)
        if status.toString() == "MSGW":
            lm.addElement("   " + prtdev.toString() + "   " + \
                          "Check Printer")
            count += 1
        times += 1
    if not lm.isEmpty():
        done = 1
        StatusWindow()
    else: