Remove XML RPC option for msfgui.
parent
1d244c4b27
commit
e34555dc22
Binary file not shown.
|
@ -97,15 +97,9 @@ public class MsfTable extends javax.swing.JTable {
|
||||||
if(!force && !DraggableTabbedPane.isVisible(this))
|
if(!force && !DraggableTabbedPane.isVisible(this))
|
||||||
return; //Don't re-add if not visible
|
return; //Don't re-add if not visible
|
||||||
try {
|
try {
|
||||||
Object arg;
|
HashMap arg = new HashMap(10);
|
||||||
if(rpcConn.type.equals("XML") && (dbTable.equals("events") || dbTable.equals("loots"))){
|
arg.put("workspace", MsfguiApp.workspace);
|
||||||
arg = MsfguiApp.workspace;
|
arg.put("offset", offset);
|
||||||
} else {
|
|
||||||
HashMap argM = new HashMap(10);
|
|
||||||
argM.put("workspace", MsfguiApp.workspace);
|
|
||||||
argM.put("offset", offset);
|
|
||||||
arg = argM;
|
|
||||||
}
|
|
||||||
List data = (List) ((Map)rpcConn.execute("db."+dbTable, arg)).get(dbTable);
|
List data = (List) ((Map)rpcConn.execute("db."+dbTable, arg)).get(dbTable);
|
||||||
if(data == null)
|
if(data == null)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -44,24 +44,18 @@
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="disableDbButton" min="-2" max="-2" attributes="0"/>
|
<Component id="disableDbButton" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="usernameField" alignment="0" pref="427" max="32767" attributes="0"/>
|
<Component id="usernameField" alignment="0" pref="433" max="32767" attributes="0"/>
|
||||||
<Component id="hostField" alignment="0" pref="427" max="32767" attributes="0"/>
|
<Component id="hostField" alignment="0" pref="433" max="32767" attributes="0"/>
|
||||||
<Component id="passwordField" alignment="0" pref="427" max="32767" attributes="0"/>
|
<Component id="passwordField" alignment="0" pref="433" max="32767" attributes="0"/>
|
||||||
<Component id="portField" alignment="0" pref="427" max="32767" attributes="0"/>
|
<Component id="portField" alignment="0" pref="433" max="32767" attributes="0"/>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Component id="sslBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="sslBox" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace pref="250" max="32767" attributes="0"/>
|
|
||||||
<Component id="xmlButton" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
|
||||||
<Component id="msgpackButton" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="startNewButton" min="-2" max="-2" attributes="0"/>
|
<Component id="startNewButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="pathButton" min="-2" max="-2" attributes="0"/>
|
<Component id="pathButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="126" max="32767" attributes="0"/>
|
<EmptySpace pref="132" max="32767" attributes="0"/>
|
||||||
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="connectButton" min="-2" max="-2" attributes="0"/>
|
<Component id="connectButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
@ -97,22 +91,14 @@
|
||||||
<Component id="portLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="portLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Component id="sslBox" alignment="0" min="0" pref="0" max="32767" attributes="1"/>
|
||||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
<Component id="sslLabel" alignment="0" max="32767" attributes="1"/>
|
||||||
<Component id="sslBox" alignment="0" min="0" pref="0" max="32767" attributes="1"/>
|
</Group>
|
||||||
<Component id="sslLabel" alignment="0" max="32767" attributes="1"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<Component id="disableDbLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Component id="disableDbButton" alignment="3" min="-2" pref="18" max="-2" attributes="0"/>
|
||||||
<Component id="disableDbLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="disableDbButton" alignment="3" min="-2" pref="18" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="msgpackButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="xmlButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
@ -268,24 +254,5 @@
|
||||||
<Property name="name" type="java.lang.String" value="disableDbButton" noResource="true"/>
|
<Property name="name" type="java.lang.String" value="disableDbButton" noResource="true"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JRadioButton" name="xmlButton">
|
|
||||||
<Properties>
|
|
||||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
|
||||||
<ComponentRef name="buttonGroup1"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="selected" type="boolean" value="true"/>
|
|
||||||
<Property name="text" type="java.lang.String" resourceKey="xmlButton.text"/>
|
|
||||||
<Property name="name" type="java.lang.String" value="xmlButton" noResource="true"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JRadioButton" name="msgpackButton">
|
|
||||||
<Properties>
|
|
||||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
|
||||||
<ComponentRef name="buttonGroup1"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="text" type="java.lang.String" resourceKey="msgpackButton.text"/>
|
|
||||||
<Property name="name" type="java.lang.String" value="msgpackButton" noResource="true"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
int port = Integer.parseInt(info.get("port").toString());
|
int port = Integer.parseInt(info.get("port").toString());
|
||||||
boolean ssl = Boolean.parseBoolean(info.get("ssl").toString());
|
boolean ssl = Boolean.parseBoolean(info.get("ssl").toString());
|
||||||
String type = info.get("type").toString();
|
String type = info.get("type").toString();
|
||||||
RpcConnection rpc = RpcConnection.getConn(type, username, password.toCharArray(), host, port, ssl);
|
RpcConnection rpc = RpcConnection.getConn(username, password.toCharArray(), host, port, ssl);
|
||||||
if(javax.swing.JOptionPane.showConfirmDialog(null, "Connect to last remembered rpcd?") == javax.swing.JOptionPane.YES_OPTION)
|
if(javax.swing.JOptionPane.showConfirmDialog(null, "Connect to last remembered rpcd?") == javax.swing.JOptionPane.YES_OPTION)
|
||||||
return rpc;
|
return rpc;
|
||||||
rpc.execute("auth.logout");
|
rpc.execute("auth.logout");
|
||||||
|
@ -154,8 +154,6 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
sslLabel = new javax.swing.JLabel();
|
sslLabel = new javax.swing.JLabel();
|
||||||
disableDbLabel = new javax.swing.JLabel();
|
disableDbLabel = new javax.swing.JLabel();
|
||||||
disableDbButton = new javax.swing.JCheckBox();
|
disableDbButton = new javax.swing.JCheckBox();
|
||||||
xmlButton = new javax.swing.JRadioButton();
|
|
||||||
msgpackButton = new javax.swing.JRadioButton();
|
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(OpenConnectionDialog.class);
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(OpenConnectionDialog.class);
|
||||||
|
@ -255,15 +253,6 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
disableDbButton.setText(resourceMap.getString("disableDbButton.text")); // NOI18N
|
disableDbButton.setText(resourceMap.getString("disableDbButton.text")); // NOI18N
|
||||||
disableDbButton.setName("disableDbButton"); // NOI18N
|
disableDbButton.setName("disableDbButton"); // NOI18N
|
||||||
|
|
||||||
buttonGroup1.add(xmlButton);
|
|
||||||
xmlButton.setSelected(true);
|
|
||||||
xmlButton.setText(resourceMap.getString("xmlButton.text")); // NOI18N
|
|
||||||
xmlButton.setName("xmlButton"); // NOI18N
|
|
||||||
|
|
||||||
buttonGroup1.add(msgpackButton);
|
|
||||||
msgpackButton.setText(resourceMap.getString("msgpackButton.text")); // NOI18N
|
|
||||||
msgpackButton.setName("msgpackButton"); // NOI18N
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
|
@ -284,21 +273,16 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(disableDbButton)
|
.addComponent(disableDbButton)
|
||||||
.addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE)
|
.addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
|
||||||
.addComponent(hostField, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE)
|
.addComponent(hostField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
|
||||||
.addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE)
|
.addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
|
||||||
.addComponent(portField, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE)
|
.addComponent(portField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addComponent(sslBox)))
|
||||||
.addComponent(sslBox)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 250, Short.MAX_VALUE)
|
|
||||||
.addComponent(xmlButton)
|
|
||||||
.addGap(18, 18, 18)
|
|
||||||
.addComponent(msgpackButton))))
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(startNewButton)
|
.addComponent(startNewButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(pathButton)
|
.addComponent(pathButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 126, Short.MAX_VALUE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 132, Short.MAX_VALUE)
|
||||||
.addComponent(cancelButton)
|
.addComponent(cancelButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
.addComponent(connectButton)))
|
.addComponent(connectButton)))
|
||||||
|
@ -326,18 +310,13 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
.addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(portLabel))
|
.addComponent(portLabel))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addComponent(sslBox, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
.addComponent(sslLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
.addComponent(sslBox, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(sslLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addComponent(disableDbLabel)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addComponent(disableDbButton, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addComponent(disableDbLabel)
|
|
||||||
.addComponent(disableDbButton, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
||||||
.addComponent(msgpackButton)
|
|
||||||
.addComponent(xmlButton)))
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(connectButton, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
|
.addComponent(connectButton, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
|
||||||
|
@ -356,11 +335,8 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
String host = hostField.getText();
|
String host = hostField.getText();
|
||||||
int port = Integer.parseInt(portField.getText());
|
int port = Integer.parseInt(portField.getText());
|
||||||
boolean ssl = checkCrypto(sslBox.isSelected());
|
boolean ssl = checkCrypto(sslBox.isSelected());
|
||||||
String type = "xml";
|
|
||||||
if(msgpackButton.isSelected())
|
|
||||||
type = "msg";
|
|
||||||
try {
|
try {
|
||||||
rpcConn = RpcConnection.getConn(type, username, password, host, port, ssl);
|
rpcConn = RpcConnection.getConn(username, password, host, port, ssl);
|
||||||
} catch (MsfException mex) {
|
} catch (MsfException mex) {
|
||||||
rpcConn = null;
|
rpcConn = null;
|
||||||
}
|
}
|
||||||
|
@ -390,10 +366,6 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
|
|
||||||
private void startNewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startNewButtonActionPerformed
|
private void startNewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startNewButtonActionPerformed
|
||||||
//Setup defaults
|
//Setup defaults
|
||||||
if(msgpackButton.isSelected())
|
|
||||||
RpcConnection.defaultType = "msg";
|
|
||||||
else
|
|
||||||
RpcConnection.defaultType = "xml";
|
|
||||||
RpcConnection.defaultUser = usernameField.getText();
|
RpcConnection.defaultUser = usernameField.getText();
|
||||||
if(passwordField.getPassword().length > 0)
|
if(passwordField.getPassword().length > 0)
|
||||||
RpcConnection.defaultPass = new String(passwordField.getPassword());
|
RpcConnection.defaultPass = new String(passwordField.getPassword());
|
||||||
|
@ -434,7 +406,6 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
private javax.swing.JLabel disableDbLabel;
|
private javax.swing.JLabel disableDbLabel;
|
||||||
private javax.swing.JTextField hostField;
|
private javax.swing.JTextField hostField;
|
||||||
private javax.swing.JLabel hostLabel;
|
private javax.swing.JLabel hostLabel;
|
||||||
private javax.swing.JRadioButton msgpackButton;
|
|
||||||
private javax.swing.JPasswordField passwordField;
|
private javax.swing.JPasswordField passwordField;
|
||||||
private javax.swing.JLabel passwordLabel;
|
private javax.swing.JLabel passwordLabel;
|
||||||
private javax.swing.JButton pathButton;
|
private javax.swing.JButton pathButton;
|
||||||
|
@ -446,6 +417,5 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
private javax.swing.JLabel titleLabel;
|
private javax.swing.JLabel titleLabel;
|
||||||
private javax.swing.JTextField usernameField;
|
private javax.swing.JTextField usernameField;
|
||||||
private javax.swing.JLabel usernameLabel;
|
private javax.swing.JLabel usernameLabel;
|
||||||
private javax.swing.JRadioButton xmlButton;
|
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,14 +73,14 @@
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Component id="outputPathField" pref="453" max="32767" attributes="1"/>
|
<Component id="outputPathField" pref="853" max="32767" attributes="1"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="choosePathButton" min="-2" pref="91" max="-2" attributes="0"/>
|
<Component id="choosePathButton" min="-2" pref="91" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="archField" alignment="0" pref="550" max="32767" attributes="1"/>
|
<Component id="archField" alignment="0" pref="950" max="32767" attributes="1"/>
|
||||||
<Component id="badcharsField" alignment="0" pref="550" max="32767" attributes="1"/>
|
<Component id="badcharsField" alignment="0" pref="950" max="32767" attributes="1"/>
|
||||||
<Component id="timesField" alignment="0" pref="550" max="32767" attributes="1"/>
|
<Component id="timesField" alignment="0" pref="950" max="32767" attributes="1"/>
|
||||||
<Component id="outputCombo" alignment="0" pref="550" max="32767" attributes="1"/>
|
<Component id="outputCombo" alignment="0" pref="950" max="32767" attributes="1"/>
|
||||||
<Component id="encoderCombo" alignment="0" min="-2" pref="540" max="-2" attributes="1"/>
|
<Component id="encoderCombo" alignment="0" min="-2" pref="540" max="-2" attributes="1"/>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
@ -89,8 +89,8 @@
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
<Component id="addCodeButton" pref="97" max="32767" attributes="1"/>
|
<Component id="addCodeButton" pref="497" max="32767" attributes="1"/>
|
||||||
<Component id="templateButton" alignment="0" pref="97" max="32767" attributes="1"/>
|
<Component id="templateButton" alignment="0" pref="497" max="32767" attributes="1"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -112,7 +112,6 @@
|
||||||
<Component id="handleButton" min="-2" max="-2" attributes="0"/>
|
<Component id="handleButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="handleConsoleButton" min="-2" max="-2" attributes="0"/>
|
<Component id="handleConsoleButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="121" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="outputScrollPane" alignment="0" min="-2" pref="691" max="-2" attributes="0"/>
|
<Component id="outputScrollPane" alignment="0" min="-2" pref="691" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -540,23 +540,14 @@ public class PayloadPopup extends ModuleInfoWindow {
|
||||||
hash.put("Encoder", "generic/none");
|
hash.put("Encoder", "generic/none");
|
||||||
Map data = (Map) rpcConn.execute("module.execute", "payload", fullName,hash);
|
Map data = (Map) rpcConn.execute("module.execute", "payload", fullName,hash);
|
||||||
//Basic info
|
//Basic info
|
||||||
byte[] buffer;
|
byte[] buffer = (byte[])data.get("payload");
|
||||||
String rawHex;
|
|
||||||
if(rpcConn.type.equals("msg")){
|
|
||||||
buffer = (byte[])data.get("payload");
|
|
||||||
}else{
|
|
||||||
rawHex = data.get("payload").toString();
|
|
||||||
buffer = new byte[rawHex.length() / 2];
|
|
||||||
for (int i = 0; i < rawHex.length(); i += 2)
|
|
||||||
buffer[i/2] = (byte)Integer.parseInt(rawHex.substring(i, i + 2),16);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(saveButton.isSelected()){ //Encode and output
|
if(saveButton.isSelected()){ //Encode and output
|
||||||
hash.put("format", outputCombo.getSelectedItem().toString());
|
hash.put("format", outputCombo.getSelectedItem().toString());
|
||||||
if(timesField.getText().length() > 0)
|
if(timesField.getText().length() > 0)
|
||||||
hash.put("ecount", timesField.getText());
|
hash.put("ecount", timesField.getText());
|
||||||
if(badcharsField.getText().length() > 0){
|
if(badcharsField.getText().length() > 0){
|
||||||
StringBuffer badbinary = new StringBuffer();
|
StringBuilder badbinary = new StringBuilder();
|
||||||
for(String s : badcharsField.getText().split("\\\\x"))
|
for(String s : badcharsField.getText().split("\\\\x"))
|
||||||
if(s.length() > 0)
|
if(s.length() > 0)
|
||||||
badbinary.append((char)Integer.parseInt(s, 16));
|
badbinary.append((char)Integer.parseInt(s, 16));
|
||||||
|
@ -574,10 +565,7 @@ public class PayloadPopup extends ModuleInfoWindow {
|
||||||
if(!outputCombo.getSelectedItem().toString().equals("jar")){ //jars don't get encoded
|
if(!outputCombo.getSelectedItem().toString().equals("jar")){ //jars don't get encoded
|
||||||
Map encoded = (Map) rpcConn.execute("module.encode", buffer,
|
Map encoded = (Map) rpcConn.execute("module.encode", buffer,
|
||||||
encoderCombo.getSelectedItem().toString(),hash);
|
encoderCombo.getSelectedItem().toString(),hash);
|
||||||
if(rpcConn.type.equals("msg"))
|
buffer = (byte[])encoded.get("encoded");
|
||||||
buffer = (byte[])encoded.get("encoded");
|
|
||||||
else
|
|
||||||
buffer = Base64.decode(encoded.get("encoded").toString());
|
|
||||||
}
|
}
|
||||||
FileOutputStream fout = new FileOutputStream(outputPathField.getText());
|
FileOutputStream fout = new FileOutputStream(outputPathField.getText());
|
||||||
fout.write(buffer);
|
fout.write(buffer);
|
||||||
|
|
|
@ -27,10 +27,9 @@ import org.jdesktop.application.Task;
|
||||||
* @author scriptjunkie
|
* @author scriptjunkie
|
||||||
*/
|
*/
|
||||||
public abstract class RpcConnection {
|
public abstract class RpcConnection {
|
||||||
public String type = "msg";
|
|
||||||
protected String rpcToken;
|
protected String rpcToken;
|
||||||
protected Map callCache = new HashMap();
|
protected Map callCache = new HashMap();
|
||||||
public static String defaultUser = "msf",defaultPass = null, defaultHost = "127.0.0.1", defaultType = "msg";
|
public static String defaultUser = "msf",defaultPass = null, defaultHost = "127.0.0.1";
|
||||||
public static int defaultPort = 55553;
|
public static int defaultPort = 55553;
|
||||||
public static boolean defaultSsl = false;
|
public static boolean defaultSsl = false;
|
||||||
public static boolean disableDb = false;
|
public static boolean disableDb = false;
|
||||||
|
@ -56,12 +55,8 @@ public abstract class RpcConnection {
|
||||||
* @return A new RPC connection
|
* @return A new RPC connection
|
||||||
* @throws MsfException
|
* @throws MsfException
|
||||||
*/
|
*/
|
||||||
public static RpcConnection getConn(String type, String username, char[] password, String host, int port, boolean ssl) throws MsfException{
|
public static RpcConnection getConn(String username, char[] password, String host, int port, boolean ssl) throws MsfException{
|
||||||
RpcConnection conn;
|
RpcConnection conn = new MsgRpc();
|
||||||
if(type.toLowerCase().equals("xml"))
|
|
||||||
conn = new XmlRpc();
|
|
||||||
else
|
|
||||||
conn = new MsgRpc();
|
|
||||||
conn.setup(username, password, host, port, ssl);
|
conn.setup(username, password, host, port, ssl);
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +104,6 @@ public abstract class RpcConnection {
|
||||||
root.put("port", port);
|
root.put("port", port);
|
||||||
root.put("ssl", ssl);
|
root.put("ssl", ssl);
|
||||||
root.put("disableDb", disableDb);
|
root.put("disableDb", disableDb);
|
||||||
root.put("type", type);
|
|
||||||
MsfguiApp.savePreferences();
|
MsfguiApp.savePreferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +163,6 @@ public abstract class RpcConnection {
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return "RPC connection "
|
return "RPC connection "
|
||||||
+ "\ntype: "+type
|
|
||||||
+ "\nusername: "+username
|
+ "\nusername: "+username
|
||||||
+ "\npassword: " + password
|
+ "\npassword: " + password
|
||||||
+ "\nhost: " + host
|
+ "\nhost: " + host
|
||||||
|
@ -265,10 +258,8 @@ public abstract class RpcConnection {
|
||||||
|
|
||||||
// Don't fork cause we'll check if it dies
|
// Don't fork cause we'll check if it dies
|
||||||
String rpcType = "Basic";
|
String rpcType = "Basic";
|
||||||
if(defaultType.toLowerCase().equals("msg"))
|
|
||||||
rpcType = "Msg";
|
|
||||||
java.util.List args = new java.util.ArrayList(java.util.Arrays.asList(new String[]{
|
java.util.List args = new java.util.ArrayList(java.util.Arrays.asList(new String[]{
|
||||||
"msfrpcd","-f","-P",defaultPass,"-t",rpcType,"-U",defaultUser,"-a","127.0.0.1"}));
|
"msfrpcd","-f","-P",defaultPass,"-t","Msg","-U",defaultUser,"-a","127.0.0.1"}));
|
||||||
if(!defaultSsl)
|
if(!defaultSsl)
|
||||||
args.add("-S");
|
args.add("-S");
|
||||||
if(disableDb)
|
if(disableDb)
|
||||||
|
@ -296,7 +287,7 @@ public abstract class RpcConnection {
|
||||||
} //Nope. We're good.
|
} //Nope. We're good.
|
||||||
|
|
||||||
try {
|
try {
|
||||||
myRpcConn = RpcConnection.getConn(defaultType, defaultUser, defaultPass.toCharArray(), "127.0.0.1", defaultPort, defaultSsl);
|
myRpcConn = RpcConnection.getConn(defaultUser, defaultPass.toCharArray(), "127.0.0.1", defaultPort, defaultSsl);
|
||||||
connected = true;
|
connected = true;
|
||||||
break;
|
break;
|
||||||
} catch (MsfException mex) {
|
} catch (MsfException mex) {
|
||||||
|
|
|
@ -33,7 +33,6 @@ public class XmlRpc extends RpcConnection {
|
||||||
*/
|
*/
|
||||||
public XmlRpc(){
|
public XmlRpc(){
|
||||||
super();
|
super();
|
||||||
type = "XML";
|
|
||||||
}
|
}
|
||||||
/** Creates an XMLRPC call from the given method name and parameters and sends it */
|
/** Creates an XMLRPC call from the given method name and parameters and sends it */
|
||||||
protected void writeCall(String methname, Object[] params) throws Exception{
|
protected void writeCall(String methname, Object[] params) throws Exception{
|
||||||
|
|
|
@ -17,5 +17,3 @@ sslBox.text=
|
||||||
sslLabel.text=SSL
|
sslLabel.text=SSL
|
||||||
disableDbButton.text=
|
disableDbButton.text=
|
||||||
disableDbLabel.text=Disable DB
|
disableDbLabel.text=Disable DB
|
||||||
xmlButton.text=XML
|
|
||||||
msgpackButton.text=MsgPack
|
|
||||||
|
|
Loading…
Reference in New Issue