Initial Database support, with improved basic view.

git-svn-id: file:///home/svn/framework3/trunk@10124 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Weeks 2010-08-24 00:22:49 +00:00
parent d7e9a25bc7
commit f94e174d97
5 changed files with 488 additions and 247 deletions

Binary file not shown.

View File

@ -155,6 +155,11 @@ public class InteractWindow extends MsfFrame {
outputArea.setFont(new Font("Monospaced", outputArea.getFont().getStyle(), 12)); outputArea.setFont(new Font("Monospaced", outputArea.getFont().getStyle(), 12));
checkPrompt(session); checkPrompt(session);
} }
/** Also sets initial command */
public InteractWindow(final RpcConnection rpcConn, final Map session, String type, String initVal) {
this(rpcConn,session, type);
inputField.setText(initVal);
}
/** Sets the prompt if provided */ /** Sets the prompt if provided */
private void checkPrompt(Map o) { private void checkPrompt(Map o) {
try{ try{

View File

@ -10,79 +10,23 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Component id="jTabbedPane1" alignment="0" pref="882" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="splitPane" pref="887" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Component id="jTabbedPane1" alignment="1" pref="532" max="32767" attributes="0"/>
<Component id="splitPane" pref="462" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JSplitPane" name="splitPane"> <Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="name" type="java.lang.String" value="jTabbedPane1" noResource="true"/>
<Border info="null"/>
</Property>
<Property name="lastDividerLocation" type="int" value="250"/>
<Property name="name" type="java.lang.String" value="splitPane" noResource="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 20]"/>
</Property>
</Properties> </Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="jobsPanel">
<Properties>
<Property name="name" type="java.lang.String" value="jobsPanel" noResource="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[10, 19]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="left"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="38" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jobsLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jobsLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="417" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jobsLabel">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="jobsLabel.text"/>
<Property name="name" type="java.lang.String" value="jobsLabel" noResource="true"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1"> <Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties> <Properties>
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/> <Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
@ -93,6 +37,13 @@
<AuxValues> <AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues> </AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Jobs">
<Property name="tabTitle" type="java.lang.String" resourceKey="jScrollPane1.TabConstraints.tabTitle"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents> <SubComponents>
@ -106,54 +57,6 @@
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="sessionsPanel">
<Properties>
<Property name="name" type="java.lang.String" value="sessionsPanel" noResource="true"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="sessionsLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="717" max="32767" attributes="0"/>
<Component id="searchButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane2" alignment="1" pref="843" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Component id="sessionsLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="searchButton" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane2" pref="417" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="sessionsLabel">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="sessionsLabel.text"/>
<Property name="name" type="java.lang.String" value="sessionsLabel" noResource="true"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2"> <Container class="javax.swing.JScrollPane" name="jScrollPane2">
<Properties> <Properties>
<Property name="name" type="java.lang.String" value="jScrollPane2" noResource="true"/> <Property name="name" type="java.lang.String" value="jScrollPane2" noResource="true"/>
@ -161,6 +64,13 @@
<AuxValues> <AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues> </AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Sessions">
<Property name="tabTitle" type="java.lang.String" resourceKey="jScrollPane2.TabConstraints.tabTitle"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents> <SubComponents>
@ -183,14 +93,149 @@
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="javax.swing.JButton" name="searchButton"> <Container class="javax.swing.JScrollPane" name="jScrollPane3">
<Properties> <Properties>
<Property name="text" type="java.lang.String" resourceKey="searchButton.text"/> <Property name="name" type="java.lang.String" value="jScrollPane3" noResource="true"/>
<Property name="name" type="java.lang.String" value="searchButton" noResource="true"/> </Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Hosts">
<Property name="tabTitle" type="java.lang.String" resourceKey="jScrollPane3.TabConstraints.tabTitle"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="hostsTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="13" rowCount="0">
<Column editable="true" title="Created" type="java.lang.Object"/>
<Column editable="true" title="Address" type="java.lang.Object"/>
<Column editable="true" title="Address6" type="java.lang.String"/>
<Column editable="true" title="MAC" type="java.lang.Object"/>
<Column editable="true" title="Name" type="java.lang.Object"/>
<Column editable="true" title="State" type="java.lang.Object"/>
<Column editable="true" title="OS name" type="java.lang.Object"/>
<Column editable="true" title="OS flavor" type="java.lang.Object"/>
<Column editable="true" title="OS SP" type="java.lang.Object"/>
<Column editable="true" title="OS lang" type="java.lang.Object"/>
<Column editable="true" title="Updated" type="java.lang.Object"/>
<Column editable="true" title="Purpose" type="java.lang.Object"/>
<Column editable="true" title="Info" type="java.lang.Object"/>
</Table>
</Property>
<Property name="name" type="java.lang.String" value="hostsTable" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane4">
<Properties>
<Property name="name" type="java.lang.String" value="jScrollPane4" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Services">
<Property name="tabTitle" type="java.lang.String" resourceKey="jScrollPane4.TabConstraints.tabTitle"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="servicesTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="8" rowCount="0">
<Column editable="true" title="Host" type="java.lang.String"/>
<Column editable="true" title="Created" type="java.lang.String"/>
<Column editable="true" title="Updated" type="java.lang.String"/>
<Column editable="true" title="Port" type="java.lang.Integer"/>
<Column editable="true" title="Proto" type="java.lang.String"/>
<Column editable="true" title="State" type="java.lang.String"/>
<Column editable="true" title="Name" type="java.lang.String"/>
<Column editable="true" title="Info" type="java.lang.String"/>
</Table>
</Property>
<Property name="name" type="java.lang.String" value="servicesTable" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane5">
<Properties>
<Property name="name" type="java.lang.String" value="jScrollPane5" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Vulns">
<Property name="tabTitle" type="java.lang.String" resourceKey="jScrollPane5.TabConstraints.tabTitle"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="vulnsTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="6" rowCount="0">
<Column editable="true" title="Port" type="java.lang.String"/>
<Column editable="true" title="Proto" type="java.lang.String"/>
<Column editable="true" title="Time" type="java.lang.String"/>
<Column editable="true" title="Host" type="java.lang.String"/>
<Column editable="true" title="Name" type="java.lang.String"/>
<Column editable="true" title="Refs" type="java.lang.String"/>
</Table>
</Property>
<Property name="name" type="java.lang.String" value="vulnsTable" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane6">
<Properties>
<Property name="name" type="java.lang.String" value="jScrollPane6" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Events">
<Property name="tabTitle" type="java.lang.String" resourceKey="jScrollPane6.TabConstraints.tabTitle"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="eventsTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="7" rowCount="0">
<Column editable="true" title="Host" type="java.lang.String"/>
<Column editable="true" title="Created" type="java.lang.String"/>
<Column editable="true" title="Updated" type="java.lang.String"/>
<Column editable="true" title="Name" type="java.lang.String"/>
<Column editable="true" title="Critical" type="java.lang.String"/>
<Column editable="true" title="Username" type="java.lang.String"/>
<Column editable="true" title="Info" type="java.lang.String"/>
</Table>
</Property>
<Property name="name" type="java.lang.String" value="eventsTable" noResource="true"/>
</Properties> </Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="searchButtonActionPerformed"/>
</Events>
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
@ -240,6 +285,15 @@
<Property name="name" type="java.lang.String" value="jSeparator1" noResource="true"/> <Property name="name" type="java.lang.String" value="jSeparator1" noResource="true"/>
</Properties> </Properties>
</MenuItem> </MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="searchItem">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="searchItem.text"/>
<Property name="name" type="java.lang.String" value="searchItem" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="searchItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="changeLFMenuItem"> <MenuItem class="javax.swing.JMenuItem" name="changeLFMenuItem">
<Properties> <Properties>
<Property name="mnemonic" type="int" value="76"/> <Property name="mnemonic" type="int" value="76"/>
@ -406,6 +460,35 @@
</Menu> </Menu>
</SubComponents> </SubComponents>
</Menu> </Menu>
<Menu class="javax.swing.JMenu" name="databaseMenu">
<Properties>
<Property name="mnemonic" type="int" value="68"/>
<Property name="text" type="java.lang.String" resourceKey="databaseMenu.text"/>
<Property name="name" type="java.lang.String" value="databaseMenu" noResource="true"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="connectItem">
<Properties>
<Property name="mnemonic" type="int" value="67"/>
<Property name="text" type="java.lang.String" resourceKey="connectItem.text"/>
<Property name="name" type="java.lang.String" value="connectItem" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="connectItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="refreshItem">
<Properties>
<Property name="mnemonic" type="int" value="82"/>
<Property name="text" type="java.lang.String" resourceKey="refreshItem.text"/>
<Property name="name" type="java.lang.String" value="refreshItem" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="refreshItemActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="helpMenu"> <Menu class="javax.swing.JMenu" name="helpMenu">
<Properties> <Properties>
<Property name="mnemonic" type="int" value="72"/> <Property name="mnemonic" type="int" value="72"/>
@ -450,7 +533,7 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="statusMessageLabel" min="-2" max="-2" attributes="0"/> <Component id="statusMessageLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="725" max="32767" attributes="0"/> <EmptySpace pref="698" max="32767" attributes="0"/>
<Component id="progressBar" min="-2" max="-2" attributes="0"/> <Component id="progressBar" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="statusAnimationLabel" min="-2" max="-2" attributes="0"/> <Component id="statusAnimationLabel" min="-2" max="-2" attributes="0"/>
@ -467,7 +550,7 @@
<Component id="statusAnimationLabel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="statusAnimationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="progressBar" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="progressBar" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/> <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -525,6 +608,6 @@
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,22,0,0,3,-113"/> <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,89,0,0,3,114"/>
</AuxValues> </AuxValues>
</Form> </Form>

View File

@ -4,6 +4,7 @@
package msfgui; package msfgui;
import java.awt.Component; import java.awt.Component;
import java.awt.Graphics;
import java.awt.HeadlessException; import java.awt.HeadlessException;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import org.jdesktop.application.Action; import org.jdesktop.application.Action;
@ -24,6 +25,7 @@ import java.util.HashMap;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Vector;
import javax.swing.Timer; import javax.swing.Timer;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -36,6 +38,7 @@ import javax.swing.JOptionPane;
import javax.swing.JPopupMenu; import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.table.DefaultTableModel;
import org.jdesktop.application.Task; import org.jdesktop.application.Task;
import org.jdesktop.swingworker.SwingWorker; import org.jdesktop.swingworker.SwingWorker;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -56,7 +59,6 @@ public class MainFrame extends FrameView {
public MainFrame(SingleFrameApplication app) { public MainFrame(SingleFrameApplication app) {
super(app); super(app);
initComponents(); initComponents();
splitPane.setDividerLocation(200);
sessionsTableModel = null; sessionsTableModel = null;
sessionPopupMap = new HashMap(); sessionPopupMap = new HashMap();
@ -144,8 +146,8 @@ public class MainFrame extends FrameView {
} }
/** Adds menu items for reopening and closing the console */ /** Adds menu items for reopening and closing the console */
private void registerConsole(Map res, boolean show) { private void registerConsole(Map res, boolean show, String initVal) {
final InteractWindow iw = new InteractWindow(rpcConn, res, "console"); final InteractWindow iw = new InteractWindow(rpcConn, res, "console", initVal);
iw.setVisible(show); iw.setVisible(show);
final String id = res.get("id").toString(); final String id = res.get("id").toString();
final JMenuItem openItem = new JMenuItem(id); final JMenuItem openItem = new JMenuItem(id);
@ -317,7 +319,7 @@ public class MainFrame extends FrameView {
try{ try{
Object[] consoles = (Object[]) ((Map)rpcConn.execute("console.list")).get("consoles"); Object[] consoles = (Object[]) ((Map)rpcConn.execute("console.list")).get("consoles");
for (Object console : consoles) for (Object console : consoles)
registerConsole((Map)console,false); registerConsole((Map)console,false, "");
}catch (MsfException mex){ }catch (MsfException mex){
JOptionPane.showMessageDialog(getFrame(), mex); JOptionPane.showMessageDialog(getFrame(), mex);
} }
@ -389,21 +391,25 @@ public class MainFrame extends FrameView {
private void initComponents() { private void initComponents() {
mainPanel = new javax.swing.JPanel(); mainPanel = new javax.swing.JPanel();
splitPane = new javax.swing.JSplitPane(); jTabbedPane1 = new javax.swing.JTabbedPane();
jobsPanel = new javax.swing.JPanel();
jobsLabel = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane(); jScrollPane1 = new javax.swing.JScrollPane();
jobsList = new javax.swing.JList(); jobsList = new javax.swing.JList();
sessionsPanel = new javax.swing.JPanel();
sessionsLabel = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane(); jScrollPane2 = new javax.swing.JScrollPane();
sessionsTable = new javax.swing.JTable(); sessionsTable = new javax.swing.JTable();
searchButton = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane();
hostsTable = new javax.swing.JTable();
jScrollPane4 = new javax.swing.JScrollPane();
servicesTable = new javax.swing.JTable();
jScrollPane5 = new javax.swing.JScrollPane();
vulnsTable = new javax.swing.JTable();
jScrollPane6 = new javax.swing.JScrollPane();
eventsTable = new javax.swing.JTable();
menuBar = new javax.swing.JMenuBar(); menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenu fileMenu = new javax.swing.JMenu();
connectRpcMenuItem = new javax.swing.JMenuItem(); connectRpcMenuItem = new javax.swing.JMenuItem();
startRpcMenuItem = new javax.swing.JMenuItem(); startRpcMenuItem = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JPopupMenu.Separator(); jSeparator1 = new javax.swing.JPopupMenu.Separator();
searchItem = new javax.swing.JMenuItem();
changeLFMenuItem = new javax.swing.JMenuItem(); changeLFMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
exploitsMenu = new javax.swing.JMenu(); exploitsMenu = new javax.swing.JMenu();
@ -422,6 +428,9 @@ public class MainFrame extends FrameView {
newConsoleItem = new javax.swing.JMenuItem(); newConsoleItem = new javax.swing.JMenuItem();
existingConsoleMenu = new javax.swing.JMenu(); existingConsoleMenu = new javax.swing.JMenu();
closeConsoleMenu = new javax.swing.JMenu(); closeConsoleMenu = new javax.swing.JMenu();
databaseMenu = new javax.swing.JMenu();
connectItem = new javax.swing.JMenuItem();
refreshItem = new javax.swing.JMenuItem();
helpMenu = new javax.swing.JMenu(); helpMenu = new javax.swing.JMenu();
onlineHelpMenu = new javax.swing.JMenuItem(); onlineHelpMenu = new javax.swing.JMenuItem();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
@ -432,17 +441,7 @@ public class MainFrame extends FrameView {
mainPanel.setName("mainPanel"); // NOI18N mainPanel.setName("mainPanel"); // NOI18N
splitPane.setBorder(null); jTabbedPane1.setName("jTabbedPane1"); // NOI18N
splitPane.setLastDividerLocation(250);
splitPane.setName("splitPane"); // NOI18N
splitPane.setPreferredSize(new java.awt.Dimension(30, 20));
jobsPanel.setName("jobsPanel"); // NOI18N
jobsPanel.setPreferredSize(new java.awt.Dimension(10, 19));
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(MainFrame.class);
jobsLabel.setText(resourceMap.getString("jobsLabel.text")); // NOI18N
jobsLabel.setName("jobsLabel"); // NOI18N
jScrollPane1.setName("jScrollPane1"); // NOI18N jScrollPane1.setName("jScrollPane1"); // NOI18N
jScrollPane1.setPreferredSize(new java.awt.Dimension(10, 10)); jScrollPane1.setPreferredSize(new java.awt.Dimension(10, 10));
@ -450,31 +449,8 @@ public class MainFrame extends FrameView {
jobsList.setName("jobsList"); // NOI18N jobsList.setName("jobsList"); // NOI18N
jScrollPane1.setViewportView(jobsList); jScrollPane1.setViewportView(jobsList);
javax.swing.GroupLayout jobsPanelLayout = new javax.swing.GroupLayout(jobsPanel); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(MainFrame.class);
jobsPanel.setLayout(jobsPanelLayout); jTabbedPane1.addTab(resourceMap.getString("jScrollPane1.TabConstraints.tabTitle"), jScrollPane1); // NOI18N
jobsPanelLayout.setHorizontalGroup(
jobsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
.addGroup(jobsPanelLayout.createSequentialGroup()
.addComponent(jobsLabel)
.addContainerGap())
);
jobsPanelLayout.setVerticalGroup(
jobsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jobsPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jobsLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
.addContainerGap())
);
splitPane.setLeftComponent(jobsPanel);
sessionsPanel.setName("sessionsPanel"); // NOI18N
sessionsLabel.setText(resourceMap.getString("sessionsLabel.text")); // NOI18N
sessionsLabel.setName("sessionsLabel"); // NOI18N
jScrollPane2.setName("jScrollPane2"); // NOI18N jScrollPane2.setName("jScrollPane2"); // NOI18N
@ -490,54 +466,109 @@ public class MainFrame extends FrameView {
sessionsTable.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); sessionsTable.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jScrollPane2.setViewportView(sessionsTable); jScrollPane2.setViewportView(sessionsTable);
searchButton.setText(resourceMap.getString("searchButton.text")); // NOI18N jTabbedPane1.addTab(resourceMap.getString("jScrollPane2.TabConstraints.tabTitle"), jScrollPane2); // NOI18N
searchButton.setName("searchButton"); // NOI18N
searchButton.addActionListener(new java.awt.event.ActionListener() { jScrollPane3.setName("jScrollPane3"); // NOI18N
public void actionPerformed(java.awt.event.ActionEvent evt) {
searchButtonActionPerformed(evt); hostsTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Created", "Address", "Address6", "MAC", "Name", "State", "OS name", "OS flavor", "OS SP", "OS lang", "Updated", "Purpose", "Info"
}
) {
Class[] types = new Class [] {
java.lang.Object.class, java.lang.Object.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
} }
}); });
hostsTable.setName("hostsTable"); // NOI18N
jScrollPane3.setViewportView(hostsTable);
javax.swing.GroupLayout sessionsPanelLayout = new javax.swing.GroupLayout(sessionsPanel); jTabbedPane1.addTab(resourceMap.getString("jScrollPane3.TabConstraints.tabTitle"), jScrollPane3); // NOI18N
sessionsPanel.setLayout(sessionsPanelLayout);
sessionsPanelLayout.setHorizontalGroup(
sessionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(sessionsPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(sessionsLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 717, Short.MAX_VALUE)
.addComponent(searchButton))
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 843, Short.MAX_VALUE)
);
sessionsPanelLayout.setVerticalGroup(
sessionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(sessionsPanelLayout.createSequentialGroup()
.addGroup(sessionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(sessionsPanelLayout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(sessionsLabel))
.addComponent(searchButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
.addContainerGap())
);
splitPane.setRightComponent(sessionsPanel); jScrollPane4.setName("jScrollPane4"); // NOI18N
servicesTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Host", "Created", "Updated", "Port", "Proto", "State", "Name", "Info"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
servicesTable.setName("servicesTable"); // NOI18N
jScrollPane4.setViewportView(servicesTable);
jTabbedPane1.addTab(resourceMap.getString("jScrollPane4.TabConstraints.tabTitle"), jScrollPane4); // NOI18N
jScrollPane5.setName("jScrollPane5"); // NOI18N
vulnsTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Port", "Proto", "Time", "Host", "Name", "Refs"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
vulnsTable.setName("vulnsTable"); // NOI18N
jScrollPane5.setViewportView(vulnsTable);
jTabbedPane1.addTab(resourceMap.getString("jScrollPane5.TabConstraints.tabTitle"), jScrollPane5); // NOI18N
jScrollPane6.setName("jScrollPane6"); // NOI18N
eventsTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Host", "Created", "Updated", "Name", "Critical", "Username", "Info"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
eventsTable.setName("eventsTable"); // NOI18N
jScrollPane6.setViewportView(eventsTable);
jTabbedPane1.addTab(resourceMap.getString("jScrollPane6.TabConstraints.tabTitle"), jScrollPane6); // NOI18N
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout); mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup( mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup() .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 882, Short.MAX_VALUE)
.addContainerGap()
.addComponent(splitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 887, Short.MAX_VALUE)
.addContainerGap())
); );
mainPanelLayout.setVerticalGroup( mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup() .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
.addComponent(splitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)
.addContainerGap())
); );
menuBar.setName("menuBar"); // NOI18N menuBar.setName("menuBar"); // NOI18N
@ -564,6 +595,15 @@ public class MainFrame extends FrameView {
jSeparator1.setName("jSeparator1"); // NOI18N jSeparator1.setName("jSeparator1"); // NOI18N
fileMenu.add(jSeparator1); fileMenu.add(jSeparator1);
searchItem.setText(resourceMap.getString("searchItem.text")); // NOI18N
searchItem.setName("searchItem"); // NOI18N
searchItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
searchItemActionPerformed(evt);
}
});
fileMenu.add(searchItem);
changeLFMenuItem.setMnemonic('L'); changeLFMenuItem.setMnemonic('L');
changeLFMenuItem.setText(resourceMap.getString("changeLFMenuItem.text")); // NOI18N changeLFMenuItem.setText(resourceMap.getString("changeLFMenuItem.text")); // NOI18N
changeLFMenuItem.setName("changeLFMenuItem"); // NOI18N changeLFMenuItem.setName("changeLFMenuItem"); // NOI18N
@ -698,6 +738,32 @@ public class MainFrame extends FrameView {
menuBar.add(consoleMenu); menuBar.add(consoleMenu);
databaseMenu.setMnemonic('D');
databaseMenu.setText(resourceMap.getString("databaseMenu.text")); // NOI18N
databaseMenu.setName("databaseMenu"); // NOI18N
connectItem.setMnemonic('C');
connectItem.setText(resourceMap.getString("connectItem.text")); // NOI18N
connectItem.setName("connectItem"); // NOI18N
connectItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
connectItemActionPerformed(evt);
}
});
databaseMenu.add(connectItem);
refreshItem.setMnemonic('R');
refreshItem.setText(resourceMap.getString("refreshItem.text")); // NOI18N
refreshItem.setName("refreshItem"); // NOI18N
refreshItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
refreshItemActionPerformed(evt);
}
});
databaseMenu.add(refreshItem);
menuBar.add(databaseMenu);
helpMenu.setMnemonic('H'); helpMenu.setMnemonic('H');
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N helpMenu.setName("helpMenu"); // NOI18N
@ -734,7 +800,7 @@ public class MainFrame extends FrameView {
.addGroup(statusPanelLayout.createSequentialGroup() .addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(statusMessageLabel) .addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 725, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 698, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel) .addComponent(statusAnimationLabel)
@ -748,7 +814,7 @@ public class MainFrame extends FrameView {
.addComponent(statusMessageLabel) .addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel) .addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3)) .addGap(12, 12, 12))
); );
setComponent(mainPanel); setComponent(mainPanel);
@ -821,19 +887,92 @@ public class MainFrame extends FrameView {
new EditorWindow(MsfguiLog.defaultLog.getHashes()).setVisible(true); new EditorWindow(MsfguiLog.defaultLog.getHashes()).setVisible(true);
}//GEN-LAST:event_collectedCredsMenuItemActionPerformed }//GEN-LAST:event_collectedCredsMenuItemActionPerformed
private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
searchWin.setVisible(true);
}//GEN-LAST:event_searchButtonActionPerformed
private void newConsoleItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newConsoleItemActionPerformed private void newConsoleItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newConsoleItemActionPerformed
try{ try{
Map res = (Map)rpcConn.execute("console.create"); Map res = (Map)rpcConn.execute("console.create");
registerConsole(res, true); registerConsole(res, true, "");
}catch(MsfException mex){ }catch(MsfException mex){
JOptionPane.showMessageDialog(getFrame(), mex); JOptionPane.showMessageDialog(getFrame(), mex);
} }
}//GEN-LAST:event_newConsoleItemActionPerformed }//GEN-LAST:event_newConsoleItemActionPerformed
private void searchItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchItemActionPerformed
searchWin.setVisible(true);
}//GEN-LAST:event_searchItemActionPerformed
private void connectItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_connectItemActionPerformed
String answer = JOptionPane.showInputDialog(getFrame(), "Enter Connection String", "Connection String", JOptionPane.QUESTION_MESSAGE);
if(answer == null)
return;
try{
Map session = (Map)rpcConn.execute("console.create");
registerConsole(session, true, "db_connect "+answer);
}catch(MsfException mex){
JOptionPane.showMessageDialog(getFrame(), mex);
}
}//GEN-LAST:event_connectItemActionPerformed
private void refreshItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshItemActionPerformed
//Hosts
try{
DefaultTableModel mod = (DefaultTableModel)hostsTable.getModel();
while(mod.getRowCount() > 0)
mod.removeRow(0);
Object[] hosts = (Object[])((Map)rpcConn.execute("db.hosts",new Object[]{new HashMap()})).get("hosts");
for (Object hostO : hosts){
Map host = (Map)hostO;
mod.addRow(new Object[]{host.get("created_at"),host.get("address"),host.get("address6"),
host.get("mac"),host.get("name"),host.get("state"),host.get("os_name"),host.get("os_flavor"),
host.get("os_sp"),host.get("os_lang"),host.get("updated_at"),host.get("purpose"),host.get("info")});
}
TableHelper.fitColumnWidths(mod,hostsTable);
}catch(MsfException mex){
}
//Services
try{
DefaultTableModel mod = (DefaultTableModel)servicesTable.getModel();
while(mod.getRowCount() > 0)
mod.removeRow(0);
Object[] services = (Object[])((Map)rpcConn.execute("db.services",new Object[]{new HashMap()})).get("services");
for (Object serviceO : services){
Map service = (Map)serviceO;
mod.addRow(new Object[]{service.get("host"),service.get("created_at"),service.get("updated_at"),
service.get("port"),service.get("proto"),service.get("state"),service.get("name"),service.get("info")});
}
TableHelper.fitColumnWidths(mod,servicesTable);
}catch(MsfException mex){
}
//Vulns
try{
DefaultTableModel mod = (DefaultTableModel)vulnsTable.getModel();
while(mod.getRowCount() > 0)
mod.removeRow(0);
Object[] vulns = (Object[])((Map)rpcConn.execute("db.vulns",new Object[]{new HashMap()})).get("vulns");
for (Object vulnO : vulns){
Map vuln = (Map)vulnO;
mod.addRow(new Object[]{vuln.get("port"),vuln.get("proto"),vuln.get("time"),
vuln.get("host"),vuln.get("name"),vuln.get("refs")});
}
TableHelper.fitColumnWidths(mod,vulnsTable);
}catch(MsfException mex){
}
//Events
try{
DefaultTableModel mod = (DefaultTableModel)eventsTable.getModel();
while(mod.getRowCount() > 0)
mod.removeRow(0);
Object wspace = ((Map)rpcConn.execute("db.current_workspace")).get("workspace");
Object[] events = (Object[])((Map)rpcConn.execute("db.events",new Object[]{wspace})).get("events");
for (Object eventO : events){
Map event = (Map)eventO;
mod.addRow(new Object[]{event.get("host"),event.get("created_at"),event.get("updated_at"),
event.get("name"),event.get("critical"),event.get("username"),event.get("info")});
}
TableHelper.fitColumnWidths(mod,eventsTable);
}catch(MsfException mex){
}
}//GEN-LAST:event_refreshItemActionPerformed
/** Runs command on all current meterpreter sessions in new thread; posting updates for each thread */ /** Runs command on all current meterpreter sessions in new thread; posting updates for each thread */
private void runOnAllMeterpreters(String cmd, String output, JLabel outputLabel) { private void runOnAllMeterpreters(String cmd, String output, JLabel outputLabel) {
SessionCommand.runOnAllMeterpreters(sessionsTableModel, cmd, output, outputLabel, rpcConn); SessionCommand.runOnAllMeterpreters(sessionsTableModel, cmd, output, outputLabel, rpcConn);
@ -1073,18 +1212,25 @@ public class MainFrame extends FrameView {
private javax.swing.JMenuItem clearHistoryItem; private javax.swing.JMenuItem clearHistoryItem;
private javax.swing.JMenu closeConsoleMenu; private javax.swing.JMenu closeConsoleMenu;
private javax.swing.JMenuItem collectedCredsMenuItem; private javax.swing.JMenuItem collectedCredsMenuItem;
private javax.swing.JMenuItem connectItem;
private javax.swing.JMenuItem connectRpcMenuItem; private javax.swing.JMenuItem connectRpcMenuItem;
private javax.swing.JMenu consoleMenu; private javax.swing.JMenu consoleMenu;
private javax.swing.JMenu databaseMenu;
private javax.swing.JTable eventsTable;
private javax.swing.JMenu existingConsoleMenu; private javax.swing.JMenu existingConsoleMenu;
private javax.swing.JMenu exploitsMenu; private javax.swing.JMenu exploitsMenu;
private javax.swing.JMenu helpMenu; private javax.swing.JMenu helpMenu;
private javax.swing.JMenu historyMenu; private javax.swing.JMenu historyMenu;
private javax.swing.JTable hostsTable;
private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JPopupMenu.Separator jSeparator1; private javax.swing.JPopupMenu.Separator jSeparator1;
private javax.swing.JLabel jobsLabel; private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JList jobsList; private javax.swing.JList jobsList;
private javax.swing.JPanel jobsPanel;
private javax.swing.JMenuItem killSessionsMenuItem; private javax.swing.JMenuItem killSessionsMenuItem;
private javax.swing.JMenuItem logGenerateMenuItem; private javax.swing.JMenuItem logGenerateMenuItem;
private javax.swing.JPanel mainPanel; private javax.swing.JPanel mainPanel;
@ -1097,15 +1243,15 @@ public class MainFrame extends FrameView {
private javax.swing.JMenu postMenu; private javax.swing.JMenu postMenu;
private javax.swing.JProgressBar progressBar; private javax.swing.JProgressBar progressBar;
public javax.swing.JMenu recentMenu; public javax.swing.JMenu recentMenu;
private javax.swing.JButton searchButton; private javax.swing.JMenuItem refreshItem;
private javax.swing.JLabel sessionsLabel; private javax.swing.JMenuItem searchItem;
private javax.swing.JPanel sessionsPanel; private javax.swing.JTable servicesTable;
private javax.swing.JTable sessionsTable; private javax.swing.JTable sessionsTable;
private javax.swing.JSplitPane splitPane;
private javax.swing.JMenuItem startRpcMenuItem; private javax.swing.JMenuItem startRpcMenuItem;
private javax.swing.JLabel statusAnimationLabel; private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel; private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel; private javax.swing.JPanel statusPanel;
private javax.swing.JTable vulnsTable;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
private final Timer messageTimer; private final Timer messageTimer;
private final Timer busyIconTimer; private final Timer busyIconTimer;

View File

@ -29,8 +29,6 @@ StatusBar.busyIcons[11] = busyicons/busy-icon11.png
StatusBar.busyIcons[12] = busyicons/busy-icon12.png StatusBar.busyIcons[12] = busyicons/busy-icon12.png
StatusBar.busyIcons[13] = busyicons/busy-icon13.png StatusBar.busyIcons[13] = busyicons/busy-icon13.png
StatusBar.busyIcons[14] = busyicons/busy-icon14.png StatusBar.busyIcons[14] = busyicons/busy-icon14.png
sessionsLabel.text=Sessions
jobsLabel.text=Jobs
exploitsMenu.text=Exploits exploitsMenu.text=Exploits
auxiliaryMenu.text=Auxiliary auxiliaryMenu.text=Auxiliary
startRpcMenuItem.text=Start new msfrpcd startRpcMenuItem.text=Start new msfrpcd
@ -49,8 +47,17 @@ historyMenu.text=History
killSessionsMenuItem.text=Kill all sessions killSessionsMenuItem.text=Kill all sessions
changeLFMenuItem.text=Change Look and Feel changeLFMenuItem.text=Change Look and Feel
collectedCredsMenuItem.text=Show collected hashes collectedCredsMenuItem.text=Show collected hashes
searchButton.text=Search databaseMenu.text=Database
consoleMenu.text=Console connectItem.text=Connect
newConsoleItem.text=New refreshItem.text=Refresh
existingConsoleMenu.text=Open Existing jScrollPane6.TabConstraints.tabTitle=Events
jScrollPane5.TabConstraints.tabTitle=Vulns
jScrollPane4.TabConstraints.tabTitle=Services
jScrollPane3.TabConstraints.tabTitle=Hosts
jScrollPane1.TabConstraints.tabTitle=Jobs
jScrollPane2.TabConstraints.tabTitle=Sessions
searchItem.text=Search
closeConsoleMenu.text=Close Existing closeConsoleMenu.text=Close Existing
existingConsoleMenu.text=Open Existing
newConsoleItem.text=New
consoleMenu.text=Console