diff --git a/data/gui/msfgui.jar b/data/gui/msfgui.jar index 09032e6613..c618315a51 100644 Binary files a/data/gui/msfgui.jar and b/data/gui/msfgui.jar differ diff --git a/external/source/gui/msfguijava/src/msfgui/MainFrame.form b/external/source/gui/msfguijava/src/msfgui/MainFrame.form index 5126107c19..1bc2391772 100644 --- a/external/source/gui/msfguijava/src/msfgui/MainFrame.form +++ b/external/source/gui/msfguijava/src/msfgui/MainFrame.form @@ -610,6 +610,16 @@ + + + + + + + + + + diff --git a/external/source/gui/msfguijava/src/msfgui/MainFrame.java b/external/source/gui/msfguijava/src/msfgui/MainFrame.java index f384d32145..61e4b38163 100644 --- a/external/source/gui/msfguijava/src/msfgui/MainFrame.java +++ b/external/source/gui/msfguijava/src/msfgui/MainFrame.java @@ -524,6 +524,7 @@ nameloop: for (int i = 0; i < names.length; i++) { clearHistoryItem = new javax.swing.JMenuItem(); postMenu = new javax.swing.JMenu(); menuRunAllMeterp = new javax.swing.JMenu(); + crackPasswordsItem = new javax.swing.JMenuItem(); killSessionsMenuItem = new javax.swing.JMenuItem(); logGenerateMenuItem = new javax.swing.JMenuItem(); consoleMenu = new javax.swing.JMenu(); @@ -907,6 +908,16 @@ nameloop: for (int i = 0; i < names.length; i++) { menuRunAllMeterp.setName("menuRunAllMeterp"); // NOI18N postMenu.add(menuRunAllMeterp); + crackPasswordsItem.setMnemonic('C'); + crackPasswordsItem.setText(resourceMap.getString("crackPasswordsItem.text")); // NOI18N + crackPasswordsItem.setName("crackPasswordsItem"); // NOI18N + crackPasswordsItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + crackPasswordsItemActionPerformed(evt); + } + }); + postMenu.add(crackPasswordsItem); + killSessionsMenuItem.setMnemonic('K'); killSessionsMenuItem.setText(resourceMap.getString("killSessionsMenuItem.text")); // NOI18N killSessionsMenuItem.setName("killSessionsMenuItem"); // NOI18N @@ -1577,6 +1588,10 @@ nameloop: for (int i = 0; i < names.length; i++) { } }//GEN-LAST:event_dbExportItemActionPerformed + private void crackPasswordsItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crackPasswordsItemActionPerformed + MsfguiApp.runModule("auxiliary", "analyze/jtr_crack_fast", new HashMap(), rpcConn, this, true); + }//GEN-LAST:event_crackPasswordsItemActionPerformed + /** Runs command on all current meterpreter sessions in new thread; posting updates for each thread */ private void runOnAllMeterpreters(String cmd, String output, JLabel outputLabel) { SessionCommand.runOnAllMeterpreters(sessionsTableModel, cmd, output, outputLabel, rpcConn); @@ -1858,6 +1873,7 @@ nameloop: for (int i = 0; i < names.length; i++) { private javax.swing.JMenuItem connectItem; private javax.swing.JMenuItem connectRpcMenuItem; private javax.swing.JMenu consoleMenu; + private javax.swing.JMenuItem crackPasswordsItem; private javax.swing.JScrollPane credsPane; private javax.swing.JTable credsTable; private javax.swing.JMenuItem credsViewItem; @@ -1918,7 +1934,7 @@ nameloop: for (int i = 0; i < names.length; i++) { private javax.swing.JMenuItem soundItem; private javax.swing.JMenuItem startRpcMenuItem; public javax.swing.JLabel statusAnimationLabel; - private javax.swing.JLabel statusMessageLabel; + javax.swing.JLabel statusMessageLabel; private javax.swing.JPanel statusPanel; public javax.swing.JTabbedPane tabbedPane; private javax.swing.JMenuItem unloadPluginItem; diff --git a/external/source/gui/msfguijava/src/msfgui/ModuleInfoWindow.java b/external/source/gui/msfguijava/src/msfgui/ModuleInfoWindow.java index 467cd5f63d..b872231319 100644 --- a/external/source/gui/msfguijava/src/msfgui/ModuleInfoWindow.java +++ b/external/source/gui/msfguijava/src/msfgui/ModuleInfoWindow.java @@ -240,8 +240,8 @@ public abstract class ModuleInfoWindow extends MsfFrame { * @throws MsfException * @throws HeadlessException */ - protected void run(boolean console, Map hash) throws MsfException, HeadlessException { - run(console,hash, moduleType, fullName); + protected void run(Map hash, boolean console) throws MsfException, HeadlessException { + run(moduleType, fullName, hash, console); } /** * Takes options the user has provided and runs the specified module @@ -250,37 +250,7 @@ public abstract class ModuleInfoWindow extends MsfFrame { * @throws MsfException * @throws HeadlessException */ - protected void run(boolean console, Map hash, String moduleType, String fullName) throws MsfException, HeadlessException { - //Execute and get results - if (console) { // Create a list of commands to run in the console - Map res = (Map) rpcConn.execute("console.create"); - ArrayList autoCommands = new ArrayList(); - autoCommands.add("use " + moduleType + "/" + fullName); - //Add target if it is set and not zero if there is no default or non-default if there is a default - if(moduleType.equals("exploit") && hash.containsKey("TARGET")){ - Map info = (Map) rpcConn.execute("module.info", moduleType, fullName); - if(info.containsKey("default_target") && !hash.get("TARGET").toString().equals(info.get("default_target").toString()) - || !info.containsKey("default_target") && !hash.get("TARGET").toString().equals("0")) - autoCommands.add("set TARGET " + hash.get("TARGET")); - } - if (hash.containsKey("PAYLOAD")) - autoCommands.add("set PAYLOAD " + hash.get("PAYLOAD")); - //Convert the rest of the options to set commands - for (Object entObj : hash.entrySet()) { - Map.Entry ent = (Map.Entry) entObj; - if (!(ent.getKey().toString().equals("TARGET")) && !(ent.getKey().toString().equals("PAYLOAD"))) - autoCommands.add("set " + ent.getKey() + " " + MsfguiApp.escapeBackslashes(ent.getValue().toString())); - } - autoCommands.add("exploit"); - InteractWindow iw = new InteractWindow(rpcConn, res, autoCommands); - parentFrame.registerConsole(res, true, iw); - MsfguiLog.defaultLog.logMethodCall("module.execute", new Object[]{moduleType, fullName, hash}); - } else { // Non-console; just fire away - Map info = (Map) rpcConn.execute("module.execute",moduleType, fullName,hash); - if (!info.get("result").equals("success")) - MsfguiApp.showMessage(rootPane, info); - } - MsfguiApp.addRecentModule(java.util.Arrays.asList(new Object[]{moduleType, fullName, hash}), rpcConn, parentFrame); + protected void run(String moduleType, String fullName, Map hash, boolean console) throws MsfException, HeadlessException { + MsfguiApp.runModule(moduleType,fullName,hash,rpcConn,parentFrame,console); } - } diff --git a/external/source/gui/msfguijava/src/msfgui/ModulePopup.java b/external/source/gui/msfguijava/src/msfgui/ModulePopup.java index a74790d3ce..53a636aa9f 100644 --- a/external/source/gui/msfguijava/src/msfgui/ModulePopup.java +++ b/external/source/gui/msfguijava/src/msfgui/ModulePopup.java @@ -242,7 +242,7 @@ public class ModulePopup extends ModuleInfoWindow implements TreeSelectionListen hash.put("TARGET",target); } //Actually run the module - run(console, hash); + run(hash, console); //close out this.setVisible(false); diff --git a/external/source/gui/msfguijava/src/msfgui/MsfguiApp.java b/external/source/gui/msfguijava/src/msfgui/MsfguiApp.java index 4ce8d37a88..afd6946dfd 100644 --- a/external/source/gui/msfguijava/src/msfgui/MsfguiApp.java +++ b/external/source/gui/msfguijava/src/msfgui/MsfguiApp.java @@ -179,6 +179,47 @@ public class MsfguiApp extends SingleFrameApplication { return proc; } + /** + * Runs the specified module from options provided, sending results to main frame + * @param console + * @param hash + * @throws MsfException + * @throws HeadlessException + */ + public static void runModule(String moduleType, String fullName, Map hash, RpcConnection rpcConn, + MainFrame parentFrame, boolean console) throws MsfException, java.awt.HeadlessException { + //Execute and get results + if (console) { // Create a list of commands to run in the console + Map res = (Map) rpcConn.execute("console.create"); + java.util.ArrayList autoCommands = new java.util.ArrayList(); + autoCommands.add("use " + moduleType + "/" + fullName); + //Add target if it is set and not zero if there is no default or non-default if there is a default + if(moduleType.equals("exploit") && hash.containsKey("TARGET")){ + Map info = (Map) rpcConn.execute("module.info", moduleType, fullName); + if(info.containsKey("default_target") && !hash.get("TARGET").toString().equals(info.get("default_target").toString()) + || !info.containsKey("default_target") && !hash.get("TARGET").toString().equals("0")) + autoCommands.add("set TARGET " + hash.get("TARGET")); + } + if (hash.containsKey("PAYLOAD")) + autoCommands.add("set PAYLOAD " + hash.get("PAYLOAD")); + //Convert the rest of the options to set commands + for (Object entObj : hash.entrySet()) { + Map.Entry ent = (Map.Entry) entObj; + if (!(ent.getKey().toString().equals("TARGET")) && !(ent.getKey().toString().equals("PAYLOAD"))) + autoCommands.add("set " + ent.getKey() + " " + MsfguiApp.escapeBackslashes(ent.getValue().toString())); + } + autoCommands.add("exploit"); + InteractWindow iw = new InteractWindow(rpcConn, res, autoCommands); + parentFrame.registerConsole(res, true, iw); + MsfguiLog.defaultLog.logMethodCall("module.execute", new Object[]{moduleType, fullName, hash}); + } else { // Non-console; just fire away + Map info = (Map) rpcConn.execute("module.execute",moduleType, fullName,hash); + if (!info.get("result").equals("success")) + MsfguiApp.showMessage(parentFrame.getFrame(), info); + } + MsfguiApp.addRecentModule(java.util.Arrays.asList(new Object[]{moduleType, fullName, hash}), rpcConn, parentFrame); + } + /** Get root node of xml saved options file */ public static Map getPropertiesNode(){ return propRoot; diff --git a/external/source/gui/msfguijava/src/msfgui/PayloadPopup.java b/external/source/gui/msfguijava/src/msfgui/PayloadPopup.java index 422d827665..f0abe10514 100644 --- a/external/source/gui/msfguijava/src/msfgui/PayloadPopup.java +++ b/external/source/gui/msfguijava/src/msfgui/PayloadPopup.java @@ -51,7 +51,7 @@ public class PayloadPopup extends ModuleInfoWindow { Map hash = getOptions(mainPanel); hash.put("PAYLOAD", fullName); hash.put("TARGET", "0"); - run(console, hash, "exploit", "multi/handler"); + run("exploit", "multi/handler", hash, console); } /** Resets group layout displaying appropriate elements */ diff --git a/external/source/gui/msfguijava/src/msfgui/resources/MainFrame.properties b/external/source/gui/msfguijava/src/msfgui/resources/MainFrame.properties index ba3141eff1..836993ebf7 100644 --- a/external/source/gui/msfguijava/src/msfgui/resources/MainFrame.properties +++ b/external/source/gui/msfguijava/src/msfgui/resources/MainFrame.properties @@ -92,3 +92,4 @@ hostsViewItem.text=Hosts nmapItem.text=Nmap viewPrefsItem.text=Preferences... dbExportItem.text=Export +crackPasswordsItem.text=Crack Passwords