diff --git a/data/gui/msfgui.jar b/data/gui/msfgui.jar index 2a6c45310d..b26255c1a2 100755 Binary files a/data/gui/msfgui.jar and b/data/gui/msfgui.jar differ diff --git a/external/source/gui/msfguijava/nbproject/build-impl.xml b/external/source/gui/msfguijava/nbproject/build-impl.xml index da1b7e1c1d..e21a8cd0e9 100644 --- a/external/source/gui/msfguijava/nbproject/build-impl.xml +++ b/external/source/gui/msfguijava/nbproject/build-impl.xml @@ -55,6 +55,7 @@ is divided into following sections: + @@ -83,23 +84,40 @@ is divided into following sections: - + - - + + - - - - - + + + + - - + + + + + + + + - - + + + + + + + + + + + + + + @@ -156,6 +174,8 @@ is divided into following sections: + + @@ -182,11 +202,53 @@ is divided into following sections: - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -211,6 +273,8 @@ is divided into following sections: + + @@ -358,14 +422,65 @@ is divided into following sections: + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -447,13 +568,13 @@ is divided into following sections: - + - + - + @@ -468,78 +589,35 @@ is divided into following sections: java -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - + + + + + + - - - + + + To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" - + - + @@ -643,7 +721,7 @@ is divided into following sections: - + @@ -660,7 +738,7 @@ is divided into following sections: Must select some files in the IDE or set javac.includes - + diff --git a/external/source/gui/msfguijava/nbproject/genfiles.properties b/external/source/gui/msfguijava/nbproject/genfiles.properties index da2eeff018..3044be6eec 100644 --- a/external/source/gui/msfguijava/nbproject/genfiles.properties +++ b/external/source/gui/msfguijava/nbproject/genfiles.properties @@ -1,8 +1,8 @@ build.xml.data.CRC32=84c180dd build.xml.script.CRC32=7b4769ae -build.xml.stylesheet.CRC32=958a1d3e@1.32.1.45 +build.xml.stylesheet.CRC32=28e38971@1.38.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=84c180dd -nbproject/build-impl.xml.script.CRC32=f85285ea -nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45 +nbproject/build-impl.xml.script.CRC32=dcb7e251 +nbproject/build-impl.xml.stylesheet.CRC32=78c6a6ee@1.38.1.45 diff --git a/external/source/gui/msfguijava/nbproject/project.properties b/external/source/gui/msfguijava/nbproject/project.properties index 4e89e52dc9..6a960f0dd6 100644 --- a/external/source/gui/msfguijava/nbproject/project.properties +++ b/external/source/gui/msfguijava/nbproject/project.properties @@ -17,7 +17,7 @@ debug.classpath=\ debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: -dist.dir=dist +dist.dir=../../../../data/gui/ dist.jar=${dist.dir}/msfgui.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= diff --git a/external/source/gui/msfguijava/src/msfgui/AutorouteOptionsDialog.java b/external/source/gui/msfguijava/src/msfgui/AutorouteOptionsDialog.java index 628ed60315..7f84d8bc99 100755 --- a/external/source/gui/msfguijava/src/msfgui/AutorouteOptionsDialog.java +++ b/external/source/gui/msfguijava/src/msfgui/AutorouteOptionsDialog.java @@ -11,7 +11,7 @@ public class AutorouteOptionsDialog extends OptionsDialog { super(parent.getFrame(), "Autoroute Options", modal); initComponents(); try{ - ipField.setText(parent.session.get("tunnel_peer").toString().split(":")[0]+"/24"); + ipField.setText("192.168.1.1/24"); }catch(NullPointerException nex){ } } diff --git a/external/source/gui/msfguijava/src/msfgui/MainFrame.form b/external/source/gui/msfguijava/src/msfgui/MainFrame.form index 32038435f7..d8c3274bd0 100644 --- a/external/source/gui/msfguijava/src/msfgui/MainFrame.form +++ b/external/source/gui/msfguijava/src/msfgui/MainFrame.form @@ -1,6 +1,6 @@ - + -
+ @@ -20,7 +20,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -124,10 +124,10 @@ - + - + @@ -141,7 +141,7 @@ - + @@ -173,6 +173,9 @@ + + + @@ -417,7 +420,7 @@ - + diff --git a/external/source/gui/msfguijava/src/msfgui/MainFrame.java b/external/source/gui/msfguijava/src/msfgui/MainFrame.java index eef523d96b..cfd4637424 100644 --- a/external/source/gui/msfguijava/src/msfgui/MainFrame.java +++ b/external/source/gui/msfguijava/src/msfgui/MainFrame.java @@ -48,7 +48,7 @@ public class MainFrame extends FrameView { private SessionsTable sessionsTableModel; private JPopupMenu jobPopupMenu, shellPopupMenu, meterpreterPopupMenu, sessionPopupMenu; private String clickedJob; - public Map session; + public Map[] selectedSessions; private SearchWindow searchWin; public MainFrame(SingleFrameApplication app) { @@ -132,8 +132,10 @@ public class MainFrame extends FrameView { sessionsPollTimer = new SwingWorker(){ @Override protected List doInBackground() throws Exception { + int delay = 500; while(true){ try { + Thread.sleep(delay); //update sessions Map slist = (Map) rpcConn.execute("session.list"); ArrayList sessionList = new ArrayList(); @@ -165,9 +167,9 @@ public class MainFrame extends FrameView { i++; } publish((Object)jobStrings); - Thread.sleep(500); } catch (MsfException xre) { JOptionPane.showMessageDialog(null, xre); + delay *= 2; } catch (InterruptedException iex){ } } @@ -209,7 +211,7 @@ public class MainFrame extends FrameView { searchNext = false; Component [] compsCopy = comps; for (Component menu : compsCopy) { - if (menu.getName().equals(names[i])) { + if (menu.getName().equals(names[i]) && menu instanceof JMenu) { if (i < names.length - 1) currentMenu = (JMenu) menu; found = true; @@ -429,6 +431,7 @@ public class MainFrame extends FrameView { } )); sessionsTable.setName("sessionsTable"); // NOI18N + sessionsTable.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); jScrollPane2.setViewportView(sessionsTable); searchButton.setText(resourceMap.getString("searchButton.text")); // NOI18N @@ -723,9 +726,9 @@ public class MainFrame extends FrameView { private void killSessionsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_killSessionsMenuItemActionPerformed for( Object sesObj : sessionsTableModel.sessions ){ try{ - rpcConn.execute("session.stop", new Object[]{session.get("id")}); + rpcConn.execute("session.stop", new Object[]{((Map)sesObj).get("id")}); } catch (MsfException xre) { - statusMessageLabel.setText("Error killing session "+session.get("id")); + statusMessageLabel.setText("Error killing session "+((Map)sesObj).get("id")); } } }//GEN-LAST:event_killSessionsMenuItemActionPerformed @@ -761,7 +764,8 @@ public class MainFrame extends FrameView { return RpcConnection.startRpcConn(this); } public void showInteractWindow() { - ((InteractWindow)(sessionPopupMap.get(session.get("uuid")))).setVisible(true); + for(Map session : selectedSessions) + ((InteractWindow)(sessionPopupMap.get(session.get("uuid")))).setVisible(true); } /* Master function to setup popup menus for jobs and sessions * First handles jobs, then shell sessions, then meterpreter sessions, @@ -804,18 +808,19 @@ public class MainFrame extends FrameView { //SESSION POPUP MENUS sessionsTable.addMouseListener(new PopupMouseListener() { public void doubleClicked(MouseEvent e){ //show interaction window on double-click - int clickedSession = sessionsTable.rowAtPoint(e.getPoint()); - if (clickedSession == -1) - return; - session = (Map) sessionsTableModel.getSessionList().get(clickedSession); - showInteractWindow(); + int[] selrows = sessionsTable.getSelectedRows(); + selectedSessions = new HashMap[selrows.length]; + for(int i = 0; i < selrows.length; i++) + selectedSessions[i] = (Map)sessionsTableModel.getSessionList().get(selrows[i]); } public void showPopup(MouseEvent e) { //must have a row selected - int clickedSession = sessionsTable.rowAtPoint(e.getPoint()); - if (!e.isPopupTrigger() || clickedSession == -1) + if (!e.isPopupTrigger()) return; - session = (Map) sessionsTableModel.getSessionList().get(clickedSession); + doubleClicked(e); + if(selectedSessions.length == 0) + return; + Map session = selectedSessions[0]; if (session.get("type").equals("shell")) shellPopupMenu.show(e.getComponent(), e.getX(), e.getY()); else if (session.get("type").equals("meterpreter")) @@ -837,13 +842,13 @@ public class MainFrame extends FrameView { //Setup meterpreter menu meterpreterPopupMenu = new JPopupMenu(); - addSessionItem("Access Filesystem",meterpreterPopupMenu,new RpcAction() { - public void action() throws Exception { + addSessionItem("Access Filesystem",meterpreterPopupMenu,new RpcAction(this) { + public void action(Map session) throws Exception { new MeterpFileBrowser(rpcConn, session, sessionPopupMap).setVisible(true); } }); - addSessionItem("Processes",meterpreterPopupMenu,new RpcAction() { - public void action() throws Exception { + addSessionItem("Processes",meterpreterPopupMenu,new RpcAction(this) { + public void action(Map session) throws Exception { new ProcessList(rpcConn,session,sessionPopupMap).setVisible(true); } }); @@ -863,8 +868,8 @@ public class MainFrame extends FrameView { meterpreterPopupMenu.add(monitorMenu); addScript("Start keylogger",monitorMenu,"keylogrecorder"); addScript("Start packet recorder",monitorMenu,"packetrecorder"); - addScript("Screenshot",monitorMenu,new RpcAction() { - public void action() throws Exception { + addScript("Screenshot",monitorMenu,new RpcAction(this) { + public void action(Map session) throws Exception { rpcConn.execute("session.meterpreter_write", new Object[]{session.get("id"), Base64.encode("screenshot\n".getBytes())}); } @@ -896,8 +901,8 @@ public class MainFrame extends FrameView { return "gettelnet.rb "+UserPassDialog.getUserPassOpts(getFrame()); } }); - addScript("Add admin user",accessMenu,new RpcAction() { - public void action() throws Exception { + addScript("Add admin user",accessMenu,new RpcAction(this) { + public void action(Map session) throws Exception { String[] userPass = UserPassDialog.showUserPassDialog(getFrame()); if(userPass == null) return; @@ -938,6 +943,8 @@ public class MainFrame extends FrameView { } /** Adds a named session menu item to a given popup menu */ private void addSessionItem(String name, JComponent menu,ActionListener action) { + if(action == null) + action = new RpcAction(null,this); JMenuItem tempItem = new JMenuItem(name); menu.add(tempItem); tempItem.addActionListener(action); @@ -961,8 +968,8 @@ public class MainFrame extends FrameView { } /** Adds a kill session menu item to a given popup menu */ private void addSessionKillItem(JComponent popupMenu) throws HeadlessException { - addSessionItem("Kill session",popupMenu,new RpcAction() { - public void action() throws Exception { + addSessionItem("Kill session",popupMenu,new RpcAction(this) { + public void action(Map session) throws Exception { rpcConn.execute("session.stop", new Object[]{session.get("id")}); } }); diff --git a/external/source/gui/msfguijava/src/msfgui/RpcAction.java b/external/source/gui/msfguijava/src/msfgui/RpcAction.java index 1c3b4ac9a6..029ba1cf19 100644 --- a/external/source/gui/msfguijava/src/msfgui/RpcAction.java +++ b/external/source/gui/msfguijava/src/msfgui/RpcAction.java @@ -2,6 +2,7 @@ package msfgui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.Map; import javax.swing.JOptionPane; /** @@ -16,24 +17,34 @@ public class RpcAction implements ActionListener { } public RpcAction(){ } + public RpcAction( MainFrame parent){ + this.parent = parent; + } public RpcAction(Object arg, MainFrame parent){ this.arg = arg; this.parent = parent; } public void actionPerformed(ActionEvent e){ try{ - action(); + if(parent == null) + action(); + else + for(Map session : parent.selectedSessions) + action(session); }catch(Exception ex){ if(!ex.getMessage().equals("cancelled")) JOptionPane.showMessageDialog(null, "Error in RPC call: "+ex); } } - /* Default action executes session.meterpreter_script and shows console window. */ + /** action() with no args provided as an exception-handling action listener. */ public void action() throws Exception{ - if(arg != null) - parent.rpcConn.execute("session.meterpreter_script", new Object[]{parent.session.get("id"), getCmd()}); - else if (parent == null) + if (parent == null) throw new MsfException("Error: no parent. If using default constructor, must override action()."); + } + /** Default action executes session.meterpreter_script and shows console window. */ + public void action(Map session) throws Exception{ + if(arg != null) + parent.rpcConn.execute("session.meterpreter_script", new Object[]{session.get("id"), getCmd()}); parent.showInteractWindow(); } } diff --git a/external/source/gui/msfguijava/src/msfgui/RpcConnection.java b/external/source/gui/msfguijava/src/msfgui/RpcConnection.java index 014afa1e2f..f5b8bdae87 100644 --- a/external/source/gui/msfguijava/src/msfgui/RpcConnection.java +++ b/external/source/gui/msfguijava/src/msfgui/RpcConnection.java @@ -254,12 +254,12 @@ public class RpcConnection { root.setAttribute("host", "127.0.0.1"); root.setAttribute("port", Integer.toString(defaultPort)); - setMessage("Starting msfrpcd. \"msfrpcd -P " + defaultPass + " -S -U metasploit -a 127.0.0.1\""); + setMessage("Starting msfrpcd. \"msfrpcd -P " + defaultPass + " -t Basic -S -U metasploit -a 127.0.0.1\""); setProgress(0.2f); Process proc = null; try { proc = MsfguiApp.startMsfProc(new String[]{ - "msfrpcd","-P",defaultPass,"-S","-U",defaultUser,"-a","127.0.0.1"}); + "msfrpcd","-P",defaultPass,"-t","Basic","-S","-U",defaultUser,"-a","127.0.0.1"}); } catch (MsfException ex) { setMessage("msfrpcd not found."); setProgress(1f);