");
+
+ //Host summary
+ //Add headers
+ fout.write("
Hosts
");
+ Set sessionsEntrySet = sessions.entrySet();
+ HashMap hosts = new HashMap();
+ //Map hosts to sessions by IP
+ for(Object e : sessionsEntrySet){
+ Map session = (Map)((Entry) e).getValue();
+ if(session.containsKey("tunnel_peer")){ //actual session; not console
+ String host = session.get("tunnel_peer").toString().split(":")[0];
+ Set hostSet = (Set)hosts.get(host);
+ if(hostSet == null){
+ hostSet = new HashSet();
+ hosts.put(host, hostSet);
+ }
+ hostSet.add(session);
+ }
+ }
+ if(hosts.isEmpty()){
+ fout.write("
None. Go exploit something next time.
");
+ }else{
+ fout.write("
host | \n");
+ ArrayList headers = new ArrayList();
+ headers.add("type");
+ headers.add("via_exploit");
+ headers.add("via_payload");
+ headers.add("tunnel_peer");
+ headers.add("tunnel_local");
+ headers.add("desc");
+ fout.write("type | via exploit | via payload | tunnel peer | tunnel local | desc | ");
+ fout.write("
\n");
+
+ for(Object e : hosts.entrySet()){
+ String key = ((Entry)e).getKey().toString();
+ fout.write(""+key+" | \n");
+ Set hostSessions = (Set)(((Entry)e).getValue());
+ for(Object o : hostSessions){
+ Map session = (Map)o;
+ for(Object var : headers)
+ fout.write(""+session.get(var)+" | ");
+ fout.write("
\n | ");
+ }
+ fout.write("
");
+ }
+ fout.write("
\n\n");
+ }//end hosts
+
+ //Activity log
+ fout.write("
Activities
\n");
+ for(Object o : activityLog)
+ fout.write(""+htmlEntities(o.toString())+" |
\n");
+ fout.write("
\n\n");
+
+ //Complete console logs
+ fout.write("
Session logs
\n");
+ for(Object e : sessionsEntrySet){
+ Entry ent = (Entry) e;
+ Object log = ((Map)(ent.getValue())).get("console");
+ if(log == null)
+ continue;
+ Map session = (Map)ent.getValue();
+ fout.write("
Session "+ent.getKey()+"
");
+ if(session.containsKey("tunnel_peer"))
+ fout.write("To " + session.get("tunnel_peer"));
+ fout.write("
\n");
+ for(Object logEntry : (ArrayList)log){
+ String entryString = logEntry.toString();
+
+ //If has a newline, and it's not at the end, it's multiline - put in tags
+ if((entryString.indexOf('\n') - entryString.length()) % entryString.length() != -1)
+ entryString = ""+entryString+"
";
+ if(entryString.contains(">>>"))
+ fout.write(""+entryString+" |
\n");
+ else
+ fout.write(""+entryString+" |
\n");
+ }
+ fout.write("
");
+ }
+ fout.write("\n");
+ fout.flush();
+ fout.close();
+ return filename;
+ }
+
+ /** Gets localized date and now properly formatted */
+ private String now() {
+ return formatter.format(new Date());
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/MsfTable.java metasploit-gui-1.0/src/msfgui/MsfTable.java
--- metasploit-gui-1.0/src/msfgui/MsfTable.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/MsfTable.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,130 @@
+package msfgui;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.table.DefaultTableModel;
+
+/**
+ * Table customization defaults to non-editable, autosorted table with some preferences
+ * from the MsfGuiApp properties set.
+ * Also has a more sane column class getter and default renderer.
+ *
+ * @author scriptjunkie
+ */
+public class MsfTable extends javax.swing.JTable {
+ private final String[] dbNames;
+ private final String dbTable;
+ public RpcConnection rpcConn;
+ /**
+ * Default constructor just takes column names
+ * @param colnames The names of the columns in the table
+ */
+ public MsfTable(final RpcConnection rpcConn, String[] colnames, String dbTable, String[] dbNames){
+ this.dbNames = dbNames;
+ this.dbTable = dbTable;
+ this.rpcConn = rpcConn;
+ setModel(new javax.swing.table.DefaultTableModel(new Object [][] {}, colnames) {
+ public Class getColumnClass(int columnIndex) {
+ try{
+ return getValueAt(0, columnIndex).getClass();
+ }catch(ArrayIndexOutOfBoundsException aioobex){
+ }catch(NullPointerException aioobex){
+ }
+ return java.lang.String.class;
+ }
+ public boolean isCellEditable(int i,int j) {
+ return false;
+ }
+ });
+ setAutoCreateRowSorter(true); //sorting is cool!
+
+ //Render options
+ boolean showLines = Boolean.TRUE.equals(MsfguiApp.getPropertiesNode().get("tableShowLines"));
+ setShowHorizontalLines(showLines);
+ setShowVerticalLines(showLines);
+ setDefaultRenderer(java.util.Date.class, new javax.swing.table.DefaultTableCellRenderer());
+ if(!"off".equals(MsfguiApp.getPropertiesNode().get("tableResize"))) //
+ setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
+
+ //On double-click show a window with cell contents
+ addMouseListener(new MouseAdapter(){
+ public void mouseClicked(MouseEvent e){
+ if (e.getClickCount() != 2)
+ return;
+ JTextArea jack = new JTextArea(getValueAt(
+ rowAtPoint(e.getPoint()),
+ columnAtPoint(e.getPoint())).toString());
+ jack.setLineWrap(true);
+ JScrollPane scroll = new JScrollPane(jack);
+ scroll.setPreferredSize(new Dimension(400, 300));
+ scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ JOptionPane.showMessageDialog(MsfTable.this, scroll,"Cell info",JOptionPane.INFORMATION_MESSAGE);
+ }
+ } );
+ }
+ /** Automatically query more info on new data */
+ public void addAutoAdjuster(final JScrollPane pane){
+ //Add autoadjuster to get more DB info
+ pane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener(){
+ public void adjustmentValueChanged(AdjustmentEvent evt) {
+ java.awt.Adjustable adj = evt.getAdjustable();
+ if(evt.getValueIsAdjusting() || adj.getValue() + adj.getVisibleAmount() != adj.getMaximum())
+ return;
+ Component source = ((Component)evt.getSource());
+ while(!(source instanceof JScrollPane))
+ source = source.getParent();
+ int rowCount = getRowCount();
+ if(rowCount == 0 || (getRowCount() % 100) != 0)
+ return;
+ reAddQuery(false, rowCount);
+ }
+ });
+ }
+
+ /** Clear a table's contents, reenabling the tab, and replace with contents of data returned from a db call */
+ public void reAddQuery(boolean force, int offset) {
+ if(!force && !DraggableTabbedPane.isVisible(this))
+ return; //Don't re-add if not visible
+ try {
+ HashMap arg = new HashMap(10);
+ arg.put("workspace", MsfguiApp.workspace);
+ arg.put("offset", offset);
+ List data = (List) ((Map)rpcConn.execute("db."+dbTable, arg)).get(dbTable);
+ if(data == null)
+ return;
+ DefaultTableModel mod = (DefaultTableModel) getModel();
+ while (mod.getRowCount() > offset)
+ mod.removeRow(mod.getRowCount() - 1);
+ for (Object dataObj : data) {
+ Object[] row = new Object[dbNames.length];
+ for (int i = 0; i < dbNames.length; i++){
+ row[i] = ((Map) dataObj).get(dbNames[i]);
+ try{
+ if(dbNames[i].endsWith("_at") || dbNames[i].equals("time"))
+ row[i] = new java.util.Date(Long.parseLong(row[i].toString()) * 1000);
+ }catch(NumberFormatException nfex){
+ //don't do anything
+ }
+ }
+ mod.addRow(row);
+ }
+ TableHelper.fitColumnWidths(mod, this);
+ DraggableTabbedPane.setTabComponentEnabled(this, true);
+ } catch (MsfException mex) {
+ mex.printStackTrace();
+ if(mex.getMessage().equals("database not loaded"))
+ throw mex;
+ }
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/MsgRpc.java metasploit-gui-1.0/src/msfgui/MsgRpc.java
--- metasploit-gui-1.0/src/msfgui/MsgRpc.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/MsgRpc.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,136 @@
+package msfgui;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import org.msgpack.MessagePack;
+import org.msgpack.MessagePackObject;
+import org.msgpack.Packer;
+import org.msgpack.object.*;
+
+/**
+ * Implements an RPC backend using the MessagePack interface
+ * @author scriptjunkie
+ */
+public class MsgRpc extends RpcConnection {
+ private URL u;
+ private URLConnection huc; // new for each call
+ protected int timeout = 5000;
+
+ /**
+ * Creates a new URL to use as the basis of a connection.
+ */
+ protected void connect() throws MalformedURLException{
+ if(ssl){ // Install the all-trusting trust manager & HostnameVerifier
+ try {
+ SSLContext sc = SSLContext.getInstance("SSL");
+ sc.init(null, new TrustManager[]{
+ new X509TrustManager() {
+ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ public void checkClientTrusted(
+ java.security.cert.X509Certificate[] certs, String authType) {
+ }
+ public void checkServerTrusted(
+ java.security.cert.X509Certificate[] certs, String authType) {
+ }
+ }
+ }, new java.security.SecureRandom());
+ HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+ HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
+ public boolean verify(String string,SSLSession ssls) {
+ return true;
+ }
+ });
+ } catch (Exception e) {
+ }
+ u = new URL("https",host,port,"/api/1.0");
+ }else{
+ u = new URL("http",host,port,"/api/1.0");
+ }
+ }
+
+ /**
+ * Decodes a response recursively from MessagePackObject to a normal Java object
+ * @param src MessagePack response
+ * @return decoded object
+ */
+ private static Object unMsg(Object src){
+ Object out = src;
+ if(src instanceof ArrayType){
+ List l = ((ArrayType)src).asList();
+ List outList = new ArrayList(l.size());
+ out = outList;
+ for(Object o : l)
+ outList.add(unMsg(o));
+ }else if(src instanceof BooleanType){
+ out = ((BooleanType)src).asBoolean();
+ }else if(src instanceof FloatType){
+ out = ((FloatType)src).asFloat();
+ }else if(src instanceof IntegerType){
+ out = ((IntegerType)src).asInt();
+ }else if(src instanceof MapType){
+ Set ents = ((MapType)src).asMap().entrySet();
+ out = new HashMap();
+ for (Object ento : ents){
+ Map.Entry ent = (Map.Entry)ento;
+ Object key = unMsg(ent.getKey());
+ Object val = ent.getValue();
+ // Hack - keep bytes of generated or encoded payload
+ if(ents.size() == 1 && val instanceof RawType &&
+ (key.equals("payload") || key.equals("encoded")))
+ val = ((RawType)val).asByteArray();
+ else
+ val = unMsg(val);
+ ((Map)out).put(key, val);
+ }
+ if(((Map)out).containsKey("error") && ((Map)out).containsKey("error_class")){
+ System.out.println(((Map)out).get("error_backtrace"));
+ throw new MsfException(((Map)out).get("error_message").toString());
+ }
+ }else if(src instanceof NilType){
+ out = null;
+ }else if(src instanceof RawType){
+ out = ((RawType)src).asString();
+ }
+ return out;
+ }
+
+ /** Creates an XMLRPC call from the given method name and parameters and sends it */
+ protected void writeCall(String methodName, Object[] args) throws Exception{
+ huc = u.openConnection();
+ huc.setDoOutput(true);
+ huc.setDoInput(true);
+ huc.setUseCaches(false);
+ huc.setRequestProperty("Content-Type", "binary/message-pack");
+ huc.setReadTimeout(timeout);
+ OutputStream os = huc.getOutputStream();
+ Packer pk = new Packer(os);
+
+ pk.packArray(args.length+1);
+ pk.pack(methodName);
+ for(Object o : args)
+ pk.pack(o);
+ os.close();
+ }
+
+ /** Receives an RPC response and converts to an object */
+ protected Object readResp() throws Exception{
+ InputStream is = huc.getInputStream();
+ MessagePackObject mpo = MessagePack.unpack(is);
+ return unMsg(mpo);
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.form metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,150 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.java metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/MulticommandOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,184 @@
+package msfgui;
+
+import javax.swing.JFileChooser;
+
+/**
+ * Options dialog for the multicommand script
+ * @author scriptjunkie
+ */
+public class MulticommandOptionsDialog extends OptionsDialog {
+ /** Creates new form UploadexecOptionsDialog */
+ public MulticommandOptionsDialog(java.awt.Frame parent) {
+ super(parent, "Multicommand Options", true);
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ okButton = new javax.swing.JButton();
+ chooseButton = new javax.swing.JButton();
+ outputFileField = new javax.swing.JTextField();
+ commandFileField = new javax.swing.JTextField();
+ commandFileButton = new javax.swing.JButton();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ commandsArea = new javax.swing.JTextArea();
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+
+ setName("Form"); // NOI18N
+ addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent evt) {
+ closeDialog(evt);
+ }
+ });
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(MulticommandOptionsDialog.class);
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ chooseButton.setText(resourceMap.getString("chooseButton.text")); // NOI18N
+ chooseButton.setName("chooseButton"); // NOI18N
+ chooseButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chooseButtonActionPerformed(evt);
+ }
+ });
+
+ outputFileField.setText(resourceMap.getString("outputFileField.text")); // NOI18N
+ outputFileField.setName("outputFileField"); // NOI18N
+
+ commandFileField.setText(resourceMap.getString("commandFileField.text")); // NOI18N
+ commandFileField.setName("commandFileField"); // NOI18N
+
+ commandFileButton.setText(resourceMap.getString("commandFileButton.text")); // NOI18N
+ commandFileButton.setName("commandFileButton"); // NOI18N
+ commandFileButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ commandFileButtonActionPerformed(evt);
+ }
+ });
+
+ jScrollPane1.setName("jScrollPane1"); // NOI18N
+
+ commandsArea.setColumns(20);
+ commandsArea.setRows(5);
+ commandsArea.setName("commandsArea"); // NOI18N
+ jScrollPane1.setViewportView(commandsArea);
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(chooseButton)
+ .addComponent(commandFileButton)
+ .addComponent(jLabel1)
+ .addComponent(jLabel2))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
+ .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(commandFileField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
+ .addComponent(outputFileField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(outputFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(chooseButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(commandFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(commandFileButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(okButton))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel2)))
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("multicommand ");
+ if(outputFileField.getText().length() > 0)
+ cmd.append(" -f ").append(MsfguiApp.escapeBackslashes(outputFileField.getText()));
+ String commandList = commandsArea.getText();
+ if(commandFileField.getText().length() > 0){
+ cmd.append(" -rc ").append(MsfguiApp.escapeBackslashes(commandFileField.getText()));
+ }else if(commandList.length() > 0){
+ String [] cmds = commandList.split("\n");
+ cmd.append(" -cl ");
+ for(int i = 0; i < cmds.length; i++){
+ cmd.append(MsfguiApp.escapeBackslashes(cmds[i].trim()));
+ if (i < cmds.length - 1)
+ cmd.append(',');
+ }
+ }
+ command = cmd.toString();
+ doClose();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ /** Closes the dialog */
+ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
+ doClose();
+ }//GEN-LAST:event_closeDialog
+
+ private void chooseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ outputFileField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_chooseButtonActionPerformed
+
+ private void commandFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_commandFileButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ commandFileField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_commandFileButtonActionPerformed
+
+ private void doClose() {
+ setVisible(false);
+ dispose();
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton chooseButton;
+ private javax.swing.JButton commandFileButton;
+ private javax.swing.JTextField commandFileField;
+ private javax.swing.JTextArea commandsArea;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JButton okButton;
+ private javax.swing.JTextField outputFileField;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.form metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,173 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.java metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/NetenumOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,192 @@
+package msfgui;
+
+import javax.swing.JFileChooser;
+
+/**
+ * Options dialog for the netenum script
+ * @author scriptjunkie
+ */
+public class NetenumOptionsDialog extends OptionsDialog {
+ /** Creates new form NetenumOptionsDialog */
+ public NetenumOptionsDialog(java.awt.Frame parent) {
+ super(parent, "Netenum options", true);
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ okButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ addressField = new javax.swing.JTextField();
+ pingBox = new javax.swing.JCheckBox();
+ reverseDnsBox = new javax.swing.JCheckBox();
+ forwardBox = new javax.swing.JCheckBox();
+ mxNsBox = new javax.swing.JCheckBox();
+ serviceBox = new javax.swing.JCheckBox();
+ jLabel2 = new javax.swing.JLabel();
+ domainField = new javax.swing.JTextField();
+ fileField = new javax.swing.JTextField();
+ chooseButton = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(NetenumOptionsDialog.class);
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ addressField.setText(resourceMap.getString("addressField.text")); // NOI18N
+ addressField.setName("addressField"); // NOI18N
+
+ pingBox.setText(resourceMap.getString("pingBox.text")); // NOI18N
+ pingBox.setName("pingBox"); // NOI18N
+
+ reverseDnsBox.setText(resourceMap.getString("reverseDnsBox.text")); // NOI18N
+ reverseDnsBox.setName("reverseDnsBox"); // NOI18N
+
+ forwardBox.setText(resourceMap.getString("forwardBox.text")); // NOI18N
+ forwardBox.setName("forwardBox"); // NOI18N
+
+ mxNsBox.setText(resourceMap.getString("mxNsBox.text")); // NOI18N
+ mxNsBox.setName("mxNsBox"); // NOI18N
+
+ serviceBox.setText(resourceMap.getString("serviceBox.text")); // NOI18N
+ serviceBox.setName("serviceBox"); // NOI18N
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ domainField.setText(resourceMap.getString("domainField.text")); // NOI18N
+ domainField.setName("domainField"); // NOI18N
+
+ fileField.setText(resourceMap.getString("fileField.text")); // NOI18N
+ fileField.setName("fileField"); // NOI18N
+
+ chooseButton.setText(resourceMap.getString("chooseButton.text")); // NOI18N
+ chooseButton.setName("chooseButton"); // NOI18N
+ chooseButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chooseButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(forwardBox)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(addressField, javax.swing.GroupLayout.DEFAULT_SIZE, 196, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(pingBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(reverseDnsBox))
+ .addComponent(mxNsBox)
+ .addComponent(serviceBox)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(domainField, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(chooseButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(fileField, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE))
+ .addComponent(okButton, javax.swing.GroupLayout.Alignment.TRAILING))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel1)
+ .addComponent(addressField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(reverseDnsBox)
+ .addComponent(pingBox))
+ .addGap(18, 18, 18)
+ .addComponent(mxNsBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(serviceBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel2)
+ .addComponent(domainField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addComponent(forwardBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(fileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(chooseButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(okButton)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void chooseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ fileField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_chooseButtonActionPerformed
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("netenum ");
+ if(addressField.getText().length() > 0)
+ cmd.append(" -r ").append(addressField.getText());
+ if(pingBox.isSelected())
+ cmd.append(" -ps");
+ if(reverseDnsBox.isSelected())
+ cmd.append(" -rl");
+ if(forwardBox.isSelected())
+ cmd.append(" -fl");
+ if(fileField.getText().length() > 0)
+ cmd.append(" -hl ").append(MsfguiApp.escapeBackslashes(fileField.getText()));
+ if(domainField.getText().length() > 0)
+ cmd.append(" -d ").append(domainField.getText());
+ if(mxNsBox.isSelected())
+ cmd.append(" -st");
+ if(serviceBox.isSelected())
+ cmd.append(" -sr");
+ command = cmd.toString();
+ setVisible(false);
+ dispose();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField addressField;
+ private javax.swing.JButton chooseButton;
+ private javax.swing.JTextField domainField;
+ private javax.swing.JTextField fileField;
+ private javax.swing.JCheckBox forwardBox;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JCheckBox mxNsBox;
+ private javax.swing.JButton okButton;
+ private javax.swing.JCheckBox pingBox;
+ private javax.swing.JCheckBox reverseDnsBox;
+ private javax.swing.JCheckBox serviceBox;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.form metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.form
--- metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,258 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.java metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.java
--- metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/OpenConnectionDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,457 @@
+package msfgui;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+
+/**
+ * Options dialog for opening a connection the rpc daemon
+ * @author scriptjunkie
+ */
+public class OpenConnectionDialog extends javax.swing.JDialog {
+ private MainFrame mainframe;
+ private RpcConnection rpcConn;
+ private int timeout = 4;
+ private javax.swing.Timer countdown;
+
+ /** Creates new form UserPassDialog */
+ public OpenConnectionDialog(boolean modal, MainFrame mainframe) {
+ super(mainframe.getFrame(), modal);
+ this.mainframe = mainframe;
+ initComponents();
+ setTitle("msfgui");
+ org.jdesktop.application.ResourceMap resourceMap
+ = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class)
+ .getContext().getResourceMap(ModulePopup.class);
+ this.setIconImage(resourceMap.getImageIcon("main.icon").getImage());
+
+ startNewButton.requestFocusInWindow();
+ startNewButton.addFocusListener(new FocusListener(){
+ public void focusGained(FocusEvent fe) {
+ }
+ public void focusLost(FocusEvent fe) {
+ timeout = 0;
+ startNewButton.setText("Start new msfrpcd");
+ }
+ });
+ countdown = new javax.swing.Timer(1000,new ActionListener(){
+ public void actionPerformed(ActionEvent ae) {
+ if(timeout == 0){
+ countdown.stop();
+ return;
+ }
+ timeout = timeout - 1;
+ startNewButton.setText("Start new msfrpcd ("+timeout+")");
+ if(timeout == 0)
+ startNewButtonActionPerformed(ae);
+ }
+ });
+ countdown.start();
+ startNewButton.setText("Start new msfrpcd ("+timeout+")");
+ Map root = MsfguiApp.getPropertiesNode();
+ fillDefault(root.get("username"),usernameField);
+ fillDefault(root.get("host"),hostField);
+ if(root.containsKey("port") && !root.get("port").toString().equals("3790")) //don't interfere with default Metasploit
+ fillDefault(root.get("port"),portField);
+ sslBox.setSelected(Boolean.TRUE.equals(root.get("ssl")));
+ disableDbButton.setSelected(Boolean.TRUE.equals(root.get("disableDb")));
+ }
+
+ private boolean checkCrypto(boolean ssl) throws MsfException {
+ try {
+ if (ssl)
+ javax.crypto.KeyGenerator.getInstance("SunTlsRsaPremasterSecret");
+ } catch (NoSuchAlgorithmException nsax) {
+ int res = JOptionPane.showConfirmDialog(this, "Error: this version of Java may not support the necessary "
+ + "\ncryptographic capabilities to connect to msfrpcd over SSL. Try running \n"
+ + (System.getProperty("os.name").toLowerCase().contains("windows") ? "" : "java -jar ")
+ + MsfguiApp.getMyPath() + " \n"
+ + "as your system version of Java may work.\n\nContinue anyway?");
+ if(res != JOptionPane.YES_OPTION)
+ throw new MsfException("SSLcheck", nsax);
+ }
+ return ssl;
+ }
+
+ /** Sets the text of the given component if val is defined */
+ private void fillDefault(Object val, JTextField field) {
+ if (val!= null)
+ field.setText(val.toString());
+ }
+
+ /** Gets a connection for a main window from saved credentials or via the open
+ * connection dialog.
+ * @param mainframe the parent frame
+ * @return the new connection
+ */
+ public static RpcConnection getConnection(MainFrame mainframe) {
+ if(mainframe.rpcConn != null){
+ MsfguiApp.showMessage(mainframe.getFrame(), "You are already connected!\n"
+ + "Exit before making a new connection.");
+ throw new RuntimeException("Already connected");
+ }
+ //try saved connection credentials
+ try{
+ Map info = MsfguiApp.getPropertiesNode();
+ String username = info.get("username").toString();
+ String password = info.get("password").toString();
+ String host = info.get("host").toString();
+ int port = Integer.parseInt(info.get("port").toString());
+ boolean ssl = Boolean.parseBoolean(info.get("ssl").toString());
+ RpcConnection rpc = RpcConnection.getConn(username, password.toCharArray(), host, port, ssl);
+ if(JOptionPane.showConfirmDialog(null, "Connect to last remembered rpcd?") == JOptionPane.YES_OPTION)
+ return rpc;
+ rpc.execute("auth.logout");
+ } catch (MsfException mex) {
+ if(mex.getMessage().toLowerCase().contains("authentication error"))
+ mainframe.statusAnimationLabel.setText("Error authenticating; msfrpcd is running "
+ +"but you did not enter the right credentials.");
+ else if (mex.getMessage().toLowerCase().contains("connection reset"))
+ mainframe.statusAnimationLabel.setText("Connection reset; is the SSL option correct?"
+ + " Is msfrpcd running on the right port?");
+ else if (mex.getMessage().toLowerCase().contains("timed out"))
+ mainframe.statusAnimationLabel.setText("Timeout; is the SSL option correct?"
+ + " Is msfrpcd running on the right port?");
+ } catch (NullPointerException nex) {//generated when attributes dont exist.
+ } catch (Exception ex) { //for weird msg exceptions
+ }
+ //Try service token on default 3790
+ BufferedReader fin = null;
+ try{//Init base path if necessary
+ if(System.getProperty("os.name").toLowerCase().contains("windows"))
+ MsfguiApp.getBase();
+ //Get path to servicekey
+ String serviceKeyPath = "/opt/metasploit/apps/pro/engine/tmp/servicekey.txt";
+ if(System.getProperty("os.name").toLowerCase().contains("windows"))
+ serviceKeyPath = MsfguiApp.getPropertiesNode().get("BASE") + "\\apps\\pro\\engine\\tmp\\servicekey.txt";
+ //open servicekey and try connecting
+ System.out.println(serviceKeyPath);
+ fin = new BufferedReader(new FileReader(serviceKeyPath));
+ RpcConnection rpc = RpcConnection.getConn("", fin.readLine().toCharArray(), "localhost", 3790, true);
+ //if it worked, give user the option to connect
+ if(JOptionPane.showConfirmDialog(null, "Connect to local rpcd?") == JOptionPane.YES_OPTION)
+ return rpc;
+ }catch(IOException iox){//file not found/unreadable/
+ if(JOptionPane.showConfirmDialog(null,
+ "Cannot open service key. If metasploit is installed\n"
+ + "as a service, try running msfgui as root. Do you want\n"
+ + "to connect to a different service or start a new one?\n") != JOptionPane.YES_OPTION)
+ System.exit(0);
+ }catch(MsfException mx){//local rpc not running - ignore
+ }
+ //Darn. open the gui anyway
+ OpenConnectionDialog diag = new OpenConnectionDialog(true, mainframe);
+ diag.setVisible(true);
+ return diag.rpcConn;
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ buttonGroup1 = new javax.swing.ButtonGroup();
+ titleLabel = new javax.swing.JLabel();
+ usernameLabel = new javax.swing.JLabel();
+ passwordLabel = new javax.swing.JLabel();
+ hostLabel = new javax.swing.JLabel();
+ portLabel = new javax.swing.JLabel();
+ usernameField = new javax.swing.JTextField();
+ passwordField = new javax.swing.JPasswordField();
+ hostField = new javax.swing.JTextField();
+ portField = new javax.swing.JTextField();
+ connectButton = new javax.swing.JButton();
+ cancelButton = new javax.swing.JButton();
+ startNewButton = new javax.swing.JButton();
+ pathButton = new javax.swing.JButton();
+ sslBox = new javax.swing.JCheckBox();
+ sslLabel = new javax.swing.JLabel();
+ disableDbLabel = new javax.swing.JLabel();
+ disableDbButton = new javax.swing.JCheckBox();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(OpenConnectionDialog.class);
+ setTitle(resourceMap.getString("Form.title")); // NOI18N
+
+ titleLabel.setText(resourceMap.getString("titleLabel.text")); // NOI18N
+ titleLabel.setName("titleLabel"); // NOI18N
+
+ usernameLabel.setText(resourceMap.getString("usernameLabel.text")); // NOI18N
+ usernameLabel.setName("usernameLabel"); // NOI18N
+
+ passwordLabel.setText(resourceMap.getString("passwordLabel.text")); // NOI18N
+ passwordLabel.setName("passwordLabel"); // NOI18N
+
+ hostLabel.setText(resourceMap.getString("hostLabel.text")); // NOI18N
+ hostLabel.setName("hostLabel"); // NOI18N
+
+ portLabel.setText(resourceMap.getString("portLabel.text")); // NOI18N
+ portLabel.setName("portLabel"); // NOI18N
+
+ usernameField.setText(resourceMap.getString("usernameField.text")); // NOI18N
+ usernameField.setName("usernameField"); // NOI18N
+ usernameField.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ usernameFieldActionPerformed(evt);
+ }
+ });
+
+ passwordField.setText(resourceMap.getString("passwordField.text")); // NOI18N
+ passwordField.setName("passwordField"); // NOI18N
+ passwordField.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ passwordFieldActionPerformed(evt);
+ }
+ });
+
+ hostField.setText(resourceMap.getString("hostField.text")); // NOI18N
+ hostField.setName("hostField"); // NOI18N
+ hostField.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ hostFieldActionPerformed(evt);
+ }
+ });
+
+ portField.setText(resourceMap.getString("portField.text")); // NOI18N
+ portField.setName("portField"); // NOI18N
+ portField.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ portFieldActionPerformed(evt);
+ }
+ });
+
+ connectButton.setFont(connectButton.getFont());
+ connectButton.setText(resourceMap.getString("connectButton.text")); // NOI18N
+ connectButton.setName("connectButton"); // NOI18N
+ connectButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ connectButtonActionPerformed(evt);
+ }
+ });
+
+ cancelButton.setFont(cancelButton.getFont());
+ cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
+ cancelButton.setName("cancelButton"); // NOI18N
+ cancelButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cancelButtonActionPerformed(evt);
+ }
+ });
+
+ startNewButton.setFont(startNewButton.getFont().deriveFont(startNewButton.getFont().getStyle() | java.awt.Font.BOLD));
+ startNewButton.setText(resourceMap.getString("startNewButton.text")); // NOI18N
+ startNewButton.setName("startNewButton"); // NOI18N
+ startNewButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ startNewButtonActionPerformed(evt);
+ }
+ });
+
+ pathButton.setText(resourceMap.getString("pathButton.text")); // NOI18N
+ pathButton.setName("pathButton"); // NOI18N
+ pathButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ pathButtonActionPerformed(evt);
+ }
+ });
+
+ sslBox.setText(resourceMap.getString("sslBox.text")); // NOI18N
+ sslBox.setName("sslBox"); // NOI18N
+
+ sslLabel.setText(resourceMap.getString("sslLabel.text")); // NOI18N
+ sslLabel.setName("sslLabel"); // NOI18N
+
+ disableDbLabel.setText(resourceMap.getString("disableDbLabel.text")); // NOI18N
+ disableDbLabel.setName("disableDbLabel"); // NOI18N
+
+ disableDbButton.setText(resourceMap.getString("disableDbButton.text")); // NOI18N
+ disableDbButton.setName("disableDbButton"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(titleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(6, 6, 6)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(sslLabel)
+ .addComponent(hostLabel)
+ .addComponent(passwordLabel)
+ .addComponent(portLabel)
+ .addComponent(disableDbLabel)
+ .addComponent(usernameLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(disableDbButton)
+ .addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
+ .addComponent(hostField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
+ .addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
+ .addComponent(portField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
+ .addComponent(sslBox)))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(startNewButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pathButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 132, Short.MAX_VALUE)
+ .addComponent(cancelButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(connectButton)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(titleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(usernameLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(passwordLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(hostLabel)
+ .addComponent(hostField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(portLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(sslBox, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
+ .addComponent(sslLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(disableDbLabel)
+ .addComponent(disableDbButton, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(connectButton, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
+ .addComponent(cancelButton, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
+ .addComponent(startNewButton, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
+ .addComponent(pathButton, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void connectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_connectButtonActionPerformed
+ String username = usernameField.getText();
+ char[] password = passwordField.getPassword();
+ String host = hostField.getText();
+ int port = Integer.parseInt(portField.getText());
+ boolean ssl = checkCrypto(sslBox.isSelected());
+ try {
+ rpcConn = RpcConnection.getConn(username, password, host, port, ssl);
+ } catch (MsfException mex) {
+ rpcConn = null;
+ }
+ setVisible(false);
+ }//GEN-LAST:event_connectButtonActionPerformed
+
+ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
+ rpcConn = null;
+ setVisible(false);
+ }//GEN-LAST:event_cancelButtonActionPerformed
+
+ private void usernameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_usernameFieldActionPerformed
+ connectButtonActionPerformed(evt);
+ }//GEN-LAST:event_usernameFieldActionPerformed
+
+ private void passwordFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_passwordFieldActionPerformed
+ connectButtonActionPerformed(evt);
+ }//GEN-LAST:event_passwordFieldActionPerformed
+
+ private void hostFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hostFieldActionPerformed
+ connectButtonActionPerformed(evt);
+ }//GEN-LAST:event_hostFieldActionPerformed
+
+ private void portFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_portFieldActionPerformed
+ connectButtonActionPerformed(evt);
+ }//GEN-LAST:event_portFieldActionPerformed
+
+ private void startNewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startNewButtonActionPerformed
+ //Setup defaults
+ RpcConnection.defaultUser = usernameField.getText().trim();
+ if(RpcConnection.defaultUser.length() == 0) //make sure we don't try to use a blank username
+ RpcConnection.defaultUser = "msf";
+ if(passwordField.getPassword().length > 0)
+ RpcConnection.defaultPass = new String(passwordField.getPassword());
+ if(hostField.getText().length() > 0)
+ RpcConnection.defaultHost = hostField.getText();
+ RpcConnection.defaultPort = Integer.parseInt(portField.getText());
+ RpcConnection.defaultSsl = checkCrypto(sslBox.isSelected());
+ RpcConnection.disableDb = disableDbButton.isSelected();
+ //do the action. There's probably a "right" way to do Oh well.
+ mainframe.getContext().getActionMap(mainframe).get("startRpc").actionPerformed(new java.awt.event.ActionEvent(startNewButton,1234,""));
+ setVisible(false);
+ }//GEN-LAST:event_startNewButtonActionPerformed
+
+ private void pathButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pathButtonActionPerformed
+ File dir =new File("/opt/metasploit3/msf3/");
+ if(dir.isDirectory()){
+ MsfguiApp.fileChooser.setCurrentDirectory(dir);
+ }else{
+ dir = new File("C:\\metasploit");
+ if(dir.isDirectory())
+ MsfguiApp.fileChooser.setCurrentDirectory(dir);
+ }
+ if(MsfguiApp.getPropertiesNode().get("commandPrefix") != null)
+ dir =new File(MsfguiApp.getPropertiesNode().get("commandPrefix").toString());
+ if(dir.isDirectory())
+ MsfguiApp.fileChooser.setCurrentDirectory(dir);
+ MsfguiApp.fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ int result = MsfguiApp.fileChooser.showOpenDialog(this);
+ MsfguiApp.fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+ if (result != JFileChooser.APPROVE_OPTION)
+ return;
+ if(!(new File(MsfguiApp.fileChooser.getSelectedFile().getPath()+"/apps/pro")).isDirectory()){
+ MsfguiApp.showMessage(this, "Uh oh! That's not a valid metasploit folder.\n"
+ + "The right metasploit folder should have an apps subfolder.");
+ }
+ MsfguiApp.getPropertiesNode().put("BASE",
+ MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_pathButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.ButtonGroup buttonGroup1;
+ private javax.swing.JButton cancelButton;
+ private javax.swing.JButton connectButton;
+ private javax.swing.JCheckBox disableDbButton;
+ private javax.swing.JLabel disableDbLabel;
+ private javax.swing.JTextField hostField;
+ private javax.swing.JLabel hostLabel;
+ private javax.swing.JPasswordField passwordField;
+ private javax.swing.JLabel passwordLabel;
+ private javax.swing.JButton pathButton;
+ private javax.swing.JTextField portField;
+ private javax.swing.JLabel portLabel;
+ private javax.swing.JCheckBox sslBox;
+ private javax.swing.JLabel sslLabel;
+ private javax.swing.JButton startNewButton;
+ private javax.swing.JLabel titleLabel;
+ private javax.swing.JTextField usernameField;
+ private javax.swing.JLabel usernameLabel;
+ // End of variables declaration//GEN-END:variables
+}
diff -Nru metasploit-gui-1.0/src/msfgui/OptionsDialog.form metasploit-gui-1.0/src/msfgui/OptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/OptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/OptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,26 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/OptionsDialog.java metasploit-gui-1.0/src/msfgui/OptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/OptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/OptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,42 @@
+package msfgui;
+
+/**
+ * Basic options dialog for msfgui; includes icon
+ * @author scriptjunkie
+ */
+public class OptionsDialog extends javax.swing.JDialog {
+
+ protected String command;
+
+ //Opens dialog to get options
+ public String getCommand(){
+ setVisible(true);
+ return command;
+ }
+
+ /** Creates new form OptionsDialog */
+ public OptionsDialog(java.awt.Frame parent, String title, boolean modal) {
+ super(parent, title, modal);
+ command = null;
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(
+ msfgui.MsfguiApp.class).getContext().getResourceMap(ModulePopup.class);
+ this.setIconImage(resourceMap.getImageIcon("main.icon").getImage());
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ getContentPane().setLayout(null);
+ }// //GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/PayloadPopup.form metasploit-gui-1.0/src/msfgui/PayloadPopup.form
--- metasploit-gui-1.0/src/msfgui/PayloadPopup.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PayloadPopup.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,427 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/PayloadPopup.java metasploit-gui-1.0/src/msfgui/PayloadPopup.java
--- metasploit-gui-1.0/src/msfgui/PayloadPopup.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PayloadPopup.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,683 @@
+package msfgui;
+
+import java.awt.Component;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.GroupLayout.ParallelGroup;
+import javax.swing.GroupLayout.SequentialGroup;
+import javax.swing.JFileChooser;
+import javax.swing.LayoutStyle;
+
+/**
+ * Popup for generating payloads and starting handlers.
+ * @author scriptjunkie
+ */
+public class PayloadPopup extends ModuleInfoWindow {
+
+ /** Creates new form PayloadPopup */
+ public PayloadPopup(String fullName, RpcConnection rpcConn, MainFrame frame) {
+ moduleType = "payload";
+ parentFrame = frame;
+ initComponents();
+ outputPathField.setText(MsfguiApp.getTempFolder()+File.separator+"msf.exe");
+ this.rpcConn = rpcConn;
+ requiredOpts = new ArrayList();
+ optionalOpts = requiredOpts;
+ advancedOpts = requiredOpts;
+ this.fullName = fullName;
+ showOptions(fullName);
+ loadSavedSize();
+
+ //get encoders
+ try{
+ Object[] encoders = ((List)((Map) rpcConn.execute("module.encoders")).get("modules")).toArray();
+ int defaultEncoder = 0;
+ for(int i = 0; i < encoders.length; i++)
+ if(encoders[i].toString().equals("generic/none"))
+ defaultEncoder = i;
+ encoderCombo.setModel(new DefaultComboBoxModel(encoders));
+ encoderCombo.setSelectedIndex(defaultEncoder);
+ }catch(MsfException xre){
+ }
+ //get formats
+ try{
+ Object[] formats = ((List)rpcConn.execute("module.encode_formats")).toArray();
+ int defaultFormat = 0;
+ for(int i = 0; i < formats.length; i++)
+ if(formats[i].toString().equals("exe"))
+ defaultFormat = i;
+ outputCombo.setModel(new DefaultComboBoxModel(formats));
+ outputCombo.setSelectedIndex(defaultFormat);
+ }catch(MsfException xre){
+ xre.printStackTrace();
+ }
+ mainScrollPane.getVerticalScrollBar().setUnitIncrement(40);
+ }
+
+ private void doRun(boolean console) {
+ Map hash = getOptions(mainPanel);
+ hash.put("PAYLOAD", fullName);
+ hash.put("TARGET", "0");
+ run("exploit", "multi/handler", hash, console);
+ }
+
+ /** Resets group layout displaying appropriate elements */
+ private void resetLayout(){
+ boolean saving = saveButton.isSelected();
+ outputScrollPane.setVisible(!saving);
+ archField.setVisible(saving);
+ archLabel.setVisible(saving);
+ choosePathButton.setVisible(saving);
+ encoderCombo.setVisible(saving);
+ encoderLabel.setVisible(saving);
+ outputCombo.setVisible(saving);
+ outputLabel.setVisible(saving);
+ outputPathField.setVisible(saving);
+ outputPathLabel.setVisible(saving);
+ templateButton.setVisible(saving);
+ templateField.setVisible(saving);
+ templateLabel.setVisible(saving);
+ templateWorkingCheck.setVisible(saving);
+ timesField.setVisible(saving);
+ timesLabel.setVisible(saving);
+ badcharsField.setVisible(saving);
+ badcharsLabel.setVisible(saving);
+ addCodeButton.setVisible(saving);
+ addCodeLabel.setVisible(saving);
+ addCodeField.setVisible(saving);
+
+ GroupLayout mainPanelLayout = (GroupLayout)mainPanel.getLayout();
+ //HORIZONTAL GROUPING
+ ParallelGroup labelGroup = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+ //make label group
+ for(int i = 0; i < optionalOpts.size(); i+= 2)
+ labelGroup = labelGroup.addComponent((Component)optionalOpts.get(i), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
+ //make text box group
+ ParallelGroup textBoxGroup = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+ for(int i = 1; i < optionalOpts.size(); i+= 2)
+ textBoxGroup = textBoxGroup.addComponent((Component)optionalOpts.get(i));
+ //put it together
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(titleLabel)
+ .addComponent(descriptionBox)
+ .addComponent(authorsLabel)
+ .addComponent(licenseLabel)
+ .addComponent(versionLabel)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addGroup(labelGroup)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(textBoxGroup)
+ .addContainerGap())
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(generateButton)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(displayButton)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(saveButton)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(handleButton)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(handleConsoleButton))
+ .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addComponent(outputScrollPane, GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
+ .addContainerGap())
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(encoderLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(outputLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(archLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(badcharsLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(timesLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(outputPathLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(templateLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
+ .addComponent(addCodeLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(encoderCombo, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(outputCombo, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(archField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(badcharsField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(templateField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(outputPathField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(addCodeField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(templateButton)
+ .addComponent(choosePathButton)
+ .addComponent(addCodeButton)))
+ .addComponent(timesField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(templateWorkingCheck)))
+ .addContainerGap()));
+
+ //VERTICAL GROUPING
+ SequentialGroup groupie = mainPanelLayout.createSequentialGroup().
+ addComponent(titleLabel).
+ addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
+ addComponent(descriptionBox).
+ addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
+ addComponent(authorsLabel).
+ addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
+ addComponent(licenseLabel).
+ addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
+ addComponent(versionLabel);
+ for(int i = 0; i < optionalOpts.size(); i+=2){
+ groupie = groupie.addGroup(mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent((Component)optionalOpts.get(i)) //LABEL
+ .addComponent((Component)optionalOpts.get(i+1), //TEXT BOX
+ GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
+ }
+ groupie = groupie
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(generateButton)
+ .addComponent(displayButton)
+ .addComponent(saveButton)
+ .addComponent(handleButton)
+ .addComponent(handleConsoleButton))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(outputScrollPane, GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE);
+ if(saving)
+ groupie = groupie.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(outputPathLabel)
+ .addComponent(outputPathField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(choosePathButton))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(encoderLabel)
+ .addComponent(encoderCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(outputLabel)
+ .addComponent(outputCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(timesLabel)
+ .addComponent(timesField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(badcharsLabel)
+ .addComponent(badcharsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(archLabel)
+ .addComponent(archField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(templateLabel)
+ .addComponent(templateField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(templateButton)
+ .addComponent(templateWorkingCheck))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(addCodeLabel)
+ .addComponent(addCodeField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(addCodeButton));
+ groupie = groupie.addContainerGap();
+ mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.LEADING).addGroup(groupie));
+ }
+ /** Displays payload info and options. */
+ private void showOptions(String fullName) {
+ Map info = showBasicInfo(rpcConn, fullName);
+ showOptions(mainPanel, null);
+ resetLayout();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ buttonGroup1 = new javax.swing.ButtonGroup();
+ mainScrollPane = new javax.swing.JScrollPane();
+ mainPanel = new javax.swing.JPanel();
+ timesField = new javax.swing.JTextField();
+ encoderCombo = new javax.swing.JComboBox();
+ outputCombo = new javax.swing.JComboBox();
+ templateButton = new javax.swing.JButton();
+ templateWorkingCheck = new javax.swing.JCheckBox();
+ archLabel = new javax.swing.JLabel();
+ outputLabel = new javax.swing.JLabel();
+ timesLabel = new javax.swing.JLabel();
+ archField = new javax.swing.JTextField();
+ descriptionBox = new javax.swing.JLabel();
+ encoderLabel = new javax.swing.JLabel();
+ generateButton = new javax.swing.JButton();
+ outputScrollPane = new javax.swing.JScrollPane();
+ outputPane = new javax.swing.JTextArea();
+ displayButton = new javax.swing.JRadioButton();
+ saveButton = new javax.swing.JRadioButton();
+ outputPathLabel = new javax.swing.JLabel();
+ outputPathField = new javax.swing.JTextField();
+ choosePathButton = new javax.swing.JButton();
+ templateLabel = new javax.swing.JLabel();
+ templateField = new javax.swing.JTextField();
+ handleButton = new javax.swing.JButton();
+ handleConsoleButton = new javax.swing.JButton();
+ addCodeLabel = new javax.swing.JLabel();
+ addCodeField = new javax.swing.JTextField();
+ addCodeButton = new javax.swing.JButton();
+ badcharsLabel = new javax.swing.JLabel();
+ badcharsField = new javax.swing.JTextField();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setName("Form"); // NOI18N
+
+ mainScrollPane.setName("mainScrollPane"); // NOI18N
+
+ mainPanel.setName("mainPanel"); // NOI18N
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(PayloadPopup.class);
+ timesField.setText(resourceMap.getString("timesField.text")); // NOI18N
+ timesField.setName("timesField"); // NOI18N
+
+ encoderCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
+ encoderCombo.setName("encoderCombo"); // NOI18N
+
+ outputCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "c", "elf", "exe", "jar", "java", "js_le", "js_be", "perl", "raw", "ruby", "vba", "vbs", "loop-vbs", "asp", "war", "macho" }));
+ outputCombo.setName("outputCombo"); // NOI18N
+
+ templateButton.setText(resourceMap.getString("templateButton.text")); // NOI18N
+ templateButton.setName("templateButton"); // NOI18N
+ templateButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ templateButtonActionPerformed(evt);
+ }
+ });
+
+ templateWorkingCheck.setText(resourceMap.getString("templateWorkingCheck.text")); // NOI18N
+ templateWorkingCheck.setName("templateWorkingCheck"); // NOI18N
+
+ archLabel.setText(resourceMap.getString("archLabel.text")); // NOI18N
+ archLabel.setName("archLabel"); // NOI18N
+
+ outputLabel.setText(resourceMap.getString("outputLabel.text")); // NOI18N
+ outputLabel.setName("outputLabel"); // NOI18N
+
+ timesLabel.setText(resourceMap.getString("timesLabel.text")); // NOI18N
+ timesLabel.setName("timesLabel"); // NOI18N
+
+ archField.setText(resourceMap.getString("archField.text")); // NOI18N
+ archField.setName("archField"); // NOI18N
+
+ descriptionBox.setText(resourceMap.getString("descriptionBox.text")); // NOI18N
+ descriptionBox.setName("descriptionBox"); // NOI18N
+
+ encoderLabel.setText(resourceMap.getString("encoderLabel.text")); // NOI18N
+ encoderLabel.setName("encoderLabel"); // NOI18N
+
+ generateButton.setText(resourceMap.getString("generateButton.text")); // NOI18N
+ generateButton.setName("generateButton"); // NOI18N
+ generateButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ generateButtonActionPerformed(evt);
+ }
+ });
+
+ outputScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ outputScrollPane.setName("outputScrollPane"); // NOI18N
+
+ outputPane.setColumns(20);
+ outputPane.setEditable(false);
+ outputPane.setLineWrap(true);
+ outputPane.setName("outputPane"); // NOI18N
+ outputScrollPane.setViewportView(outputPane);
+
+ buttonGroup1.add(displayButton);
+ displayButton.setSelected(true);
+ displayButton.setText(resourceMap.getString("displayButton.text")); // NOI18N
+ displayButton.setName("displayButton"); // NOI18N
+ displayButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ displayButtonActionPerformed(evt);
+ }
+ });
+
+ buttonGroup1.add(saveButton);
+ saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N
+ saveButton.setName("saveButton"); // NOI18N
+ saveButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ saveButtonActionPerformed(evt);
+ }
+ });
+
+ outputPathLabel.setText(resourceMap.getString("outputPathLabel.text")); // NOI18N
+ outputPathLabel.setName("outputPathLabel"); // NOI18N
+
+ outputPathField.setText(resourceMap.getString("outputPathField.text")); // NOI18N
+ outputPathField.setName("outputPathField"); // NOI18N
+
+ choosePathButton.setText(resourceMap.getString("choosePathButton.text")); // NOI18N
+ choosePathButton.setName("choosePathButton"); // NOI18N
+ choosePathButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ choosePathButtonActionPerformed(evt);
+ }
+ });
+
+ templateLabel.setText(resourceMap.getString("templateLabel.text")); // NOI18N
+ templateLabel.setName("templateLabel"); // NOI18N
+
+ templateField.setName("templateField"); // NOI18N
+
+ handleButton.setText(resourceMap.getString("handleButton.text")); // NOI18N
+ handleButton.setName("handleButton"); // NOI18N
+ handleButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ handleButtonActionPerformed(evt);
+ }
+ });
+
+ handleConsoleButton.setText(resourceMap.getString("handleConsoleButton.text")); // NOI18N
+ handleConsoleButton.setName("handleConsoleButton"); // NOI18N
+ handleConsoleButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ handleConsoleButtonActionPerformed(evt);
+ }
+ });
+
+ addCodeLabel.setText(resourceMap.getString("addCodeLabel.text")); // NOI18N
+ addCodeLabel.setName("addCodeLabel"); // NOI18N
+
+ addCodeField.setText(resourceMap.getString("addCodeField.text")); // NOI18N
+ addCodeField.setName("addCodeField"); // NOI18N
+
+ addCodeButton.setText(resourceMap.getString("addCodeButton.text")); // NOI18N
+ addCodeButton.setName("addCodeButton"); // NOI18N
+ addCodeButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ addCodeButtonActionPerformed(evt);
+ }
+ });
+
+ badcharsLabel.setText(resourceMap.getString("badcharsLabel.text")); // NOI18N
+ badcharsLabel.setName("badcharsLabel"); // NOI18N
+
+ badcharsField.setName("badcharsField"); // NOI18N
+
+ javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(descriptionBox)
+ .addGap(1394, 1394, 1394))
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(outputPathLabel)
+ .addComponent(encoderLabel)
+ .addComponent(outputLabel)
+ .addComponent(timesLabel)
+ .addComponent(addCodeLabel)
+ .addComponent(badcharsLabel)
+ .addComponent(archLabel)
+ .addComponent(templateLabel))
+ .addGap(18, 18, 18)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(outputPathField, javax.swing.GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(choosePathButton, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(archField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
+ .addComponent(badcharsField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
+ .addComponent(timesField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
+ .addComponent(outputCombo, javax.swing.GroupLayout.Alignment.LEADING, 0, 550, Short.MAX_VALUE)
+ .addComponent(encoderCombo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 540, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(addCodeField)
+ .addComponent(templateField, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(addCodeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
+ .addComponent(templateButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(templateWorkingCheck)
+ .addGap(115, 115, 115))))
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(generateButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(displayButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(saveButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(handleButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(handleConsoleButton)
+ .addGap(121, 121, 121))
+ .addComponent(outputScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 691, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(795, 795, 795))
+ );
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addGap(119, 119, 119)
+ .addComponent(descriptionBox)
+ .addGap(18, 18, 18)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(generateButton)
+ .addComponent(displayButton)
+ .addComponent(saveButton)
+ .addComponent(handleButton)
+ .addComponent(handleConsoleButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 12, Short.MAX_VALUE)
+ .addGap(6, 6, 6)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(outputPathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(outputPathLabel)
+ .addComponent(choosePathButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(encoderCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(encoderLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(outputCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(outputLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(timesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(timesLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(badcharsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(badcharsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(archField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(archLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(templateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(templateLabel)
+ .addComponent(templateButton)
+ .addComponent(templateWorkingCheck))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(addCodeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(addCodeLabel)
+ .addComponent(addCodeButton))
+ .addContainerGap())
+ );
+
+ mainScrollPane.setViewportView(mainPanel);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(mainScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 795, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(mainScrollPane)
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void generateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateButtonActionPerformed
+ try {
+ HashMap hash = getOptions(mainPanel);
+ if(outputCombo.getSelectedItem().toString().equals("jar"))
+ hash.put("Format", "jar");
+ hash.put("Encoder", "generic/none");
+ Map data = (Map) rpcConn.execute("module.execute", "payload", fullName,hash);
+ //Basic info
+ byte[] buffer = (byte[])data.get("payload");
+
+ if(saveButton.isSelected()){ //Encode and output
+ hash.put("format", outputCombo.getSelectedItem().toString());
+ if(timesField.getText().length() > 0)
+ hash.put("ecount", timesField.getText());
+ if(badcharsField.getText().length() > 0){
+ StringBuilder badbinary = new StringBuilder();
+ for(String s : badcharsField.getText().split("\\\\x"))
+ if(s.length() > 0)
+ badbinary.append((char)Integer.parseInt(s, 16));
+ hash.put("badchars", badbinary.toString());
+ }
+ if(archField.getText().length() > 0)
+ hash.put("arch", archField.getText());
+ if(addCodeField.getText().length() > 0)
+ hash.put("addshellcode", addCodeField.getText());
+ if(templateField.getText().length() > 0){
+ hash.put("altexe", templateField.getText());
+ if(templateWorkingCheck.isSelected())
+ hash.put("inject", true);
+ }
+ if(!outputCombo.getSelectedItem().toString().equals("jar")){ //jars don't get encoded
+ Map encoded = (Map) rpcConn.execute("module.encode", buffer,
+ encoderCombo.getSelectedItem().toString(),hash);
+ buffer = (byte[])encoded.get("encoded");
+ }
+ FileOutputStream fout = new FileOutputStream(outputPathField.getText());
+ fout.write(buffer);
+ fout.close();
+ return;
+ }
+
+ outputPane.setText("Payload "+fullName+" "+hash+" "+buffer.length+" bytes.");
+ boolean isPlain = true;
+ StringBuilder plain = new StringBuilder("");
+ for(int i = 0; i < buffer.length; i++){
+ if (!Character.isISOControl(buffer[i]))// or check isLetterOrDigit isWhitespace or " , . (){}-_+=<>.,?/'"; etc.
+ plain.append((char)buffer[i]);
+ else
+ isPlain = false;
+ }
+ if(isPlain)
+ outputPane.append("\n\nplain text\n"+plain);
+ StringBuilder rubyHex = new StringBuilder("\"");
+ for(int i = 0; i < buffer.length; i += 10){
+ for(int j = 0; j < 10 && i + j < buffer.length; j++){
+ rubyHex.append("\\x");
+ rubyHex.append(Integer.toString((buffer[i+j] & 0xF0)/16,16));
+ rubyHex.append(Integer.toString(buffer[i+j] & 0x0F,16));
+ }
+ rubyHex.append("\"");
+ if(i + 10 < buffer.length)
+ rubyHex.append("+\n\"");
+ }
+ outputPane.append("\n\nruby\n"+rubyHex);
+ } catch (MsfException ex) {
+ MsfguiApp.showMessage(this, ex);
+ } catch (IOException ex) {
+ MsfguiApp.showMessage(this, ex);
+ }
+ }//GEN-LAST:event_generateButtonActionPerformed
+
+ private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
+ resetLayout();
+ }//GEN-LAST:event_saveButtonActionPerformed
+
+ private void displayButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayButtonActionPerformed
+ resetLayout();
+ }//GEN-LAST:event_displayButtonActionPerformed
+
+ private void choosePathButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_choosePathButtonActionPerformed
+ if(MsfguiApp.fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION)
+ outputPathField.setText(MsfguiApp.fileChooser.getSelectedFile().getAbsolutePath());
+ }//GEN-LAST:event_choosePathButtonActionPerformed
+
+ private void templateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_templateButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ templateField.setText(MsfguiApp.fileChooser.getSelectedFile().getAbsolutePath());
+ }//GEN-LAST:event_templateButtonActionPerformed
+
+ private void handleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_handleButtonActionPerformed
+ doRun(false);
+ }//GEN-LAST:event_handleButtonActionPerformed
+
+ private void handleConsoleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_handleConsoleButtonActionPerformed
+ doRun(true);
+ }//GEN-LAST:event_handleConsoleButtonActionPerformed
+
+ private void addCodeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addCodeButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ addCodeField.setText(MsfguiApp.fileChooser.getSelectedFile().getAbsolutePath());
+ }//GEN-LAST:event_addCodeButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton addCodeButton;
+ private javax.swing.JTextField addCodeField;
+ private javax.swing.JLabel addCodeLabel;
+ private javax.swing.JTextField archField;
+ private javax.swing.JLabel archLabel;
+ private javax.swing.JTextField badcharsField;
+ private javax.swing.JLabel badcharsLabel;
+ private javax.swing.ButtonGroup buttonGroup1;
+ private javax.swing.JButton choosePathButton;
+ public javax.swing.JLabel descriptionBox;
+ private javax.swing.JRadioButton displayButton;
+ private javax.swing.JComboBox encoderCombo;
+ private javax.swing.JLabel encoderLabel;
+ private javax.swing.JButton generateButton;
+ private javax.swing.JButton handleButton;
+ private javax.swing.JButton handleConsoleButton;
+ private javax.swing.JPanel mainPanel;
+ private javax.swing.JScrollPane mainScrollPane;
+ private javax.swing.JComboBox outputCombo;
+ private javax.swing.JLabel outputLabel;
+ private javax.swing.JTextArea outputPane;
+ private javax.swing.JTextField outputPathField;
+ private javax.swing.JLabel outputPathLabel;
+ private javax.swing.JScrollPane outputScrollPane;
+ private javax.swing.JRadioButton saveButton;
+ private javax.swing.JButton templateButton;
+ private javax.swing.JTextField templateField;
+ private javax.swing.JLabel templateLabel;
+ private javax.swing.JCheckBox templateWorkingCheck;
+ private javax.swing.JTextField timesField;
+ private javax.swing.JLabel timesLabel;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.form metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,208 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.java metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PersistenceOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,225 @@
+package msfgui;
+
+/**
+ * Options dialog for persistence
+ * @author scriptjunkie
+ */
+public class PersistenceOptionsDialog extends OptionsDialog {
+
+ /** Creates new form PersistenceOptionsDialog */
+ public PersistenceOptionsDialog(java.awt.Frame parent) {
+ super(parent,"Enter options for persistence", true);
+ initComponents();
+ ipField.setText(MsfguiApp.getLocalIp());
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ ipLabel = new javax.swing.JLabel();
+ portLabel = new javax.swing.JLabel();
+ ipField = new javax.swing.JTextField();
+ portField = new javax.swing.JTextField();
+ okButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ cancelButton = new javax.swing.JButton();
+ serviceRestartBox = new javax.swing.JCheckBox();
+ handlerBox = new javax.swing.JCheckBox();
+ intervalField = new javax.swing.JTextField();
+ intervalLabel = new javax.swing.JLabel();
+ loginRestartBox = new javax.swing.JCheckBox();
+ anyLoginRestartBox = new javax.swing.JCheckBox();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ ipLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(PersistenceOptionsDialog.class);
+ ipLabel.setText(resourceMap.getString("ipLabel.text")); // NOI18N
+ ipLabel.setName("ipLabel"); // NOI18N
+
+ portLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+ portLabel.setText(resourceMap.getString("portLabel.text")); // NOI18N
+ portLabel.setName("portLabel"); // NOI18N
+
+ ipField.setName("ipField"); // NOI18N
+ ipField.setPreferredSize(new java.awt.Dimension(50, 27));
+
+ portField.setText(resourceMap.getString("portField.text")); // NOI18N
+ portField.setName("portField"); // NOI18N
+ portField.setPreferredSize(new java.awt.Dimension(50, 27));
+
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
+ cancelButton.setName("cancelButton"); // NOI18N
+ cancelButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cancelButtonActionPerformed(evt);
+ }
+ });
+
+ serviceRestartBox.setSelected(true);
+ serviceRestartBox.setText(resourceMap.getString("serviceRestartBox.text")); // NOI18N
+ serviceRestartBox.setName("serviceRestartBox"); // NOI18N
+
+ handlerBox.setText(resourceMap.getString("handlerBox.text")); // NOI18N
+ handlerBox.setName("handlerBox"); // NOI18N
+
+ intervalField.setText(resourceMap.getString("intervalField.text")); // NOI18N
+ intervalField.setName("intervalField"); // NOI18N
+
+ intervalLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+ intervalLabel.setText(resourceMap.getString("intervalLabel.text")); // NOI18N
+ intervalLabel.setName("intervalLabel"); // NOI18N
+
+ loginRestartBox.setText(resourceMap.getString("loginRestartBox.text")); // NOI18N
+ loginRestartBox.setName("loginRestartBox"); // NOI18N
+ loginRestartBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ loginRestartBoxActionPerformed(evt);
+ }
+ });
+
+ anyLoginRestartBox.setText(resourceMap.getString("anyLoginRestartBox.text")); // NOI18N
+ anyLoginRestartBox.setName("anyLoginRestartBox"); // NOI18N
+ anyLoginRestartBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ anyLoginRestartBoxActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(44, 44, 44))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(intervalLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(ipLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(portLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(portField, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)
+ .addComponent(ipField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)
+ .addComponent(intervalField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE))
+ .addContainerGap())
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(handlerBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(serviceRestartBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(loginRestartBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(anyLoginRestartBox)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(cancelButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(okButton)
+ .addContainerGap())))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(serviceRestartBox)
+ .addComponent(loginRestartBox)
+ .addComponent(anyLoginRestartBox))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(handlerBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(ipLabel)
+ .addComponent(ipField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(portLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(intervalField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(intervalLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(okButton)
+ .addComponent(cancelButton))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("persistence ");
+ if(handlerBox.isSelected())
+ cmd.append(" -A ");
+ if(serviceRestartBox.isSelected())
+ cmd.append(" -S ");
+ if(anyLoginRestartBox.isSelected())
+ cmd.append(" -X ");
+ if(loginRestartBox.isSelected())
+ cmd.append(" -U ");
+ cmd.append(" -i ").append(Integer.parseInt(intervalField.getText()));
+ cmd.append(" -p ").append(Integer.parseInt(portField.getText()));
+ cmd.append(" -r ").append(ipField.getText());
+ command = cmd.toString();
+ this.setVisible(false);
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
+ command = null;
+ this.setVisible(false);
+ }//GEN-LAST:event_cancelButtonActionPerformed
+
+ private void loginRestartBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginRestartBoxActionPerformed
+ if(loginRestartBox.isSelected())
+ anyLoginRestartBox.setSelected(false);
+ }//GEN-LAST:event_loginRestartBoxActionPerformed
+
+ private void anyLoginRestartBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_anyLoginRestartBoxActionPerformed
+ if(anyLoginRestartBox.isSelected())
+ loginRestartBox.setSelected(false);
+ }//GEN-LAST:event_anyLoginRestartBoxActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JCheckBox anyLoginRestartBox;
+ private javax.swing.JButton cancelButton;
+ private javax.swing.JCheckBox handlerBox;
+ private javax.swing.JTextField intervalField;
+ private javax.swing.JLabel intervalLabel;
+ private javax.swing.JTextField ipField;
+ private javax.swing.JLabel ipLabel;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JCheckBox loginRestartBox;
+ private javax.swing.JButton okButton;
+ private javax.swing.JTextField portField;
+ private javax.swing.JLabel portLabel;
+ private javax.swing.JCheckBox serviceRestartBox;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/PopupMouseListener.java metasploit-gui-1.0/src/msfgui/PopupMouseListener.java
--- metasploit-gui-1.0/src/msfgui/PopupMouseListener.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PopupMouseListener.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,30 @@
+package msfgui;
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+/**
+ * Convenient handler for showing popup windows from mouse clicks
+ * @author scriptjunkie
+ */
+public abstract class PopupMouseListener extends MouseAdapter{
+ public void mousePressed(MouseEvent e) {
+ if (e.isPopupTrigger())
+ showPopup(e);
+ }
+ public void mouseReleased(MouseEvent e) {
+ if (e.isPopupTrigger())
+ showPopup(e);
+ }
+ public void mouseClicked(MouseEvent e){ //show interaction window on double-click
+ try{
+ if(e.getClickCount() == 2)
+ doubleClicked(e);
+ }catch(MsfException xre){
+ MsfguiApp.showMessage(null, "action failed " + xre);
+ }
+ }
+ public void doubleClicked (MouseEvent e) throws MsfException{//empty by default
+ };
+ public abstract void showPopup(MouseEvent e);
+}
diff -Nru metasploit-gui-1.0/src/msfgui/PreferencesFrame.form metasploit-gui-1.0/src/msfgui/PreferencesFrame.form
--- metasploit-gui-1.0/src/msfgui/PreferencesFrame.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PreferencesFrame.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,231 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/PreferencesFrame.java metasploit-gui-1.0/src/msfgui/PreferencesFrame.java
--- metasploit-gui-1.0/src/msfgui/PreferencesFrame.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/PreferencesFrame.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,309 @@
+package msfgui;
+
+import java.awt.Color;
+import java.util.Map;
+import javax.swing.JColorChooser;
+import javax.swing.UIManager;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+/**
+ * Preferences form to see/save preferences.
+ *
+ * @author scriptjunkie
+ */
+public class PreferencesFrame extends MsfFrame {
+ private final Map prefs;
+ private String[] lookNFeels;
+
+ /** Creates new form viewPrefs */
+ public PreferencesFrame() {
+ LookAndFeelInfo[] infoArray = UIManager.getInstalledLookAndFeels();
+ lookNFeels = new String[infoArray.length];
+ for(int i = 0; i < infoArray.length; i++)
+ lookNFeels[i] = infoArray[i].getClassName();
+ initComponents();
+ updateSizes(this);
+ prefs = MsfguiApp.getPropertiesNode();
+ setLnFBox.setSelectedItem(prefs.get("LnF"));
+ tabWindowBox.setSelected(!"window".equals(prefs.get("tabWindowPreference")));
+ tableLineBox.setSelected(Boolean.TRUE.equals(prefs.get("tableShowLines")));
+ tableExpandBox.setSelected(!"off".equals(prefs.get("tableResize")));
+ if(Boolean.TRUE.equals(prefs.get("overrideColors")))
+ colorThemeBox.setSelected(true);
+ if(prefs.containsKey("defaultTextSize"))
+ fontSizeSlider.setValue(new Integer(prefs.get("defaultTextSize").toString()));
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ tabWindowBox = new javax.swing.JCheckBox();
+ tableLineBox = new javax.swing.JCheckBox();
+ tableExpandBox = new javax.swing.JCheckBox();
+ headerLabel = new javax.swing.JLabel();
+ okButton = new javax.swing.JButton();
+ cancelButton = new javax.swing.JButton();
+ restartLabel = new javax.swing.JLabel();
+ setLnFBox = new javax.swing.JComboBox();
+ lnFLabel = new javax.swing.JLabel();
+ fontSizeSlider = new javax.swing.JSlider();
+ textSizeLabel = new javax.swing.JLabel();
+ colorThemeBox = new javax.swing.JCheckBox();
+ foregroundButton = new javax.swing.JButton();
+ background = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setName("Form"); // NOI18N
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(PreferencesFrame.class);
+ tabWindowBox.setText(resourceMap.getString("tabWindowBox.text")); // NOI18N
+ tabWindowBox.setName("tabWindowBox"); // NOI18N
+
+ tableLineBox.setText(resourceMap.getString("tableLineBox.text")); // NOI18N
+ tableLineBox.setName("tableLineBox"); // NOI18N
+
+ tableExpandBox.setText(resourceMap.getString("tableExpandBox.text")); // NOI18N
+ tableExpandBox.setName("tableExpandBox"); // NOI18N
+
+ headerLabel.setText(resourceMap.getString("headerLabel.text")); // NOI18N
+ headerLabel.setName("headerLabel"); // NOI18N
+
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
+ cancelButton.setName("cancelButton"); // NOI18N
+ cancelButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cancelButtonActionPerformed(evt);
+ }
+ });
+
+ restartLabel.setText(resourceMap.getString("restartLabel.text")); // NOI18N
+ restartLabel.setName("restartLabel"); // NOI18N
+
+ setLnFBox.setModel(new javax.swing.DefaultComboBoxModel(lookNFeels));
+ setLnFBox.setName("setLnFBox"); // NOI18N
+ setLnFBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ setLnFBoxActionPerformed(evt);
+ }
+ });
+
+ lnFLabel.setText(resourceMap.getString("lnFLabel.text")); // NOI18N
+ lnFLabel.setName("lnFLabel"); // NOI18N
+
+ fontSizeSlider.setMaximum(20);
+ fontSizeSlider.setMinimum(4);
+ fontSizeSlider.setPaintLabels(true);
+ fontSizeSlider.setPaintTicks(true);
+ fontSizeSlider.setSnapToTicks(true);
+ fontSizeSlider.setValue(10);
+ fontSizeSlider.setName("fontSizeSlider"); // NOI18N
+ fontSizeSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ fontSizeSliderStateChanged(evt);
+ }
+ });
+
+ textSizeLabel.setText(resourceMap.getString("textSizeLabel.text")); // NOI18N
+ textSizeLabel.setName("textSizeLabel"); // NOI18N
+
+ colorThemeBox.setText(resourceMap.getString("colorThemeBox.text")); // NOI18N
+ colorThemeBox.setName("colorThemeBox"); // NOI18N
+
+ foregroundButton.setText(resourceMap.getString("foregroundButton.text")); // NOI18N
+ foregroundButton.setName("foregroundButton"); // NOI18N
+ foregroundButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ foregroundButtonActionPerformed(evt);
+ }
+ });
+
+ background.setText(resourceMap.getString("background.text")); // NOI18N
+ background.setName("background"); // NOI18N
+ background.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ backgroundActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(headerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(setLnFBox, 0, 704, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(lnFLabel)))
+ .addContainerGap())
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(tableLineBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 638, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(tableExpandBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 476, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(restartLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 696, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(okButton)))
+ .addGap(18, 18, 18))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(tabWindowBox)
+ .addContainerGap(635, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(fontSizeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(textSizeLabel)
+ .addContainerGap(486, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(colorThemeBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(foregroundButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(background)
+ .addContainerGap(445, Short.MAX_VALUE))))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(headerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(setLnFBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(lnFLabel))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(colorThemeBox)
+ .addComponent(foregroundButton)
+ .addComponent(background))
+ .addGap(47, 47, 47)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(textSizeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(fontSizeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(tabWindowBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(tableLineBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(tableExpandBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(restartLabel)
+ .addComponent(cancelButton)
+ .addComponent(okButton))
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
+ try{
+ UIManager.setLookAndFeel(prefs.get("LnF").toString());
+ }catch(Exception ex){
+ }
+ setVisible(false);
+ dispose();
+ }//GEN-LAST:event_cancelButtonActionPerformed
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ prefs.put("LnF", setLnFBox.getSelectedItem().toString());
+ prefs.put("tabWindowPreference", tabWindowBox.isSelected() ? "tab" : "window");
+ prefs.put("tableShowLines", tableLineBox.isSelected());
+ prefs.put("tableResize", tableExpandBox.isSelected() ? "on" : "off");
+ prefs.put("overrideColors", colorThemeBox.isSelected());
+ prefs.put("defaultTextSize", new Integer(fontSizeSlider.getValue()).toString());
+ if(fontSizeSlider.getValue() >= 12)
+ prefs.put("jComponentSizeVariant", "large");
+ else if(fontSizeSlider.getValue() >= 10)
+ prefs.put("jComponentSizeVariant", "regular");
+ else if(fontSizeSlider.getValue() >= 8)
+ prefs.put("jComponentSizeVariant", "small");
+ else
+ prefs.put("jComponentSizeVariant", "mini");
+ setVisible(false);
+ dispose();
+ updateUIs();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ /**
+ * Recursively iterates through a container, updating the size to this local font slider size
+ * @param c Container to be resized
+ */
+ public void updateSize(java.awt.Container c) {
+ for(java.awt.Component com : c.getComponents()) {
+ com.setFont(com.getFont().deriveFont((float)fontSizeSlider.getValue()));
+ if (com instanceof java.awt.Container)
+ updateSize((java.awt.Container) com);
+ }
+ }
+ private void fontSizeSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fontSizeSliderStateChanged
+ updateSize(this);
+ }//GEN-LAST:event_fontSizeSliderStateChanged
+
+ private void setLnFBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setLnFBoxActionPerformed
+ try{
+ UIManager.setLookAndFeel(setLnFBox.getSelectedItem().toString());
+ javax.swing.SwingUtilities.updateComponentTreeUI(this);
+ pack();
+ }catch(Exception ex){
+ }
+ }//GEN-LAST:event_setLnFBoxActionPerformed
+
+ private void foregroundButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_foregroundButtonActionPerformed
+ Color fgcol = JColorChooser.showDialog(this, null, lnFLabel.getForeground());
+ prefs.put("foregroundColor",fgcol.getRGB());
+ colorThemeBox.setSelected(true);
+ prefs.put("overrideColors",true);
+ updateSizes(this);
+ }//GEN-LAST:event_foregroundButtonActionPerformed
+
+ private void backgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backgroundActionPerformed
+ Color bgcol = JColorChooser.showDialog(this, null, lnFLabel.getForeground());
+ prefs.put("backgroundColor",bgcol.getRGB());
+ colorThemeBox.setSelected(true);
+ prefs.put("overrideColors",true);
+ updateSizes(this);
+ }//GEN-LAST:event_backgroundActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton background;
+ private javax.swing.JButton cancelButton;
+ private javax.swing.JCheckBox colorThemeBox;
+ private javax.swing.JSlider fontSizeSlider;
+ private javax.swing.JButton foregroundButton;
+ private javax.swing.JLabel headerLabel;
+ private javax.swing.JLabel lnFLabel;
+ private javax.swing.JButton okButton;
+ private javax.swing.JLabel restartLabel;
+ private javax.swing.JComboBox setLnFBox;
+ private javax.swing.JCheckBox tabWindowBox;
+ private javax.swing.JCheckBox tableExpandBox;
+ private javax.swing.JCheckBox tableLineBox;
+ private javax.swing.JLabel textSizeLabel;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/ProcessList.form metasploit-gui-1.0/src/msfgui/ProcessList.form
--- metasploit-gui-1.0/src/msfgui/ProcessList.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/ProcessList.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,151 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/ProcessList.java metasploit-gui-1.0/src/msfgui/ProcessList.java
--- metasploit-gui-1.0/src/msfgui/ProcessList.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/ProcessList.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,260 @@
+package msfgui;
+
+import java.awt.Component;
+import java.awt.HeadlessException;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.util.Map;
+import java.util.concurrent.locks.ReentrantLock;
+import javax.swing.Timer;
+import javax.swing.table.DefaultTableModel;
+
+/**
+ * Window displaying a process list for meterpreter sessions.
+ * @author scriptjunkie
+ */
+public class ProcessList extends MsfFrame {
+ protected final Map session;
+ protected final RpcConnection rpcConn;
+ protected ReentrantLock lock;
+ protected final DefaultTableModel model;
+ protected Timer readTimer = null;
+
+ /** Shows process list window for a session, creating one if necessary */
+ static void showList(RpcConnection rpcConn, Map session, Map sessionWindowMap) {
+ Object processListWindow = sessionWindowMap.get(session.get("id")+"procList");
+ if(processListWindow == null){
+ processListWindow = new ProcessList(rpcConn,session,sessionWindowMap).mainPanel;
+ sessionWindowMap.put(session.get("id")+"procList",processListWindow);
+ }
+ DraggableTabbedPane.show((Component)processListWindow);
+ }
+
+ /** Creates new form ProcessList */
+ public ProcessList(final RpcConnection rpcConn, final Map session, Map sessionPopupMap) {
+ super("Meterpreter remote process list");
+ initComponents();
+ tabbedPane.setTitleAt(0, "Session "+session.get("id")+" process list");
+ loadSavedSize();
+ model = new DefaultTableModel(){
+ public boolean isCellEditable(int row, int col){
+ return false;
+ }
+ public Class getColumnClass(int columnIndex) {
+ try{
+ return getValueAt(0, columnIndex).getClass();
+ }catch(ArrayIndexOutOfBoundsException aioobex){
+ return java.lang.String.class;
+ }
+ }
+ };
+ processTable.setModel(model);
+ processTable.setShowHorizontalLines(false);
+ processTable.setShowVerticalLines(false);
+ processTable.setAutoCreateRowSorter(true);
+ this.rpcConn = rpcConn;
+ this.session = session;
+ this.lock = (ReentrantLock)sessionPopupMap.get(session.get("id")+"lock");
+ //See if we need to move our tab
+ Map props = MsfguiApp.getPropertiesNode();
+ if(!props.get("tabWindowPreference").equals("window")){
+ ((DraggableTabbedPane)tabbedPane).moveTabTo(0, DraggableTabbedPane.getTabPane(
+ (Component)sessionPopupMap.get(session.get("id")+"console")));
+ DraggableTabbedPane.show(mainPanel);
+ }
+ listProcs();
+ }
+
+ /** Lists the processes that are running */
+ protected void listProcs() throws HeadlessException {
+ lock.lock();
+ if (runCommand("ps"))
+ return;
+ readTimer = new Timer(300, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ Map received = (Map) rpcConn.execute("session.meterpreter_read", session.get("id"));
+ byte[] decodedBytes = RpcConnection.getData(received);
+ if (decodedBytes.length == 0)
+ return; //no data
+ String[] lines = new String(decodedBytes).split("\n");
+ String headerRow = null;
+ for (String line : lines) {
+ line = line.trim();
+ if(line.startsWith("PID")){
+ headerRow = line;
+ model.setColumnIdentifiers(line.split("\\s+"));
+ while(model.getRowCount() > 0)
+ model.removeRow(0);
+ }
+ if (line.length() < 2 || line.charAt(1) < '0' || line.charAt(1) > '9')
+ continue;
+ model.addRow(TableHelper.fill(line,headerRow));
+ }
+ readTimer.stop();
+ TableHelper.fitColumnWidths(model, processTable);
+ } catch(NullPointerException nex){ //junk data from previous command? Ignore.
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ if (ex.getMessage().contains("unknown session"))
+ readTimer.stop();
+ MsfguiApp.showMessage(null, ex.getMessage());
+ }
+ lock.unlock();
+ }
+ });
+ readTimer.start();
+ }
+
+ //Runs command, returning whether error was found
+ private boolean runCommand(String cmd) throws HeadlessException {
+ try {
+ rpcConn.execute("session.meterpreter_run_single", session.get("id"),cmd);
+ } catch (Exception ex) {
+ MsfguiApp.showMessage(this, ex);
+ if (ex.getMessage().toLowerCase().contains("unknown session"))
+ return true;
+ }
+ return false;
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ tabbedPane = new DraggableTabbedPane(this);
+ mainPanel = new javax.swing.JPanel();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ processTable = new javax.swing.JTable();
+ refreshButton = new javax.swing.JButton();
+ migrateButton = new javax.swing.JButton();
+ killButton = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ tabbedPane.setName("tabbedPane"); // NOI18N
+
+ mainPanel.setName("mainPanel"); // NOI18N
+
+ jScrollPane1.setName("jScrollPane1"); // NOI18N
+
+ processTable.setModel(new javax.swing.table.DefaultTableModel(
+ new Object [][] {
+
+ },
+ new String [] {
+ "Name", "PID", "User", "Session", "Path"
+ }
+ ) {
+ Class[] types = new 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];
+ }
+ });
+ processTable.setName("processTable"); // NOI18N
+ jScrollPane1.setViewportView(processTable);
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(ProcessList.class);
+ refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N
+ refreshButton.setName("refreshButton"); // NOI18N
+ refreshButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ refreshButtonActionPerformed(evt);
+ }
+ });
+
+ migrateButton.setText(resourceMap.getString("migrateButton.text")); // NOI18N
+ migrateButton.setName("migrateButton"); // NOI18N
+ migrateButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ migrateButtonActionPerformed(evt);
+ }
+ });
+
+ killButton.setText(resourceMap.getString("killButton.text")); // NOI18N
+ killButton.setName("killButton"); // NOI18N
+ killButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ killButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 586, Short.MAX_VALUE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(refreshButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 416, Short.MAX_VALUE)
+ .addComponent(killButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(migrateButton)))
+ .addContainerGap())
+ );
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(refreshButton)
+ .addComponent(migrateButton)
+ .addComponent(killButton))
+ .addContainerGap())
+ );
+
+ tabbedPane.addTab("tab1", mainPanel);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 622, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE)
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void migrateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_migrateButtonActionPerformed
+ runCommand("migrate "+processTable.getModel().getValueAt(processTable.getSelectedRow(),0));
+ listProcs();
+ }//GEN-LAST:event_migrateButtonActionPerformed
+
+ private void killButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_killButtonActionPerformed
+ runCommand("kill "+processTable.getModel().getValueAt(processTable.getSelectedRow(),0));
+ listProcs();
+ }//GEN-LAST:event_killButtonActionPerformed
+
+ private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed
+ listProcs();
+ }//GEN-LAST:event_refreshButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JButton killButton;
+ private javax.swing.JPanel mainPanel;
+ private javax.swing.JButton migrateButton;
+ private javax.swing.JTable processTable;
+ private javax.swing.JButton refreshButton;
+ private javax.swing.JTabbedPane tabbedPane;
+ // End of variables declaration//GEN-END:variables
+}
diff -Nru metasploit-gui-1.0/src/msfgui/Rank.java metasploit-gui-1.0/src/msfgui/Rank.java
--- metasploit-gui-1.0/src/msfgui/Rank.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/Rank.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,62 @@
+package msfgui;
+
+/**
+ *
+ * Represents a module rank. Immutable, like an integer.
+ * @author scriptjunkie
+ */
+public final class Rank {
+ //ManualRanking = 0
+ //LowRanking = 100
+ //AverageRanking = 200
+ //NormalRanking = 300
+ //GoodRanking = 400
+ //GreatRanking = 500
+ //ExcellentRanking = 600
+ private final int rank;
+
+ //Creates from object, hopefully string or integer
+ public Rank(Object rank){
+ this(rank instanceof Integer ?
+ ((Integer)rank).intValue()
+ : Integer.parseInt(rank.toString()));
+ }
+
+ //Only accept valid ranks
+ public Rank(int rank){
+ if(rank % 100 != 0 || rank < 0 || rank > 600)
+ throw new RuntimeException("Invalid rank assigned in constructor.");
+ this.rank = rank;
+ }
+
+ //Give back internal int; makes comparison easier
+ public int toInt(){
+ return rank;
+ }
+
+ //Return easy String representation
+ public String toString(){
+ switch(rank){
+ case 0:
+ return "Manual";
+ case 100:
+ return "Low";
+ case 200:
+ return "Average";
+ case 300:
+ return "Normal";
+ case 400:
+ return "Good";
+ case 500:
+ return "Great";
+ case 600:
+ return "Excellent";
+ }
+ throw new RuntimeException("Invalid internal rank state.");
+ }
+
+ //Static method to simplify getting rank string from int
+ public static String toString(Object rank){
+ return new Rank(rank).toString();
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.form metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,132 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.java metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/RemoteWinenumOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,137 @@
+package msfgui;
+
+/**
+ * Options dialog for remote winenum script
+ * @author scriptjunkie
+ */
+public class RemoteWinenumOptionsDialog extends OptionsDialog {
+
+ /** Creates new OptionsDialog */
+ public RemoteWinenumOptionsDialog(java.awt.Frame parent) {
+ super(parent, "Remote winenum options", true);
+ initComponents();
+ }
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ //
//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ okButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ addressField = new javax.swing.JTextField();
+ jLabel2 = new javax.swing.JLabel();
+ userField = new javax.swing.JTextField();
+ passField = new javax.swing.JTextField();
+ jLabel3 = new javax.swing.JLabel();
+ jLabel4 = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(RemoteWinenumOptionsDialog.class);
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ addressField.setText(resourceMap.getString("addressField.text")); // NOI18N
+ addressField.setName("addressField"); // NOI18N
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ userField.setText(resourceMap.getString("userField.text")); // NOI18N
+ userField.setName("userField"); // NOI18N
+
+ passField.setText(resourceMap.getString("passField.text")); // NOI18N
+ passField.setName("passField"); // NOI18N
+
+ jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
+ jLabel3.setName("jLabel3"); // NOI18N
+
+ jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
+ jLabel4.setName("jLabel4"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(addressField, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGap(13, 13, 13)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(passField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE)
+ .addComponent(userField, javax.swing.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE)))
+ .addComponent(okButton, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel3))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel1)
+ .addComponent(addressField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(userField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel2))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(passField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel4))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(okButton)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("remotewinenum ");
+ if(addressField.getText().length() > 0)
+ cmd.append(" -t "+addressField.getText());
+ if(userField.getText().length() > 0)
+ cmd.append(" -u \""+userField.getText()+"\"");
+ if(passField.getText().length() > 0)
+ cmd.append(" -p \""+passField.getText()+"\"");
+ command = cmd.toString();
+ setVisible(false);
+ dispose();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField addressField;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JButton okButton;
+ private javax.swing.JTextField passField;
+ private javax.swing.JTextField userField;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/resources/AutorouteOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/AutorouteOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/AutorouteOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/AutorouteOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,5 @@
+deleteRouteButton.text=Delete Route
+addRouteButton.text=Add route
+okButton.text=Ok
+ipField.text=192.168.1.0/24
+subnetLabel.text=Subnet:
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon0.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon0.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon10.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon10.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon11.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon11.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon12.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon12.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon13.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon13.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon14.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon14.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon1.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon1.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon2.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon2.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon3.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon3.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon4.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon4.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon5.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon5.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon6.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon6.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon7.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon7.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon8.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon8.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon9.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/busy-icon9.png differ
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/idle-icon.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/busyicons/idle-icon.png differ
diff -Nru metasploit-gui-1.0/src/msfgui/resources/DbConnectDialog.properties metasploit-gui-1.0/src/msfgui/resources/DbConnectDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/DbConnectDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/DbConnectDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,14 @@
+jLabel1.text=Type
+jLabel2.text=Database Name
+jLabel3.text=Username
+usernameField.text=
+passwordField.text=
+jLabel4.text=Password
+dbNameField.text=
+connectButton.text=Connect
+cancelButton.text=Cancel
+hostField.text=
+portField.text=
+jLabel5.text=Host
+jLabel6.text=Port
+defaultsButton.text=Load Defaults
diff -Nru metasploit-gui-1.0/src/msfgui/resources/EditorWindow.properties metasploit-gui-1.0/src/msfgui/resources/EditorWindow.properties
--- metasploit-gui-1.0/src/msfgui/resources/EditorWindow.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/EditorWindow.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,3 @@
+
+saveButton.text=Save
+jLabel1.text=Unique hashes collected from all meterpreter sessions
diff -Nru metasploit-gui-1.0/src/msfgui/resources/InteractWindow.properties metasploit-gui-1.0/src/msfgui/resources/InteractWindow.properties
--- metasploit-gui-1.0/src/msfgui/resources/InteractWindow.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/InteractWindow.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,6 @@
+
+inputField.text=
+submitButton.text=Submit
+main.icon=metasploit.png
+promptLabel.text=>>>
+mainPanel.TabConstraints.tabTitle=Console 1
diff -Nru metasploit-gui-1.0/src/msfgui/resources/JobInfoPopup.properties metasploit-gui-1.0/src/msfgui/resources/JobInfoPopup.properties
--- metasploit-gui-1.0/src/msfgui/resources/JobInfoPopup.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/JobInfoPopup.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1 @@
+okButton.text=OK
diff -Nru metasploit-gui-1.0/src/msfgui/resources/MainFrame.properties metasploit-gui-1.0/src/msfgui/resources/MainFrame.properties
--- metasploit-gui-1.0/src/msfgui/resources/MainFrame.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/MainFrame.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,94 @@
+# Resources for the MsfguiJDesktopView class
+
+# top-level menus
+
+fileMenu.text = File
+
+# @Action resources
+
+showAboutBox.Action.text = &About...
+showAboutBox.Action.shortDescription = Show the application's information dialog
+
+# status bar resources
+
+StatusBar.messageTimeout = 5000
+StatusBar.busyAnimationRate = 30
+StatusBar.idleIcon = busyicons/idle-icon.png
+StatusBar.busyIcons[0] = busyicons/busy-icon0.png
+StatusBar.busyIcons[1] = busyicons/busy-icon1.png
+StatusBar.busyIcons[2] = busyicons/busy-icon2.png
+StatusBar.busyIcons[3] = busyicons/busy-icon3.png
+StatusBar.busyIcons[4] = busyicons/busy-icon4.png
+StatusBar.busyIcons[5] = busyicons/busy-icon5.png
+StatusBar.busyIcons[6] = busyicons/busy-icon6.png
+StatusBar.busyIcons[7] = busyicons/busy-icon7.png
+StatusBar.busyIcons[8] = busyicons/busy-icon8.png
+StatusBar.busyIcons[9] = busyicons/busy-icon9.png
+StatusBar.busyIcons[10] = busyicons/busy-icon10.png
+StatusBar.busyIcons[11] = busyicons/busy-icon11.png
+StatusBar.busyIcons[12] = busyicons/busy-icon12.png
+StatusBar.busyIcons[13] = busyicons/busy-icon13.png
+StatusBar.busyIcons[14] = busyicons/busy-icon14.png
+exploitsMenu.text=Exploits
+auxiliaryMenu.text=Auxiliary
+startRpcMenuItem.text=Start new msfrpcd
+connectRpcMenuItem.text=Connect to msfrpcd
+payloadsMenu.text=Payloads
+main.icon=metasploit.png
+recentMenu.text=Recent
+clearHistoryItem.text=Clear History
+helpMenu.text=Help
+onlineHelpMenu.text=Online
+postMenu.text=Post-Exploit
+menuRunAllMeterp.text=Run on all meterpreter sessions...
+logGenerateMenuItem.text=Generate HTML Log Report
+historyMenu.text=History
+killSessionsMenuItem.text=Kill all sessions
+databaseMenu.text=Database
+connectItem.text=Connect
+refreshItem.text=Refresh
+searchItem.text=Search
+closeConsoleMenu.text=Close Existing
+existingConsoleMenu.text=Open Existing
+newConsoleItem.text=New
+consoleMenu.text=Console
+importItem.text=Import
+disconnectItem.text=Disconnect
+pluginsMenu.text=Plugins
+dbTrackerItem.text=DB tracker
+autoAddRouteItem.text=Auto add route
+soundItem.text=Sound
+ipsFilterItem.text=IPS filter
+socketLoggerItem.text=Socket logger
+otherPluginItem.text=Other
+dbCredcollectItem.text=DB credcollect
+unloadPluginItem.text=Unload plugin
+showDetailsItem.text=Show connection details
+jobsPane.TabConstraints.tabTitle=Jobs
+sessionsPane.TabConstraints.tabTitle=Sessions
+hostsPane.TabConstraints.tabTitle=Hosts
+clientsPane.TabConstraints.tabTitle=Clients
+servicesPane.TabConstraints.tabTitle=Services
+vulnsPane.TabConstraints.tabTitle=Vulns
+notesPane.TabConstraints.tabTitle=Notes
+lootsPane.TabConstraints.tabTitle=Loots
+currWorkspaceItem.text=Select Workspace
+addWorkspaceItem.text=Add Workspace
+delWorkspaceItem.text=Delete Workspace
+refreshConsolesItem.text=Refresh Existing
+credsPane.TabConstraints.tabTitle=Creds
+viewMenu.text=View
+jobViewItem.text=Jobs
+lootsViewItem.text=Loots
+sessionsViewItem.text=Sessions
+credsViewItem.text=Creds
+notesViewItem.text=Notes
+eventsViewItem.text=Events
+vulnsViewItem.text=Vulns
+servicesViewItem.text=Services
+clientsViewItem.text=Clients
+hostsViewItem.text=Hosts
+nmapItem.text=Nmap
+viewPrefsItem.text=Preferences...
+dbExportItem.text=Export
+crackPasswordsItem.text=Crack Passwords
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/metasploit.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/metasploit.png differ
diff -Nru metasploit-gui-1.0/src/msfgui/resources/MeterpFileBrowser.properties metasploit-gui-1.0/src/msfgui/resources/MeterpFileBrowser.properties
--- metasploit-gui-1.0/src/msfgui/resources/MeterpFileBrowser.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/MeterpFileBrowser.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,10 @@
+uploadButton.text=Upload
+downloadButton.text=Download
+deleteButton.text=Delete
+dirButton.text=Make Directory
+refreshButton.text=Refresh
+pwdLabel.text=Listing
+upButton.text=Go up
+recSearchDownloadButton.text=Recursive search/download
+goButton.text=Go
+addressField.text=
diff -Nru metasploit-gui-1.0/src/msfgui/resources/ModulePopup.properties metasploit-gui-1.0/src/msfgui/resources/ModulePopup.properties
--- metasploit-gui-1.0/src/msfgui/resources/ModulePopup.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/ModulePopup.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,9 @@
+targetsLabel.text=
Targets
+exploitButton.text=Run Exploit
+requiredLabel.text=
Required
+optionalLabel.text=
Optional
+main.icon=metasploit.png
+advancedLabel.text=
Advanced
+exploitButton1.text=Run Exploit
+consoleRunButton1.text=Run in Console
+consoleRunButton.text=Run in Console
diff -Nru metasploit-gui-1.0/src/msfgui/resources/MsfguiAboutBox.properties metasploit-gui-1.0/src/msfgui/resources/MsfguiAboutBox.properties
--- metasploit-gui-1.0/src/msfgui/resources/MsfguiAboutBox.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/MsfguiAboutBox.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,18 @@
+title = About: ${Application.title}
+
+closeAboutBox.Action.text = &Close
+
+appDescLabel.text=A Java GUI to the Metasploit Framework created by scriptjunkie.
+
+versionLabel.text=Version\:
+
+homepageLabel.text=Homepage\:
+
+#NOI18N
+imageLabel.icon=splash.png
+targetsLabel.text=
Targets
+main.icon=metasploit.png
+rubyVersionLabel.text=Ruby Version:
+javaVersionLabel.text=Java Version:
+appJavaVersionLabel.text=3
+appRubyVersionLabel.text=3
diff -Nru metasploit-gui-1.0/src/msfgui/resources/MsfguiApp.properties metasploit-gui-1.0/src/msfgui/resources/MsfguiApp.properties
--- metasploit-gui-1.0/src/msfgui/resources/MsfguiApp.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/MsfguiApp.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,10 @@
+# Application global resources
+
+Application.name = msfguiJDesktop
+Application.title = msfgui
+Application.version = 3
+Application.homepage = http\://www.metasploit.com/
+Application.description = A Java GUI to the Metasploit Framework.
+Application.vendorId = Metasploit
+Application.id = ${Application.name}
+Application.lookAndFeel = system
diff -Nru metasploit-gui-1.0/src/msfgui/resources/MulticommandOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/MulticommandOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/MulticommandOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/MulticommandOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,7 @@
+okButton.text=Go
+chooseButton.text=Choose output file
+commandFileButton.text=Choose command file
+commandFileField.text=
+outputFileField.text=
+jLabel1.text=Commands - one per line
+jLabel2.text=Leave blank to use file
diff -Nru metasploit-gui-1.0/src/msfgui/resources/NetenumOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/NetenumOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/NetenumOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/NetenumOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,13 @@
+
+okButton.text=Ok
+jLabel1.text=Target address (may be CIDR)
+addressField.text=192.168.1.1/24
+pingBox.text=Ping sweep
+reverseDnsBox.text=DNS reverse lookup
+forwardBox.text=Forward lookup host list and domain
+mxNsBox.text=Perform MX and NS lookups for domain
+jLabel2.text=Domian name
+domainField.text=
+chooseButton.text=Choose file with host list
+fileField.text=
+serviceBox.text=Perform service record lookups for domain
diff -Nru metasploit-gui-1.0/src/msfgui/resources/OpenConnectionDialog.properties metasploit-gui-1.0/src/msfgui/resources/OpenConnectionDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/OpenConnectionDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/OpenConnectionDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,19 @@
+passwordField.text=
+usernameField.text=msf
+hostField.text=127.0.0.1
+portField.text=55553
+connectButton.text=Connect
+usernameLabel.text=Username
+titleLabel.text=
Connect to msfrpcd
+passwordLabel.text=Password
+hostLabel.text=Host
+portLabel.text=Port
+cancelButton.text=Cancel
+Form.title=msfgui - connection
+main.icon=metasploit.png
+startNewButton.text=Start new msfrpcd
+pathButton.text=Change path
+sslBox.text=
+sslLabel.text=SSL
+disableDbButton.text=
+disableDbLabel.text=Disable DB
diff -Nru metasploit-gui-1.0/src/msfgui/resources/PayloadPopup.properties metasploit-gui-1.0/src/msfgui/resources/PayloadPopup.properties
--- metasploit-gui-1.0/src/msfgui/resources/PayloadPopup.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/PayloadPopup.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,25 @@
+main.icon=metasploit.png
+jScrollPane2.TabConstraints.tabTitle=payload
+jLabel6.text=Platform
+timesField.text=
+archField.text=
+templateButton.text=Choose...
+encoderLabel.text=Encoder
+outputLabel.text=Output Format
+timesLabel.text=Number of times to encode
+archLabel.text=Architecture
+templateWorkingCheck.text=Keep template working?
+generateButton.text=Generate
+displayButton.text=display
+saveButton.text=encode/save
+outputPathField.text=/tmp/msfoutput.exe
+choosePathButton.text=Choose...
+outputPathLabel.text=Output Path
+templateLabel.text=(win32 only) exe template
+handleButton.text=Start handler
+handleConsoleButton.text=Start handler in console
+descriptionBox.text=Description
+addCodeLabel.text=(win32 only) add shellcode
+addCodeButton.text=Choose...
+addCodeField.text=
+badcharsLabel.text=Badchars (\\xff\\x00)
diff -Nru metasploit-gui-1.0/src/msfgui/resources/PersistenceOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/PersistenceOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/PersistenceOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/PersistenceOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,14 @@
+jLabel1.text=
Options
+okButton.text=OK
+cancelButton.text=Cancel
+ipField.text=metasploit
+jCheckBox2.text=Start on boot?
+portField.text=4444
+portLabel.text=Port for connect-back
+ipLabel.text=IP for connect-back
+handlerBox.text=Start handler now
+intervalField.text=10
+intervalLabel.text=Interval for connect-back
+loginRestartBox.text=Restart on current user login
+anyLoginRestartBox.text=Restart on any login
+serviceRestartBox.text=Restart on boot as service
diff -Nru metasploit-gui-1.0/src/msfgui/resources/PreferencesFrame.properties metasploit-gui-1.0/src/msfgui/resources/PreferencesFrame.properties
--- metasploit-gui-1.0/src/msfgui/resources/PreferencesFrame.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/PreferencesFrame.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,12 @@
+tabWindowBox.text=Prefer tabs to windows
+tableLineBox.text=Prefer lines in tables
+tableExpandBox.text=Expand tables to fit data instead of window
+okButton.text=OK
+cancelButton.text=Cancel
+headerLabel.text=
View Preferences
+restartLabel.text=Note: may need to restart msfgui to apply changes
+foregroundButton.text=Foreground
+textSizeLabel.text=Default text size
+colorThemeBox.text=Override color theme
+lnFLabel.text=Look and Feel
+background.text=Background
diff -Nru metasploit-gui-1.0/src/msfgui/resources/ProcessList.properties metasploit-gui-1.0/src/msfgui/resources/ProcessList.properties
--- metasploit-gui-1.0/src/msfgui/resources/ProcessList.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/ProcessList.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,3 @@
+migrateButton.text=Migrate
+killButton.text=Kill
+refreshButton.text=Refresh
diff -Nru metasploit-gui-1.0/src/msfgui/resources/ProcessWindow.properties metasploit-gui-1.0/src/msfgui/resources/ProcessWindow.properties
--- metasploit-gui-1.0/src/msfgui/resources/ProcessWindow.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/ProcessWindow.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,2 @@
+
+outputField.text=Output (Running)
diff -Nru metasploit-gui-1.0/src/msfgui/resources/RemoteWinenumOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/RemoteWinenumOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/RemoteWinenumOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/RemoteWinenumOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,9 @@
+
+okButton.text=Ok
+jLabel1.text=Target address
+addressField.text=192.168.1.2
+jLabel2.text=Username
+jLabel3.text=Credentials: (leave blank to use current process's creds)
+jLabel4.text=Password
+passField.text=
+userField.text=
diff -Nru metasploit-gui-1.0/src/msfgui/resources/ScheduleTaskOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/ScheduleTaskOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/ScheduleTaskOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/ScheduleTaskOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,24 @@
+jLabel1.text=Schedule a task
+dailyButton.text=Every - days
+startupButton.text=Startup
+loginButton.text=Login
+hourlyButton.text=Every - hours
+minuteButton.text=Every - minutes
+immediateButton.text=Immediately - once
+uploadField.text=
+goButton.text=Go
+jLabel2.text=Command
+commandField.text=
+jLabel3.text=Options for uploaded EXE
+uploadedArgs.text=
+uploadButton.text=Upload EXE
+jLabel4.text=Remote system
+remoteSystemField.text=
+remoteScheduleBox.text=Remote schedule? EXE must already be on target system
+jLabel5.text=How many?
+howManyField.text=1
+jLabel6.text=Password
+usernameField.text=
+passwordField.text=
+jLabel7.text=Username (leave empty to use current account)
+jLabel8.text=leave blank if not uploading
diff -Nru metasploit-gui-1.0/src/msfgui/resources/SearchDwldOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/SearchDwldOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/SearchDwldOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/SearchDwldOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,8 @@
+okButton.text=Go
+jLabel1.text=Directory (or blank for all drives):
+dirField.text=
+jLabel2.text=Filter:
+outputDirField.text=
+recursiveBox.text=Recursive
+searchPatternField.text=*.doc|*.odt|*.png|pass*
+outDirButton.text=Output Directory
diff -Nru metasploit-gui-1.0/src/msfgui/resources/SearchWindow.properties metasploit-gui-1.0/src/msfgui/resources/SearchWindow.properties
--- metasploit-gui-1.0/src/msfgui/resources/SearchWindow.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/SearchWindow.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,17 @@
+jLabel1.text=
Search for modules
+jLabel2.text=All by name:
+exploitsRadioButton.text=Exploits
+auxiliaryRadioButton.text=Auxiliary
+payloadsRadioButton.text=Payloads
+jLabel3.text=Individual by details: (Note, loading all details takes a long time!)
+jLabel4.text=By:
+referenceRadioButton.text=Reference (CVE, BID, OSVDB, etc)
+descriptionRadioButton.text=Description
+searchButton.text=Search
+searchField.text=
+exploitsRadioButton.actionCommand=exploit
+auxiliaryRadioButton.actionCommand=auxiliary
+payloadsRadioButton.actionCommand=payload
+descriptionRadioButton.actionCommand=description
+referenceRadioButton.actionCommand=reference
+launchButton.text=Launch
diff -Nru metasploit-gui-1.0/src/msfgui/resources/ShellWindow.properties metasploit-gui-1.0/src/msfgui/resources/ShellWindow.properties
--- metasploit-gui-1.0/src/msfgui/resources/ShellWindow.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/ShellWindow.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,4 @@
+
+inputField.text=
+submitButton.text=Submit
+main.icon=metasploit.png
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/src/msfgui/resources/splash.png and /tmp/kvQywBdWKJ/metasploit-gui-1.0/src/msfgui/resources/splash.png differ
diff -Nru metasploit-gui-1.0/src/msfgui/resources/UploadexecOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/UploadexecOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/UploadexecOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/UploadexecOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,10 @@
+okButton.text=Go
+fileField.text=
+chooseButton.text=Choose exe/script
+jLabel1.text=Options to pass
+optionsField.text=
+pathField.text=
+jLabel2.text=Path (blank = %TEMP%)
+removeBox.text=Remove after running?
+verboseBox.text=Show output?
+jLabel3.text=Only works if exe finishes right away
diff -Nru metasploit-gui-1.0/src/msfgui/resources/UserPassDialog.properties metasploit-gui-1.0/src/msfgui/resources/UserPassDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/UserPassDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/UserPassDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,7 @@
+passwordField.text=rocks
+usernameField.text=metasploit
+usernameLabel.text=Username:
+passwordLabel.text=Password:
+jLabel1.text=
Enter credentials
Note: special characters and quotes don't always work.
+dontButton.text=Dont add user
+okButton.text=OK
diff -Nru metasploit-gui-1.0/src/msfgui/resources/WebcamFrame.properties metasploit-gui-1.0/src/msfgui/resources/WebcamFrame.properties
--- metasploit-gui-1.0/src/msfgui/resources/WebcamFrame.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/WebcamFrame.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,7 @@
+
+startButton.text=Start
+stopButton.text=Stop
+delayField.text=1000
+delayLabel.text=Delay (MS)
+imageLabel.text=
+frameButton.text=Save Frame
diff -Nru metasploit-gui-1.0/src/msfgui/resources/WinbfOptionsDialog.properties metasploit-gui-1.0/src/msfgui/resources/WinbfOptionsDialog.properties
--- metasploit-gui-1.0/src/msfgui/resources/WinbfOptionsDialog.properties 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/resources/WinbfOptionsDialog.properties 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,10 @@
+okButton.text=Go
+jLabel2.text=Login name to brute force
+jLabel3.text=Target IP
+targetField.text=
+passwordButton.text=Choose Password List
+userButton.text=Choose Username List
+userField.text=
+passwordField.text=
+loginField.text=
+checkPolicyBox.text=Check local lockout policy
diff -Nru metasploit-gui-1.0/src/msfgui/RpcAction.java metasploit-gui-1.0/src/msfgui/RpcAction.java
--- metasploit-gui-1.0/src/msfgui/RpcAction.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/RpcAction.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,62 @@
+package msfgui;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Map;
+
+/**
+ * Provides an ActionListener for running a meterpreter script on each selected session. Each time
+ * the action is executed, the command is retrieved from the toString() method of commandGenerator
+ * and executed on each session.
+ * @author scriptjunkie
+ */
+public class RpcAction implements ActionListener {
+ protected Object commandGenerator = null;
+ protected String command = null;
+ protected MainFrame parent = null;
+ public RpcAction(){
+ }
+ public RpcAction( MainFrame parent){
+ this.parent = parent;
+ }
+ public RpcAction(Object commandGenerator, MainFrame parent){
+ this.commandGenerator = commandGenerator;
+ this.parent = parent;
+ }
+ public void actionPerformed(ActionEvent e){
+ try{
+ prepare();
+ if(parent == null)
+ action();
+ else
+ for(Map session : parent.selectedSessions)
+ action(session);
+ }catch(Exception ex){
+ if(!ex.getMessage().equals("cancelled")){
+ MsfguiApp.showMessage(null, "Error in RPC call: "+ex);
+ ex.printStackTrace();
+ }
+ }
+ }
+ /** prepare() is provided to prepare state of action handler
+ * such as preparing a command that will be run on all selected sessions. */
+ public void prepare() throws Exception{
+ if(commandGenerator != null){
+ if(commandGenerator instanceof OptionsDialog)
+ command = ((OptionsDialog)commandGenerator).getCommand();
+ else
+ command = commandGenerator.toString();
+ }
+ }
+ /** action() with no args provided as an exception-handling action listener. */
+ public void action() throws Exception{
+ 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(commandGenerator != null)
+ parent.rpcConn.execute("session.meterpreter_script", session.get("id"), command);
+ parent.showInteractWindow();
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/RpcConnection.java metasploit-gui-1.0/src/msfgui/RpcConnection.java
--- metasploit-gui-1.0/src/msfgui/RpcConnection.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/RpcConnection.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,341 @@
+package msfgui;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.net.SocketException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import org.jdesktop.application.Task;
+
+/**
+ * RpcConnection handles connection details to a msfrpcd and automatically sends
+ * activity to be logged. It also caches some method calls to more quickly
+ * retrieve results later.
+ *
+ * Connection implementation is left to child classes, which must implemtent
+ * writeCall() and readResp() and may implement connect.
+ *
+ * @author scriptjunkie
+ */
+public abstract class RpcConnection {
+ protected String rpcToken;
+ protected Map callCache = new HashMap();
+ public static String defaultUser = "msf",defaultPass = null, defaultHost = "127.0.0.1";
+ public static int defaultPort = 55553;
+ public static boolean defaultSsl = false;
+ public static boolean disableDb = false;
+ protected Socket connection;
+ protected OutputStream sout; //socket output/input
+ protected InputStream sin;
+ protected final Object lockObject = new Object();//to synchronize one request at a time
+ protected String username, password, host;
+ protected int port;
+ protected boolean ssl;
+
+ protected abstract void writeCall(String methname, Object[] params) throws Exception;
+ protected abstract Object readResp() throws Exception;
+
+ /**
+ * Creates an RPC connection of the appropriate type and connection details
+ * @param type RPC type
+ * @param username
+ * @param password
+ * @param host IP address or hostname of RPC server
+ * @param port Port RPC server is operating on
+ * @param ssl Whether SSL is to be used
+ * @return A new RPC connection
+ * @throws MsfException
+ */
+ public static RpcConnection getConn(String username, char[] password, String host, int port, boolean ssl) throws MsfException{
+ RpcConnection conn = new MsgRpc();
+ conn.setup(username, password, host, port, ssl);
+ return conn;
+ }
+
+ /**
+ * Gets the unencoded data returned from a something.read call
+ * @param ret The return from the read call
+ * @return the
+ */
+ public static byte[] getData(Map received){
+ if(received.containsKey("encoding") && received.get("encoding").equals("base64"))
+ return Base64.decode(received.get("data").toString());
+ else
+ return received.get("data").toString().getBytes();
+ }
+
+ /** Setup sets up a connection and authenticates. */
+ public void setup(String username, char[] password, String host, int port, boolean ssl) throws MsfException {
+ boolean haveRpcd=false;
+ this.username = username;
+ this.password = new String(password);
+ this.host = host;
+ this.port = port;
+ this.ssl = ssl;
+ String message = "";
+ try {
+ connect();
+ if(username == null || username.equals("")){
+ rpcToken = this.password;
+ execute("core.version"); //throws error if unsuccessful
+ haveRpcd = true;
+ }else{
+ Map results = (Map)exec("auth.login",new Object[]{username, this.password});
+ rpcToken=results.get("token").toString();
+ haveRpcd=results.get("result").equals("success");
+ }
+ } catch (MsfException xre) {
+ message = xre.getLocalizedMessage();
+ } catch (IOException io){
+ message = io.getLocalizedMessage();
+ } catch (NullPointerException nex){
+ } catch (NoSuchAlgorithmException nsax){
+ } catch (KeyManagementException kmx){
+ }
+ if(!haveRpcd)
+ throw new MsfException("Error connecting. "+message);
+ Map root = MsfguiApp.getPropertiesNode();
+ root.put("username", username);
+ root.put("password", this.password);
+ root.put("host", host);
+ root.put("port", port);
+ root.put("ssl", ssl);
+ root.put("disableDb", disableDb);
+ MsfguiApp.savePreferences();
+ }
+
+ /**
+ * Disconnects this connection
+ *
+ * @throws SocketException
+ * @throws IOException
+ */
+ protected void disconnect() throws SocketException, IOException{
+ if(connection != null)
+ connection.close();
+ }
+
+ /**
+ * Disconnects then reconnects.
+ *
+ * @throws SocketException
+ * @throws KeyManagementException
+ * @throws IOException
+ * @throws NoSuchAlgorithmException
+ */
+ protected void reconnect() throws SocketException, KeyManagementException, IOException, NoSuchAlgorithmException {
+ disconnect();
+ connect();
+ }
+
+ /**
+ * Default connect method connects the TCP stream, setting up SSL if necessary.
+ *
+ * @throws SocketException
+ * @throws KeyManagementException
+ * @throws IOException
+ * @throws NoSuchAlgorithmException
+ */
+ protected void connect() throws SocketException, KeyManagementException, IOException, NoSuchAlgorithmException {
+ if (ssl) {
+ TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
+ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
+ }
+ public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
+ }
+ }};
+ // Let us create the factory where we can set some parameters for the connection
+ SSLContext sc = SSLContext.getInstance("SSL");
+ sc.init(null, trustAllCerts, new java.security.SecureRandom());
+ connection = sc.getSocketFactory().createSocket(host, port);
+ } else {
+ connection = new Socket(host, port);
+ }
+ connection.setSoTimeout(10000); //Ten second timeout
+ sout = connection.getOutputStream();
+ sin = connection.getInputStream();
+ }
+
+ public String toString(){
+ return "RPC connection "
+ + "\nusername: "+username
+ + "\npassword: " + password
+ + "\nhost: " + host
+ + "\nport: " + Integer.toString(port)
+ + "\nssl: " + ssl;
+ }
+ /** Destructor cleans up. */
+ protected void finalize() throws Throwable{
+ super.finalize();
+ connection.close();
+ }
+
+ /** Adds token, runs command, and notifies logger on call and return */
+ public Object execute(String methodName, Object... params) throws MsfException{
+ MsfguiLog.defaultLog.logMethodCall(methodName, params);
+ Object[] paramsNew = new Object[params.length+1];
+ paramsNew[0] = rpcToken;
+ System.arraycopy(params, 0, paramsNew, 1, params.length);
+ Object result = cacheExecute(methodName, paramsNew);
+ MsfguiLog.defaultLog.logMethodReturn(methodName, params, result);
+ return result;
+ }
+
+ /** Caches certain calls and checks cache for re-executing them.
+ * If not cached or not cacheable, calls exec. */
+ private Object cacheExecute(String methodName, Object[] params) throws MsfException{
+ if(methodName.equals("module.info") || methodName.equals("module.options")
+ || methodName.equals("module.compatible_payloads") || methodName.equals("module.post")){
+ StringBuilder keysb = new StringBuilder(methodName);
+ for(int i = 1; i < params.length; i++)
+ keysb.append(params[i].toString());
+ String key = keysb.toString();
+ Object result = callCache.get(key);
+ if(result == null){
+ result = exec(methodName, params);
+ callCache.put(key, result);
+ }
+ if(result instanceof Map){
+ HashMap clone = new HashMap();
+ clone.putAll((Map)result);
+ return clone;
+ }
+ return result;
+ }
+ return exec(methodName, params);
+ }
+
+ /** Method that handles synchronization and error handling for calls */
+ private Object exec (String methname, Object[] params) throws MsfException{
+ synchronized(lockObject){ //Only one method call at a time!
+ try{
+ writeCall(methname, params);
+ return readResp();
+ }catch(Exception ex){ //any weirdness gets wrapped in a MsfException
+ try{
+ if(ex instanceof java.net.SocketTimeoutException)
+ reconnect(); //reconnect on socket timeout
+ }catch (Exception ex2){
+ ex = ex2;
+ }
+ if(! (ex instanceof MsfException)){
+ if(! MsfguiApp.shuttingDown || !ex.getLocalizedMessage().toLowerCase().contains("broken pipe")){
+ if(!(ex instanceof java.net.ConnectException))
+ ex.printStackTrace();
+ throw new MsfException("Error in call: "+ex.getLocalizedMessage(), ex);
+ }
+ }
+ throw (MsfException)ex;
+ }
+ }
+ }
+
+ /** Attempts to start msfrpcd and connect to it.*/
+ public static Task startRpcConn(final MainFrame mainFrame){
+ if(mainFrame.rpcConn != null){
+ MsfguiApp.showMessage(mainFrame.getFrame(), "You are already connected!\n"
+ + "Exit before making a new connection.");
+ throw new RuntimeException("Already connected");
+ }
+ return new Task
(mainFrame.getApplication()){
+ private RpcConnection myRpcConn;
+ @Override
+ protected RpcConnection doInBackground() throws Exception {
+ setTitle("Starting new msfrpcd");
+ setMessage("Setting up and saving parameters.");
+ if(defaultPass == null){
+ StringBuilder password = new StringBuilder();
+ Random secrand = new SecureRandom();
+ for (int i = 0; i < 10; i++)
+ password.append((char) ('a'+secrand.nextInt(26)));
+ defaultPass = password.toString();
+ }
+
+ // Don't fork cause we'll check if it dies
+ String rpcType = "Basic";
+ java.util.List args = new java.util.ArrayList(java.util.Arrays.asList(new String[]{
+ "msfrpcd","-f","-P",defaultPass,"-U",defaultUser,"-a","0.0.0.0",
+ "-p",Integer.toString(defaultPort)}));
+ if(!defaultSsl)
+ args.add("-S");
+ if(disableDb)
+ args.add("-n");
+ setMessage("Starting msfrpcd.");
+ Process proc = null;
+ try {
+ proc = MsfguiApp.startMsfProc(args);
+ } catch (MsfException ex) {
+ setMessage("msfrpcd not found.");
+ setProgress(1f);
+ throw new MsfException("Could not find or start msfrpcd"); //darn
+ }
+
+ //Connect to started daemon
+ setMessage("Started msfrpcd. Connecting to new msfrpcd...");
+ boolean connected = false;
+ int timeoutTries = 0;
+ for (int tries = 0; tries < 10000; tries++) { //it usually takes a minute to get started
+
+ try{ //unfortunately this is the only direct way to check if process has terminated
+ int exitval = proc.exitValue();
+ setMessage("msfrpcd died with exit value "+exitval);
+ throw new MsfException("msfrpcd died");
+ } catch (IllegalThreadStateException itsy){
+ } //Nope. We're good.
+
+ try {
+ myRpcConn = RpcConnection.getConn(defaultUser, defaultPass.toCharArray(), "127.0.0.1", defaultPort, defaultSsl);
+ connected = true;
+ break;
+ } catch (MsfException mex) {
+ if(mex.getMessage().toLowerCase().contains("authentication error")){
+ mex.printStackTrace();
+ setMessage("Cannot connect to started msfrpcd.");
+ proc.destroy();
+ throw mex;
+ }else if(mex.getMessage().toLowerCase().contains("connection reset")){
+ mex.printStackTrace();
+ setMessage("Connection reset.");
+ proc.destroy();
+ throw mex;
+ }else if(mex.getMessage().toLowerCase().contains("timed out")){
+ mex.printStackTrace();
+ setMessage("Timeout.");
+ timeoutTries++;
+ if(timeoutTries > 5){ //this can happen legitimately
+ proc.destroy();
+ throw mex;
+ }
+ }
+ }
+ try {
+ Thread.sleep(200); //Wait for msfrpcd to be ready
+ } catch (InterruptedException iex) {
+ }
+ }//end try to connect loop
+ if(!connected){
+ setMessage("Cannot connect to started msfrpcd.");
+ throw new MsfException("Cannot connect to started msfrpcd.");
+ }
+ return myRpcConn;
+ }
+ @Override
+ protected void succeeded(RpcConnection myRpcConn) {
+ mainFrame.rpcConn = myRpcConn;
+ mainFrame.handleNewRpcConnection();
+ }
+ };
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/RunMenuFactory.java metasploit-gui-1.0/src/msfgui/RunMenuFactory.java
--- metasploit-gui-1.0/src/msfgui/RunMenuFactory.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/RunMenuFactory.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,12 @@
+package msfgui;
+
+import java.awt.event.ActionListener;
+
+/**
+ *
+ * @author scriptjunkie
+ */
+public interface RunMenuFactory {
+
+ public ActionListener getActor(String modName, String type, RpcConnection rpcConn);
+}
diff -Nru metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.form metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,319 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.java metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/ScheduleTaskOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,308 @@
+package msfgui;
+
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+
+/**
+ * Options dialog for schedule task script
+ * @author scriptjunkie
+ */
+public class ScheduleTaskOptionsDialog extends OptionsDialog {
+
+ /** Creates new form ScheduleTaskOptionsDialog */
+ public ScheduleTaskOptionsDialog(JFrame owner) {
+ super(owner,"Schedule Task Options",true);
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ whenGroup = new javax.swing.ButtonGroup();
+ jLabel1 = new javax.swing.JLabel();
+ startupButton = new javax.swing.JRadioButton();
+ loginButton = new javax.swing.JRadioButton();
+ dailyButton = new javax.swing.JRadioButton();
+ hourlyButton = new javax.swing.JRadioButton();
+ minuteButton = new javax.swing.JRadioButton();
+ immediateButton = new javax.swing.JRadioButton();
+ uploadField = new javax.swing.JTextField();
+ uploadButton = new javax.swing.JButton();
+ goButton = new javax.swing.JButton();
+ jLabel2 = new javax.swing.JLabel();
+ commandField = new javax.swing.JTextField();
+ jLabel3 = new javax.swing.JLabel();
+ uploadedArgs = new javax.swing.JTextField();
+ remoteScheduleBox = new javax.swing.JCheckBox();
+ remoteSystemField = new javax.swing.JTextField();
+ jLabel4 = new javax.swing.JLabel();
+ howManyField = new javax.swing.JTextField();
+ jLabel5 = new javax.swing.JLabel();
+ passwordField = new javax.swing.JTextField();
+ jLabel6 = new javax.swing.JLabel();
+ usernameField = new javax.swing.JTextField();
+ jLabel7 = new javax.swing.JLabel();
+ jLabel8 = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(ScheduleTaskOptionsDialog.class);
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ whenGroup.add(startupButton);
+ startupButton.setSelected(true);
+ startupButton.setText(resourceMap.getString("startupButton.text")); // NOI18N
+ startupButton.setName("startupButton"); // NOI18N
+
+ whenGroup.add(loginButton);
+ loginButton.setText(resourceMap.getString("loginButton.text")); // NOI18N
+ loginButton.setName("loginButton"); // NOI18N
+
+ whenGroup.add(dailyButton);
+ dailyButton.setText(resourceMap.getString("dailyButton.text")); // NOI18N
+ dailyButton.setName("dailyButton"); // NOI18N
+
+ whenGroup.add(hourlyButton);
+ hourlyButton.setText(resourceMap.getString("hourlyButton.text")); // NOI18N
+ hourlyButton.setName("hourlyButton"); // NOI18N
+
+ whenGroup.add(minuteButton);
+ minuteButton.setText(resourceMap.getString("minuteButton.text")); // NOI18N
+ minuteButton.setName("minuteButton"); // NOI18N
+
+ whenGroup.add(immediateButton);
+ immediateButton.setText(resourceMap.getString("immediateButton.text")); // NOI18N
+ immediateButton.setName("immediateButton"); // NOI18N
+
+ uploadField.setText(resourceMap.getString("uploadField.text")); // NOI18N
+ uploadField.setName("uploadField"); // NOI18N
+
+ uploadButton.setText(resourceMap.getString("uploadButton.text")); // NOI18N
+ uploadButton.setName("uploadButton"); // NOI18N
+ uploadButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ uploadButtonActionPerformed(evt);
+ }
+ });
+
+ goButton.setText(resourceMap.getString("goButton.text")); // NOI18N
+ goButton.setName("goButton"); // NOI18N
+ goButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ goButtonActionPerformed(evt);
+ }
+ });
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ commandField.setText(resourceMap.getString("commandField.text")); // NOI18N
+ commandField.setName("commandField"); // NOI18N
+
+ jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
+ jLabel3.setName("jLabel3"); // NOI18N
+
+ uploadedArgs.setText(resourceMap.getString("uploadedArgs.text")); // NOI18N
+ uploadedArgs.setName("uploadedArgs"); // NOI18N
+
+ remoteScheduleBox.setText(resourceMap.getString("remoteScheduleBox.text")); // NOI18N
+ remoteScheduleBox.setName("remoteScheduleBox"); // NOI18N
+
+ remoteSystemField.setText(resourceMap.getString("remoteSystemField.text")); // NOI18N
+ remoteSystemField.setName("remoteSystemField"); // NOI18N
+
+ jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
+ jLabel4.setName("jLabel4"); // NOI18N
+
+ howManyField.setText(resourceMap.getString("howManyField.text")); // NOI18N
+ howManyField.setName("howManyField"); // NOI18N
+
+ jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
+ jLabel5.setName("jLabel5"); // NOI18N
+
+ passwordField.setText(resourceMap.getString("passwordField.text")); // NOI18N
+ passwordField.setName("passwordField"); // NOI18N
+
+ jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
+ jLabel6.setName("jLabel6"); // NOI18N
+
+ usernameField.setText(resourceMap.getString("usernameField.text")); // NOI18N
+ usernameField.setName("usernameField"); // NOI18N
+
+ jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
+ jLabel7.setName("jLabel7"); // NOI18N
+
+ jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
+ jLabel8.setName("jLabel8"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel1)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(startupButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(loginButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(dailyButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(hourlyButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(minuteButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(immediateButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(remoteScheduleBox, javax.swing.GroupLayout.DEFAULT_SIZE, 513, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(remoteSystemField, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(uploadedArgs, javax.swing.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(uploadButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel8)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(uploadField, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel5)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(howManyField, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE))))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel7)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jLabel6)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(commandField, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(goButton)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(startupButton)
+ .addComponent(uploadField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(uploadButton)
+ .addComponent(jLabel8))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(loginButton)
+ .addComponent(jLabel3)
+ .addComponent(uploadedArgs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(dailyButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(hourlyButton)
+ .addComponent(howManyField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel5))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(minuteButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(immediateButton)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(remoteScheduleBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(remoteSystemField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel4))))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel7)
+ .addComponent(jLabel6))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(goButton)
+ .addComponent(commandField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel2))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void uploadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ uploadField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_uploadButtonActionPerformed
+
+ private void goButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_goButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("scheduleme ");
+ if(loginButton.isSelected())
+ cmd.append(" -l");
+ else if(immediateButton.isSelected())
+ cmd.append(" -i");
+ else if(startupButton.isSelected())
+ cmd.append(" -s");
+ else if(dailyButton.isSelected())
+ cmd.append(" -d ").append(howManyField.getText());
+ else if(hourlyButton.isSelected())
+ cmd.append(" -hr ").append(howManyField.getText());
+ else if(minuteButton.isSelected())
+ cmd.append(" -m ").append(howManyField.getText());
+ if(remoteScheduleBox.isSelected())
+ cmd.append(" -r -t ").append(remoteSystemField.getText());
+ if(usernameField.getText().length() > 0)
+ cmd.append(" -u ").append(usernameField.getText()).append(" -p ").append(passwordField.getText());
+ if(uploadField.getText().length() > 0)
+ cmd.append(" -e ").append(MsfguiApp.escapeBackslashes(uploadField.getText())).append(" -o ")
+ .append(MsfguiApp.escapeBackslashes(uploadedArgs.getText()));
+ cmd.append(" -c ").append(MsfguiApp.escapeBackslashes(commandField.getText()));
+ command = cmd.toString();
+ setVisible(false);
+ }//GEN-LAST:event_goButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField commandField;
+ private javax.swing.JRadioButton dailyButton;
+ private javax.swing.JButton goButton;
+ private javax.swing.JRadioButton hourlyButton;
+ private javax.swing.JTextField howManyField;
+ private javax.swing.JRadioButton immediateButton;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JLabel jLabel6;
+ private javax.swing.JLabel jLabel7;
+ private javax.swing.JLabel jLabel8;
+ private javax.swing.JRadioButton loginButton;
+ private javax.swing.JRadioButton minuteButton;
+ private javax.swing.JTextField passwordField;
+ private javax.swing.JCheckBox remoteScheduleBox;
+ private javax.swing.JTextField remoteSystemField;
+ private javax.swing.JRadioButton startupButton;
+ private javax.swing.JButton uploadButton;
+ private javax.swing.JTextField uploadField;
+ private javax.swing.JTextField uploadedArgs;
+ private javax.swing.JTextField usernameField;
+ private javax.swing.ButtonGroup whenGroup;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.form metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,138 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.java metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/SearchDwldOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,173 @@
+package msfgui;
+
+import javax.swing.JFileChooser;
+
+/**
+ * Options dialog for file collector script
+ * @author scriptjunkie
+ */
+public class SearchDwldOptionsDialog extends OptionsDialog {
+
+ /** Creates new form SearchDwldOptionsDialog */
+ public SearchDwldOptionsDialog(java.awt.Frame parent, String currentDir) {
+ super(parent, "Search/Download Options", true);
+ initComponents();
+ dirField.setText(currentDir);
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ buttonGroup1 = new javax.swing.ButtonGroup();
+ okButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ dirField = new javax.swing.JTextField();
+ jLabel2 = new javax.swing.JLabel();
+ searchPatternField = new javax.swing.JTextField();
+ outputDirField = new javax.swing.JTextField();
+ outDirButton = new javax.swing.JButton();
+ recursiveBox = new javax.swing.JCheckBox();
+
+ addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent evt) {
+ closeDialog(evt);
+ }
+ });
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(SearchDwldOptionsDialog.class);
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ dirField.setText(resourceMap.getString("dirField.text")); // NOI18N
+ dirField.setName("dirField"); // NOI18N
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ searchPatternField.setText(resourceMap.getString("searchPatternField.text")); // NOI18N
+ searchPatternField.setName("searchPatternField"); // NOI18N
+
+ outputDirField.setText(resourceMap.getString("outputDirField.text")); // NOI18N
+ outputDirField.setName("outputDirField"); // NOI18N
+
+ outDirButton.setText(resourceMap.getString("outDirButton.text")); // NOI18N
+ outDirButton.setName("outDirButton"); // NOI18N
+ outDirButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ outDirButtonActionPerformed(evt);
+ }
+ });
+
+ recursiveBox.setSelected(true);
+ recursiveBox.setText(resourceMap.getString("recursiveBox.text")); // NOI18N
+ recursiveBox.setName("recursiveBox"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(dirField, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))
+ .addComponent(okButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(searchPatternField, javax.swing.GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(recursiveBox))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(outDirButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(outputDirField, javax.swing.GroupLayout.DEFAULT_SIZE, 418, Short.MAX_VALUE)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel1)
+ .addComponent(dirField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(recursiveBox)
+ .addComponent(jLabel2)
+ .addComponent(searchPatternField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(outputDirField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(outDirButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(okButton)
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("file_collector");
+ if(dirField.getText().length() > 0)
+ cmd.append(" -d ").append(MsfguiApp.escapeBackslashes(dirField.getText()));
+ cmd.append(" -l ").append(outputDirField.getText());
+ if(recursiveBox.isSelected())
+ cmd.append(" -r ");
+ cmd.append(" -f ").append(searchPatternField.getText());
+ String tempFileName = MsfguiApp.getTempFilename("foundfiles", ".txt");
+ cmd.append(" -o ").append(MsfguiApp.escapeBackslashes(tempFileName));
+ cmd.append(" -i ").append(MsfguiApp.escapeBackslashes(tempFileName));
+ command = cmd.toString();
+ doClose();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ /** Closes the dialog */
+ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
+ doClose();
+ }//GEN-LAST:event_closeDialog
+
+ private void outDirButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outDirButtonActionPerformed
+ JFileChooser choosy = MsfguiApp.fileChooser;
+ int mode = choosy.getFileSelectionMode();
+ choosy.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ if(choosy.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ outputDirField.setText(choosy.getCurrentDirectory().getPath());
+ choosy.setFileSelectionMode(mode);
+ }//GEN-LAST:event_outDirButtonActionPerformed
+
+ private void doClose() {
+ setVisible(false);
+ dispose();
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.ButtonGroup buttonGroup1;
+ private javax.swing.JTextField dirField;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JButton okButton;
+ private javax.swing.JButton outDirButton;
+ private javax.swing.JTextField outputDirField;
+ private javax.swing.JCheckBox recursiveBox;
+ private javax.swing.JTextField searchPatternField;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/SearchWindow.form metasploit-gui-1.0/src/msfgui/SearchWindow.form
--- metasploit-gui-1.0/src/msfgui/SearchWindow.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/SearchWindow.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,237 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/SearchWindow.java metasploit-gui-1.0/src/msfgui/SearchWindow.java
--- metasploit-gui-1.0/src/msfgui/SearchWindow.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/SearchWindow.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,311 @@
+package msfgui;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import javax.swing.DefaultListModel;
+
+/**
+ * Window for searching for modules by name or details
+ * @author scriptjunkie
+ */
+public class SearchWindow extends MsfFrame {
+ public List modules; //list of type, name actor
+ private RpcConnection rpcConn;
+ protected DefaultListModel mod;
+ /** Creates new form SearchWindow */
+ public SearchWindow(RpcConnection rpcConn) {
+ super("Module search window");
+ this.rpcConn = rpcConn;
+ initComponents();
+ loadSavedSize();
+ modules = new ArrayList(600);
+ mod =new DefaultListModel();
+ resultList.setModel(mod);
+ searchBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
+ public void keyReleased(KeyEvent evt) {
+ String typed = searchBox.getEditor().getItem().toString();
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
+ doAction(typed);
+ return;
+ }
+ if (evt.getKeyChar() == KeyEvent.CHAR_UNDEFINED || typed.equals(searchBox.getItemAt(0).toString()))
+ return;
+ //display items
+ searchBox.removeAllItems();
+ searchBox.addItem(typed);
+ for (int i = 0; i < modules.size(); i++)
+ if (((Object[])modules.get(i))[1].toString().contains(typed))
+ searchBox.addItem(((Object[])modules.get(i))[1]);
+ ((javax.swing.JTextField) (searchBox.getEditor().getEditorComponent())).select(typed.length(),
+ typed.length());
+ searchBox.hidePopup();
+ searchBox.showPopup();
+ }
+ });
+ }
+
+ /** starts handler for named item, whether exploit, payload, or auxiliary */
+ private boolean doAction(String typed) {
+ for (int i = 0; i < modules.size(); i++) {
+ Object[] info = (Object[])modules.get(i);
+ if (info[1].toString().equals(typed)) {
+ ((ActionListener) info[2]).actionPerformed(null);
+ return true;
+ }
+ }
+ return false;
+ }
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ typeGroup = new javax.swing.ButtonGroup();
+ detailGroup = new javax.swing.ButtonGroup();
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ exploitsRadioButton = new javax.swing.JRadioButton();
+ auxiliaryRadioButton = new javax.swing.JRadioButton();
+ payloadsRadioButton = new javax.swing.JRadioButton();
+ searchBox = new javax.swing.JComboBox();
+ jLabel3 = new javax.swing.JLabel();
+ jLabel4 = new javax.swing.JLabel();
+ descriptionRadioButton = new javax.swing.JRadioButton();
+ referenceRadioButton = new javax.swing.JRadioButton();
+ searchField = new javax.swing.JTextField();
+ searchButton = new javax.swing.JButton();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ resultList = new javax.swing.JList();
+ launchButton = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(SearchWindow.class);
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ typeGroup.add(exploitsRadioButton);
+ exploitsRadioButton.setSelected(true);
+ exploitsRadioButton.setText(resourceMap.getString("exploitsRadioButton.text")); // NOI18N
+ exploitsRadioButton.setActionCommand(resourceMap.getString("exploitsRadioButton.actionCommand")); // NOI18N
+ exploitsRadioButton.setName("exploitsRadioButton"); // NOI18N
+
+ typeGroup.add(auxiliaryRadioButton);
+ auxiliaryRadioButton.setText(resourceMap.getString("auxiliaryRadioButton.text")); // NOI18N
+ auxiliaryRadioButton.setActionCommand(resourceMap.getString("auxiliaryRadioButton.actionCommand")); // NOI18N
+ auxiliaryRadioButton.setName("auxiliaryRadioButton"); // NOI18N
+
+ typeGroup.add(payloadsRadioButton);
+ payloadsRadioButton.setText(resourceMap.getString("payloadsRadioButton.text")); // NOI18N
+ payloadsRadioButton.setActionCommand(resourceMap.getString("payloadsRadioButton.actionCommand")); // NOI18N
+ payloadsRadioButton.setName("payloadsRadioButton"); // NOI18N
+
+ searchBox.setEditable(true);
+ searchBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "type name here" }));
+ searchBox.setName("searchBox"); // NOI18N
+ searchBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ searchBoxActionPerformed(evt);
+ }
+ });
+
+ jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
+ jLabel3.setName("jLabel3"); // NOI18N
+
+ jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
+ jLabel4.setName("jLabel4"); // NOI18N
+
+ detailGroup.add(descriptionRadioButton);
+ descriptionRadioButton.setSelected(true);
+ descriptionRadioButton.setText(resourceMap.getString("descriptionRadioButton.text")); // NOI18N
+ descriptionRadioButton.setActionCommand(resourceMap.getString("descriptionRadioButton.actionCommand")); // NOI18N
+ descriptionRadioButton.setName("descriptionRadioButton"); // NOI18N
+
+ detailGroup.add(referenceRadioButton);
+ referenceRadioButton.setText(resourceMap.getString("referenceRadioButton.text")); // NOI18N
+ referenceRadioButton.setActionCommand(resourceMap.getString("referenceRadioButton.actionCommand")); // NOI18N
+ referenceRadioButton.setName("referenceRadioButton"); // NOI18N
+
+ searchField.setText(resourceMap.getString("searchField.text")); // NOI18N
+ searchField.setName("searchField"); // NOI18N
+
+ searchButton.setText(resourceMap.getString("searchButton.text")); // NOI18N
+ searchButton.setName("searchButton"); // NOI18N
+ searchButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ searchButtonActionPerformed(evt);
+ }
+ });
+
+ jScrollPane1.setName("jScrollPane1"); // NOI18N
+
+ resultList.setName("resultList"); // NOI18N
+ jScrollPane1.setViewportView(resultList);
+
+ launchButton.setText(resourceMap.getString("launchButton.text")); // NOI18N
+ launchButton.setName("launchButton"); // NOI18N
+ launchButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ launchButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 578, Short.MAX_VALUE)
+ .addComponent(searchField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 578, Short.MAX_VALUE)
+ .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(searchBox, 0, 501, Short.MAX_VALUE))
+ .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
+ .addComponent(exploitsRadioButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(auxiliaryRadioButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(payloadsRadioButton))
+ .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
+ .addComponent(descriptionRadioButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(referenceRadioButton))
+ .addComponent(searchButton)
+ .addComponent(launchButton))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel2)
+ .addComponent(searchBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(exploitsRadioButton)
+ .addComponent(auxiliaryRadioButton)
+ .addComponent(payloadsRadioButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(descriptionRadioButton)
+ .addComponent(referenceRadioButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(searchButton)
+ .addGap(18, 18, 18)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(launchButton)
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void searchBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchBoxActionPerformed
+ if ((evt.getModifiers() & ActionEvent.MOUSE_EVENT_MASK) != 0) {
+ String typed = searchBox.getEditor().getItem().toString();
+ doAction(typed);
+ }
+ }//GEN-LAST:event_searchBoxActionPerformed
+
+ private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
+ mod.removeAllElements();
+ String type = typeGroup.getSelection().getActionCommand();
+ String detail = detailGroup.getSelection().getActionCommand();
+ String toSearch = searchField.getText().toLowerCase();
+
+ //look through all modules of selected type.
+ for(Object module : modules){
+ Object[] modInfo = (Object[])module;
+ if(!modInfo[0].equals(type))
+ continue;
+
+ try { //Get info
+ Map info = (Map) rpcConn.execute("module.info", modInfo[0], modInfo[1]);
+ if(detail.equals("reference")){
+ Object references = info.get("references");
+ if(references != null){
+ List refArray = (List)references;
+ for(int i = 0; i < refArray.size(); i++){
+ List ref = (List)refArray.get(i);
+ if(ref.get(1).toString().toLowerCase().contains(toSearch)
+ || (ref.get(0).toString().toLowerCase()+"-"+ref.get(1)).contains(toSearch)){
+ mod.addElement(modInfo[1]+" - "+Rank.toString(info.get("rank")));
+ break;
+ }
+ }
+ }
+ }else{
+ if(info.get("name").toString().toLowerCase().contains(toSearch)
+ || info.get("description").toString().toLowerCase().contains(toSearch))
+ mod.addElement(modInfo[1]+" - "+Rank.toString(info.get("rank")));
+ }
+ } catch (MsfException ex) {
+ MsfguiApp.showMessage(rootPane, ex);
+ }
+ }
+ }//GEN-LAST:event_searchButtonActionPerformed
+
+ private void launchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_launchButtonActionPerformed
+ String type = typeGroup.getSelection().getActionCommand();
+ String name = resultList.getSelectedValue().toString();
+ for(Object module : modules){
+ Object[] modInfo = (Object[])module;
+ if(modInfo[0].equals(type) && name.contains(modInfo[1].toString())){
+ Map info = (Map) rpcConn.execute("module.info", modInfo[0], modInfo[1]);
+ if(name.equals(modInfo[1].toString()+" - "+Rank.toString(info.get("rank")))){
+ ((ActionListener) modInfo[2]).actionPerformed(null);
+ break;
+ }
+ }
+ }
+ }//GEN-LAST:event_launchButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JRadioButton auxiliaryRadioButton;
+ private javax.swing.JRadioButton descriptionRadioButton;
+ private javax.swing.ButtonGroup detailGroup;
+ private javax.swing.JRadioButton exploitsRadioButton;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JButton launchButton;
+ private javax.swing.JRadioButton payloadsRadioButton;
+ private javax.swing.JRadioButton referenceRadioButton;
+ private javax.swing.JList resultList;
+ private javax.swing.JComboBox searchBox;
+ private javax.swing.JButton searchButton;
+ private javax.swing.JTextField searchField;
+ private javax.swing.ButtonGroup typeGroup;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/SessionCommand.java metasploit-gui-1.0/src/msfgui/SessionCommand.java
--- metasploit-gui-1.0/src/msfgui/SessionCommand.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/SessionCommand.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,61 @@
+package msfgui;
+
+import java.util.List;
+import java.util.Map;
+import javax.swing.JLabel;
+import org.jdesktop.swingworker.SwingWorker;
+
+/**
+ * A class to simplify running a command on a collection of sessions and reporting progress.
+ * @author scriptjunkie
+ */
+public class SessionCommand {
+ protected String command;
+ protected String outputPrefix;
+ protected JLabel label;
+ public SessionCommand(){
+ command = null;
+ outputPrefix = null;
+ label = null;
+ }
+ public SessionCommand(String cmd, String output, JLabel outputLabel){
+ command = cmd;
+ outputPrefix = output;
+ label = outputLabel;
+ }
+ public String getCommand(Map session, SwingWorker parent){
+ return command;
+ }
+ public void processResult(Map m) {
+ label.setText("Running "+outputPrefix + " on " + m.get("tunnel_peer") + ", session " + m.get("id"));
+ }
+ /** Starts a thread to iterate across active sessions, executing the given command on each,
+ * and updating the output label as progress is made. */
+ public static void runOnAllMeterpreters(final SessionsTable sessionsTableModel, String cmd, String output,
+ JLabel outputLabel, final RpcConnection rpcConn) {
+ final SessionCommand sess = new SessionCommand(cmd,output,outputLabel);
+ new SwingWorker() {
+ protected Object doInBackground() throws Exception {
+ try{
+ List currentSessions = sessionsTableModel.getSessionList();
+ for (Object o : currentSessions) {
+ Map session = (Map) o;
+ if (!session.get("type").equals("meterpreter"))
+ continue;
+ publish(session);
+ rpcConn.execute("session.meterpreter_write", session.get("id"),("\n"
+ +sess.getCommand(session, this)+"\n"));
+ }
+ }catch (RuntimeException rex){
+ if(!rex.getMessage().equals("cancelled"))
+ throw rex;
+ }
+ return null;
+ }
+ protected void process(List l) {
+ for(Object o : l)
+ sess.processResult((Map)o);
+ }
+ }.execute();
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/SessionsTable.java metasploit-gui-1.0/src/msfgui/SessionsTable.java
--- metasploit-gui-1.0/src/msfgui/SessionsTable.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/SessionsTable.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,63 @@
+package msfgui;
+
+import java.util.List;
+import java.util.Map;
+import javax.swing.table.*;
+
+/**
+ *
+ * @author scriptjunkie
+ */
+public class SessionsTable extends AbstractTableModel {
+ public static final int TITLE_INDEX = 0;
+ public static final int ARTIST_INDEX = 1;
+ public static final int ALBUM_INDEX = 2;
+ public static final int HIDDEN_INDEX = 3;
+ protected String[] columnNames;
+ protected List sessions;
+
+ public SessionsTable(List sessions) {
+ //also have "desc", "workspace", "target_host", "username", "uuid", "tunnel_local", "exploit_uuid"
+ this.columnNames = new String[]{"id","type","tunnel_peer","info","platform","via_exploit","via_payload"};
+ this.sessions = sessions;
+ }
+
+ @Override
+ public String getColumnName(int column) {
+ return columnNames[column];
+ }
+
+ @Override
+ public boolean isCellEditable(int row, int column) {
+ return false;
+ }
+
+ @Override
+ public Class getColumnClass(int column) {
+ return String.class;
+ }
+
+ public Object getValueAt(int row, int column) {
+ return ((Map) sessions.get(row)).get(columnNames[column]);
+ }
+
+ @Override
+ public void setValueAt(Object value, int row, int column) {
+ }
+
+ public int getRowCount() {
+ return sessions.size();
+ }
+
+ public int getColumnCount() {
+ return columnNames.length;
+ }
+
+ public void updateSessions(List newSessions) {
+ sessions = newSessions;
+ }
+
+ public List getSessionList() {
+ return sessions;
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/TableHelper.java metasploit-gui-1.0/src/msfgui/TableHelper.java
--- metasploit-gui-1.0/src/msfgui/TableHelper.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/TableHelper.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,69 @@
+package msfgui;
+
+import java.awt.Component;
+import java.util.Vector;
+import javax.swing.JTable;
+import javax.swing.table.*;
+
+/**
+ * Provides methods to help format tables from data
+ * @author scriptjunkie
+ */
+public class TableHelper {
+ public static final int MARGIN = 4;
+
+ /** Sets preferred column widths for the table based on header and data content. */
+ public static void fitColumnWidths(TableModel model, JTable mainTable) {
+ for (int col = 0; col < model.getColumnCount();col++) {
+ TableColumn tc = mainTable.getColumnModel().getColumn(col);
+ TableCellRenderer tcr = mainTable.getTableHeader().getDefaultRenderer();
+ int width = tcr.getTableCellRendererComponent(mainTable,
+ model.getColumnName(col), false, false, 0, col).getPreferredSize().width + MARGIN;
+ if(model.getRowCount() > 0)
+ tcr = mainTable.getDefaultRenderer(model.getColumnClass(col));
+ for (int row = 0; row < model.getRowCount();row++) {
+ Component c = tcr.getTableCellRendererComponent(mainTable,
+ model.getValueAt(row, col), false, false, row, col);
+ if (width < c.getPreferredSize().width + MARGIN)
+ width = c.getPreferredSize().width + MARGIN;
+ }
+ tc.setPreferredWidth(width);
+ }
+ }
+
+ /** Based on a header row demonstrating the length and position of the fields,
+ * break a line into column elements. */
+ protected static Vector fill(String line, String headerRow){
+ Vector output = new Vector();
+ boolean lastWhitespace = false;
+ StringBuilder val = new StringBuilder();
+ int max = Math.max(headerRow.length(), line.length());
+ for(int i = 0; i < max; i++){
+ if(headerRow.length() <= i){
+ val.append(line.charAt(i));
+ continue;
+ }
+ if(lastWhitespace && !Character.isWhitespace(headerRow.charAt(i))){
+ //If it's a number, make it an integer; otherwise a string
+ String cell = val.toString().trim();
+ try{
+ output.add(Integer.parseInt(cell));
+ }catch(NumberFormatException nex){
+ output.add(cell);
+ }
+ val.delete(0, val.length());
+ }
+ if(line.length() > i)
+ val.append(line.charAt(i));
+ lastWhitespace = Character.isWhitespace(headerRow.charAt(i));
+ }
+ //If it's a number, make it an integer; otherwise a string
+ String cell = val.toString().trim();
+ try{
+ output.add(Integer.parseInt(cell));
+ }catch(NumberFormatException nex){
+ output.add(cell);
+ }
+ return output;
+ }
+}
diff -Nru metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.form metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,160 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.java metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/UploadexecOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,184 @@
+package msfgui;
+
+import javax.swing.JFileChooser;
+
+/**
+ * Options dialog for uploading and executing a file
+ * @author scriptjunkie
+ */
+public class UploadexecOptionsDialog extends OptionsDialog {
+ /** Creates new form UploadexecOptionsDialog */
+ public UploadexecOptionsDialog(java.awt.Frame parent) {
+ super(parent, "Upload Exec Options", true);
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ okButton = new javax.swing.JButton();
+ chooseButton = new javax.swing.JButton();
+ fileField = new javax.swing.JTextField();
+ jLabel1 = new javax.swing.JLabel();
+ optionsField = new javax.swing.JTextField();
+ pathField = new javax.swing.JTextField();
+ jLabel2 = new javax.swing.JLabel();
+ verboseBox = new javax.swing.JCheckBox();
+ removeBox = new javax.swing.JCheckBox();
+ jLabel3 = new javax.swing.JLabel();
+
+ addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent evt) {
+ closeDialog(evt);
+ }
+ });
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(UploadexecOptionsDialog.class);
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ chooseButton.setText(resourceMap.getString("chooseButton.text")); // NOI18N
+ chooseButton.setName("chooseButton"); // NOI18N
+ chooseButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chooseButtonActionPerformed(evt);
+ }
+ });
+
+ fileField.setText(resourceMap.getString("fileField.text")); // NOI18N
+ fileField.setName("fileField"); // NOI18N
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ optionsField.setText(resourceMap.getString("optionsField.text")); // NOI18N
+ optionsField.setName("optionsField"); // NOI18N
+
+ pathField.setText(resourceMap.getString("pathField.text")); // NOI18N
+ pathField.setName("pathField"); // NOI18N
+
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ verboseBox.setText(resourceMap.getString("verboseBox.text")); // NOI18N
+ verboseBox.setName("verboseBox"); // NOI18N
+
+ removeBox.setText(resourceMap.getString("removeBox.text")); // NOI18N
+ removeBox.setName("removeBox"); // NOI18N
+
+ jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
+ jLabel3.setName("jLabel3"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(chooseButton)
+ .addComponent(jLabel1)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(verboseBox)
+ .addComponent(jLabel2)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(removeBox)
+ .addComponent(optionsField, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
+ .addComponent(fileField, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
+ .addComponent(pathField, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(chooseButton)
+ .addComponent(fileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(optionsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel1))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(pathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(removeBox)
+ .addComponent(verboseBox)))
+ .addComponent(jLabel2))
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
+ .addComponent(okButton)
+ .addContainerGap())
+ .addGroup(layout.createSequentialGroup()
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel3)
+ .addContainerGap())))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("uploadexec ");
+ if(optionsField.getText().length() > 0)
+ cmd.append(" -o ").append(MsfguiApp.escapeBackslashes(optionsField.getText()));
+ if(pathField.getText().length() > 0)
+ cmd.append(" -p ").append(MsfguiApp.escapeBackslashes(pathField.getText()));
+ cmd.append(" -e ").append(MsfguiApp.escapeBackslashes(fileField.getText()));
+ if(verboseBox.isSelected())
+ cmd.append(" -v");
+ if(removeBox.isSelected())
+ cmd.append(" -r");
+ command = cmd.toString();
+ doClose();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ /** Closes the dialog */
+ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
+ doClose();
+ }//GEN-LAST:event_closeDialog
+
+ private void chooseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ fileField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_chooseButtonActionPerformed
+
+ private void doClose() {
+ setVisible(false);
+ dispose();
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton chooseButton;
+ private javax.swing.JTextField fileField;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JButton okButton;
+ private javax.swing.JTextField optionsField;
+ private javax.swing.JTextField pathField;
+ private javax.swing.JCheckBox removeBox;
+ private javax.swing.JCheckBox verboseBox;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/UserPassDialog.form metasploit-gui-1.0/src/msfgui/UserPassDialog.form
--- metasploit-gui-1.0/src/msfgui/UserPassDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/UserPassDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,139 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/UserPassDialog.java metasploit-gui-1.0/src/msfgui/UserPassDialog.java
--- metasploit-gui-1.0/src/msfgui/UserPassDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/UserPassDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,162 @@
+package msfgui;
+
+import java.awt.Frame;
+
+/**
+ * Options dialog for username/password input
+ * @author scriptjunkie
+ */
+public class UserPassDialog extends OptionsDialog {
+ public boolean okd;
+
+ //Opens dialog to get options for a persistence
+ public static String getUserPassOpts(Frame parent) {
+ String[] userPass = showUserPassDialog(parent);
+ if(userPass == null)
+ return " -e";
+ else
+ return " -u "+userPass[0]+" -p "+userPass[1];
+ }
+
+ /** Shows dialog and returns username and password, or null if cancelled. */
+ public static String[] showUserPassDialog(java.awt.Frame parent){
+ String[] answers = new String[]{"metasploit","rocks"};
+ UserPassDialog d = new UserPassDialog(parent,true);
+ d.setVisible(true);
+ if(d.okd){
+ answers[0] = d.usernameField.getText();
+ answers[1] = d.passwordField.getText();
+ return answers;
+ }else return null;
+ }
+
+ /** Creates new form UserPassDialog */
+ public UserPassDialog(java.awt.Frame parent, boolean modal) {
+ super(parent, "Enter username and password", modal);
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ usernameLabel = new javax.swing.JLabel();
+ passwordLabel = new javax.swing.JLabel();
+ usernameField = new javax.swing.JTextField();
+ passwordField = new javax.swing.JTextField();
+ okButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ dontButton = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(UserPassDialog.class);
+ usernameLabel.setText(resourceMap.getString("usernameLabel.text")); // NOI18N
+ usernameLabel.setName("usernameLabel"); // NOI18N
+
+ passwordLabel.setText(resourceMap.getString("passwordLabel.text")); // NOI18N
+ passwordLabel.setName("passwordLabel"); // NOI18N
+
+ usernameField.setText(resourceMap.getString("usernameField.text")); // NOI18N
+ usernameField.setName("usernameField"); // NOI18N
+ usernameField.setPreferredSize(new java.awt.Dimension(50, 27));
+
+ passwordField.setText(resourceMap.getString("passwordField.text")); // NOI18N
+ passwordField.setName("passwordField"); // NOI18N
+ passwordField.setPreferredSize(new java.awt.Dimension(50, 27));
+
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ dontButton.setText(resourceMap.getString("dontButton.text")); // NOI18N
+ dontButton.setName("dontButton"); // NOI18N
+ dontButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ dontButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(44, 44, 44))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(passwordLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(usernameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)
+ .addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE))
+ .addContainerGap()))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(dontButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(okButton)
+ .addContainerGap())))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(usernameLabel)
+ .addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(okButton)
+ .addComponent(dontButton)))
+ .addComponent(passwordLabel))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ okd = true;
+ this.setVisible(false);
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ private void dontButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dontButtonActionPerformed
+ okd = false;
+ this.setVisible(false);
+ }//GEN-LAST:event_dontButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton dontButton;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JButton okButton;
+ private javax.swing.JTextField passwordField;
+ private javax.swing.JLabel passwordLabel;
+ private javax.swing.JTextField usernameField;
+ private javax.swing.JLabel usernameLabel;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/WebcamFrame.form metasploit-gui-1.0/src/msfgui/WebcamFrame.form
--- metasploit-gui-1.0/src/msfgui/WebcamFrame.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/WebcamFrame.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,114 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/WebcamFrame.java metasploit-gui-1.0/src/msfgui/WebcamFrame.java
--- metasploit-gui-1.0/src/msfgui/WebcamFrame.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/WebcamFrame.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,206 @@
+package msfgui;
+
+import java.io.FileOutputStream;
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.SocketException;
+import java.util.Map;
+import javax.swing.ImageIcon;
+import javax.swing.SwingWorker;
+
+/**
+ * Frame to display images from a webcam.
+ * @author scriptjunkie
+ */
+public class WebcamFrame extends MsfFrame {
+ protected final Map session;
+ protected final RpcConnection rpcConn;
+ public static final int CAM_SOCK_PORT_NUM = 16235;
+ private SwingWorker sw;
+ public static final char POLL = 'r';
+ public static final char STOP_POLLING = 's';
+ private final StringBuffer imageCommand;//synchronized mutable object as command placeholder for polling thread
+ private byte[] imageData;
+
+ /** Creates new form WebcamFrame */
+ public WebcamFrame(final RpcConnection rpcConn, final Map session) {
+ initComponents();
+ this.rpcConn = rpcConn;
+ this.session = session;
+ imageCommand = new StringBuffer("r");
+ }
+
+ /** Shows webcam window for a session, creating one if necessary */
+ static void showWebcam(RpcConnection rpcConn, Map session, Map sessionWindowMap) {
+ Object webcamWindow = sessionWindowMap.get(session.get("id")+"webcam");
+ if(webcamWindow == null){
+ webcamWindow = new WebcamFrame(rpcConn,session);
+ sessionWindowMap.put(session.get("id")+"webcam",webcamWindow);
+ }
+ ((MsfFrame)webcamWindow).setVisible(true);
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ startButton = new javax.swing.JButton();
+ stopButton = new javax.swing.JButton();
+ delayLabel = new javax.swing.JLabel();
+ delayField = new javax.swing.JTextField();
+ imageLabel = new javax.swing.JLabel();
+ frameButton = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setName("Form"); // NOI18N
+ addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent evt) {
+ formWindowClosing(evt);
+ }
+ });
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(WebcamFrame.class);
+ startButton.setText(resourceMap.getString("startButton.text")); // NOI18N
+ startButton.setName("startButton"); // NOI18N
+ startButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ startButtonActionPerformed(evt);
+ }
+ });
+
+ stopButton.setText(resourceMap.getString("stopButton.text")); // NOI18N
+ stopButton.setName("stopButton"); // NOI18N
+ stopButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ stopButtonActionPerformed(evt);
+ }
+ });
+
+ delayLabel.setText(resourceMap.getString("delayLabel.text")); // NOI18N
+ delayLabel.setName("delayLabel"); // NOI18N
+
+ delayField.setText(resourceMap.getString("delayField.text")); // NOI18N
+ delayField.setName("delayField"); // NOI18N
+
+ imageLabel.setText(resourceMap.getString("imageLabel.text")); // NOI18N
+ imageLabel.setName("imageLabel"); // NOI18N
+
+ frameButton.setText(resourceMap.getString("frameButton.text")); // NOI18N
+ frameButton.setName("frameButton"); // NOI18N
+ frameButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ frameButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(imageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(delayLabel)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(delayField, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(startButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(stopButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(frameButton)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(delayLabel)
+ .addComponent(delayField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(startButton)
+ .addComponent(stopButton)
+ .addComponent(frameButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(imageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
+ try { //Make socket
+ imageCommand.setCharAt(0, POLL);
+ final DatagramSocket camSock = new DatagramSocket(CAM_SOCK_PORT_NUM);
+ final WebcamFrame me = this;
+ rpcConn.execute("session.meterpreter_script", session.get("id"),
+ "webcam -g -d "+Integer.parseInt(delayField.getText()));
+ sw = new SwingWorker() {
+ private DatagramPacket dp = new DatagramPacket(new byte[100000], 100000);
+ protected Object doInBackground() throws Exception {
+ while (true) {
+ //Get each picture and send it to label to be displayed
+ camSock.receive(dp);
+ imageData = new byte[dp.getLength()];
+ System.arraycopy(dp.getData(), 0, imageData, 0, imageData.length);
+ this.publish(imageData);
+ if (imageCommand.charAt(0) != POLL){
+ //Stop it!
+ rpcConn.execute("session.meterpreter_script", session.get("id"), "webcam -s");
+ camSock.close();
+ return null;
+ }
+ }
+ }
+ protected void process(java.util.List values) {
+ for (Object o : values)
+ imageLabel.setIcon(new ImageIcon((byte[]) o));
+ me.pack();
+ }
+ };
+ sw.execute();
+ } catch(NumberFormatException nex){
+ MsfguiApp.showMessage(this, "Please enter a valid delay interval between frames!");
+ } catch(MsfException mex) {
+ MsfguiApp.showMessage(this, mex);
+ } catch (SocketException sox) {
+ MsfguiApp.showMessage(this, sox);
+ }
+ }//GEN-LAST:event_startButtonActionPerformed
+
+ private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopButtonActionPerformed
+ imageCommand.setCharAt(0, STOP_POLLING);
+ }//GEN-LAST:event_stopButtonActionPerformed
+
+ private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
+ imageCommand.setCharAt(0, STOP_POLLING);
+ }//GEN-LAST:event_formWindowClosing
+
+ private void frameButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_frameButtonActionPerformed
+ if(MsfguiApp.fileChooser.showSaveDialog(this) != javax.swing.JFileChooser.APPROVE_OPTION)
+ return;
+ try{
+ FileOutputStream fout = new FileOutputStream(MsfguiApp.fileChooser.getSelectedFile());
+ fout.write(imageData);
+ fout.close();
+ }catch(java.io.IOException ix){
+ }
+ }//GEN-LAST:event_frameButtonActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField delayField;
+ private javax.swing.JLabel delayLabel;
+ private javax.swing.JButton frameButton;
+ private javax.swing.JLabel imageLabel;
+ private javax.swing.JButton startButton;
+ private javax.swing.JButton stopButton;
+ // End of variables declaration//GEN-END:variables
+}
diff -Nru metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.form metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.form
--- metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.form 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.form 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,154 @@
+
+
+
diff -Nru metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.java metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.java
--- metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/WinbfOptionsDialog.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,190 @@
+package msfgui;
+
+import javax.swing.JFileChooser;
+
+/**
+ * Options dialog to provide to winbf password brute-forcing script.
+ * @author scriptjunkie
+ */
+public class WinbfOptionsDialog extends OptionsDialog {
+ /** Creates new winbf dialog */
+ public WinbfOptionsDialog(java.awt.Frame parent) {
+ super(parent, "Winbf Options", true);
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ okButton = new javax.swing.JButton();
+ userButton = new javax.swing.JButton();
+ userField = new javax.swing.JTextField();
+ passwordField = new javax.swing.JTextField();
+ loginField = new javax.swing.JTextField();
+ jLabel2 = new javax.swing.JLabel();
+ checkPolicyBox = new javax.swing.JCheckBox();
+ targetField = new javax.swing.JTextField();
+ jLabel3 = new javax.swing.JLabel();
+ passwordButton = new javax.swing.JButton();
+
+ addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent evt) {
+ closeDialog(evt);
+ }
+ });
+
+ org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(WinbfOptionsDialog.class);
+ okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okButtonActionPerformed(evt);
+ }
+ });
+
+ userButton.setText(resourceMap.getString("userButton.text")); // NOI18N
+ userButton.setName("userButton"); // NOI18N
+ userButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ userButtonActionPerformed(evt);
+ }
+ });
+
+ userField.setText(resourceMap.getString("userField.text")); // NOI18N
+ userField.setName("userField"); // NOI18N
+
+ passwordField.setText(resourceMap.getString("passwordField.text")); // NOI18N
+ passwordField.setName("passwordField"); // NOI18N
+
+ loginField.setText(resourceMap.getString("loginField.text")); // NOI18N
+ loginField.setName("loginField"); // NOI18N
+
+ jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ checkPolicyBox.setText(resourceMap.getString("checkPolicyBox.text")); // NOI18N
+ checkPolicyBox.setName("checkPolicyBox"); // NOI18N
+
+ targetField.setText(resourceMap.getString("targetField.text")); // NOI18N
+ targetField.setName("targetField"); // NOI18N
+
+ jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
+ jLabel3.setName("jLabel3"); // NOI18N
+
+ passwordButton.setText(resourceMap.getString("passwordButton.text")); // NOI18N
+ passwordButton.setName("passwordButton"); // NOI18N
+ passwordButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ passwordButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel3)
+ .addComponent(userButton)
+ .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
+ .addComponent(passwordButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(checkPolicyBox, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
+ .addComponent(userField, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
+ .addComponent(loginField, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
+ .addComponent(targetField, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(userField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(userButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(passwordButton))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(loginField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel2))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(targetField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel3))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(checkPolicyBox)
+ .addComponent(okButton))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
+ StringBuilder cmd = new StringBuilder("winbf ");
+ if(targetField.getText().length() > 0)
+ cmd.append(" -t ").append(MsfguiApp.escapeBackslashes(targetField.getText()));
+ if(userField.getText().length() > 0)
+ cmd.append(" -L ").append(MsfguiApp.escapeBackslashes(userField.getText()));
+ if(passwordField.getText().length() > 0)
+ cmd.append(" -p ").append(MsfguiApp.escapeBackslashes(passwordField.getText()));
+ if(loginField.getText().length() > 0)
+ cmd.append(" -l ").append(MsfguiApp.escapeBackslashes(loginField.getText()));
+ if(checkPolicyBox.isSelected())
+ cmd.append(" -cp");
+ command = cmd.toString();
+ doClose();
+ }//GEN-LAST:event_okButtonActionPerformed
+
+ /** Closes the dialog */
+ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
+ doClose();
+ }//GEN-LAST:event_closeDialog
+
+ private void userButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ userField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_userButtonActionPerformed
+
+ private void passwordButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_passwordButtonActionPerformed
+ if(MsfguiApp.fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+ passwordField.setText(MsfguiApp.fileChooser.getSelectedFile().getPath());
+ }//GEN-LAST:event_passwordButtonActionPerformed
+
+ private void doClose() {
+ setVisible(false);
+ dispose();
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JCheckBox checkPolicyBox;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JTextField loginField;
+ private javax.swing.JButton okButton;
+ private javax.swing.JButton passwordButton;
+ private javax.swing.JTextField passwordField;
+ private javax.swing.JTextField targetField;
+ private javax.swing.JButton userButton;
+ private javax.swing.JTextField userField;
+ // End of variables declaration//GEN-END:variables
+
+}
diff -Nru metasploit-gui-1.0/src/msfgui/XmlRpc.java metasploit-gui-1.0/src/msfgui/XmlRpc.java
--- metasploit-gui-1.0/src/msfgui/XmlRpc.java 1970-01-01 00:00:00.000000000 +0000
+++ metasploit-gui-1.0/src/msfgui/XmlRpc.java 2014-05-20 19:41:40.000000000 +0000
@@ -0,0 +1,210 @@
+package msfgui;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * XMLRPC implementation of an RpcConnection.
+ *
+ * Implements a minimal XMLRPC client for our purposes. Reinventing the wheel is
+ * usually a bad idea, but CVE/description searching takes a long time and this
+ * implementation runs a CVE search twice as fast as the apache libs. It also
+ * results in a more responsive console.
+ *
+ * @author scriptjunkie
+ */
+public class XmlRpc extends RpcConnection {
+
+ /**
+ * We're an XML RPC
+ */
+ public XmlRpc(){
+ super();
+ }
+ /** Creates an XMLRPC call from the given method name and parameters and sends it */
+ protected void writeCall(String methname, Object[] params) throws Exception{
+ if(methname.endsWith("write"))
+ params[2] = Base64.encode(params[2].toString().getBytes());
+ if(methname.startsWith("db.import_"))
+ ((Map)params[1]).put("data", Base64.encode((byte[])((Map)params[1]).get("data")));
+ if(methname.equals("module.encode"))
+ params[1] = Base64.encode((byte[])params[1]);
+ Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ Element methodCall = doc.createElement("methodCall");
+ doc.appendChild(methodCall);
+ Element methodName = doc.createElement("methodName");
+ methodName.appendChild(doc.createTextNode(methname));
+ methodCall.appendChild(methodName);
+ Element paramsEl = doc.createElement("params");
+ methodCall.appendChild(paramsEl);
+ //Add each parameter by type. Usually just the maps are difficult
+ for(Object param : params){
+ Element paramEl = doc.createElement("param");
+ paramEl.appendChild(objectToNode(doc,param));
+ paramsEl.appendChild(paramEl);
+ }
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(bout));
+ sout.write(bout.toByteArray());
+ sout.write(0);
+ }
+
+ /**
+ * Takes the object provided and recursively creates a node out of it suitable
+ * for xmlrpc transmission.
+ * @param doc
+ * @param param
+ * @return
+ */
+ public static Node objectToNode(Document doc, Object param){
+ Node valEl = doc.createElement("value");
+ if(param instanceof Map){ //Reverse of the parseVal() struct-to-HashMap code
+ Element structEl = doc.createElement("struct");
+ for(Object entryObj : ((Map)param).entrySet()){
+ Map.Entry ent = (Map.Entry)entryObj;
+ Element membEl = doc.createElement("member");
+ Element nameEl = doc.createElement("name");
+ nameEl.appendChild(doc.createTextNode(ent.getKey().toString()));
+ membEl.appendChild(nameEl);
+ membEl.appendChild(objectToNode(doc,ent.getValue()));
+ structEl.appendChild(membEl);
+ }
+ valEl.appendChild(structEl);
+ }else if(param instanceof List || param instanceof Object[]){ //Reverse of the parseVal() array-to-HashMap code
+ Element arrayEl = doc.createElement("array");
+ Element dataEl = doc.createElement("data");
+ if(param instanceof Object[])
+ for(Object obj : (Object[])param)
+ dataEl.appendChild(objectToNode(doc,obj));
+ else
+ for(Object obj : (List)param)
+ dataEl.appendChild(objectToNode(doc,obj));
+ arrayEl.appendChild(dataEl);
+ valEl.appendChild(arrayEl);
+ }else if(param instanceof Integer){ //not sure I even need this
+ Element i4El = doc.createElement("i4");
+ i4El.appendChild(doc.createTextNode(param.toString()));
+ valEl.appendChild(i4El);
+ }else if(param instanceof Boolean){ //not sure I even need this
+ Element boolEl = doc.createElement("boolean");
+ boolEl.appendChild(doc.createTextNode(param.toString()));
+ valEl.appendChild(boolEl);
+ }else{
+ Element strEl = doc.createElement("string");
+ strEl.appendChild(doc.createTextNode(param.toString()));
+ valEl.appendChild(strEl);
+ }
+ return valEl;
+ }
+
+ /** Receives an XMLRPC response and converts to an object */
+ protected Object readResp() throws Exception{
+ //Will store our response
+ StringBuilder sb = new StringBuilder();
+ int len;
+ do{
+ //read bytes
+ ByteArrayOutputStream cache = new ByteArrayOutputStream();
+ int val;
+ while((val = sin.read()) != 0){
+ if(val == -1)
+ throw new MsfException("Stream died.");
+ cache.write(val);
+ }
+ //parse the response: ...
+ ByteArrayInputStream is = new ByteArrayInputStream(cache.toByteArray());
+ int a = is.read();
+ while(a != -1){
+ if(!Character.isISOControl(a) || a == '\t')
+ sb.append((char)a);
+ //else
+ // sb.append("").append(Integer.toHexString(a)).append(';');
+ a = is.read();
+ }
+ len = sb.length();//Check to make sure we aren't stopping on an embedded null
+ } while (sb.lastIndexOf("") < len - 20 || len < 30);
+ Document root = DocumentBuilderFactory.newInstance().newDocumentBuilder()
+ .parse(new ByteArrayInputStream(sb.toString().getBytes()));
+
+ if(!root.getFirstChild().getNodeName().equals("methodResponse"))
+ throw new MsfException("Error reading response: not a response.");
+ Node methResp = root.getFirstChild();
+ if(methResp.getFirstChild().getNodeName().equals("fault")){
+ throw new MsfException(methResp.getFirstChild()//fault
+ .getFirstChild() // value
+ .getFirstChild() // struct
+ .getLastChild() // member
+ .getLastChild() // value
+ .getTextContent());
+ }
+ Node params = methResp.getFirstChild();
+ if(!params.getNodeName().equals("params"))
+ throw new MsfException("Error reading response: no params.");
+ Node param = params.getFirstChild();
+ if(!param.getNodeName().equals("param"))
+ throw new MsfException("Error reading response: no param.");
+ Node value = param.getFirstChild();
+ if(!value.getNodeName().equals("value"))
+ throw new MsfException("Error reading response: no value.");
+ return parseVal(value);
+ }
+
+ /** Takes an XMLRPC DOM value node and creates a java object out of it recursively */
+ public static Object parseVal(Node submemb) throws MsfException {
+ Node type = submemb.getFirstChild();
+ String typeName = type.getNodeName();
+ if(typeName.equals("string")){//jobs
+ return type.getTextContent(); //String returns java string
+ }else if (typeName.equals("array")){ //Array returns List
+ ArrayList arrgh = new ArrayList();
+ Node data = type.getFirstChild();
+ if(!data.getNodeName().equals("data"))
+ throw new MsfException("Error reading array: no data.");
+ for(Node val = data.getFirstChild(); val != null; val = val.getNextSibling())
+ arrgh.add(parseVal(val));
+ return arrgh;
+ }else if (typeName.equals("struct")){ //Struct returns a HashMap of name->value member pairs
+ HashMap structmembs = new HashMap();
+ for(Node member = type.getFirstChild(); member != null; member = member.getNextSibling()){
+ if(!member.getNodeName().equals("member"))
+ throw new MsfException("Error reading response: non struct member.");
+ Object name = null, membValue = null;
+ //get each member and put into output map
+ for(Node submember = member.getFirstChild(); submember != null; submember = submember.getNextSibling()){
+ if(submember.getNodeName().equals("name"))
+ name = submember.getTextContent();
+ else if (submember.getNodeName().equals("value"))
+ membValue = parseVal(submember); //Value can be arbitrarily complex
+ }
+ structmembs.put(name, membValue);
+ }
+ return structmembs;
+ }else if (typeName.equals("i4")){
+ return new Integer(type.getTextContent());
+ }else if (typeName.equals("boolean")){
+ return type.getTextContent().equals("1") || Boolean.valueOf(type.getTextContent());
+ }else if (typeName.equals("dateTime.iso8601")) {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
+ try{
+ return sdf.parse(type.getTextContent());
+ }catch(ParseException pex){
+ return type.getTextContent();
+ }
+ } else {
+ throw new MsfException("Error reading val: unknown type " + typeName);
+ }
+ }
+}
Binary files /tmp/S5OQQjp5SJ/metasploit-gui-1.0/swing-worker-1.1.jar and /tmp/kvQywBdWKJ/metasploit-gui-1.0/swing-worker-1.1.jar differ