Initial commit of Java Metasploit GUI source. Netbeans project files included.
git-svn-id: file:///home/svn/framework3/trunk@9815 4d416f70-5f16-0410-b530-b9f4589650daunstable
|
@ -0,0 +1,28 @@
|
||||||
|
Copyright (C) 2010, scriptjunkie
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of msfgui nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- You may freely edit this file. See commented blocks below for -->
|
||||||
|
<!-- some examples of how to customize the build. -->
|
||||||
|
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||||
|
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||||
|
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||||
|
<!-- the Compile on Save feature is turned off for the project. -->
|
||||||
|
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||||
|
<!-- in the project's Project Properties dialog box.-->
|
||||||
|
<project name="msfgui" default="default" basedir=".">
|
||||||
|
<description>Builds, tests, and runs the project msfgui.</description>
|
||||||
|
<import file="nbproject/build-impl.xml"/>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
There exist several targets which are by default empty and which can be
|
||||||
|
used for execution of your tasks. These targets are usually executed
|
||||||
|
before and after some main targets. They are:
|
||||||
|
|
||||||
|
-pre-init: called before initialization of project properties
|
||||||
|
-post-init: called after initialization of project properties
|
||||||
|
-pre-compile: called before javac compilation
|
||||||
|
-post-compile: called after javac compilation
|
||||||
|
-pre-compile-single: called before javac compilation of single file
|
||||||
|
-post-compile-single: called after javac compilation of single file
|
||||||
|
-pre-compile-test: called before javac compilation of JUnit tests
|
||||||
|
-post-compile-test: called after javac compilation of JUnit tests
|
||||||
|
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||||
|
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||||
|
-pre-jar: called before JAR building
|
||||||
|
-post-jar: called after JAR building
|
||||||
|
-post-clean: called after cleaning build products
|
||||||
|
|
||||||
|
(Targets beginning with '-' are not intended to be called on their own.)
|
||||||
|
|
||||||
|
Example of inserting an obfuscator after compilation could look like this:
|
||||||
|
|
||||||
|
<target name="-post-compile">
|
||||||
|
<obfuscate>
|
||||||
|
<fileset dir="${build.classes.dir}"/>
|
||||||
|
</obfuscate>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
For list of available properties check the imported
|
||||||
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
|
|
||||||
|
Another way to customize the build is by overriding existing main targets.
|
||||||
|
The targets of interest are:
|
||||||
|
|
||||||
|
-init-macrodef-javac: defines macro for javac compilation
|
||||||
|
-init-macrodef-junit: defines macro for junit execution
|
||||||
|
-init-macrodef-debug: defines macro for class debugging
|
||||||
|
-init-macrodef-java: defines macro for class execution
|
||||||
|
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
||||||
|
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
||||||
|
run: execution of project
|
||||||
|
-javadoc-build: Javadoc generation
|
||||||
|
test-report: JUnit report generation
|
||||||
|
|
||||||
|
An example of overriding the target for project execution could look like this:
|
||||||
|
|
||||||
|
<target name="run" depends="msfgui-impl.jar">
|
||||||
|
<exec dir="bin" executable="launcher.exe">
|
||||||
|
<arg file="${dist.jar}"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
Notice that the overridden target depends on the jar target and not only on
|
||||||
|
the compile target as the regular run target does. Again, for a list of available
|
||||||
|
properties which you can use, check the target you are overriding in the
|
||||||
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
|
-->
|
||||||
|
</project>
|
|
@ -0,0 +1,3 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
X-COMMENT: Main-Class will be added automatically by build
|
||||||
|
SplashScreen-Image: msfgui/resources/splash.png
|
|
@ -0,0 +1,805 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||||
|
*** EDIT ../build.xml INSTEAD ***
|
||||||
|
|
||||||
|
For the purpose of easier reading the script
|
||||||
|
is divided into following sections:
|
||||||
|
|
||||||
|
- initialization
|
||||||
|
- compilation
|
||||||
|
- jar
|
||||||
|
- execution
|
||||||
|
- debugging
|
||||||
|
- javadoc
|
||||||
|
- junit compilation
|
||||||
|
- junit execution
|
||||||
|
- junit debugging
|
||||||
|
- applet
|
||||||
|
- cleanup
|
||||||
|
|
||||||
|
-->
|
||||||
|
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="msfgui-impl">
|
||||||
|
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||||
|
<condition>
|
||||||
|
<not>
|
||||||
|
<antversion atleast="1.7.1"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
|
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
|
||||||
|
<!--
|
||||||
|
======================
|
||||||
|
INITIALIZATION SECTION
|
||||||
|
======================
|
||||||
|
-->
|
||||||
|
<target name="-pre-init">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="-pre-init" name="-init-private">
|
||||||
|
<property file="nbproject/private/config.properties"/>
|
||||||
|
<property file="nbproject/private/configs/${config}.properties"/>
|
||||||
|
<property file="nbproject/private/private.properties"/>
|
||||||
|
</target>
|
||||||
|
<target depends="-pre-init,-init-private" name="-init-user">
|
||||||
|
<property file="${user.properties.file}"/>
|
||||||
|
<!-- The two properties below are usually overridden -->
|
||||||
|
<!-- by the active platform. Just a fallback. -->
|
||||||
|
<property name="default.javac.source" value="1.4"/>
|
||||||
|
<property name="default.javac.target" value="1.4"/>
|
||||||
|
</target>
|
||||||
|
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
|
||||||
|
<property file="nbproject/configs/${config}.properties"/>
|
||||||
|
<property file="nbproject/project.properties"/>
|
||||||
|
</target>
|
||||||
|
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
|
||||||
|
<available file="${manifest.file}" property="manifest.available"/>
|
||||||
|
<condition property="main.class.available">
|
||||||
|
<and>
|
||||||
|
<isset property="main.class"/>
|
||||||
|
<not>
|
||||||
|
<equals arg1="${main.class}" arg2="" trim="true"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="manifest.available+main.class">
|
||||||
|
<and>
|
||||||
|
<isset property="manifest.available"/>
|
||||||
|
<isset property="main.class.available"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="do.mkdist">
|
||||||
|
<and>
|
||||||
|
<isset property="libs.CopyLibs.classpath"/>
|
||||||
|
<not>
|
||||||
|
<istrue value="${mkdist.disabled}"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="manifest.available+main.class+mkdist.available">
|
||||||
|
<and>
|
||||||
|
<istrue value="${manifest.available+main.class}"/>
|
||||||
|
<isset property="do.mkdist"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="manifest.available+mkdist.available">
|
||||||
|
<and>
|
||||||
|
<istrue value="${manifest.available}"/>
|
||||||
|
<isset property="do.mkdist"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="manifest.available-mkdist.available">
|
||||||
|
<or>
|
||||||
|
<istrue value="${manifest.available}"/>
|
||||||
|
<isset property="do.mkdist"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<condition property="manifest.available+main.class-mkdist.available">
|
||||||
|
<or>
|
||||||
|
<istrue value="${manifest.available+main.class}"/>
|
||||||
|
<isset property="do.mkdist"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<condition property="have.tests">
|
||||||
|
<or>
|
||||||
|
<available file="${test.src.dir}"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<condition property="have.sources">
|
||||||
|
<or>
|
||||||
|
<available file="${src.dir}"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<condition property="netbeans.home+have.tests">
|
||||||
|
<and>
|
||||||
|
<isset property="netbeans.home"/>
|
||||||
|
<isset property="have.tests"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="no.javadoc.preview">
|
||||||
|
<and>
|
||||||
|
<isset property="javadoc.preview"/>
|
||||||
|
<isfalse value="${javadoc.preview}"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<property name="run.jvmargs" value=""/>
|
||||||
|
<property name="javac.compilerargs" value=""/>
|
||||||
|
<property name="work.dir" value="${basedir}"/>
|
||||||
|
<condition property="no.deps">
|
||||||
|
<and>
|
||||||
|
<istrue value="${no.dependencies}"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<property name="javac.debug" value="true"/>
|
||||||
|
<property name="javadoc.preview" value="true"/>
|
||||||
|
<property name="application.args" value=""/>
|
||||||
|
<property name="source.encoding" value="${file.encoding}"/>
|
||||||
|
<property name="runtime.encoding" value="${source.encoding}"/>
|
||||||
|
<condition property="javadoc.encoding.used" value="${javadoc.encoding}">
|
||||||
|
<and>
|
||||||
|
<isset property="javadoc.encoding"/>
|
||||||
|
<not>
|
||||||
|
<equals arg1="${javadoc.encoding}" arg2=""/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<property name="javadoc.encoding.used" value="${source.encoding}"/>
|
||||||
|
<property name="includes" value="**"/>
|
||||||
|
<property name="excludes" value=""/>
|
||||||
|
<property name="do.depend" value="false"/>
|
||||||
|
<condition property="do.depend.true">
|
||||||
|
<istrue value="${do.depend}"/>
|
||||||
|
</condition>
|
||||||
|
<path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
|
||||||
|
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
|
||||||
|
<length length="0" string="${endorsed.classpath}" when="greater"/>
|
||||||
|
</condition>
|
||||||
|
<property name="javac.fork" value="false"/>
|
||||||
|
</target>
|
||||||
|
<target name="-post-init">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
|
||||||
|
<fail unless="src.dir">Must set src.dir</fail>
|
||||||
|
<fail unless="test.src.dir">Must set test.src.dir</fail>
|
||||||
|
<fail unless="build.dir">Must set build.dir</fail>
|
||||||
|
<fail unless="dist.dir">Must set dist.dir</fail>
|
||||||
|
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
|
||||||
|
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
|
||||||
|
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
|
||||||
|
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
|
||||||
|
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
|
||||||
|
<fail unless="dist.jar">Must set dist.jar</fail>
|
||||||
|
</target>
|
||||||
|
<target name="-init-macrodef-property">
|
||||||
|
<macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
|
||||||
|
<attribute name="name"/>
|
||||||
|
<attribute name="value"/>
|
||||||
|
<sequential>
|
||||||
|
<property name="@{name}" value="${@{value}}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target name="-init-macrodef-javac">
|
||||||
|
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<attribute default="${src.dir}" name="srcdir"/>
|
||||||
|
<attribute default="${build.classes.dir}" name="destdir"/>
|
||||||
|
<attribute default="${javac.classpath}" name="classpath"/>
|
||||||
|
<attribute default="${includes}" name="includes"/>
|
||||||
|
<attribute default="${excludes}" name="excludes"/>
|
||||||
|
<attribute default="${javac.debug}" name="debug"/>
|
||||||
|
<attribute default="${empty.dir}" name="sourcepath"/>
|
||||||
|
<attribute default="${empty.dir}" name="gensrcdir"/>
|
||||||
|
<element name="customize" optional="true"/>
|
||||||
|
<sequential>
|
||||||
|
<property location="${build.dir}/empty" name="empty.dir"/>
|
||||||
|
<mkdir dir="${empty.dir}"/>
|
||||||
|
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
||||||
|
<src>
|
||||||
|
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
||||||
|
<include name="*"/>
|
||||||
|
</dirset>
|
||||||
|
</src>
|
||||||
|
<classpath>
|
||||||
|
<path path="@{classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
<compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
|
||||||
|
<compilerarg line="${javac.compilerargs}"/>
|
||||||
|
<customize/>
|
||||||
|
</javac>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<attribute default="${src.dir}" name="srcdir"/>
|
||||||
|
<attribute default="${build.classes.dir}" name="destdir"/>
|
||||||
|
<attribute default="${javac.classpath}" name="classpath"/>
|
||||||
|
<sequential>
|
||||||
|
<depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
|
||||||
|
<classpath>
|
||||||
|
<path path="@{classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
</depend>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<attribute default="${build.classes.dir}" name="destdir"/>
|
||||||
|
<sequential>
|
||||||
|
<fail unless="javac.includes">Must set javac.includes</fail>
|
||||||
|
<pathconvert pathsep="," property="javac.includes.binary">
|
||||||
|
<path>
|
||||||
|
<filelist dir="@{destdir}" files="${javac.includes}"/>
|
||||||
|
</path>
|
||||||
|
<globmapper from="*.java" to="*.class"/>
|
||||||
|
</pathconvert>
|
||||||
|
<delete>
|
||||||
|
<files includes="${javac.includes.binary}"/>
|
||||||
|
</delete>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target name="-init-macrodef-junit">
|
||||||
|
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<attribute default="${includes}" name="includes"/>
|
||||||
|
<attribute default="${excludes}" name="excludes"/>
|
||||||
|
<attribute default="**" name="testincludes"/>
|
||||||
|
<sequential>
|
||||||
|
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
|
||||||
|
<batchtest todir="${build.test.results.dir}">
|
||||||
|
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
|
||||||
|
<filename name="@{testincludes}"/>
|
||||||
|
</fileset>
|
||||||
|
</batchtest>
|
||||||
|
<classpath>
|
||||||
|
<path path="${run.test.classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
<syspropertyset>
|
||||||
|
<propertyref prefix="test-sys-prop."/>
|
||||||
|
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
||||||
|
</syspropertyset>
|
||||||
|
<formatter type="brief" usefile="false"/>
|
||||||
|
<formatter type="xml"/>
|
||||||
|
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
||||||
|
<jvmarg line="${run.jvmargs}"/>
|
||||||
|
</junit>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
|
||||||
|
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
|
||||||
|
<attribute default="${main.class}" name="name"/>
|
||||||
|
<attribute default="${debug.classpath}" name="classpath"/>
|
||||||
|
<attribute default="" name="stopclassname"/>
|
||||||
|
<sequential>
|
||||||
|
<nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
|
||||||
|
<classpath>
|
||||||
|
<path path="@{classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
</nbjpdastart>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
|
||||||
|
<attribute default="${build.classes.dir}" name="dir"/>
|
||||||
|
<sequential>
|
||||||
|
<nbjpdareload>
|
||||||
|
<fileset dir="@{dir}" includes="${fix.classes}">
|
||||||
|
<include name="${fix.includes}*.class"/>
|
||||||
|
</fileset>
|
||||||
|
</nbjpdareload>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target name="-init-debug-args">
|
||||||
|
<property name="version-output" value="java version "${ant.java.version}"/>
|
||||||
|
<condition property="have-jdk-older-than-1.4">
|
||||||
|
<or>
|
||||||
|
<contains string="${version-output}" substring="java version "1.0"/>
|
||||||
|
<contains string="${version-output}" substring="java version "1.1"/>
|
||||||
|
<contains string="${version-output}" substring="java version "1.2"/>
|
||||||
|
<contains string="${version-output}" substring="java version "1.3"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
|
||||||
|
<istrue value="${have-jdk-older-than-1.4}"/>
|
||||||
|
</condition>
|
||||||
|
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
|
||||||
|
<os family="windows"/>
|
||||||
|
</condition>
|
||||||
|
<condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
|
||||||
|
<isset property="debug.transport"/>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
<target depends="-init-debug-args" name="-init-macrodef-debug">
|
||||||
|
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<attribute default="${main.class}" name="classname"/>
|
||||||
|
<attribute default="${debug.classpath}" name="classpath"/>
|
||||||
|
<element name="customize" optional="true"/>
|
||||||
|
<sequential>
|
||||||
|
<java classname="@{classname}" dir="${work.dir}" fork="true">
|
||||||
|
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
||||||
|
<jvmarg line="${debug-args-line}"/>
|
||||||
|
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
||||||
|
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
|
||||||
|
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
|
||||||
|
<jvmarg line="${run.jvmargs}"/>
|
||||||
|
<classpath>
|
||||||
|
<path path="@{classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
<syspropertyset>
|
||||||
|
<propertyref prefix="run-sys-prop."/>
|
||||||
|
<mapper from="run-sys-prop.*" to="*" type="glob"/>
|
||||||
|
</syspropertyset>
|
||||||
|
<customize/>
|
||||||
|
</java>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target name="-init-macrodef-java">
|
||||||
|
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
|
||||||
|
<attribute default="${main.class}" name="classname"/>
|
||||||
|
<attribute default="${run.classpath}" name="classpath"/>
|
||||||
|
<element name="customize" optional="true"/>
|
||||||
|
<sequential>
|
||||||
|
<java classname="@{classname}" dir="${work.dir}" fork="true">
|
||||||
|
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
||||||
|
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
|
||||||
|
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
|
||||||
|
<jvmarg line="${run.jvmargs}"/>
|
||||||
|
<classpath>
|
||||||
|
<path path="@{classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
<syspropertyset>
|
||||||
|
<propertyref prefix="run-sys-prop."/>
|
||||||
|
<mapper from="run-sys-prop.*" to="*" type="glob"/>
|
||||||
|
</syspropertyset>
|
||||||
|
<customize/>
|
||||||
|
</java>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target name="-init-presetdef-jar">
|
||||||
|
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
|
||||||
|
<jar compress="${jar.compress}" jarfile="${dist.jar}">
|
||||||
|
<j2seproject1:fileset dir="${build.classes.dir}"/>
|
||||||
|
</jar>
|
||||||
|
</presetdef>
|
||||||
|
</target>
|
||||||
|
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
|
||||||
|
<!--
|
||||||
|
===================
|
||||||
|
COMPILATION SECTION
|
||||||
|
===================
|
||||||
|
-->
|
||||||
|
<target name="-deps-jar-init" unless="built-jar.properties">
|
||||||
|
<property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
|
||||||
|
<delete file="${built-jar.properties}" quiet="true"/>
|
||||||
|
</target>
|
||||||
|
<target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
|
||||||
|
<echo level="warn" message="Cycle detected: msfgui was already built"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
|
||||||
|
<mkdir dir="${build.dir}"/>
|
||||||
|
<touch file="${built-jar.properties}" verbose="false"/>
|
||||||
|
<property file="${built-jar.properties}" prefix="already.built.jar."/>
|
||||||
|
<antcall target="-warn-already-built-jar"/>
|
||||||
|
<propertyfile file="${built-jar.properties}">
|
||||||
|
<entry key="${basedir}" value=""/>
|
||||||
|
</propertyfile>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
|
||||||
|
<target depends="init" name="-check-automatic-build">
|
||||||
|
<available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
|
||||||
|
<antcall target="clean"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,deps-jar" name="-pre-pre-compile">
|
||||||
|
<mkdir dir="${build.classes.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target name="-pre-compile">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target if="do.depend.true" name="-compile-depend">
|
||||||
|
<pathconvert property="build.generated.subdirs">
|
||||||
|
<dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
|
||||||
|
<include name="*"/>
|
||||||
|
</dirset>
|
||||||
|
</pathconvert>
|
||||||
|
<j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
|
||||||
|
<j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
|
||||||
|
<copy todir="${build.classes.dir}">
|
||||||
|
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
<target name="-post-compile">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
|
||||||
|
<target name="-pre-compile-single">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
|
||||||
|
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
|
||||||
|
<j2seproject3:force-recompile/>
|
||||||
|
<j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target name="-post-compile-single">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
|
||||||
|
<!--
|
||||||
|
====================
|
||||||
|
JAR BUILDING SECTION
|
||||||
|
====================
|
||||||
|
-->
|
||||||
|
<target depends="init" name="-pre-pre-jar">
|
||||||
|
<dirname file="${dist.jar}" property="dist.jar.dir"/>
|
||||||
|
<mkdir dir="${dist.jar.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target name="-pre-jar">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
|
||||||
|
<j2seproject1:jar/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
|
||||||
|
<j2seproject1:jar manifest="${manifest.file}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
|
||||||
|
<j2seproject1:jar manifest="${manifest.file}">
|
||||||
|
<j2seproject1:manifest>
|
||||||
|
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
|
||||||
|
</j2seproject1:manifest>
|
||||||
|
</j2seproject1:jar>
|
||||||
|
<echo>To run this application from the command line without Ant, try:</echo>
|
||||||
|
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
||||||
|
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
||||||
|
<pathconvert property="run.classpath.with.dist.jar">
|
||||||
|
<path path="${run.classpath}"/>
|
||||||
|
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
|
||||||
|
</pathconvert>
|
||||||
|
<echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
|
||||||
|
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
||||||
|
<pathconvert property="run.classpath.without.build.classes.dir">
|
||||||
|
<path path="${run.classpath}"/>
|
||||||
|
<map from="${build.classes.dir.resolved}" to=""/>
|
||||||
|
</pathconvert>
|
||||||
|
<pathconvert pathsep=" " property="jar.classpath">
|
||||||
|
<path path="${run.classpath.without.build.classes.dir}"/>
|
||||||
|
<chainedmapper>
|
||||||
|
<flattenmapper/>
|
||||||
|
<globmapper from="*" to="lib/*"/>
|
||||||
|
</chainedmapper>
|
||||||
|
</pathconvert>
|
||||||
|
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
||||||
|
<copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
||||||
|
<fileset dir="${build.classes.dir}"/>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Main-Class" value="${main.class}"/>
|
||||||
|
<attribute name="Class-Path" value="${jar.classpath}"/>
|
||||||
|
</manifest>
|
||||||
|
</copylibs>
|
||||||
|
<echo>To run this application from the command line without Ant, try:</echo>
|
||||||
|
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
||||||
|
<echo>java -jar "${dist.jar.resolved}"</echo>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+mkdist.available" name="-do-jar-with-libraries-without-mainclass" unless="main.class.available">
|
||||||
|
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
||||||
|
<pathconvert property="run.classpath.without.build.classes.dir">
|
||||||
|
<path path="${run.classpath}"/>
|
||||||
|
<map from="${build.classes.dir.resolved}" to=""/>
|
||||||
|
</pathconvert>
|
||||||
|
<pathconvert pathsep=" " property="jar.classpath">
|
||||||
|
<path path="${run.classpath.without.build.classes.dir}"/>
|
||||||
|
<chainedmapper>
|
||||||
|
<flattenmapper/>
|
||||||
|
<globmapper from="*" to="lib/*"/>
|
||||||
|
</chainedmapper>
|
||||||
|
</pathconvert>
|
||||||
|
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
||||||
|
<copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
||||||
|
<fileset dir="${build.classes.dir}"/>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Class-Path" value="${jar.classpath}"/>
|
||||||
|
</manifest>
|
||||||
|
</copylibs>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.mkdist" name="-do-jar-with-libraries-without-manifest" unless="manifest.available">
|
||||||
|
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
||||||
|
<pathconvert property="run.classpath.without.build.classes.dir">
|
||||||
|
<path path="${run.classpath}"/>
|
||||||
|
<map from="${build.classes.dir.resolved}" to=""/>
|
||||||
|
</pathconvert>
|
||||||
|
<pathconvert pathsep=" " property="jar.classpath">
|
||||||
|
<path path="${run.classpath.without.build.classes.dir}"/>
|
||||||
|
<chainedmapper>
|
||||||
|
<flattenmapper/>
|
||||||
|
<globmapper from="*" to="lib/*"/>
|
||||||
|
</chainedmapper>
|
||||||
|
</pathconvert>
|
||||||
|
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
||||||
|
<copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
||||||
|
<fileset dir="${build.classes.dir}"/>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Class-Path" value="${jar.classpath}"/>
|
||||||
|
</manifest>
|
||||||
|
</copylibs>
|
||||||
|
</target>
|
||||||
|
<target name="-post-jar">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-mainclass,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/>
|
||||||
|
<!--
|
||||||
|
=================
|
||||||
|
EXECUTION SECTION
|
||||||
|
=================
|
||||||
|
-->
|
||||||
|
<target depends="init,compile" description="Run a main class." name="run">
|
||||||
|
<j2seproject1:java>
|
||||||
|
<customize>
|
||||||
|
<arg line="${application.args}"/>
|
||||||
|
</customize>
|
||||||
|
</j2seproject1:java>
|
||||||
|
</target>
|
||||||
|
<target name="-do-not-recompile">
|
||||||
|
<property name="javac.includes.binary" value=""/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-single" name="run-single">
|
||||||
|
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
|
||||||
|
<j2seproject1:java classname="${run.class}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test-single" name="run-test-with-main">
|
||||||
|
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
|
||||||
|
<j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
|
||||||
|
</target>
|
||||||
|
<!--
|
||||||
|
=================
|
||||||
|
DEBUGGING SECTION
|
||||||
|
=================
|
||||||
|
-->
|
||||||
|
<target depends="init" if="netbeans.home" name="-debug-start-debugger">
|
||||||
|
<j2seproject1:nbjpdastart name="${debug.class}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
|
||||||
|
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile" name="-debug-start-debuggee">
|
||||||
|
<j2seproject3:debug>
|
||||||
|
<customize>
|
||||||
|
<arg line="${application.args}"/>
|
||||||
|
</customize>
|
||||||
|
</j2seproject3:debug>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
|
||||||
|
<target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
|
||||||
|
<j2seproject1:nbjpdastart stopclassname="${main.class}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
|
||||||
|
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
|
||||||
|
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
|
||||||
|
<j2seproject3:debug classname="${debug.class}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
|
||||||
|
<target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
|
||||||
|
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
|
||||||
|
<j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
|
||||||
|
<target depends="init" name="-pre-debug-fix">
|
||||||
|
<fail unless="fix.includes">Must set fix.includes</fail>
|
||||||
|
<property name="javac.includes" value="${fix.includes}.java"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
|
||||||
|
<j2seproject1:nbjpdareload/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
|
||||||
|
<!--
|
||||||
|
===============
|
||||||
|
JAVADOC SECTION
|
||||||
|
===============
|
||||||
|
-->
|
||||||
|
<target depends="init" name="-javadoc-build">
|
||||||
|
<mkdir dir="${dist.javadoc.dir}"/>
|
||||||
|
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||||
|
<classpath>
|
||||||
|
<path path="${javac.classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||||
|
<filename name="**/*.java"/>
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
|
||||||
|
<include name="**/*.java"/>
|
||||||
|
</fileset>
|
||||||
|
</javadoc>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
|
||||||
|
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
|
||||||
|
<!--
|
||||||
|
=========================
|
||||||
|
JUNIT COMPILATION SECTION
|
||||||
|
=========================
|
||||||
|
-->
|
||||||
|
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
|
||||||
|
<mkdir dir="${build.test.classes.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target name="-pre-compile-test">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target if="do.depend.true" name="-compile-test-depend">
|
||||||
|
<j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
|
||||||
|
<j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
|
||||||
|
<copy todir="${build.test.classes.dir}">
|
||||||
|
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
<target name="-post-compile-test">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
|
||||||
|
<target name="-pre-compile-test-single">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
|
||||||
|
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
|
||||||
|
<j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
|
||||||
|
<j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
|
||||||
|
<copy todir="${build.test.classes.dir}">
|
||||||
|
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
<target name="-post-compile-test-single">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
|
||||||
|
<!--
|
||||||
|
=======================
|
||||||
|
JUNIT EXECUTION SECTION
|
||||||
|
=======================
|
||||||
|
-->
|
||||||
|
<target depends="init" if="have.tests" name="-pre-test-run">
|
||||||
|
<mkdir dir="${build.test.results.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
|
||||||
|
<j2seproject3:junit testincludes="**/*Test.java"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
|
||||||
|
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
|
||||||
|
</target>
|
||||||
|
<target depends="init" if="have.tests" name="test-report"/>
|
||||||
|
<target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
|
||||||
|
<target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
|
||||||
|
<target depends="init" if="have.tests" name="-pre-test-run-single">
|
||||||
|
<mkdir dir="${build.test.results.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
|
||||||
|
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
|
||||||
|
<j2seproject3:junit excludes="" includes="${test.includes}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
|
||||||
|
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
|
||||||
|
<!--
|
||||||
|
=======================
|
||||||
|
JUNIT DEBUGGING SECTION
|
||||||
|
=======================
|
||||||
|
-->
|
||||||
|
<target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
|
||||||
|
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
|
||||||
|
<property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
|
||||||
|
<delete file="${test.report.file}"/>
|
||||||
|
<mkdir dir="${build.test.results.dir}"/>
|
||||||
|
<j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
|
||||||
|
<customize>
|
||||||
|
<syspropertyset>
|
||||||
|
<propertyref prefix="test-sys-prop."/>
|
||||||
|
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
||||||
|
</syspropertyset>
|
||||||
|
<arg value="${test.class}"/>
|
||||||
|
<arg value="showoutput=true"/>
|
||||||
|
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
|
||||||
|
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
|
||||||
|
</customize>
|
||||||
|
</j2seproject3:debug>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
|
||||||
|
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
|
||||||
|
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
|
||||||
|
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
|
||||||
|
<!--
|
||||||
|
=========================
|
||||||
|
APPLET EXECUTION SECTION
|
||||||
|
=========================
|
||||||
|
-->
|
||||||
|
<target depends="init,compile-single" name="run-applet">
|
||||||
|
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
|
||||||
|
<j2seproject1:java classname="sun.applet.AppletViewer">
|
||||||
|
<customize>
|
||||||
|
<arg value="${applet.url}"/>
|
||||||
|
</customize>
|
||||||
|
</j2seproject1:java>
|
||||||
|
</target>
|
||||||
|
<!--
|
||||||
|
=========================
|
||||||
|
APPLET DEBUGGING SECTION
|
||||||
|
=========================
|
||||||
|
-->
|
||||||
|
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
|
||||||
|
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
|
||||||
|
<j2seproject3:debug classname="sun.applet.AppletViewer">
|
||||||
|
<customize>
|
||||||
|
<arg value="${applet.url}"/>
|
||||||
|
</customize>
|
||||||
|
</j2seproject3:debug>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
|
||||||
|
<!--
|
||||||
|
===============
|
||||||
|
CLEANUP SECTION
|
||||||
|
===============
|
||||||
|
-->
|
||||||
|
<target name="-deps-clean-init" unless="built-clean.properties">
|
||||||
|
<property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
|
||||||
|
<delete file="${built-clean.properties}" quiet="true"/>
|
||||||
|
</target>
|
||||||
|
<target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
|
||||||
|
<echo level="warn" message="Cycle detected: msfgui was already built"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
|
||||||
|
<mkdir dir="${build.dir}"/>
|
||||||
|
<touch file="${built-clean.properties}" verbose="false"/>
|
||||||
|
<property file="${built-clean.properties}" prefix="already.built.clean."/>
|
||||||
|
<antcall target="-warn-already-built-clean"/>
|
||||||
|
<propertyfile file="${built-clean.properties}">
|
||||||
|
<entry key="${basedir}" value=""/>
|
||||||
|
</propertyfile>
|
||||||
|
</target>
|
||||||
|
<target depends="init" name="-do-clean">
|
||||||
|
<delete dir="${build.dir}"/>
|
||||||
|
<delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
|
||||||
|
</target>
|
||||||
|
<target name="-post-clean">
|
||||||
|
<!-- Empty placeholder for easier customization. -->
|
||||||
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
|
</target>
|
||||||
|
<target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
|
||||||
|
<target name="-check-call-dep">
|
||||||
|
<property file="${call.built.properties}" prefix="already.built."/>
|
||||||
|
<condition property="should.call.dep">
|
||||||
|
<not>
|
||||||
|
<isset property="already.built.${call.subproject}"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
<target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
|
||||||
|
<ant antfile="${call.script}" inheritall="false" target="${call.target}">
|
||||||
|
<propertyset>
|
||||||
|
<propertyref prefix="transfer."/>
|
||||||
|
<mapper from="transfer.*" to="*" type="glob"/>
|
||||||
|
</propertyset>
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
</project>
|
|
@ -0,0 +1,8 @@
|
||||||
|
build.xml.data.CRC32=84c180dd
|
||||||
|
build.xml.script.CRC32=7b4769ae
|
||||||
|
build.xml.stylesheet.CRC32=958a1d3e@1.32.1.45
|
||||||
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
|
nbproject/build-impl.xml.data.CRC32=84c180dd
|
||||||
|
nbproject/build-impl.xml.script.CRC32=f85285ea
|
||||||
|
nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45
|
|
@ -0,0 +1,67 @@
|
||||||
|
application.desc=A simple java desktop application based on Swing Application Framework
|
||||||
|
application.homepage=http://appframework.dev.java.net
|
||||||
|
application.title=Basic Application Example
|
||||||
|
application.vendor=Sun Microsystems Inc.
|
||||||
|
build.classes.dir=${build.dir}/classes
|
||||||
|
build.classes.excludes=**/*.form,**/*.java
|
||||||
|
# This directory is removed when the project is cleaned:
|
||||||
|
build.dir=build
|
||||||
|
build.generated.dir=${build.dir}/generated
|
||||||
|
build.generated.sources.dir=${build.dir}/generated-sources
|
||||||
|
# Only compile against the classpath explicitly listed here:
|
||||||
|
build.sysclasspath=ignore
|
||||||
|
build.test.classes.dir=${build.dir}/test/classes
|
||||||
|
build.test.results.dir=${build.dir}/test/results
|
||||||
|
debug.classpath=\
|
||||||
|
${run.classpath}
|
||||||
|
debug.test.classpath=\
|
||||||
|
${run.test.classpath}
|
||||||
|
# This directory is removed when the project is cleaned:
|
||||||
|
dist.dir=dist
|
||||||
|
dist.jar=${dist.dir}/msfgui.jar
|
||||||
|
dist.javadoc.dir=${dist.dir}/javadoc
|
||||||
|
endorsed.classpath=
|
||||||
|
excludes=
|
||||||
|
includes=**
|
||||||
|
jar.compress=false
|
||||||
|
javac.classpath=\
|
||||||
|
${libs.swing-app-framework.classpath}
|
||||||
|
# Space-separated list of extra javac options
|
||||||
|
javac.compilerargs=
|
||||||
|
javac.deprecation=false
|
||||||
|
javac.source=1.5
|
||||||
|
javac.target=1.5
|
||||||
|
javac.test.classpath=\
|
||||||
|
${javac.classpath}:\
|
||||||
|
${build.classes.dir}:\
|
||||||
|
${libs.junit.classpath}:\
|
||||||
|
${libs.junit_4.classpath}
|
||||||
|
javadoc.additionalparam=
|
||||||
|
javadoc.author=false
|
||||||
|
javadoc.encoding=${source.encoding}
|
||||||
|
javadoc.noindex=false
|
||||||
|
javadoc.nonavbar=false
|
||||||
|
javadoc.notree=false
|
||||||
|
javadoc.private=false
|
||||||
|
javadoc.splitindex=true
|
||||||
|
javadoc.use=true
|
||||||
|
javadoc.version=false
|
||||||
|
javadoc.windowtitle=
|
||||||
|
jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
|
||||||
|
main.class=msfgui.MsfguiApp
|
||||||
|
manifest.file=manifest.mf
|
||||||
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
|
platform.active=default_platform
|
||||||
|
run.classpath=\
|
||||||
|
${javac.classpath}:\
|
||||||
|
${build.classes.dir}
|
||||||
|
# Space-separated list of JVM arguments used when running the project
|
||||||
|
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
|
||||||
|
# or test-sys-prop.name=value to set system properties for unit tests):
|
||||||
|
run.jvmargs=
|
||||||
|
run.test.classpath=\
|
||||||
|
${javac.test.classpath}:\
|
||||||
|
${build.test.classes.dir}
|
||||||
|
source.encoding=UTF-8
|
||||||
|
src.dir=src
|
||||||
|
test.src.dir=test
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.java.j2seproject</type>
|
||||||
|
<configuration>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<name>msfgui</name>
|
||||||
|
<minimum-ant-version>1.6.5</minimum-ant-version>
|
||||||
|
<source-roots>
|
||||||
|
<root id="src.dir"/>
|
||||||
|
</source-roots>
|
||||||
|
<test-roots>
|
||||||
|
<root id="test.src.dir"/>
|
||||||
|
</test-roots>
|
||||||
|
</data>
|
||||||
|
<swingapp xmlns="http://www.netbeans.org/ns/form-swingapp/1">
|
||||||
|
<application-class name="msfgui.MsfguiApp"/>
|
||||||
|
</swingapp>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
1
external/source/gui/msfguijava/src/META-INF/services/org.jdesktop.application.Application
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
msfgui.MsfguiApp
|
|
@ -0,0 +1,110 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="addRouteButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="deleteRouteButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="subnetLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="ipField" pref="314" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="okButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="addRouteButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="deleteRouteButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="subnetLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="ipField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="addRouteButton">
|
||||||
|
<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="addRouteButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="addRouteButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="deleteRouteButton">
|
||||||
|
<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="deleteRouteButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="deleteRouteButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="subnetLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="subnetLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="subnetLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="ipField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="ipField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="ipField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,117 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class AutorouteOptionsDialog extends OptionsDialog {
|
||||||
|
|
||||||
|
/** Creates new form AutorouteOptionsDialog */
|
||||||
|
public AutorouteOptionsDialog(MainFrame parent, boolean modal) {
|
||||||
|
super(parent.getFrame(), "Autoroute Options", modal);
|
||||||
|
initComponents();
|
||||||
|
try{
|
||||||
|
ipField.setText(parent.session.get("tunnel_peer").toString().split(":")[0]+"/24");
|
||||||
|
}catch(NullPointerException nex){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
buttonGroup1 = new javax.swing.ButtonGroup();
|
||||||
|
addRouteButton = new javax.swing.JRadioButton();
|
||||||
|
deleteRouteButton = new javax.swing.JRadioButton();
|
||||||
|
subnetLabel = new javax.swing.JLabel();
|
||||||
|
ipField = new javax.swing.JTextField();
|
||||||
|
okButton = new javax.swing.JButton();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
|
buttonGroup1.add(addRouteButton);
|
||||||
|
addRouteButton.setSelected(true);
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(AutorouteOptionsDialog.class);
|
||||||
|
addRouteButton.setText(resourceMap.getString("addRouteButton.text")); // NOI18N
|
||||||
|
addRouteButton.setName("addRouteButton"); // NOI18N
|
||||||
|
|
||||||
|
buttonGroup1.add(deleteRouteButton);
|
||||||
|
deleteRouteButton.setText(resourceMap.getString("deleteRouteButton.text")); // NOI18N
|
||||||
|
deleteRouteButton.setName("deleteRouteButton"); // NOI18N
|
||||||
|
|
||||||
|
subnetLabel.setText(resourceMap.getString("subnetLabel.text")); // NOI18N
|
||||||
|
subnetLabel.setName("subnetLabel"); // NOI18N
|
||||||
|
|
||||||
|
ipField.setText(resourceMap.getString("ipField.text")); // NOI18N
|
||||||
|
ipField.setName("ipField"); // 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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(addRouteButton)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(deleteRouteButton))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(subnetLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(ipField, javax.swing.GroupLayout.DEFAULT_SIZE, 314, 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(addRouteButton)
|
||||||
|
.addComponent(deleteRouteButton))
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(subnetLabel)
|
||||||
|
.addComponent(ipField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(okButton)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||||
|
if(addRouteButton.isSelected())
|
||||||
|
command = "autoroute -s " + ipField.getText();
|
||||||
|
else
|
||||||
|
command = "autoroute -d -s " + ipField.getText();
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
}//GEN-LAST:event_okButtonActionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JRadioButton addRouteButton;
|
||||||
|
private javax.swing.ButtonGroup buttonGroup1;
|
||||||
|
private javax.swing.JRadioButton deleteRouteButton;
|
||||||
|
private javax.swing.JTextField ipField;
|
||||||
|
private javax.swing.JButton okButton;
|
||||||
|
private javax.swing.JLabel subnetLabel;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple Base64 encoding/decoding. Very loosely based on Apache Base64 class.
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class Base64 {
|
||||||
|
private static final char intToBase64[] = {
|
||||||
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
||||||
|
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
|
||||||
|
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
|
||||||
|
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
||||||
|
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
|
||||||
|
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
|
||||||
|
'8', '9', '+', '/'
|
||||||
|
};
|
||||||
|
private static final byte base64ToInt[] = {
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, -1, -1, 62, -1, -1, -1, 63, 52, 53,
|
||||||
|
54, 55, 56, 57, 58, 59, 60, 61, -1, -1,
|
||||||
|
-1, -1, -1, -1, -1, 0, 1, 2, 3, 4,
|
||||||
|
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||||
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
||||||
|
25, -1, -1, -1, -1, -1, -1, 26, 27, 28,
|
||||||
|
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
|
||||||
|
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
|
||||||
|
49, 50, 51
|
||||||
|
};
|
||||||
|
/** Converts a byte array to a bae64-encoded String. */
|
||||||
|
public static String encode(byte source[]) {
|
||||||
|
int offset = 0;
|
||||||
|
int num = 0;
|
||||||
|
int numBytes = 0;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < source.length; i++) {
|
||||||
|
int b = source[offset++];
|
||||||
|
if (b < 0)
|
||||||
|
b += 256;
|
||||||
|
num = (num << 8) + b;
|
||||||
|
if (++numBytes != 3)
|
||||||
|
continue;
|
||||||
|
sb.append(intToBase64[num >> 18]);
|
||||||
|
sb.append(intToBase64[num >> 12 & 0x3f]);
|
||||||
|
sb.append(intToBase64[num >> 6 & 0x3f]);
|
||||||
|
sb.append(intToBase64[num & 0x3f]);
|
||||||
|
num = 0;
|
||||||
|
numBytes = 0;
|
||||||
|
}
|
||||||
|
if (numBytes > 0) {
|
||||||
|
if (numBytes == 1) {
|
||||||
|
sb.append(intToBase64[num >> 2]);
|
||||||
|
sb.append(intToBase64[num << 4 & 0x3f]);
|
||||||
|
sb.append("==");
|
||||||
|
} else {
|
||||||
|
sb.append(intToBase64[num >> 10]);
|
||||||
|
sb.append(intToBase64[num >> 4 & 0x3f]);
|
||||||
|
sb.append(intToBase64[num << 2 & 0x3f]);
|
||||||
|
sb.append('=');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
/** Decodes a Base64-encoded String to a byte array. */
|
||||||
|
public static byte[] decode(String source) throws MsfException {
|
||||||
|
int num=0;
|
||||||
|
int numBytes=0;
|
||||||
|
int eofBytes = 0;
|
||||||
|
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||||
|
for (int i = 0; i < source.length(); i++) {
|
||||||
|
char c = source.charAt(i);
|
||||||
|
if (Character.isWhitespace(c))
|
||||||
|
continue;
|
||||||
|
if (c == '=') {
|
||||||
|
eofBytes++;
|
||||||
|
num = num << 6;
|
||||||
|
switch (++numBytes) {
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
throw new MsfException("Unexpected end of stream character (=)");
|
||||||
|
case 3:
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
bout.write((byte) (num >> 16));
|
||||||
|
if (eofBytes == 1)
|
||||||
|
bout.write((byte) (num >> 8));
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
throw new MsfException("Trailing garbage detected");
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("Invalid value for numBytes");
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (eofBytes > 0)
|
||||||
|
throw new MsfException("Base64 characters after end of stream character (=) detected.");
|
||||||
|
if (c >= 0 && c < Base64.base64ToInt.length) {
|
||||||
|
int result = Base64.base64ToInt[c];
|
||||||
|
if (result >= 0) {
|
||||||
|
num = (num << 6) + result;
|
||||||
|
if (++numBytes != 4)
|
||||||
|
continue;
|
||||||
|
bout.write((byte) (num >> 16));
|
||||||
|
bout.write((byte) (num >> 8 & 0xff));
|
||||||
|
bout.write((byte) (num & 0xff));
|
||||||
|
num = 0;
|
||||||
|
numBytes = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!Character.isWhitespace(c))
|
||||||
|
throw new MsfException("Invalid Base64 character: " + (int) c);
|
||||||
|
}
|
||||||
|
return bout.toByteArray();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="scrollPane" alignment="0" pref="686" max="32767" attributes="0"/>
|
||||||
|
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="saveButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="scrollPane" pref="629" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="saveButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="scrollPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="scrollPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="textBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="textBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="saveButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="saveButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="saveButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,109 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class EditorWindow extends MsfFrame {
|
||||||
|
/** Creates new form EditorWindow */
|
||||||
|
public EditorWindow(String text) {
|
||||||
|
initComponents();
|
||||||
|
textBox.setFont(new Font("Monospaced", textBox.getFont().getStyle(), 12));
|
||||||
|
textBox.setText(text);
|
||||||
|
}
|
||||||
|
/** Creates new form EditorWindow */
|
||||||
|
public EditorWindow(Collection info) {
|
||||||
|
this("");
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for(Object o : info)
|
||||||
|
sb.append(o+"\n");
|
||||||
|
textBox.setText(sb.toString());
|
||||||
|
setTitle("Collected hashes");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
scrollPane = new javax.swing.JScrollPane();
|
||||||
|
textBox = new javax.swing.JTextArea();
|
||||||
|
saveButton = new javax.swing.JButton();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
|
scrollPane.setName("scrollPane"); // NOI18N
|
||||||
|
|
||||||
|
textBox.setColumns(20);
|
||||||
|
textBox.setRows(5);
|
||||||
|
textBox.setName("textBox"); // NOI18N
|
||||||
|
scrollPane.setViewportView(textBox);
|
||||||
|
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(EditorWindow.class);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
|
||||||
|
jLabel1.setName("jLabel1"); // 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(scrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 686, Short.MAX_VALUE)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(saveButton, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(jLabel1)))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 629, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(saveButton)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
|
||||||
|
if(MsfguiApp.fileChooser.showSaveDialog(this) != javax.swing.JFileChooser.APPROVE_OPTION)
|
||||||
|
return;
|
||||||
|
try{
|
||||||
|
FileWriter fout = new FileWriter(MsfguiApp.fileChooser.getSelectedFile());
|
||||||
|
fout.write(textBox.getText());
|
||||||
|
fout.close();
|
||||||
|
}catch(IOException ex){
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_saveButtonActionPerformed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JButton saveButton;
|
||||||
|
private javax.swing.JScrollPane scrollPane;
|
||||||
|
private javax.swing.JTextArea textBox;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
|
||||||
|
<EventHandler event="windowOpened" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowOpened"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="inputField" pref="657" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="submitButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="outputScrollPane" alignment="0" pref="737" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="outputScrollPane" pref="533" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="inputField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="submitButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="outputScrollPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="autoscrolls" type="boolean" value="true"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputScrollPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="outputArea">
|
||||||
|
<Properties>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputArea" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JTextField" name="inputField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="inputField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="inputField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="inputFieldActionPerformed"/>
|
||||||
|
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="inputFieldKeyPressed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="submitButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="submitButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="submitButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="submitButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,228 @@
|
||||||
|
/*
|
||||||
|
* InteractWindow.java
|
||||||
|
*
|
||||||
|
* Created on May 15, 2010, 5:46:53 PM
|
||||||
|
*/
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import org.jdesktop.swingworker.SwingWorker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class InteractWindow extends MsfFrame {
|
||||||
|
public final ReentrantLock lock = new ReentrantLock();
|
||||||
|
public static final char POLL = 'r';
|
||||||
|
public static final char STOP_POLLING = 's';
|
||||||
|
private final Map session;
|
||||||
|
private final RpcConnection rpcConn;
|
||||||
|
private String type;
|
||||||
|
private StringBuffer timerCommand;//synchronized mutable object as command placeholder for polling thread
|
||||||
|
private static ArrayList commands;
|
||||||
|
private static int currentCommand = 0;
|
||||||
|
static{
|
||||||
|
commands = new ArrayList();
|
||||||
|
commands.add("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates a new window for interacting with shells/meterpreters */
|
||||||
|
public InteractWindow(final RpcConnection rpcConn, final Map session, final String type) {
|
||||||
|
super(type+" interaction window");
|
||||||
|
initComponents();
|
||||||
|
this.rpcConn = rpcConn;
|
||||||
|
this.session = session;
|
||||||
|
this.type = type;
|
||||||
|
timerCommand = new StringBuffer(""+POLL);
|
||||||
|
|
||||||
|
//start new thread polling for input
|
||||||
|
new SwingWorker() {
|
||||||
|
protected Object doInBackground() throws Exception {
|
||||||
|
long time = 100;
|
||||||
|
while (timerCommand.charAt(0) == POLL) {
|
||||||
|
if (lock.tryLock() == false) {
|
||||||
|
this.publish("locked");
|
||||||
|
lock.lock();
|
||||||
|
this.publish("unlocked");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
Map received = (Map) rpcConn.execute("session." + type + "_read", new Object[]{session.get("id")});
|
||||||
|
time = System.currentTimeMillis() - start;
|
||||||
|
if (!received.get("encoding").equals("base64"))
|
||||||
|
throw new MsfException("Uhoh. Unknown encoding. Time to update?");
|
||||||
|
byte[] decodedBytes = Base64.decode(received.get("data").toString());
|
||||||
|
if (decodedBytes.length > 0) {
|
||||||
|
outputArea.append(new String(decodedBytes));
|
||||||
|
if(decodedBytes[decodedBytes.length-1] != '\n')
|
||||||
|
outputArea.append("\n");//cause windows is just like that.
|
||||||
|
publish("data");
|
||||||
|
}
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
if(!ex.getMessage().equals("unknown session"))
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
timerCommand.setCharAt(0, STOP_POLLING);
|
||||||
|
}
|
||||||
|
lock.unlock();
|
||||||
|
try {
|
||||||
|
Thread.sleep(100 + (time * 3));// if it takes a long time to get data, ask for it slower
|
||||||
|
} catch (InterruptedException iex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
protected void process(List l){
|
||||||
|
for(Object o : l){
|
||||||
|
if(o.equals("locked")){
|
||||||
|
submitButton.setEnabled(false);
|
||||||
|
inputField.setEditable(false);
|
||||||
|
}else if(o.equals("unlocked")){
|
||||||
|
submitButton.setEnabled(true);
|
||||||
|
inputField.setEditable(true);
|
||||||
|
}else{
|
||||||
|
outputArea.setCaretPosition(outputArea.getDocument().getLength());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.execute();
|
||||||
|
|
||||||
|
if(type.equals("meterpreter"))
|
||||||
|
inputField.setText("help");
|
||||||
|
outputArea.setFont(new Font("Monospaced", outputArea.getFont().getStyle(), 12));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
outputScrollPane = new javax.swing.JScrollPane();
|
||||||
|
outputArea = new javax.swing.JTextArea();
|
||||||
|
inputField = new javax.swing.JTextField();
|
||||||
|
submitButton = new javax.swing.JButton();
|
||||||
|
|
||||||
|
addWindowListener(new java.awt.event.WindowAdapter() {
|
||||||
|
public void windowClosed(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowClosed(evt);
|
||||||
|
}
|
||||||
|
public void windowOpened(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowOpened(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
outputScrollPane.setAutoscrolls(true);
|
||||||
|
outputScrollPane.setName("outputScrollPane"); // NOI18N
|
||||||
|
|
||||||
|
outputArea.setColumns(20);
|
||||||
|
outputArea.setEditable(false);
|
||||||
|
outputArea.setRows(5);
|
||||||
|
outputArea.setName("outputArea"); // NOI18N
|
||||||
|
outputScrollPane.setViewportView(outputArea);
|
||||||
|
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(InteractWindow.class);
|
||||||
|
inputField.setText(resourceMap.getString("inputField.text")); // NOI18N
|
||||||
|
inputField.setName("inputField"); // NOI18N
|
||||||
|
inputField.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
inputFieldActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
inputField.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyPressed(java.awt.event.KeyEvent evt) {
|
||||||
|
inputFieldKeyPressed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
submitButton.setText(resourceMap.getString("submitButton.text")); // NOI18N
|
||||||
|
submitButton.setName("submitButton"); // NOI18N
|
||||||
|
submitButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
submitButtonActionPerformed(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(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(inputField, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(submitButton))
|
||||||
|
.addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 737, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 533, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(inputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(submitButton))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void inputFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inputFieldActionPerformed
|
||||||
|
try {
|
||||||
|
String command = inputField.getText();
|
||||||
|
commands.add(command);
|
||||||
|
String data = Base64.encode((command+"\n").getBytes());
|
||||||
|
rpcConn.execute("session."+type+"_write", new Object[]{session.get("id"),data});
|
||||||
|
outputArea.append(">>>"+command+"\n");
|
||||||
|
outputArea.setCaretPosition(outputArea.getDocument().getLength());
|
||||||
|
|
||||||
|
inputField.setText("");
|
||||||
|
currentCommand = 0;
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_inputFieldActionPerformed
|
||||||
|
|
||||||
|
private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitButtonActionPerformed
|
||||||
|
inputFieldActionPerformed(evt);
|
||||||
|
}//GEN-LAST:event_submitButtonActionPerformed
|
||||||
|
|
||||||
|
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
|
||||||
|
timerCommand.setCharAt(0, STOP_POLLING);
|
||||||
|
}//GEN-LAST:event_formWindowClosed
|
||||||
|
|
||||||
|
private void inputFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputFieldKeyPressed
|
||||||
|
if(evt.getKeyCode() == KeyEvent.VK_UP){
|
||||||
|
currentCommand = (currentCommand - 1 + commands.size()) % commands.size();
|
||||||
|
inputField.setText(commands.get(currentCommand).toString());
|
||||||
|
}else if(evt.getKeyCode() == KeyEvent.VK_DOWN){
|
||||||
|
currentCommand = (currentCommand + 1) % commands.size();
|
||||||
|
inputField.setText(commands.get(currentCommand).toString());
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_inputFieldKeyPressed
|
||||||
|
|
||||||
|
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
|
||||||
|
inputField.requestFocusInWindow();
|
||||||
|
}//GEN-LAST:event_formWindowOpened
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JTextField inputField;
|
||||||
|
private javax.swing.JTextArea outputArea;
|
||||||
|
private javax.swing.JScrollPane outputScrollPane;
|
||||||
|
private javax.swing.JButton submitButton;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="Form" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="okButton" alignment="1" min="-2" pref="67" max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="395" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" pref="358" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="textArea">
|
||||||
|
<Properties>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="lineWrap" type="boolean" value="true"/>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
<Property name="wrapStyleWord" type="boolean" value="true"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="textArea" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,132 @@
|
||||||
|
/*
|
||||||
|
* JobInfoPopup.java
|
||||||
|
*
|
||||||
|
* Created on May 19, 2010, 2:25:40 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class JobInfoPopup extends javax.swing.JDialog {
|
||||||
|
/** A return status code - returned if Cancel button has been pressed */
|
||||||
|
public static final int RET_CANCEL = 0;
|
||||||
|
/** A return status code - returned if OK button has been pressed */
|
||||||
|
public static final int RET_OK = 1;
|
||||||
|
|
||||||
|
/** Creates new form JobInfoPopup */
|
||||||
|
public JobInfoPopup(java.awt.Frame parent, boolean modal, Object text) {
|
||||||
|
super(parent, modal);
|
||||||
|
initComponents();
|
||||||
|
Map myMap = (Map)text;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for(Object oEntry : myMap.entrySet()){
|
||||||
|
Map.Entry entry = (Map.Entry)oEntry;
|
||||||
|
if(entry.getValue() instanceof Map){
|
||||||
|
sb.append(entry.getKey()+"\n");
|
||||||
|
for(Object osubEntry : ((Map)entry.getValue()).entrySet()){
|
||||||
|
Map.Entry subEntry = (Map.Entry)osubEntry;
|
||||||
|
sb.append(" "+subEntry.getKey()+ " = " + subEntry.getValue()+"\n");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
sb.append(entry.getKey()+ " = " + entry.getValue()+"\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
textArea.setText(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return the return status of this dialog - one of RET_OK or RET_CANCEL */
|
||||||
|
public int getReturnStatus() {
|
||||||
|
return returnStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
okButton = new javax.swing.JButton();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
textArea = new javax.swing.JTextArea();
|
||||||
|
|
||||||
|
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(JobInfoPopup.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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
jScrollPane1.setName("jScrollPane1"); // NOI18N
|
||||||
|
|
||||||
|
textArea.setColumns(20);
|
||||||
|
textArea.setLineWrap(true);
|
||||||
|
textArea.setRows(5);
|
||||||
|
textArea.setWrapStyleWord(true);
|
||||||
|
textArea.setName("textArea"); // NOI18N
|
||||||
|
jScrollPane1.setViewportView(textArea);
|
||||||
|
|
||||||
|
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(okButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(okButton)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||||
|
doClose(RET_OK);
|
||||||
|
}//GEN-LAST:event_okButtonActionPerformed
|
||||||
|
|
||||||
|
/** Closes the dialog */
|
||||||
|
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
|
||||||
|
doClose(RET_CANCEL);
|
||||||
|
}//GEN-LAST:event_closeDialog
|
||||||
|
|
||||||
|
private void doClose(int retStatus) {
|
||||||
|
returnStatus = retStatus;
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JButton okButton;
|
||||||
|
private javax.swing.JTextArea textArea;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
private int returnStatus = RET_CANCEL;
|
||||||
|
}
|
|
@ -0,0 +1,497 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="splitPane" pref="887" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="splitPane" pref="460" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JSplitPane" name="splitPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="null"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="lastDividerLocation" type="int" value="250"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="splitPane" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[30, 20]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="jobsPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jobsPanel" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[10, 19]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="left"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="37" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jobsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Component id="jobsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" pref="411" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jobsLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jobsLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jobsLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[10, 10]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JList" name="jobsList">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
|
||||||
|
<StringArray count="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="jobsList" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JPanel" name="sessionsPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="sessionsPanel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="right"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="sessionsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="710" max="32767" attributes="0"/>
|
||||||
|
<Component id="searchButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jScrollPane2" alignment="1" pref="845" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
|
||||||
|
<Component id="sessionsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="searchButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane2" pref="412" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="sessionsLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="sessionsLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="sessionsLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="sessionsTable">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
|
<Table columnCount="0" rowCount="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||||
|
<TableColumnModel selectionModel="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="sessionsTable" noResource="true"/>
|
||||||
|
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||||
|
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="searchButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="searchButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="searchButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="searchButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JMenuBar" name="menuBar">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="menuBar" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||||
|
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="fileMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="70"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="fileMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="fileMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="connectRpcMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="67"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="connectRpcMenuItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="connectRpcMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="connectRpcMenuItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="startRpcMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="83"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="startRpcMenuItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="startRpcMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jSeparator1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="changeLFMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="76"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="changeLFMenuItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="changeLFMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="changeLFMenuItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="exitMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||||
|
<action class="org.jdesktop.application.Application" id="quit" methodName="quit"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="exitMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exitMenuItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="exploitsMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="69"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="exploitsMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="exploitsMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="auxiliaryMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="65"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="auxiliaryMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="auxiliaryMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="payloadsMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="80"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="payloadsMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="payloadsMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="historyMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="72"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="historyMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="historyMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="recentMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="82"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="recentMenu.text"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="recentMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Menu>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="clearHistoryItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="72"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="clearHistoryItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="clearHistoryItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clearHistoryItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="postMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="116"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="postMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="postMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="menuRunAllMeterp">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="82"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="menuRunAllMeterp.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="menuRunAllMeterp" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="otherMeterpCommandMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="79"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="otherMeterpCommandMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="otherMeterpCommandMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="otherMeterpCommandMenuActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="killSessionsMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="75"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="killSessionsMenuItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="killSessionsMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="killSessionsMenuItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="collectedCredsMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="83"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="collectedCredsMenuItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="collectedCredsMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="collectedCredsMenuItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="logGenerateMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="71"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="logGenerateMenuItem.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="logGenerateMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="logGenerateMenuItemActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="helpMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="72"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="helpMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="helpMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="onlineHelpMenu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="mnemonic" type="int" value="79"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="onlineHelpMenu.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="onlineHelpMenu" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onlineHelpMenuActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="aboutMenuItem">
|
||||||
|
<Properties>
|
||||||
|
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||||
|
<action class="msfgui.MsfguiJDesktopView" id="showAboutBox" methodName="showAboutBox"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="aboutMenuItem" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JPanel" name="statusPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="statusPanel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="statusMessageLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="736" max="32767" attributes="0"/>
|
||||||
|
<Component id="progressBar" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="statusAnimationLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="statusMessageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="statusAnimationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="progressBar" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="statusMessageLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="statusMessageLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="statusAnimationLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="statusAnimationLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JProgressBar" name="progressBar">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="progressBar" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="component" type="javax.swing.JComponent" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||||
|
<ComponentRef name="mainPanel"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="menuBar" type="javax.swing.JMenuBar" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||||
|
<ComponentRef name="menuBar"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="statusBar" type="javax.swing.JComponent" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||||
|
<ComponentRef name="statusPanel"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,22,0,0,3,-113"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Form>
|
|
@ -0,0 +1,176 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
|
||||||
|
<EventHandler event="windowOpened" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowOpened"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="731" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="refreshButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="69" max="32767" attributes="0"/>
|
||||||
|
<Component id="recSearchDownloadButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="dirButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="deleteButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="downloadButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="pwdLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="upButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="pwdLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="upButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" pref="532" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="downloadButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="deleteButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="dirButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="refreshButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="recSearchDownloadButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="downloadButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="downloadButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="downloadButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="downloadButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="uploadButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="uploadButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="uploadButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="uploadButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="deleteButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="deleteButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="deleteButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="dirButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="dirButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="dirButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dirButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="refreshButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="refreshButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="refreshButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="refreshButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="pwdLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="pwdLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="pwdLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="mainTable">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
|
<Table columnCount="4" rowCount="0">
|
||||||
|
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
||||||
|
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
||||||
|
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
||||||
|
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
||||||
|
</Table>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="mainTable" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="upButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="upButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="upButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="upButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="recSearchDownloadButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="recSearchDownloadButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="recSearchDownloadButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="recSearchDownloadButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,503 @@
|
||||||
|
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Vector;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.Icon;
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.JPopupMenu;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
import javax.swing.Timer;
|
||||||
|
import javax.swing.filechooser.FileSystemView;
|
||||||
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class MeterpFileBrowser extends MsfFrame {
|
||||||
|
protected Map session, sessionPopupMap;
|
||||||
|
protected final RpcConnection rpcConn;
|
||||||
|
protected ReentrantLock lock;
|
||||||
|
protected Map files;
|
||||||
|
protected List fileVector;
|
||||||
|
protected Timer readTimer = null;
|
||||||
|
protected final Icon folderIcon, fileIcon;
|
||||||
|
protected JFileChooser fchooser;
|
||||||
|
protected JPopupMenu popupMenu;
|
||||||
|
protected final DefaultTableModel model;
|
||||||
|
protected InteractWindow interactWin;
|
||||||
|
|
||||||
|
/** Creates a new window for interacting with filesystem */
|
||||||
|
public MeterpFileBrowser(final RpcConnection rpcConn, final Map session, Map sessionPopupMap) {
|
||||||
|
super("Meterpreter remote file browsing");
|
||||||
|
this.rpcConn = rpcConn;
|
||||||
|
this.session = session;
|
||||||
|
this.interactWin = ((InteractWindow)sessionPopupMap.get(session.get("uuid")));
|
||||||
|
this.lock = interactWin.lock;
|
||||||
|
files = new HashMap();
|
||||||
|
fileVector = new Vector(100);
|
||||||
|
initComponents();
|
||||||
|
model = new DefaultTableModel(){
|
||||||
|
public boolean isCellEditable(int row, int col){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mainTable.setModel(model);
|
||||||
|
mainTable.setShowHorizontalLines(false);
|
||||||
|
mainTable.setShowVerticalLines(false);
|
||||||
|
fchooser = new JFileChooser();
|
||||||
|
|
||||||
|
final FileSystemView view = FileSystemView.getFileSystemView();
|
||||||
|
folderIcon = view.getSystemIcon(view.getDefaultDirectory());
|
||||||
|
File tempFile = null;
|
||||||
|
try{
|
||||||
|
tempFile = File.createTempFile("temp", ".txt");
|
||||||
|
tempFile.delete();
|
||||||
|
} catch (IOException iox){
|
||||||
|
JOptionPane.showMessageDialog(null, "Cannot create temp file. Weird.");
|
||||||
|
}
|
||||||
|
fileIcon = view.getSystemIcon(tempFile);
|
||||||
|
tempFile.delete();
|
||||||
|
mainTable.setDefaultRenderer(Object.class,new DefaultTableCellRenderer(){
|
||||||
|
@Override
|
||||||
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col){
|
||||||
|
// Get the renderer component from parent class
|
||||||
|
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
|
||||||
|
if(!mainTable.getColumnName(col).equals("Name")){
|
||||||
|
label.setIcon(null);
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
if(files.get(value) != null && files.get(value).equals("dir")){
|
||||||
|
label.setIcon(folderIcon);
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
File tempFile = File.createTempFile("temp",value.toString());
|
||||||
|
label.setIcon(view.getSystemIcon(tempFile));
|
||||||
|
tempFile.delete();
|
||||||
|
} catch (IOException iox){
|
||||||
|
label.setIcon(fileIcon);
|
||||||
|
}
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fchooser.setMultiSelectionEnabled(false);
|
||||||
|
popupMenu = new JPopupMenu();
|
||||||
|
JMenuItem men = new JMenuItem("Delete");
|
||||||
|
men.addActionListener(new ActionListener(){
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
delete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
popupMenu.add(men);
|
||||||
|
men = new JMenuItem("Download");
|
||||||
|
men.addActionListener(new ActionListener(){
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
download();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
popupMenu.add(men);
|
||||||
|
setupPopupMenu( rpcConn, session);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calls meterpreter_write with the session ID and Base64 encoded text. */
|
||||||
|
private Object executeCommand(String text) throws MsfException{
|
||||||
|
return rpcConn.execute("session.meterpreter_write", new Object[]{session.get("id"),
|
||||||
|
Base64.encode(text.getBytes())});
|
||||||
|
}
|
||||||
|
/** Handles click events, like popup menu and double-click navigation */
|
||||||
|
protected void setupPopupMenu(final RpcConnection rpcConn, final Map session) {
|
||||||
|
mainTable.addMouseListener(new PopupMouseListener() {
|
||||||
|
public void doubleClicked(MouseEvent e) {
|
||||||
|
//show interaction window on double-click
|
||||||
|
int indx = mainTable.getSelectedRow();
|
||||||
|
if (indx == -1)
|
||||||
|
return;
|
||||||
|
String clickedFile = mainTable.getValueAt(indx, 0).toString();
|
||||||
|
if (files.get(clickedFile).equals("dir")) {
|
||||||
|
try {
|
||||||
|
executeCommand("cd \"" + clickedFile + "\"\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
getFiles();
|
||||||
|
} else {
|
||||||
|
download();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showPopup(MouseEvent e) {
|
||||||
|
int indx = mainTable.getSelectedRow();
|
||||||
|
if (indx == -1)
|
||||||
|
return;
|
||||||
|
if (e.isPopupTrigger())
|
||||||
|
popupMenu.show(mainTable, e.getX(), e.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Deletes selected file */
|
||||||
|
protected void delete() {
|
||||||
|
int indx = mainTable.getSelectedRow();
|
||||||
|
if (indx == -1)
|
||||||
|
return;
|
||||||
|
String clickedFile = mainTable.getValueAt(indx, 0).toString();
|
||||||
|
try {
|
||||||
|
if (files.get(clickedFile).equals("dir"))
|
||||||
|
executeCommand("rmdir \"" + clickedFile + "\"\n");
|
||||||
|
else
|
||||||
|
executeCommand("rm \"" + clickedFile + "\"\n");
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
getFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Retrieves list of files. */
|
||||||
|
protected void getFiles() {
|
||||||
|
while(model.getRowCount() > 0)
|
||||||
|
model.removeRow(0);
|
||||||
|
try {
|
||||||
|
executeCommand("ls\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
if(readTimer != null && readTimer.isRunning())
|
||||||
|
return;
|
||||||
|
readTimer = new Timer(300, new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
try {
|
||||||
|
Map received = (Map) rpcConn.execute("session.meterpreter_read", new Object[]{session.get("id")});
|
||||||
|
if (! received.get("encoding").equals("base64")) {
|
||||||
|
JOptionPane.showMessageDialog(null, "uhoh. encoding changed. Time to update msfgui?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
byte[] decodedBytes = Base64.decode(received.get("data").toString());
|
||||||
|
if (decodedBytes.length == 0)
|
||||||
|
return;
|
||||||
|
String[] lines = new String(decodedBytes).split("\n");
|
||||||
|
String headerRow = null;
|
||||||
|
String headerNames = null;
|
||||||
|
for(String line : lines){
|
||||||
|
line = line.trim();
|
||||||
|
if(line.startsWith("Listing")){
|
||||||
|
pwdLabel.setText(line);
|
||||||
|
}else if(line.startsWith("Mode")){
|
||||||
|
headerNames = line;
|
||||||
|
}else if(line.startsWith("-")){
|
||||||
|
headerRow = line;
|
||||||
|
model.setColumnIdentifiers(TableHelper.fill(headerNames,line));
|
||||||
|
while(model.getRowCount() > 0)
|
||||||
|
model.removeRow(0);
|
||||||
|
}
|
||||||
|
if(line.length() == 0 || line.charAt(0) < '0' || line.charAt(0) > '9')
|
||||||
|
continue;
|
||||||
|
String filename = line.substring(getEndOfWhitespaceBlock(line, 6));
|
||||||
|
fileVector.add(filename);
|
||||||
|
int indx = getEndOfWhitespaceBlock(line, 2);
|
||||||
|
files.put(filename,line.substring(indx,indx+3));
|
||||||
|
model.addRow(TableHelper.fill(line,headerRow));
|
||||||
|
}
|
||||||
|
readTimer.stop();
|
||||||
|
TableHelper.fitColumnWidths(model, mainTable);
|
||||||
|
int nameColumn = mainTable.getColumnCount()-1;
|
||||||
|
for(int i = 0; i < mainTable.getColumnCount(); i++)
|
||||||
|
if(mainTable.getColumnName(i).equals("Name"))
|
||||||
|
nameColumn = i;
|
||||||
|
mainTable.moveColumn(nameColumn, 0);
|
||||||
|
readTimer.stop();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
if(ex.getMessage().equals("unknown session"))
|
||||||
|
readTimer.stop();
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Helps parsing responses. */
|
||||||
|
private int getEndOfWhitespaceBlock(String line, int num) {
|
||||||
|
int whiteSpaces = 0;
|
||||||
|
int indx = 0;
|
||||||
|
while (whiteSpaces < num) {
|
||||||
|
if (Character.isWhitespace(line.charAt(indx)) && !Character.isWhitespace(line.charAt(indx + 1)))
|
||||||
|
whiteSpaces++;
|
||||||
|
indx++;
|
||||||
|
}
|
||||||
|
return indx;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
readTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
downloadButton = new javax.swing.JButton();
|
||||||
|
uploadButton = new javax.swing.JButton();
|
||||||
|
deleteButton = new javax.swing.JButton();
|
||||||
|
dirButton = new javax.swing.JButton();
|
||||||
|
refreshButton = new javax.swing.JButton();
|
||||||
|
pwdLabel = new javax.swing.JLabel();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
mainTable = new javax.swing.JTable();
|
||||||
|
upButton = new javax.swing.JButton();
|
||||||
|
recSearchDownloadButton = new javax.swing.JButton();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
addWindowListener(new java.awt.event.WindowAdapter() {
|
||||||
|
public void windowClosed(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowClosed(evt);
|
||||||
|
}
|
||||||
|
public void windowOpened(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowOpened(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(MeterpFileBrowser.class);
|
||||||
|
downloadButton.setText(resourceMap.getString("downloadButton.text")); // NOI18N
|
||||||
|
downloadButton.setName("downloadButton"); // NOI18N
|
||||||
|
downloadButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
downloadButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N
|
||||||
|
deleteButton.setName("deleteButton"); // NOI18N
|
||||||
|
deleteButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
deleteButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dirButton.setText(resourceMap.getString("dirButton.text")); // NOI18N
|
||||||
|
dirButton.setName("dirButton"); // NOI18N
|
||||||
|
dirButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
dirButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
pwdLabel.setText(resourceMap.getString("pwdLabel.text")); // NOI18N
|
||||||
|
pwdLabel.setName("pwdLabel"); // NOI18N
|
||||||
|
|
||||||
|
jScrollPane1.setName("jScrollPane1"); // NOI18N
|
||||||
|
|
||||||
|
mainTable.setModel(new javax.swing.table.DefaultTableModel(
|
||||||
|
new Object [][] {
|
||||||
|
|
||||||
|
},
|
||||||
|
new String [] {
|
||||||
|
"Title 1", "Title 2", "Title 3", "Title 4"
|
||||||
|
}
|
||||||
|
));
|
||||||
|
mainTable.setName("mainTable"); // NOI18N
|
||||||
|
jScrollPane1.setViewportView(mainTable);
|
||||||
|
|
||||||
|
upButton.setText(resourceMap.getString("upButton.text")); // NOI18N
|
||||||
|
upButton.setName("upButton"); // NOI18N
|
||||||
|
upButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
upButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
recSearchDownloadButton.setText(resourceMap.getString("recSearchDownloadButton.text")); // NOI18N
|
||||||
|
recSearchDownloadButton.setName("recSearchDownloadButton"); // NOI18N
|
||||||
|
recSearchDownloadButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
recSearchDownloadButtonActionPerformed(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(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 731, Short.MAX_VALUE)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(refreshButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
|
||||||
|
.addComponent(recSearchDownloadButton)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(dirButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(uploadButton)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(deleteButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(downloadButton))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(pwdLabel)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(upButton)))
|
||||||
|
.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(pwdLabel)
|
||||||
|
.addComponent(upButton))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(downloadButton)
|
||||||
|
.addComponent(deleteButton)
|
||||||
|
.addComponent(uploadButton)
|
||||||
|
.addComponent(dirButton)
|
||||||
|
.addComponent(refreshButton)
|
||||||
|
.addComponent(recSearchDownloadButton))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
|
||||||
|
lock.unlock();
|
||||||
|
}//GEN-LAST:event_formWindowClosed
|
||||||
|
|
||||||
|
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
|
||||||
|
lock.lock();
|
||||||
|
// Some exploits open in C:\Windows\system32. Too many files in there! Try to move to C:\ which should be more manageable
|
||||||
|
try {
|
||||||
|
executeCommand("cd \"C:\\\\\"\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
getFiles();
|
||||||
|
}//GEN-LAST:event_formWindowOpened
|
||||||
|
|
||||||
|
private void downloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downloadButtonActionPerformed
|
||||||
|
download();
|
||||||
|
}//GEN-LAST:event_downloadButtonActionPerformed
|
||||||
|
|
||||||
|
private void uploadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadButtonActionPerformed
|
||||||
|
fchooser.setDialogTitle("Select file to upload");
|
||||||
|
fchooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
|
||||||
|
if(fchooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
executeCommand("lcd \""+MsfguiApp.cleanBackslashes(fchooser.getSelectedFile().getParent()) + "\"\n");
|
||||||
|
executeCommand("upload \""+fchooser.getSelectedFile().getName() + "\"\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
getFiles();
|
||||||
|
}//GEN-LAST:event_uploadButtonActionPerformed
|
||||||
|
|
||||||
|
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
|
||||||
|
delete();
|
||||||
|
}//GEN-LAST:event_deleteButtonActionPerformed
|
||||||
|
|
||||||
|
private void dirButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dirButtonActionPerformed
|
||||||
|
String newDir = JOptionPane.showInputDialog(this,"New directory name","Choose Directory Name",JOptionPane.QUESTION_MESSAGE);
|
||||||
|
if(newDir == null)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
executeCommand("mkdir \""+newDir + "\"\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
getFiles();
|
||||||
|
}//GEN-LAST:event_dirButtonActionPerformed
|
||||||
|
|
||||||
|
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed
|
||||||
|
getFiles();
|
||||||
|
}//GEN-LAST:event_refreshButtonActionPerformed
|
||||||
|
|
||||||
|
private void upButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upButtonActionPerformed
|
||||||
|
try {
|
||||||
|
executeCommand("cd ..\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
getFiles();
|
||||||
|
}//GEN-LAST:event_upButtonActionPerformed
|
||||||
|
|
||||||
|
private void recSearchDownloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_recSearchDownloadButtonActionPerformed
|
||||||
|
try{
|
||||||
|
String currentDir = pwdLabel.getText().substring(pwdLabel.getText().indexOf(' ')+1);
|
||||||
|
rpcConn.execute("session.meterpreter_script", new Object[]{session.get("id"),
|
||||||
|
new SearchDwldOptionsDialog(this, currentDir).toString()});
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
interactWin.setVisible(true);
|
||||||
|
}catch (NullPointerException nex){//cancelled
|
||||||
|
}catch (Exception ex){
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_recSearchDownloadButtonActionPerformed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton deleteButton;
|
||||||
|
private javax.swing.JButton dirButton;
|
||||||
|
private javax.swing.JButton downloadButton;
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JTable mainTable;
|
||||||
|
private javax.swing.JLabel pwdLabel;
|
||||||
|
private javax.swing.JButton recSearchDownloadButton;
|
||||||
|
private javax.swing.JButton refreshButton;
|
||||||
|
private javax.swing.JButton upButton;
|
||||||
|
private javax.swing.JButton uploadButton;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
private void download() {
|
||||||
|
int indx = mainTable.getSelectedRow();
|
||||||
|
if (indx == -1)
|
||||||
|
return;
|
||||||
|
Object o = mainTable.getValueAt(indx, 0);
|
||||||
|
String clickedFile = o.toString();
|
||||||
|
fchooser.setDialogTitle("Select destination folder");
|
||||||
|
fchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||||
|
if(fchooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
executeCommand("lcd \""+MsfguiApp.cleanBackslashes(fchooser.getSelectedFile().toString()) + "\"\n");
|
||||||
|
executeCommand("download \""+clickedFile + "\"\n");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,230 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.7" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="mainScrollPane" pref="919" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="mainScrollPane" pref="884" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="mainScrollPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="mainScrollPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="mainScrollPaneComponentResized"/>
|
||||||
|
</Events>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="descriptionPane" alignment="0" pref="906" max="32767" attributes="0"/>
|
||||||
|
<Component id="authorsLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="licenseLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="versionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="targetsLabel" alignment="0" min="-2" pref="431" max="-2" attributes="0"/>
|
||||||
|
<Component id="payloadScrollPane" alignment="0" pref="906" max="32767" attributes="0"/>
|
||||||
|
<Component id="titleLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="requiredLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="optionalLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="advancedLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="exploitButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="exploitButton1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Component id="titleLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="descriptionPane" min="-2" pref="122" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="authorsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="licenseLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="versionLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="targetsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="payloadScrollPane" min="-2" pref="296" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="requiredLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="optionalLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="advancedLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="exploitButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="exploitButton1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="95" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="titleLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="titleLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="titleLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="authorsLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="authorsLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="authorsLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="licenseLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="licenseLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="licenseLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="versionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="versionLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="versionLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="targetsLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="targetsLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="targetsLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="payloadScrollPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="payloadScrollPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTree" name="payloadTree">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.tree.TreeModel" editor="org.netbeans.modules.form.editors2.TreeModelEditor">
|
||||||
|
<TreeModel code="Payloads
"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="payloadTree" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="exploitButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="exploitButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="exploitButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exploitButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="requiredLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="requiredLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="requiredLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="optionalLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="optionalLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="optionalLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="descriptionPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="descriptionPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JEditorPane" name="descriptionBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="contentType" type="java.lang.String" value="text/html" noResource="true"/>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="descriptionBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JLabel" name="advancedLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="advancedLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="advancedLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="exploitButton1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="msfgui/resources/ModulePopup.properties" key="exploitButton.text" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="exploitButton1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exploitButton1ActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,662 @@
|
||||||
|
/*
|
||||||
|
* ModulePopup.java
|
||||||
|
*
|
||||||
|
* Created on May 15, 2010, 12:32:03 AM
|
||||||
|
*/
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.HeadlessException;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.swing.GroupLayout;
|
||||||
|
import javax.swing.GroupLayout.ParallelGroup;
|
||||||
|
import javax.swing.GroupLayout.SequentialGroup;
|
||||||
|
import javax.swing.JEditorPane;
|
||||||
|
import javax.swing.JMenu;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JRadioButton;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.event.TreeSelectionEvent;
|
||||||
|
import javax.swing.event.TreeSelectionListener;
|
||||||
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
|
import javax.swing.tree.DefaultTreeModel;
|
||||||
|
import javax.swing.tree.TreePath;
|
||||||
|
import javax.swing.tree.TreeSelectionModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class ModulePopup extends MsfFrame implements TreeSelectionListener{
|
||||||
|
private JMenu recentMenu;
|
||||||
|
private String moduleType;
|
||||||
|
private String fullName;
|
||||||
|
private RpcConnection rpcConn;
|
||||||
|
private String payload;
|
||||||
|
private String target;
|
||||||
|
private ArrayList requiredOpts; // I love how these options aren't optional
|
||||||
|
private ArrayList optionalOpts;
|
||||||
|
private ArrayList advancedOpts;
|
||||||
|
|
||||||
|
/** Creates new ModulePopup from recent run */
|
||||||
|
public ModulePopup(RpcConnection rpcConn, Object[] args, JMenu recentMenu) {
|
||||||
|
this(args[1].toString(), rpcConn, args[0].toString(), recentMenu);
|
||||||
|
Map opts = (Map)args[2];
|
||||||
|
if(args[0].toString().equals("exploit")){
|
||||||
|
//Set target
|
||||||
|
target = opts.get("TARGET").toString();
|
||||||
|
for (Component comp : mainPanel.getComponents()){
|
||||||
|
if(comp instanceof JRadioButton){
|
||||||
|
JRadioButton but = (JRadioButton)comp;
|
||||||
|
if(but.getName().equals("targetsButton"+target)){
|
||||||
|
but.setSelected(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Set payload
|
||||||
|
showPayloads(rpcConn, fullName, target, opts.get("PAYLOAD").toString());
|
||||||
|
}
|
||||||
|
//Set options
|
||||||
|
for(Component comp : mainPanel.getComponents()){
|
||||||
|
if(!(comp instanceof JTextField))
|
||||||
|
continue;
|
||||||
|
JTextField optionField = (JTextField)comp;
|
||||||
|
Object optionVal = opts.get(optionField.getName().substring("field".length()));
|
||||||
|
if(optionVal != null)
|
||||||
|
optionField.setText(optionVal.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Creates new ModulePopup */
|
||||||
|
public ModulePopup(String fullName, RpcConnection rpcConn, String moduleType, JMenu recentMenu) {
|
||||||
|
this.recentMenu = recentMenu;
|
||||||
|
initComponents();
|
||||||
|
exploitButton.setText("Run "+moduleType);
|
||||||
|
exploitButton1.setText("Run "+moduleType);
|
||||||
|
this.moduleType = moduleType;
|
||||||
|
requiredOpts = new ArrayList();
|
||||||
|
optionalOpts = new ArrayList();
|
||||||
|
advancedOpts = new ArrayList();
|
||||||
|
this.fullName = fullName;
|
||||||
|
setTitle(fullName);
|
||||||
|
payload = "";
|
||||||
|
this.rpcConn = rpcConn;
|
||||||
|
showModuleInfo(rpcConn, fullName);
|
||||||
|
if(moduleType.equals("exploit")){
|
||||||
|
payloadTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
|
||||||
|
//Listen for when the selection changes.
|
||||||
|
payloadTree.addTreeSelectionListener(this);
|
||||||
|
payloadTree.setToggleClickCount(1);
|
||||||
|
} else {
|
||||||
|
mainPanel.remove(payloadScrollPane);
|
||||||
|
mainPanel.remove(targetsLabel);
|
||||||
|
}
|
||||||
|
descriptionBox.setFont(authorsLabel.getFont());
|
||||||
|
descriptionBox.setBackground(authorsLabel.getBackground());
|
||||||
|
mainScrollPane.getVerticalScrollBar().setUnitIncrement(40);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Sets selected payload to the official payload */
|
||||||
|
public void valueChanged(TreeSelectionEvent e) {
|
||||||
|
DefaultMutableTreeNode node = (DefaultMutableTreeNode)payloadTree.getLastSelectedPathComponent();
|
||||||
|
if (node == null || !node.isLeaf())
|
||||||
|
return;
|
||||||
|
payload = node.getUserObject().toString();
|
||||||
|
while(node.getParent() != node.getRoot()){
|
||||||
|
node = (DefaultMutableTreeNode)node.getParent();
|
||||||
|
payload = node.getUserObject() + "/" + payload;
|
||||||
|
}
|
||||||
|
showOptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Displays targetsMap on frame */
|
||||||
|
private void showModuleInfo(final RpcConnection rpcConn, final String fullName) throws HeadlessException {
|
||||||
|
try { //Get info
|
||||||
|
Map info = (Map) rpcConn.execute("module.info", new Object[]{moduleType, fullName});
|
||||||
|
//Basic info
|
||||||
|
setTitle(info.get("name") + " " + fullName);
|
||||||
|
titleLabel.setText("<html><h2>"+info.get("name")+ "</h2></html>");
|
||||||
|
Object references = info.get("references");
|
||||||
|
StringBuilder referenceString = new StringBuilder();
|
||||||
|
if(references != null){
|
||||||
|
Object[] refArray = (Object[])references;
|
||||||
|
referenceString.append("<br>References:<br>");
|
||||||
|
for(int i = 0; i < refArray.length; i++){
|
||||||
|
Object[] ref = (Object[])refArray[i];
|
||||||
|
referenceString.append(ref[0]+": "+ref[1]+"<br> ");
|
||||||
|
}
|
||||||
|
referenceString.append("<br>");
|
||||||
|
}
|
||||||
|
descriptionBox.setText("<html><b>Description</b> "+info.get("description").toString().replaceAll("\\s+", " ")+referenceString+"</html>");
|
||||||
|
if(info.get("license") instanceof String){
|
||||||
|
licenseLabel.setText("<html><b>License:</b> "+ info.get("license")+"</html>");
|
||||||
|
}else{
|
||||||
|
Object [] license = (Object[]) info.get("license");
|
||||||
|
StringBuilder licenseString = new StringBuilder();
|
||||||
|
for(int i = 0; i < license.length; i++)
|
||||||
|
licenseString.append(license[i]+" ");
|
||||||
|
licenseLabel.setText("<html><b>License:</b> "+ licenseString+"</html>");
|
||||||
|
}
|
||||||
|
versionLabel.setText("<html><b>Version:</b> "+ info.get("version")+"</html>");
|
||||||
|
//Authors
|
||||||
|
Object[] authors = (Object[]) info.get("authors");
|
||||||
|
StringBuilder authorLine = new StringBuilder();
|
||||||
|
if (authors.length > 0)
|
||||||
|
authorLine.append(authors[0].toString());
|
||||||
|
for (int i = 1; i < authors.length; i++)
|
||||||
|
authorLine.append(", " + authors[i]);
|
||||||
|
authorsLabel.setText("<html><b>Authors:</b> "+ authorLine.toString()+"</html>");
|
||||||
|
if(moduleType.equals("exploit")){
|
||||||
|
//Targets
|
||||||
|
Map targetsMap = (Map) info.get("targets");
|
||||||
|
if(targetsMap == null){
|
||||||
|
JOptionPane.showMessageDialog(this, "No Targets. ??");
|
||||||
|
}else{
|
||||||
|
String defaultTarget="";
|
||||||
|
if(info.get("default_target") != null)
|
||||||
|
defaultTarget = info.get("default_target").toString();
|
||||||
|
for (Object targetName : targetsMap.keySet()) {
|
||||||
|
JRadioButton radio = new JRadioButton();
|
||||||
|
buttonGroup.add(radio);
|
||||||
|
radio.setText(targetsMap.get(targetName).toString()); // NOI18N
|
||||||
|
radio.setName("targetButton" + targetName); // NOI18N
|
||||||
|
radio.setActionCommand(targetName.toString());
|
||||||
|
radio.addActionListener(new ActionListener(){
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
target = buttonGroup.getSelection().getActionCommand();
|
||||||
|
showPayloads(rpcConn,fullName,target);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mainPanel.add(radio);
|
||||||
|
if (targetName.equals(defaultTarget)) {
|
||||||
|
radio.setSelected(true);
|
||||||
|
showPayloads(rpcConn,fullName,targetName.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { //AUXILIARY
|
||||||
|
showOptions();
|
||||||
|
}
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, ex);
|
||||||
|
}
|
||||||
|
reGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates payload menu. */
|
||||||
|
private void showPayloads(RpcConnection rpcConn, String modName, String target) throws HeadlessException {
|
||||||
|
showPayloads(rpcConn, modName, target, null);
|
||||||
|
}
|
||||||
|
/** Creates payload menu. */
|
||||||
|
private void showPayloads(RpcConnection rpcConn, String modName, String target, String defaultPayload) throws HeadlessException {
|
||||||
|
try { //Get info
|
||||||
|
Object[] mlist;
|
||||||
|
try {
|
||||||
|
mlist = (Object[])((Map)rpcConn.execute("module.compatible_payloads",
|
||||||
|
new Object[]{modName,target})).get("payloads"); //WARNING - ALTERED COMPATIBLE PAYLOAD RPC DEF
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
mlist = (Object[])((Map)rpcConn.execute("module.compatible_payloads",
|
||||||
|
new Object[]{modName})).get("payloads"); //old rpc payload def
|
||||||
|
}
|
||||||
|
//Ok. it worked. now replace the payload list
|
||||||
|
|
||||||
|
DefaultTreeModel payloadModel = (DefaultTreeModel)payloadTree.getModel();
|
||||||
|
DefaultMutableTreeNode top = (DefaultMutableTreeNode)(payloadModel.getRoot());
|
||||||
|
int count = top.getChildCount();
|
||||||
|
for(int i = count - 1; i >=0; i--){
|
||||||
|
payloadModel.removeNodeFromParent((DefaultMutableTreeNode)top.getChildAt(i));
|
||||||
|
}
|
||||||
|
top.removeAllChildren();
|
||||||
|
|
||||||
|
DefaultMutableTreeNode defaultPayloadNode = null;
|
||||||
|
for (Object payloadFullName : mlist) {
|
||||||
|
String[] names = payloadFullName.toString().split("/");
|
||||||
|
DefaultMutableTreeNode currentNode = top;
|
||||||
|
for (int i = 0; i < names.length; i++) {
|
||||||
|
boolean found = false;
|
||||||
|
for(int j = 0; j < currentNode.getChildCount(); j++){
|
||||||
|
DefaultMutableTreeNode node = (DefaultMutableTreeNode)currentNode.getChildAt(j);
|
||||||
|
if(node.getUserObject().toString().equals(names[i])){
|
||||||
|
if (i < names.length - 1)
|
||||||
|
currentNode = node;
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found)
|
||||||
|
continue;
|
||||||
|
DefaultMutableTreeNode nod = new DefaultMutableTreeNode(names[i]);
|
||||||
|
payloadModel.insertNodeInto(nod, currentNode, 0);
|
||||||
|
if (i < names.length - 1) {
|
||||||
|
payloadTree.scrollPathToVisible(new TreePath(nod.getPath()));
|
||||||
|
currentNode = nod;
|
||||||
|
}
|
||||||
|
if(payloadFullName.equals(defaultPayload))
|
||||||
|
defaultPayloadNode=nod;
|
||||||
|
}//end for each subname
|
||||||
|
}//end for each module
|
||||||
|
if(defaultPayloadNode != null){
|
||||||
|
payloadTree.scrollPathToVisible(new TreePath(defaultPayloadNode.getPath()));
|
||||||
|
payloadTree.setSelectionPath(new TreePath(defaultPayloadNode.getPath()));
|
||||||
|
}
|
||||||
|
payloadTree.setRootVisible(false);
|
||||||
|
payloadTree.revalidate();
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Displays exploit and payload options. */
|
||||||
|
private void showOptions() {
|
||||||
|
for(Object o : requiredOpts)
|
||||||
|
mainPanel.remove((Component)o);
|
||||||
|
requiredOpts.clear();
|
||||||
|
for(Object o : optionalOpts)
|
||||||
|
mainPanel.remove((Component)o);
|
||||||
|
optionalOpts.clear();
|
||||||
|
for(Object o : advancedOpts)
|
||||||
|
mainPanel.remove((Component)o);
|
||||||
|
advancedOpts.clear();
|
||||||
|
try{
|
||||||
|
//display options
|
||||||
|
Map options = (Map) rpcConn.execute("module.options", new Object[]{moduleType, fullName});
|
||||||
|
// payload options
|
||||||
|
if(moduleType.equals("exploit")){
|
||||||
|
if(payload.length() <= 0){
|
||||||
|
JOptionPane.showMessageDialog(this, "You must select a payload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
options.putAll((Map) rpcConn.execute("module.options", new Object[]{"payload", payload.toString()}));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object optionName : options.keySet()) {
|
||||||
|
Map option = (Map)options.get(optionName); //{desc=blah, evasion=fals, advanced=false, required=true, type=port, default=blah}
|
||||||
|
JScrollPane containerPane = new JScrollPane();
|
||||||
|
containerPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
JEditorPane tempText = new JEditorPane();
|
||||||
|
tempText.setContentType("text/html");
|
||||||
|
tempText.setEditable(false);
|
||||||
|
tempText.setText("<html><b>"+optionName.toString()+"</b> " + option.get("desc") + "</html>");
|
||||||
|
containerPane.setViewportView(tempText);
|
||||||
|
containerPane.setViewportBorder(null);
|
||||||
|
containerPane.setBorder(null);
|
||||||
|
tempText.setBorder(null);
|
||||||
|
mainPanel.add(containerPane);
|
||||||
|
tempText.setBackground(authorsLabel.getBackground());
|
||||||
|
tempText.setFont(authorsLabel.getFont());
|
||||||
|
JTextField optionField = new JTextField();
|
||||||
|
if (option.get("default") != null) {
|
||||||
|
optionField.setText(option.get("default").toString());
|
||||||
|
} else if (optionName.equals("LHOST")){ //try to find local ip
|
||||||
|
optionField.setText(MsfguiApp.getLocalIp());
|
||||||
|
}
|
||||||
|
optionField.setName("field" + optionName);
|
||||||
|
mainPanel.add(optionField);
|
||||||
|
if(option.get("required").equals(Boolean.TRUE)){
|
||||||
|
requiredOpts.add(containerPane);
|
||||||
|
requiredOpts.add(optionField);
|
||||||
|
}else if (option.get("advanced").equals(Boolean.FALSE)){
|
||||||
|
optionalOpts.add(containerPane);
|
||||||
|
optionalOpts.add(optionField);
|
||||||
|
}else{
|
||||||
|
advancedOpts.add(containerPane);
|
||||||
|
advancedOpts.add(optionField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, ex);
|
||||||
|
}
|
||||||
|
reGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Runs the exploit with given options and payload. Closes window if successful. */
|
||||||
|
private void runModule() {
|
||||||
|
try{
|
||||||
|
//Put options into request
|
||||||
|
HashMap hash = new HashMap();
|
||||||
|
//Exploit only stuff
|
||||||
|
if(moduleType.equals("exploit")){
|
||||||
|
if(payload.length() <= 0){
|
||||||
|
JOptionPane.showMessageDialog(rootPane, "You must select a payload");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
hash.put("PAYLOAD",payload.toString());
|
||||||
|
target = buttonGroup.getSelection().getActionCommand();
|
||||||
|
hash.put("TARGET",target);
|
||||||
|
}
|
||||||
|
for(Component comp : mainPanel.getComponents()){
|
||||||
|
if(!(comp instanceof JTextField))
|
||||||
|
continue;
|
||||||
|
JTextField optionField = (JTextField)comp;
|
||||||
|
if(optionField.getText().length() > 0)
|
||||||
|
hash.put(optionField.getName().substring("field".length()), optionField.getText());
|
||||||
|
}
|
||||||
|
//Execute and get results
|
||||||
|
final Object[] args = new Object[]{moduleType, fullName,hash};
|
||||||
|
Map info = (Map) rpcConn.execute("module.execute",args);
|
||||||
|
if(!info.get("result").equals("success"))
|
||||||
|
JOptionPane.showMessageDialog(rootPane, info);
|
||||||
|
MsfguiApp.addRecentModule(args, recentMenu, rpcConn);
|
||||||
|
|
||||||
|
//close out
|
||||||
|
this.setVisible(false);
|
||||||
|
this.dispose();
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="comment">
|
||||||
|
/* DELETEME!
|
||||||
|
private void wrapLabelText(JLabel label, String text) {
|
||||||
|
FontMetrics fm = label.getFontMetrics(label.getFont());
|
||||||
|
Container container = label.getParent().getParent();
|
||||||
|
int containerWidth = container.getWidth();
|
||||||
|
|
||||||
|
BreakIterator boundary = BreakIterator.getWordInstance();
|
||||||
|
boundary.setText(text);
|
||||||
|
|
||||||
|
StringBuffer trial = new StringBuffer();
|
||||||
|
StringBuffer real = new StringBuffer("<html>");
|
||||||
|
|
||||||
|
int start = boundary.first();
|
||||||
|
for (int end = boundary.next(); end != BreakIterator.DONE;
|
||||||
|
start = end, end = boundary.next()) {
|
||||||
|
String word = text.substring(start, end);
|
||||||
|
trial.append(word);
|
||||||
|
int trialWidth = SwingUtilities.computeStringWidth(fm, trial.toString());
|
||||||
|
if (trialWidth > containerWidth) {
|
||||||
|
trial = new StringBuffer(word);
|
||||||
|
real.append("<br>");
|
||||||
|
}
|
||||||
|
real.append(word);
|
||||||
|
}
|
||||||
|
real.append("</html>");
|
||||||
|
|
||||||
|
label.setText(real.toString());
|
||||||
|
} */// </editor-fold>
|
||||||
|
|
||||||
|
/** Reformats the view based on visible options and targetsMap. */
|
||||||
|
private void reGroup(){
|
||||||
|
GroupLayout mainPanelLayout = (GroupLayout)mainPanel.getLayout();
|
||||||
|
ParallelGroup horizGroup = mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(titleLabel)
|
||||||
|
.addComponent(descriptionPane, javax.swing.GroupLayout.DEFAULT_SIZE, 526, Short.MAX_VALUE)
|
||||||
|
.addComponent(authorsLabel)
|
||||||
|
.addComponent(licenseLabel)
|
||||||
|
.addComponent(versionLabel);
|
||||||
|
//Exploit only stuff
|
||||||
|
if(moduleType.equals("exploit")){
|
||||||
|
horizGroup.addComponent(targetsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 431, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(payloadScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE);
|
||||||
|
}
|
||||||
|
horizGroup.addComponent(requiredLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(optionalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE);
|
||||||
|
Enumeration targets = buttonGroup.getElements();
|
||||||
|
while(targets.hasMoreElements())
|
||||||
|
horizGroup = horizGroup.addComponent((JRadioButton)targets.nextElement());
|
||||||
|
for(Object obj : requiredOpts)
|
||||||
|
horizGroup = horizGroup.addComponent((Component) obj, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
|
||||||
|
for(Object obj : optionalOpts)
|
||||||
|
horizGroup = horizGroup.addComponent((Component) obj, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
|
||||||
|
for(Object obj : advancedOpts)
|
||||||
|
horizGroup = horizGroup.addComponent((Component) obj, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
|
||||||
|
|
||||||
|
horizGroup = horizGroup.addComponent(exploitButton)
|
||||||
|
.addComponent(exploitButton1);
|
||||||
|
mainPanelLayout.setHorizontalGroup(mainPanelLayout.createSequentialGroup().addContainerGap()
|
||||||
|
.addGroup(horizGroup).addContainerGap());
|
||||||
|
|
||||||
|
SequentialGroup vGroup = mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(titleLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(descriptionPane, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(authorsLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(licenseLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
//Exploit only stuff
|
||||||
|
if(moduleType.equals("exploit")){
|
||||||
|
vGroup.addComponent(targetsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
targets = buttonGroup.getElements();
|
||||||
|
while(targets.hasMoreElements()){
|
||||||
|
vGroup.addComponent((JRadioButton)targets.nextElement())
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
}
|
||||||
|
vGroup = vGroup.addComponent(payloadScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
}
|
||||||
|
boolean odd = false;
|
||||||
|
odd = addObjectsToVgroup(vGroup, odd, requiredLabel, requiredOpts);
|
||||||
|
vGroup = vGroup.addComponent(exploitButton1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
odd = addObjectsToVgroup(vGroup, odd, optionalLabel, optionalOpts);
|
||||||
|
odd = addObjectsToVgroup(vGroup, odd, advancedLabel, advancedOpts);
|
||||||
|
vGroup = vGroup.addComponent(exploitButton)
|
||||||
|
.addContainerGap();
|
||||||
|
mainPanelLayout.setVerticalGroup(vGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
//helper for grouping
|
||||||
|
private boolean addObjectsToVgroup(SequentialGroup vGroup, boolean odd, Component label, ArrayList opts) {
|
||||||
|
vGroup = vGroup.addComponent(label, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
for (Object obj : opts) {
|
||||||
|
vGroup.addComponent((Component) obj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE);
|
||||||
|
if (odd)
|
||||||
|
vGroup.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
|
||||||
|
odd = !odd;
|
||||||
|
}
|
||||||
|
return odd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
buttonGroup = new javax.swing.ButtonGroup();
|
||||||
|
mainScrollPane = new javax.swing.JScrollPane();
|
||||||
|
mainPanel = new javax.swing.JPanel();
|
||||||
|
titleLabel = new javax.swing.JLabel();
|
||||||
|
authorsLabel = new javax.swing.JLabel();
|
||||||
|
licenseLabel = new javax.swing.JLabel();
|
||||||
|
versionLabel = new javax.swing.JLabel();
|
||||||
|
targetsLabel = new javax.swing.JLabel();
|
||||||
|
payloadScrollPane = new javax.swing.JScrollPane();
|
||||||
|
payloadTree = new javax.swing.JTree();
|
||||||
|
exploitButton = new javax.swing.JButton();
|
||||||
|
requiredLabel = new javax.swing.JLabel();
|
||||||
|
optionalLabel = new javax.swing.JLabel();
|
||||||
|
descriptionPane = new javax.swing.JScrollPane();
|
||||||
|
descriptionBox = new javax.swing.JEditorPane();
|
||||||
|
advancedLabel = new javax.swing.JLabel();
|
||||||
|
exploitButton1 = new javax.swing.JButton();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
|
mainScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
mainScrollPane.setName("mainScrollPane"); // NOI18N
|
||||||
|
mainScrollPane.addComponentListener(new java.awt.event.ComponentAdapter() {
|
||||||
|
public void componentResized(java.awt.event.ComponentEvent evt) {
|
||||||
|
mainScrollPaneComponentResized(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mainPanel.setName("mainPanel"); // NOI18N
|
||||||
|
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(ModulePopup.class);
|
||||||
|
titleLabel.setText(resourceMap.getString("titleLabel.text")); // NOI18N
|
||||||
|
titleLabel.setName("titleLabel"); // NOI18N
|
||||||
|
|
||||||
|
authorsLabel.setText(resourceMap.getString("authorsLabel.text")); // NOI18N
|
||||||
|
authorsLabel.setName("authorsLabel"); // NOI18N
|
||||||
|
|
||||||
|
licenseLabel.setText(resourceMap.getString("licenseLabel.text")); // NOI18N
|
||||||
|
licenseLabel.setName("licenseLabel"); // NOI18N
|
||||||
|
|
||||||
|
versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
|
||||||
|
versionLabel.setName("versionLabel"); // NOI18N
|
||||||
|
|
||||||
|
targetsLabel.setText(resourceMap.getString("targetsLabel.text")); // NOI18N
|
||||||
|
targetsLabel.setName("targetsLabel"); // NOI18N
|
||||||
|
|
||||||
|
payloadScrollPane.setName("payloadScrollPane"); // NOI18N
|
||||||
|
|
||||||
|
javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("Payloads");
|
||||||
|
payloadTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
|
||||||
|
payloadTree.setName("payloadTree"); // NOI18N
|
||||||
|
payloadScrollPane.setViewportView(payloadTree);
|
||||||
|
|
||||||
|
exploitButton.setText(resourceMap.getString("exploitButton.text")); // NOI18N
|
||||||
|
exploitButton.setName("exploitButton"); // NOI18N
|
||||||
|
exploitButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
exploitButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
requiredLabel.setText(resourceMap.getString("requiredLabel.text")); // NOI18N
|
||||||
|
requiredLabel.setName("requiredLabel"); // NOI18N
|
||||||
|
|
||||||
|
optionalLabel.setText(resourceMap.getString("optionalLabel.text")); // NOI18N
|
||||||
|
optionalLabel.setName("optionalLabel"); // NOI18N
|
||||||
|
|
||||||
|
descriptionPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
descriptionPane.setName("descriptionPane"); // NOI18N
|
||||||
|
|
||||||
|
descriptionBox.setContentType("text/html"); // NOI18N
|
||||||
|
descriptionBox.setEditable(false);
|
||||||
|
descriptionBox.setName("descriptionBox"); // NOI18N
|
||||||
|
descriptionPane.setViewportView(descriptionBox);
|
||||||
|
|
||||||
|
advancedLabel.setText(resourceMap.getString("advancedLabel.text")); // NOI18N
|
||||||
|
advancedLabel.setName("advancedLabel"); // NOI18N
|
||||||
|
|
||||||
|
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("msfgui/resources/ModulePopup"); // NOI18N
|
||||||
|
exploitButton1.setText(bundle.getString("exploitButton.text")); // NOI18N
|
||||||
|
exploitButton1.setName("exploitButton1"); // NOI18N
|
||||||
|
exploitButton1.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
exploitButton1ActionPerformed(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(descriptionPane, javax.swing.GroupLayout.DEFAULT_SIZE, 906, Short.MAX_VALUE)
|
||||||
|
.addComponent(authorsLabel)
|
||||||
|
.addComponent(licenseLabel)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addComponent(targetsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 431, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(payloadScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 906, Short.MAX_VALUE)
|
||||||
|
.addComponent(titleLabel)
|
||||||
|
.addComponent(requiredLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(optionalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(advancedLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(exploitButton)
|
||||||
|
.addComponent(exploitButton1))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
mainPanelLayout.setVerticalGroup(
|
||||||
|
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(titleLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(descriptionPane, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(authorsLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(licenseLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(targetsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(payloadScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(requiredLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(optionalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(advancedLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(exploitButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(exploitButton1)
|
||||||
|
.addContainerGap(95, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
mainScrollPane.setViewportView(mainPanel);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 919, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 884, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void exploitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exploitButtonActionPerformed
|
||||||
|
runModule();
|
||||||
|
}//GEN-LAST:event_exploitButtonActionPerformed
|
||||||
|
|
||||||
|
private void mainScrollPaneComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_mainScrollPaneComponentResized
|
||||||
|
//JOptionPane.showMessageDialog(rootPane, "scrollpane size: "+mainScrollPane.getWidth()+" panel size "+mainPanel.getWidth());
|
||||||
|
}//GEN-LAST:event_mainScrollPaneComponentResized
|
||||||
|
|
||||||
|
private void exploitButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exploitButton1ActionPerformed
|
||||||
|
exploitButtonActionPerformed(evt);
|
||||||
|
}//GEN-LAST:event_exploitButton1ActionPerformed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JLabel advancedLabel;
|
||||||
|
private javax.swing.JLabel authorsLabel;
|
||||||
|
private javax.swing.ButtonGroup buttonGroup;
|
||||||
|
private javax.swing.JEditorPane descriptionBox;
|
||||||
|
private javax.swing.JScrollPane descriptionPane;
|
||||||
|
private javax.swing.JButton exploitButton;
|
||||||
|
private javax.swing.JButton exploitButton1;
|
||||||
|
private javax.swing.JLabel licenseLabel;
|
||||||
|
private javax.swing.JPanel mainPanel;
|
||||||
|
private javax.swing.JScrollPane mainScrollPane;
|
||||||
|
private javax.swing.JLabel optionalLabel;
|
||||||
|
private javax.swing.JScrollPane payloadScrollPane;
|
||||||
|
private javax.swing.JTree payloadTree;
|
||||||
|
private javax.swing.JLabel requiredLabel;
|
||||||
|
private javax.swing.JLabel targetsLabel;
|
||||||
|
private javax.swing.JLabel titleLabel;
|
||||||
|
private javax.swing.JLabel versionLabel;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
class MsfException extends Exception{
|
||||||
|
|
||||||
|
public MsfException(Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MsfException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MsfException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public MsfException(String string) {
|
||||||
|
super(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.HeadlessException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class MsfFrame extends javax.swing.JFrame{
|
||||||
|
|
||||||
|
public MsfFrame(String title) throws HeadlessException {
|
||||||
|
super(title);
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(
|
||||||
|
msfgui.MsfguiApp.class).getContext().getResourceMap(ModulePopup.class);
|
||||||
|
this.setIconImage(resourceMap.getImageIcon("main.icon").getImage());
|
||||||
|
}
|
||||||
|
|
||||||
|
public MsfFrame() throws HeadlessException {
|
||||||
|
this("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,199 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
<Property name="title" type="java.lang.String" resourceKey="title"/>
|
||||||
|
<Property name="modal" type="boolean" value="true"/>
|
||||||
|
<Property name="resizable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="imageLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="versionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="vendorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="homepageLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="appVersionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appVendorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appHomepageLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Component id="appTitleLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appDescLabel" alignment="0" pref="266" max="32767" attributes="0"/>
|
||||||
|
<Component id="closeButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="imageLabel" min="-2" pref="302" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="appTitleLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appDescLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="versionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appVersionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="vendorLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appVendorLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="homepageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="appHomepageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="117" max="32767" attributes="0"/>
|
||||||
|
<Component id="closeButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="closeButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||||
|
<action class="msfgui.MsfguiJDesktopAboutBox" id="closeAboutBox" methodName="closeAboutBox"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="closeButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="appTitleLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font bold="true" component="appTitleLabel" property="font" relativeSize="true" size="8"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="Application.title"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="appTitleLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="versionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font bold="true" component="versionLabel" property="font" relativeSize="true" size="0"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="versionLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="versionLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="appVersionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="Application.version"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="appVersionLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="vendorLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font bold="true" component="vendorLabel" property="font" relativeSize="true" size="0"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="vendorLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="vendorLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="appVendorLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="Application.vendor"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="appVendorLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="homepageLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font bold="true" component="homepageLabel" property="font" relativeSize="true" size="0"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="homepageLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="homepageLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="appHomepageLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="Application.homepage"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="appHomepageLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="appDescLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="appDescLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="appDescLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="imageLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" resourceKey="imageLabel.icon"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="imageLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,140 @@
|
||||||
|
/*
|
||||||
|
* MsfguiAboutBox.java
|
||||||
|
*/
|
||||||
|
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import org.jdesktop.application.Action;
|
||||||
|
|
||||||
|
public class MsfguiAboutBox extends javax.swing.JDialog {
|
||||||
|
|
||||||
|
public MsfguiAboutBox(java.awt.Frame parent, String version) {
|
||||||
|
super(parent);
|
||||||
|
initComponents();
|
||||||
|
getRootPane().setDefaultButton(closeButton);
|
||||||
|
appVersionLabel.setText(version);
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(ModulePopup.class);
|
||||||
|
this.setIconImage(resourceMap.getImageIcon("main.icon").getImage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Action public void closeAboutBox() {
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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.
|
||||||
|
*/
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
closeButton = new javax.swing.JButton();
|
||||||
|
javax.swing.JLabel appTitleLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel versionLabel = new javax.swing.JLabel();
|
||||||
|
appVersionLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel vendorLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel appVendorLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel homepageLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel appDescLabel = new javax.swing.JLabel();
|
||||||
|
javax.swing.JLabel imageLabel = 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(MsfguiAboutBox.class);
|
||||||
|
setTitle(resourceMap.getString("title")); // NOI18N
|
||||||
|
setModal(true);
|
||||||
|
setResizable(false);
|
||||||
|
|
||||||
|
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getActionMap(MsfguiAboutBox.class, this);
|
||||||
|
closeButton.setAction(actionMap.get("closeAboutBox")); // NOI18N
|
||||||
|
closeButton.setName("closeButton"); // NOI18N
|
||||||
|
|
||||||
|
appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+8));
|
||||||
|
appTitleLabel.setText(resourceMap.getString("Application.title")); // NOI18N
|
||||||
|
appTitleLabel.setName("appTitleLabel"); // NOI18N
|
||||||
|
|
||||||
|
versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD));
|
||||||
|
versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
|
||||||
|
versionLabel.setName("versionLabel"); // NOI18N
|
||||||
|
|
||||||
|
appVersionLabel.setText(resourceMap.getString("Application.version")); // NOI18N
|
||||||
|
appVersionLabel.setName("appVersionLabel"); // NOI18N
|
||||||
|
|
||||||
|
vendorLabel.setFont(vendorLabel.getFont().deriveFont(vendorLabel.getFont().getStyle() | java.awt.Font.BOLD));
|
||||||
|
vendorLabel.setText(resourceMap.getString("vendorLabel.text")); // NOI18N
|
||||||
|
vendorLabel.setName("vendorLabel"); // NOI18N
|
||||||
|
|
||||||
|
appVendorLabel.setText(resourceMap.getString("Application.vendor")); // NOI18N
|
||||||
|
appVendorLabel.setName("appVendorLabel"); // NOI18N
|
||||||
|
|
||||||
|
homepageLabel.setFont(homepageLabel.getFont().deriveFont(homepageLabel.getFont().getStyle() | java.awt.Font.BOLD));
|
||||||
|
homepageLabel.setText(resourceMap.getString("homepageLabel.text")); // NOI18N
|
||||||
|
homepageLabel.setName("homepageLabel"); // NOI18N
|
||||||
|
|
||||||
|
appHomepageLabel.setText(resourceMap.getString("Application.homepage")); // NOI18N
|
||||||
|
appHomepageLabel.setName("appHomepageLabel"); // NOI18N
|
||||||
|
|
||||||
|
appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N
|
||||||
|
appDescLabel.setName("appDescLabel"); // NOI18N
|
||||||
|
|
||||||
|
imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N
|
||||||
|
imageLabel.setName("imageLabel"); // 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()
|
||||||
|
.addComponent(imageLabel)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addComponent(vendorLabel)
|
||||||
|
.addComponent(homepageLabel))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(appVersionLabel)
|
||||||
|
.addComponent(appVendorLabel)
|
||||||
|
.addComponent(appHomepageLabel)))
|
||||||
|
.addComponent(appTitleLabel, javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(appDescLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)
|
||||||
|
.addComponent(closeButton))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 302, Short.MAX_VALUE)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(appTitleLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(appDescLabel, 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(versionLabel)
|
||||||
|
.addComponent(appVersionLabel))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(vendorLabel)
|
||||||
|
.addComponent(appVendorLabel))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(homepageLabel)
|
||||||
|
.addComponent(appHomepageLabel))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 117, Short.MAX_VALUE)
|
||||||
|
.addComponent(closeButton)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JLabel appVersionLabel;
|
||||||
|
private javax.swing.JButton closeButton;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,322 @@
|
||||||
|
/*
|
||||||
|
* MsfguiApp.java
|
||||||
|
*/
|
||||||
|
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.DatagramSocket;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
import javax.swing.JMenu;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import org.jdesktop.application.Application;
|
||||||
|
import org.jdesktop.application.SingleFrameApplication;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
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;
|
||||||
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The main class of the application. Handles global settings and system functions.
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class MsfguiApp extends SingleFrameApplication {
|
||||||
|
public static final int NUM_REMEMBERED_MODULES = 20;
|
||||||
|
private static Element propRoot;
|
||||||
|
private static List recentList = new LinkedList();
|
||||||
|
public static JFileChooser fileChooser;
|
||||||
|
protected static Pattern backslash = Pattern.compile("\\\\");
|
||||||
|
|
||||||
|
static{ //get saved properties file
|
||||||
|
propRoot = null;
|
||||||
|
try{
|
||||||
|
String fname = System.getProperty("user.home")+File.separatorChar+".msfgui";
|
||||||
|
propRoot = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||||
|
.parse(new File(fname)).getDocumentElement();
|
||||||
|
} catch (Exception ex) { //if anything goes wrong, make new (IOException, SAXException, ParserConfigurationException, NullPointerException
|
||||||
|
propRoot = getPropertiesNode();//ensure existence
|
||||||
|
}
|
||||||
|
Runtime.getRuntime().addShutdownHook(new Thread(){
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
//Output the XML
|
||||||
|
String fname = System.getProperty("user.home")+File.separatorChar+".msfgui";
|
||||||
|
try{
|
||||||
|
//save recent
|
||||||
|
for(Node node = propRoot.getFirstChild(); node != null; node = node.getNextSibling())
|
||||||
|
if(node.getNodeName().equals("recent"))
|
||||||
|
propRoot.removeChild(node);
|
||||||
|
Document doc = propRoot.getOwnerDocument();
|
||||||
|
Node recentNode = doc.createElement("recent");
|
||||||
|
for(Object o : recentList){
|
||||||
|
Object[] args = (Object[])o;
|
||||||
|
Element recentItem = doc.createElement("recentItem");
|
||||||
|
recentItem.setAttribute("moduleType",args[0].toString());
|
||||||
|
recentItem.setAttribute("fullName",args[1].toString());
|
||||||
|
for(Object p : ((Map)args[2]).entrySet()){
|
||||||
|
Map.Entry prop = (Map.Entry)p;
|
||||||
|
Element propItem = doc.createElement(prop.getKey().toString());
|
||||||
|
propItem.setAttribute("val",prop.getValue().toString());
|
||||||
|
recentItem.appendChild(propItem);
|
||||||
|
}
|
||||||
|
recentNode.appendChild(recentItem);
|
||||||
|
}
|
||||||
|
propRoot.appendChild(recentNode);
|
||||||
|
TransformerFactory.newInstance().newTransformer().transform(
|
||||||
|
new DOMSource(propRoot), new StreamResult(new FileOutputStream(fname)));
|
||||||
|
}catch (Exception ex){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* At startup create and show the main frame of the application.
|
||||||
|
*/
|
||||||
|
@Override protected void startup() {
|
||||||
|
MsfguiLog.initDefaultLog();
|
||||||
|
show(new MainFrame(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is to initialize the specified window by injecting resources.
|
||||||
|
* Windows shown in our application come fully initialized from the GUI
|
||||||
|
* builder, so this additional configuration is not needed.
|
||||||
|
*/
|
||||||
|
@Override protected void configureWindow(java.awt.Window root) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A convenient static getter for the application instance.
|
||||||
|
* @return the instance of MsfguiApp
|
||||||
|
*/
|
||||||
|
public static MsfguiApp getApplication() {
|
||||||
|
return Application.getInstance(MsfguiApp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main method launching the application.
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
launch(MsfguiApp.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Application helper to launch msfrpcd or msfencode, etc. */
|
||||||
|
public static Process startMsfProc(List command) throws MsfException{
|
||||||
|
String[] args = new String[command.size()];
|
||||||
|
for(int i = 0; i < args.length; i++)
|
||||||
|
args[i] = command.get(i).toString();
|
||||||
|
return startMsfProc(args);
|
||||||
|
}
|
||||||
|
/** Application helper to launch msfrpcd or msfencode, etc. */
|
||||||
|
public static Process startMsfProc(String[] args) throws MsfException {
|
||||||
|
String msfCommand = args[0];
|
||||||
|
String prefix;
|
||||||
|
try{
|
||||||
|
prefix = getPropertiesNode().getAttributeNode("commandPrefix").getValue();
|
||||||
|
}catch(Exception ex){
|
||||||
|
prefix = "";
|
||||||
|
}
|
||||||
|
Process proc;
|
||||||
|
String[] winArgs = null;
|
||||||
|
try {
|
||||||
|
args[0] = prefix + msfCommand;
|
||||||
|
proc = Runtime.getRuntime().exec(args);
|
||||||
|
} catch (Exception ex1) {
|
||||||
|
try {
|
||||||
|
proc = Runtime.getRuntime().exec(args);
|
||||||
|
} catch (IOException ex2) {
|
||||||
|
try {
|
||||||
|
args[0] = "/opt/metasploit3/msf3/" + msfCommand;
|
||||||
|
proc = Runtime.getRuntime().exec(args);
|
||||||
|
} catch (IOException ex3) {
|
||||||
|
try {
|
||||||
|
winArgs = new String[args.length + 3];
|
||||||
|
System.arraycopy(args, 0, winArgs, 3, args.length);
|
||||||
|
winArgs[0] = "cmd";
|
||||||
|
winArgs[1] = "/c";
|
||||||
|
File dir = new File(System.getenv("PROGRAMFILES") + "\\Metasploit\\Framework3\\bin\\");
|
||||||
|
if (msfCommand.equals("msfencode"))
|
||||||
|
winArgs[2] = "ruby.exe";
|
||||||
|
else
|
||||||
|
winArgs[2] = "rubyw.exe";
|
||||||
|
winArgs[3] = "/msf3/" + msfCommand;
|
||||||
|
proc = Runtime.getRuntime().exec(winArgs, null, dir);
|
||||||
|
} catch (IOException ex4) {
|
||||||
|
try {
|
||||||
|
File dir = new File(System.getenv("PROGRAMFILES(x86)")
|
||||||
|
+ "\\Metasploit\\Framework3\\bin\\");
|
||||||
|
proc = Runtime.getRuntime().exec(winArgs, null, dir);
|
||||||
|
} catch (IOException ex5) {
|
||||||
|
try {
|
||||||
|
File dir = new File(prefix);
|
||||||
|
proc = Runtime.getRuntime().exec(winArgs, null, dir);
|
||||||
|
} catch (IOException ex6) {
|
||||||
|
throw new MsfException("Executable not found for "+msfCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return proc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get root node of xml saved options file */
|
||||||
|
public static Element getPropertiesNode(){
|
||||||
|
if(propRoot == null){
|
||||||
|
try {
|
||||||
|
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||||
|
Element root = doc.createElement("root");
|
||||||
|
doc.appendChild(root);
|
||||||
|
propRoot = root;
|
||||||
|
} catch (ParserConfigurationException ex) {
|
||||||
|
JOptionPane.showMessageDialog(null,"Error saving properties. Cannot make new properties node.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return propRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Adds a module run to the recent modules list */
|
||||||
|
public static void addRecentModule(final Object[] args, final JMenu recentMenu, final RpcConnection rpcConn) {
|
||||||
|
recentList.add(args);
|
||||||
|
Map hash = (Map)args[2];
|
||||||
|
StringBuilder name = new StringBuilder(args[0] + " " + args[1]);
|
||||||
|
for(Object ento : hash.entrySet()){
|
||||||
|
Entry ent = (Entry)ento;
|
||||||
|
String propName = ent.getKey().toString();
|
||||||
|
if(propName.endsWith("HOST") || propName.endsWith("PORT") || propName.equals("PAYLOAD"))
|
||||||
|
name.append(" "+propName+"-"+ent.getValue());
|
||||||
|
}
|
||||||
|
final JMenuItem item = new JMenuItem(name.toString());
|
||||||
|
item.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
new ModulePopup(rpcConn, args, recentMenu).setVisible(true);
|
||||||
|
recentMenu.remove(item);
|
||||||
|
recentMenu.add(item);
|
||||||
|
for(int i = 0; i < recentList.size(); i++){
|
||||||
|
if(Arrays.equals((Object[])recentList.get(i), args)){
|
||||||
|
recentList.add(recentList.remove(i));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
recentMenu.add(item);
|
||||||
|
recentMenu.setEnabled(true);
|
||||||
|
if(recentMenu.getItemCount() > NUM_REMEMBERED_MODULES)
|
||||||
|
recentMenu.remove(0);
|
||||||
|
if(recentList.size() > NUM_REMEMBERED_MODULES)
|
||||||
|
recentList.remove(0);
|
||||||
|
}
|
||||||
|
public static void addRecentModules(JMenu recentMenu, final RpcConnection rpcConn) {
|
||||||
|
Node recentNode = null;
|
||||||
|
for(Node node = propRoot.getFirstChild(); node != null; node = node.getNextSibling())
|
||||||
|
if(node.getNodeName().equals("recent"))
|
||||||
|
recentNode = node;
|
||||||
|
|
||||||
|
if(recentNode == null)
|
||||||
|
return;
|
||||||
|
NodeList recentItems = recentNode.getChildNodes();
|
||||||
|
int len = recentItems.getLength();
|
||||||
|
for(int i = 0; i < len; i++){
|
||||||
|
HashMap hash = new HashMap();
|
||||||
|
Node recentItem = recentItems.item(i);
|
||||||
|
|
||||||
|
try{
|
||||||
|
String moduleType = recentItem.getAttributes().getNamedItem("moduleType").getNodeValue();
|
||||||
|
String fullName = recentItem.getAttributes().getNamedItem("fullName").getNodeValue();
|
||||||
|
|
||||||
|
NodeList recentItemProps = recentItem.getChildNodes();
|
||||||
|
int propslen = recentItemProps.getLength();
|
||||||
|
for(int j = 0; j < propslen; j++){
|
||||||
|
Node prop = recentItemProps.item(j);
|
||||||
|
String propName = prop.getNodeName();
|
||||||
|
String val = prop.getAttributes().getNamedItem("val").getNodeValue();
|
||||||
|
hash.put(propName, val);
|
||||||
|
}
|
||||||
|
final Object[] args = new Object[]{moduleType, fullName,hash};
|
||||||
|
|
||||||
|
addRecentModule(args, recentMenu, rpcConn);
|
||||||
|
}catch(NullPointerException nex){//if attribute doesn't exist, ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Clear history of run modules */
|
||||||
|
public static void clearHistory(JMenu recentMenu){
|
||||||
|
recentList.clear();
|
||||||
|
recentMenu.removeAll();
|
||||||
|
recentMenu.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Gets a temp file from system */
|
||||||
|
public static String getTempFilename(String prefix, String suffix) {
|
||||||
|
try{
|
||||||
|
final File temp = File.createTempFile(prefix, suffix);
|
||||||
|
String path = temp.getAbsolutePath();
|
||||||
|
temp.delete();
|
||||||
|
return path;
|
||||||
|
}catch(IOException ex){
|
||||||
|
JOptionPane.showMessageDialog(null, "Cannot create temp file. This is a bad and unexpected error. What is wrong with your system?!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Gets a temp folder from system */
|
||||||
|
public static String getTempFolder() {
|
||||||
|
try{
|
||||||
|
final File temp = File.createTempFile("abcde", ".bcde");
|
||||||
|
String path = temp.getParentFile().getAbsolutePath();
|
||||||
|
temp.delete();
|
||||||
|
return path;
|
||||||
|
}catch(IOException ex){
|
||||||
|
JOptionPane.showMessageDialog(null, "Cannot create temp file. This is a bad and unexpected error. What is wrong with your system?!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the likely local IP address for talking to the world */
|
||||||
|
public static String getLocalIp(){
|
||||||
|
try{
|
||||||
|
DatagramSocket socket = new DatagramSocket();
|
||||||
|
socket.connect(InetAddress.getByName("1.2.3.4"),1234);
|
||||||
|
socket.getLocalAddress();
|
||||||
|
String answer = socket.getLocalAddress().getHostAddress();
|
||||||
|
socket.close();
|
||||||
|
return answer;
|
||||||
|
} catch(IOException ioe){
|
||||||
|
try{
|
||||||
|
return InetAddress.getLocalHost().getHostAddress();
|
||||||
|
}catch (UnknownHostException uhe){
|
||||||
|
return "127.0.0.1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String cleanBackslashes(String input){
|
||||||
|
return backslash.matcher(input).replaceAll("/");
|
||||||
|
}
|
||||||
|
public static String doubleBackslashes(String input){
|
||||||
|
return backslash.matcher(input).replaceAll("\\\\\\\\");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,228 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class keeps a record of activities taken, sessions run, and
|
||||||
|
* credentials collected
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class MsfguiLog {
|
||||||
|
final protected Map sessions; // maps session ids to sessions
|
||||||
|
final protected ArrayList activityLog; // list of strings denoting major activities
|
||||||
|
final protected DateFormat formatter;
|
||||||
|
final protected Set hashes;
|
||||||
|
final protected Pattern hashPattern;
|
||||||
|
public static MsfguiLog defaultLog;
|
||||||
|
|
||||||
|
/** Sets up default log */
|
||||||
|
public static void initDefaultLog(){
|
||||||
|
defaultLog = new MsfguiLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates a new log to be written to a file */
|
||||||
|
public MsfguiLog() {
|
||||||
|
sessions = new HashMap();
|
||||||
|
activityLog = new ArrayList();
|
||||||
|
hashes = new HashSet();
|
||||||
|
formatter = DateFormat.getDateTimeInstance();
|
||||||
|
activityLog.add(now()+" msfgui started.");
|
||||||
|
hashPattern = Pattern.compile("\\w+:[0-9]+:\\w+:\\w+:::");
|
||||||
|
}
|
||||||
|
/** Records hashes in string */
|
||||||
|
public void logHashes(String hashString){
|
||||||
|
for(String line : hashString.split("\n"))
|
||||||
|
if(hashPattern.matcher(line).matches()) // we are done.
|
||||||
|
hashes.add(line);
|
||||||
|
}
|
||||||
|
/** Returns a list of hashes. */
|
||||||
|
public Set getHashes(){
|
||||||
|
return hashes;
|
||||||
|
}
|
||||||
|
/** Ensure that a session is recorded in the sessions map */
|
||||||
|
public void logSession(Map session){
|
||||||
|
if(sessions.get(session.get("id")) != null)
|
||||||
|
return;
|
||||||
|
sessions.put(session.get("id"), session);
|
||||||
|
activityLog.add(now() + " Session "+session.get("id")+" to "+session.get("tunnel_peer")+" opened.");
|
||||||
|
}
|
||||||
|
/** See if any sessions have been closed. */
|
||||||
|
public void checkSessions(Map sessionsActive){
|
||||||
|
for(Object o : sessions.keySet()){
|
||||||
|
Map session = (Map)sessions.get(o);
|
||||||
|
//mark as inactive if we haven't already done so, and it is inactive
|
||||||
|
if(session.get("inactive") == null && sessionsActive.get(o) == null){
|
||||||
|
session.put("inactive", o);
|
||||||
|
activityLog.add(now() + " Session "+o+" closed.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Logs module runs and console commands */
|
||||||
|
public void logMethodCall(String methodName, Object[] params){
|
||||||
|
if(methodName.startsWith("session.")){
|
||||||
|
try{
|
||||||
|
if (methodName.endsWith("_write"))
|
||||||
|
logConsole(params[0].toString(), new String(Base64.decode(params[1].toString())), true);
|
||||||
|
else if (methodName.endsWith("_script"))
|
||||||
|
logConsole(params[0].toString(), "run "+params[1].toString(), true);
|
||||||
|
}catch (MsfException mex){
|
||||||
|
}
|
||||||
|
}else if (methodName.equals("module.execute")){
|
||||||
|
activityLog.add(now() + " "+params[0]+" "+params[1]+" executed with options "+params[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Logs received console data */
|
||||||
|
public void logMethodReturn(String methodName, Object[] params, Object result){
|
||||||
|
if(!methodName.startsWith("session.") || !methodName.endsWith("_read"))
|
||||||
|
return;
|
||||||
|
try{
|
||||||
|
String resString = new String(Base64.decode(((Map)result).get("data").toString()));
|
||||||
|
logConsole(params[0].toString(), resString, false);
|
||||||
|
logHashes(resString);
|
||||||
|
}catch (MsfException mex){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Record console communication */
|
||||||
|
public void logConsole(String sessionId, String message, boolean sending){
|
||||||
|
Map session = (Map)sessions.get(sessionId);
|
||||||
|
if(session == null || message.length() == 0)
|
||||||
|
return;
|
||||||
|
//if it is multiline, add a line break before
|
||||||
|
if((message.indexOf('\n') - message.length()) % message.length() != -1)
|
||||||
|
message = "\n"+message;
|
||||||
|
ArrayList consoleLog = (ArrayList)session.get("console");
|
||||||
|
if(consoleLog == null){
|
||||||
|
consoleLog = new ArrayList(30);
|
||||||
|
session.put("console",consoleLog);
|
||||||
|
}
|
||||||
|
if(sending)
|
||||||
|
consoleLog.add(now() + " >>>" + message);
|
||||||
|
else
|
||||||
|
consoleLog.add(now() + " " + message);
|
||||||
|
}
|
||||||
|
/** Saves the file and returns where */
|
||||||
|
public String save() throws IOException{ //example: /tmp/msfguilog_Jun-9-2010.html
|
||||||
|
String destination = MsfguiApp.getTempFolder()+File.separator+"msfguilog_"
|
||||||
|
+(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(
|
||||||
|
new Date()).replaceAll("[, :]+","-"))+".html";
|
||||||
|
save(destination);
|
||||||
|
return destination;
|
||||||
|
}
|
||||||
|
/** Saves the file and returns where */
|
||||||
|
public String save(String filename) throws IOException{
|
||||||
|
activityLog.add(now()+" msfgui log created.");
|
||||||
|
FileWriter fout = new FileWriter(filename);
|
||||||
|
|
||||||
|
//Style header
|
||||||
|
fout.write("<html><head><style type=\"text/css\">\n" +
|
||||||
|
"pre {font-size:9pt;}\n" +
|
||||||
|
"td{font-size:11pt; padding-right: 10px; padding-top: 5px;}\n"+
|
||||||
|
"body{ font:13px Arial,Helvetica,sans-serif;}\n" +
|
||||||
|
"h1 {border-bottom: 1px solid #BBBBBB; margin: 10px 0 15px 0;}\n" +
|
||||||
|
"h2 {margin: 0 0 10px 0 ;}\n" +
|
||||||
|
"h1.header {font-size:3em;\n" +
|
||||||
|
"margin:20px 0 30px;\n" +
|
||||||
|
"text-align:center;}\n" +
|
||||||
|
"tr.sent td {background-color: #EEFFEE; color: black;}\n" +
|
||||||
|
"tr.recv td {background-color: #EEEEFF; color: black;}\n" +
|
||||||
|
"div.session {float: left; padding-right: 10px;}\n" +
|
||||||
|
"#page{margin:0 auto; padding:30px 200px;}\n" +
|
||||||
|
"</style></head>\n<body>\n<div id=\"page\"><h1 class=\"header\">msfgui</h1>");
|
||||||
|
|
||||||
|
//Host summary
|
||||||
|
//Add headers
|
||||||
|
fout.write("<h1>Hosts</h1>");
|
||||||
|
Set sessionsEntrySet = sessions.entrySet();
|
||||||
|
if(sessions.isEmpty()){
|
||||||
|
fout.write("<p>None. Go exploit something next time.</p>");
|
||||||
|
}else{
|
||||||
|
fout.write("<table><thead><tr><td>host</td>\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("<td>type</td><td>via_exploit</td><td>via_payload</td><td>tunnel_peer</td><td>tunnel_local</td><td>desc</td>");
|
||||||
|
|
||||||
|
HashMap hosts = new HashMap();
|
||||||
|
//Map hosts to sessions by IP
|
||||||
|
for(Object e : sessionsEntrySet){
|
||||||
|
Map session = (Map)((Entry) e).getValue();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
fout.write("</tr></thead><tbody>\n");
|
||||||
|
|
||||||
|
for(Object e : hosts.entrySet()){
|
||||||
|
String key = ((Entry)e).getKey().toString();
|
||||||
|
fout.write("<tr><td>"+key+"</td>\n");
|
||||||
|
Set hostSessions = (Set)(((Entry)e).getValue());
|
||||||
|
for(Object o : hostSessions){
|
||||||
|
Map session = (Map)o;
|
||||||
|
for(Object var : headers)
|
||||||
|
fout.write("<td>"+session.get(var)+"</td>");
|
||||||
|
fout.write("</tr>\n<tr><td></td>");
|
||||||
|
}
|
||||||
|
fout.write("</tr>");
|
||||||
|
}
|
||||||
|
fout.write("</tbody></table>\n\n");
|
||||||
|
}//end hosts
|
||||||
|
|
||||||
|
//Activity log
|
||||||
|
fout.write("<h1>Activities</h1><table><tbody>\n");
|
||||||
|
for(Object o : activityLog)
|
||||||
|
fout.write("<tr><td>"+o.toString()+"</td></tr>\n");
|
||||||
|
fout.write("</tbody></table>\n\n");
|
||||||
|
|
||||||
|
//Complete console logs
|
||||||
|
fout.write("<h1>Session logs</h1>\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("<div class=\"session\"><h2>Session "+ent.getKey()+"</h2>To " +
|
||||||
|
session.get("tunnel_peer")+"<table><tbody>\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 <pre> tags
|
||||||
|
if((entryString.indexOf('\n') - entryString.length()) % entryString.length() != -1)
|
||||||
|
entryString = "<pre>"+entryString+"</pre>";
|
||||||
|
if(entryString.contains(">>>"))
|
||||||
|
fout.write("<tr class=\"sent\"><td>"+entryString+"</td></tr>\n");
|
||||||
|
else
|
||||||
|
fout.write("<tr class=\"recv\"><td>"+entryString+"</td></tr>\n");
|
||||||
|
}
|
||||||
|
fout.write("</tbody></table></div>");
|
||||||
|
}
|
||||||
|
fout.write("</body></html>\n");
|
||||||
|
fout.flush();
|
||||||
|
fout.close();
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Gets localized date and now properly formatted */
|
||||||
|
private String now() {
|
||||||
|
return formatter.format(new Date());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="Form" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="chooseButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="commandFileButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="396" max="32767" attributes="0"/>
|
||||||
|
<Component id="okButton" alignment="1" min="-2" pref="67" max="-2" attributes="0"/>
|
||||||
|
<Component id="commandFileField" alignment="0" pref="396" max="32767" attributes="0"/>
|
||||||
|
<Component id="outputFileField" alignment="0" pref="396" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="outputFileField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="chooseButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="commandFileField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="commandFileButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jScrollPane1" pref="247" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="chooseButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="chooseButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="chooseButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chooseButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="outputFileField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="outputFileField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputFileField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="commandFileField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="commandFileField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="commandFileField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="commandFileButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="commandFileButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="commandFileButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="commandFileButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="commandsArea">
|
||||||
|
<Properties>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="commandsArea" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,184 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class MulticommandOptionsDialog extends OptionsDialog {
|
||||||
|
/** Creates new form UploadexecOptionsDialog */
|
||||||
|
public MulticommandOptionsDialog(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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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 \""+MsfguiApp.doubleBackslashes(outputFileField.getText())+"\"");
|
||||||
|
String commandList = commandsArea.getText();
|
||||||
|
if(commandFileField.getText().length() > 0){
|
||||||
|
cmd.append(" -rc \""+MsfguiApp.doubleBackslashes(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.doubleBackslashes(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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,173 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="forwardBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="addressField" pref="196" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="pingBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="reverseDnsBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="mxNsBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="serviceBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="domainField" pref="292" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="chooseButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fileField" pref="198" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="okButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="addressField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="reverseDnsBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="pingBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="mxNsBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="serviceBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="domainField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="forwardBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="fileField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="chooseButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="addressField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="addressField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="addressField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="pingBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="pingBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="pingBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="reverseDnsBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="reverseDnsBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="reverseDnsBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="forwardBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="forwardBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="forwardBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="mxNsBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="mxNsBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="mxNsBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="serviceBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="serviceBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="serviceBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="domainField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="domainField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="domainField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fileField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="fileField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="fileField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="chooseButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="chooseButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="chooseButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chooseButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,192 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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 "+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 \""+MsfguiApp.doubleBackslashes(fileField.getText())+"\"");
|
||||||
|
if(domainField.getText().length() > 0)
|
||||||
|
cmd.append(" -d "+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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,224 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
<Property name="title" type="java.lang.String" resourceKey="Form.title"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="titleLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="hostLabel" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="passwordLabel" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="portLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Component id="usernameLabel" min="-2" pref="67" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="usernameField" alignment="0" pref="431" max="32767" attributes="0"/>
|
||||||
|
<Component id="hostField" pref="431" max="32767" attributes="0"/>
|
||||||
|
<Component id="passwordField" alignment="0" pref="431" max="32767" attributes="0"/>
|
||||||
|
<Component id="portField" alignment="0" pref="431" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="startNewButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="pathButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="81" max="32767" attributes="0"/>
|
||||||
|
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="connectButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Component id="titleLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="usernameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="usernameField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="passwordField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="passwordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="hostLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="hostField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="portField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="portLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Group type="103" alignment="1" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="startNewButton" alignment="3" pref="37" max="32767" attributes="0"/>
|
||||||
|
<Component id="pathButton" alignment="3" min="-2" pref="36" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="103" alignment="1" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="connectButton" alignment="3" pref="37" max="32767" attributes="1"/>
|
||||||
|
<Component id="cancelButton" alignment="3" pref="37" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="titleLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="titleLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="titleLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="usernameLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="usernameLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="usernameLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="passwordLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="hostLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="hostLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="hostLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="portLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="portLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="portLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="usernameField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="usernameField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="usernameField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="usernameFieldActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JPasswordField" name="passwordField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="passwordFieldActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="hostField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="hostField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="hostField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="hostFieldActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="portField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="portField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="portField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="portFieldActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="connectButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font component="connectButton" property="font" relativeSize="true" size="0"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="connectButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="connectButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="connectButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="cancelButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font component="cancelButton" property="font" relativeSize="true" size="0"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="cancelButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="cancelButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="startNewButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||||
|
<FontInfo relative="true">
|
||||||
|
<Font bold="true" component="startNewButton" property="font" relativeSize="true" size="0"/>
|
||||||
|
</FontInfo>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="startNewButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="startNewButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="startNewButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="pathButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="pathButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="pathButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pathButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,308 @@
|
||||||
|
/*
|
||||||
|
* UserPassDialog.java
|
||||||
|
*
|
||||||
|
* Created on May 15, 2010, 12:53:23 PM
|
||||||
|
*/
|
||||||
|
package msfgui;
|
||||||
|
import java.io.File;
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class OpenConnectionDialog extends javax.swing.JDialog {
|
||||||
|
MainFrame mainframe;
|
||||||
|
RpcConnection rpcConn;
|
||||||
|
|
||||||
|
/** 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());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RpcConnection getConnection(MainFrame mainframe) {
|
||||||
|
//try saved connection credentials
|
||||||
|
try{
|
||||||
|
Element info = MsfguiApp.getPropertiesNode();
|
||||||
|
String username = info.getAttributeNode("username").getValue();
|
||||||
|
String password = info.getAttributeNode("password").getValue();
|
||||||
|
String host = info.getAttributeNode("host").getValue();
|
||||||
|
int port = Integer.parseInt(info.getAttributeNode("port").getValue());
|
||||||
|
return new RpcConnection(username, password.toCharArray(), host, port);
|
||||||
|
} catch (MsfException mex) {
|
||||||
|
} catch (NullPointerException nex) {//generated when attributes dont exist.
|
||||||
|
}
|
||||||
|
//Darn. open the gui anyway
|
||||||
|
OpenConnectionDialog diag = new OpenConnectionDialog(true, mainframe);
|
||||||
|
diag.setVisible(true);
|
||||||
|
return diag.getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public RpcConnection getConnection() {
|
||||||
|
return 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGap(6, 6, 6)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(hostLabel)
|
||||||
|
.addComponent(passwordLabel)
|
||||||
|
.addComponent(portLabel)))
|
||||||
|
.addComponent(usernameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE)
|
||||||
|
.addComponent(hostField, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE)
|
||||||
|
.addComponent(passwordField, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE)
|
||||||
|
.addComponent(portField, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE)))
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(startNewButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(pathButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE)
|
||||||
|
.addComponent(cancelButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.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(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.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.UNRELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(startNewButton, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
|
||||||
|
.addComponent(pathButton, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.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)))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//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());
|
||||||
|
try {
|
||||||
|
rpcConn = new RpcConnection(username, password, host, port);
|
||||||
|
} catch (MsfException mex) {
|
||||||
|
rpcConn = null;
|
||||||
|
}
|
||||||
|
this.setVisible(false);
|
||||||
|
}//GEN-LAST:event_connectButtonActionPerformed
|
||||||
|
|
||||||
|
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
|
||||||
|
rpcConn = null;
|
||||||
|
this.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 = this.usernameField.getText();
|
||||||
|
if(this.passwordField.getPassword().length > 0)
|
||||||
|
RpcConnection.defaultPass = new String(this.passwordField.getPassword());
|
||||||
|
//do the action. There's probably a "right" way to do this. Oh well.
|
||||||
|
mainframe.getContext().getActionMap(mainframe).get("startRpc").actionPerformed(new java.awt.event.ActionEvent(startNewButton,1234,""));
|
||||||
|
this.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);
|
||||||
|
dir =new File(MsfguiApp.getPropertiesNode().getAttribute("commandPrefix"));
|
||||||
|
if(dir.isDirectory())
|
||||||
|
MsfguiApp.fileChooser.setCurrentDirectory(dir);
|
||||||
|
if (MsfguiApp.fileChooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
|
||||||
|
return;
|
||||||
|
MsfguiApp.getPropertiesNode().setAttribute("commandPrefix",
|
||||||
|
MsfguiApp.fileChooser.getCurrentDirectory().getPath()+File.separator);
|
||||||
|
JOptionPane.showMessageDialog(this, "Will now try running \n"
|
||||||
|
+MsfguiApp.getPropertiesNode().getAttribute("commandPrefix")+"msfrpcd\n"
|
||||||
|
+"and "+ MsfguiApp.getPropertiesNode().getAttribute("commandPrefix")+"ruby /msf3/msfrpcd\n"
|
||||||
|
+ "when starting new daemon. Note: for the second to work on Windows,\n"
|
||||||
|
+ "use something like Framework3\\bin not Framework3\\msf3");
|
||||||
|
}//GEN-LAST:event_pathButtonActionPerformed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton cancelButton;
|
||||||
|
private javax.swing.JButton connectButton;
|
||||||
|
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.JButton startNewButton;
|
||||||
|
private javax.swing.JLabel titleLabel;
|
||||||
|
private javax.swing.JTextField usernameField;
|
||||||
|
private javax.swing.JLabel usernameLabel;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||||
|
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||||
|
</Layout>
|
||||||
|
</Form>
|
|
@ -0,0 +1,45 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class OptionsDialog extends javax.swing.JDialog {
|
||||||
|
|
||||||
|
protected String command;
|
||||||
|
|
||||||
|
//Opens dialog to get options
|
||||||
|
public String getCommand(){
|
||||||
|
setVisible(true);
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
public String toString(){
|
||||||
|
return getCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,399 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="Form" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="1" pref="922" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="752" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="outputScrollPane" pref="1054" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="titleLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="descriptionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="authorsLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="licenseLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="versionLabel" 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"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" 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" 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>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="templateField" pref="268" max="32767" attributes="1"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="templateButton" min="-2" pref="87" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="archField" alignment="0" pref="362" max="32767" attributes="1"/>
|
||||||
|
<Component id="timesField" alignment="0" pref="362" max="32767" attributes="1"/>
|
||||||
|
<Component id="outputCombo" alignment="0" pref="362" max="32767" attributes="1"/>
|
||||||
|
<Component id="encoderCombo" alignment="0" pref="362" 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>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="templateWorkingCheck" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="154" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="195" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="titleLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="descriptionLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="authorsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="licenseLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="versionLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace 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"/>
|
||||||
|
<Component id="saveButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="handleButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="outputScrollPane" pref="437" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace 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="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"/>
|
||||||
|
</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"/>
|
||||||
|
</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"/>
|
||||||
|
</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"/>
|
||||||
|
</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="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>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextField" name="timesField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="timesField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="timesField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="encoderCombo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="4">
|
||||||
|
<StringItem index="0" value="Item 1"/>
|
||||||
|
<StringItem index="1" value="Item 2"/>
|
||||||
|
<StringItem index="2" value="Item 3"/>
|
||||||
|
<StringItem index="3" value="Item 4"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="encoderCombo" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="outputCombo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="15">
|
||||||
|
<StringItem index="0" value="c"/>
|
||||||
|
<StringItem index="1" value="elf"/>
|
||||||
|
<StringItem index="2" value="exe"/>
|
||||||
|
<StringItem index="3" value="java"/>
|
||||||
|
<StringItem index="4" value="js_le"/>
|
||||||
|
<StringItem index="5" value="js_be"/>
|
||||||
|
<StringItem index="6" value="perl"/>
|
||||||
|
<StringItem index="7" value="raw"/>
|
||||||
|
<StringItem index="8" value="ruby"/>
|
||||||
|
<StringItem index="9" value="vba"/>
|
||||||
|
<StringItem index="10" value="vbs"/>
|
||||||
|
<StringItem index="11" value="loop-vbs"/>
|
||||||
|
<StringItem index="12" value="asp"/>
|
||||||
|
<StringItem index="13" value="war"/>
|
||||||
|
<StringItem index="14" value="macho"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
<Property name="selectedIndex" type="int" value="2"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputCombo" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="templateButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="templateButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="templateButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="templateButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="templateWorkingCheck">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="templateWorkingCheck.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="templateWorkingCheck" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="archLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="archLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="archLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="outputLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="outputLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="timesLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="timesLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="timesLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="archField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="archField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="archField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="descriptionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="descriptionLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="descriptionLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="titleLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="titleLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="titleLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="encoderLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="encoderLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="encoderLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="generateButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="generateButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="generateButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="generateButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="versionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="versionLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="versionLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="licenseLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="licenseLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="licenseLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="authorsLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="authorsLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="authorsLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="outputScrollPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputScrollPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="outputPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="lineWrap" type="boolean" value="true"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputPane" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="displayButton">
|
||||||
|
<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="displayButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="displayButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="displayButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="saveButton">
|
||||||
|
<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="saveButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="saveButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="outputPathLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="outputPathLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputPathLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="outputPathField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="outputPathField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputPathField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="choosePathButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="choosePathButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="choosePathButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="choosePathButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="templateLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="templateLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="templateLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="templateField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="templateField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="handleButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="handleButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="handleButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="handleButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,688 @@
|
||||||
|
/*
|
||||||
|
* PayloadPopup.java
|
||||||
|
*
|
||||||
|
* Created on May 16, 2010, 12:17:16 AM
|
||||||
|
*/
|
||||||
|
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 javax.swing.DefaultComboBoxModel;
|
||||||
|
import javax.swing.GroupLayout;
|
||||||
|
import javax.swing.GroupLayout.ParallelGroup;
|
||||||
|
import javax.swing.GroupLayout.SequentialGroup;
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class PayloadPopup extends MsfFrame {
|
||||||
|
private RpcConnection rpcConn;
|
||||||
|
private ArrayList elementVector;
|
||||||
|
private String fullName;
|
||||||
|
private MainFrame mainFrame;
|
||||||
|
|
||||||
|
/** Creates new form PayloadPopup */
|
||||||
|
public PayloadPopup(String fullName, RpcConnection rpcConn, MainFrame frame) {
|
||||||
|
mainFrame = frame;
|
||||||
|
initComponents();
|
||||||
|
outputPathField.setText(MsfguiApp.getTempFolder()+File.separator+"msf.exe");
|
||||||
|
this.rpcConn = rpcConn;
|
||||||
|
elementVector = new ArrayList();
|
||||||
|
this.fullName = fullName;
|
||||||
|
showOptions(fullName);
|
||||||
|
|
||||||
|
//get encoders
|
||||||
|
try{
|
||||||
|
Object[] encoders = (Object[])((Map) rpcConn.execute("module.encoders")).get("modules");
|
||||||
|
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){
|
||||||
|
}
|
||||||
|
setSize(800, 700);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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);
|
||||||
|
|
||||||
|
GroupLayout mainPanelLayout = (GroupLayout)mainPanel.getLayout();
|
||||||
|
//HORIZONTAL GROUPING
|
||||||
|
ParallelGroup labelGroup = mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
|
||||||
|
//make label group
|
||||||
|
for(int i = 0; i < elementVector.size(); i++)
|
||||||
|
labelGroup = labelGroup.addComponent(((Component[])elementVector.get(i))[0]);
|
||||||
|
//make text box group
|
||||||
|
ParallelGroup textBoxGroup = mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
|
||||||
|
for(int i = 0; i < elementVector.size(); i++)
|
||||||
|
textBoxGroup = textBoxGroup.addComponent(((Component[])elementVector.get(i))[1]);
|
||||||
|
//put it together
|
||||||
|
mainPanelLayout.setHorizontalGroup(
|
||||||
|
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(titleLabel)
|
||||||
|
.addComponent(descriptionLabel)
|
||||||
|
.addComponent(authorsLabel)
|
||||||
|
.addComponent(licenseLabel)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGroup(labelGroup)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addGroup(textBoxGroup)
|
||||||
|
.addContainerGap())
|
||||||
|
.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.UNRELATED)
|
||||||
|
.addComponent(handleButton))
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
|
||||||
|
.addComponent(outputScrollPane, javax.swing.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))
|
||||||
|
.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))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(templateButton)
|
||||||
|
.addComponent(choosePathButton)))
|
||||||
|
.addComponent(timesField, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(templateWorkingCheck)))
|
||||||
|
.addContainerGap()));
|
||||||
|
|
||||||
|
//VERTICAL GROUPING
|
||||||
|
SequentialGroup groupie = mainPanelLayout.createSequentialGroup().
|
||||||
|
addComponent(titleLabel).
|
||||||
|
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||||||
|
addComponent(descriptionLabel).
|
||||||
|
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||||||
|
addComponent(authorsLabel).
|
||||||
|
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||||||
|
addComponent(licenseLabel).
|
||||||
|
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||||||
|
addComponent(versionLabel);
|
||||||
|
for(int i = 0; i < elementVector.size(); i++){
|
||||||
|
groupie = groupie.addGroup(mainPanelLayout.createParallelGroup(
|
||||||
|
javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(((Component[])elementVector.get(i))[0]) //LABEL
|
||||||
|
.addComponent(((Component[])elementVector.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);
|
||||||
|
}
|
||||||
|
groupie = groupie
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(generateButton)
|
||||||
|
.addComponent(displayButton)
|
||||||
|
.addComponent(saveButton)
|
||||||
|
.addComponent(handleButton))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.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(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))
|
||||||
|
.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))
|
||||||
|
.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))
|
||||||
|
.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))
|
||||||
|
.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(templateButton)
|
||||||
|
.addComponent(templateWorkingCheck))
|
||||||
|
.addContainerGap();
|
||||||
|
mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(
|
||||||
|
javax.swing.GroupLayout.Alignment.LEADING).addGroup(groupie));
|
||||||
|
}
|
||||||
|
/** Displays payload info and options. */
|
||||||
|
private void showOptions(String fullName) {
|
||||||
|
try {
|
||||||
|
Map info = (Map) rpcConn.execute("module.info", new Object[]{"payload", fullName});
|
||||||
|
//Basic info
|
||||||
|
setTitle(info.get("name") + " " + fullName);
|
||||||
|
titleLabel.setText("<html><h2>"+info.get("name")+ "</h2></html>");
|
||||||
|
//wrapLabelText(descriptionLabel, info.get("description").toString().replace("\n", " "));
|
||||||
|
descriptionLabel.setText(info.get("description").toString().replace("\n", " "));
|
||||||
|
if(info.get("license") instanceof String){
|
||||||
|
licenseLabel.setText("<html><b>License:</b> "+ info.get("license")+"</html>");
|
||||||
|
}else{
|
||||||
|
Object [] license = (Object[]) info.get("license");
|
||||||
|
StringBuilder licenseString = new StringBuilder();
|
||||||
|
for(int i = 0; i < license.length; i++)
|
||||||
|
licenseString.append(license[i]+" ");
|
||||||
|
licenseLabel.setText("<html><b>License:</b> "+ licenseString+"</html>");
|
||||||
|
}
|
||||||
|
versionLabel.setText("<html><b>Version:</b> "+ info.get("version")+"</html>");
|
||||||
|
//Authors
|
||||||
|
Object[] authors = (Object[]) info.get("authors");
|
||||||
|
StringBuilder authorLine = new StringBuilder();
|
||||||
|
if (authors.length > 0)
|
||||||
|
authorLine.append(authors[0].toString());
|
||||||
|
for (int i = 1; i < authors.length; i++)
|
||||||
|
authorLine.append(", " + authors[i]);
|
||||||
|
authorsLabel.setText("<html><b>Authors:</b> "+ authorLine.toString()+"</html>");
|
||||||
|
|
||||||
|
//display options
|
||||||
|
Map options = (Map) rpcConn.execute("module.options", new Object[]{"payload", fullName});
|
||||||
|
for (Object optionName : options.keySet())
|
||||||
|
addOption(optionName, (Map)options.get(optionName));
|
||||||
|
resetLayout();
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addOption(Object optionName, Map option) {
|
||||||
|
JLabel lab = new JLabel();
|
||||||
|
mainPanel.add(lab);
|
||||||
|
lab.setText(optionName + " " + option.get("desc"));
|
||||||
|
lab.setName(optionName.toString());
|
||||||
|
JTextField optionField = new JTextField();
|
||||||
|
if (option.get("default") != null)
|
||||||
|
optionField.setText(option.get("default").toString());
|
||||||
|
else if (optionName.equals("LHOST"))
|
||||||
|
optionField.setText(MsfguiApp.getLocalIp());
|
||||||
|
optionField.setName("field" + optionName);
|
||||||
|
mainPanel.add(optionField);
|
||||||
|
elementVector.add(new Component[]{lab,optionField});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
buttonGroup1 = new javax.swing.ButtonGroup();
|
||||||
|
jScrollPane1 = 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();
|
||||||
|
descriptionLabel = new javax.swing.JLabel();
|
||||||
|
titleLabel = new javax.swing.JLabel();
|
||||||
|
encoderLabel = new javax.swing.JLabel();
|
||||||
|
generateButton = new javax.swing.JButton();
|
||||||
|
versionLabel = new javax.swing.JLabel();
|
||||||
|
licenseLabel = new javax.swing.JLabel();
|
||||||
|
authorsLabel = new javax.swing.JLabel();
|
||||||
|
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();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
setName("Form"); // NOI18N
|
||||||
|
|
||||||
|
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
jScrollPane1.setName("jScrollPane1"); // 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", "java", "js_le", "js_be", "perl", "raw", "ruby", "vba", "vbs", "loop-vbs", "asp", "war", "macho" }));
|
||||||
|
outputCombo.setSelectedIndex(2);
|
||||||
|
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
|
||||||
|
|
||||||
|
descriptionLabel.setText(resourceMap.getString("descriptionLabel.text")); // NOI18N
|
||||||
|
descriptionLabel.setName("descriptionLabel"); // NOI18N
|
||||||
|
|
||||||
|
titleLabel.setText(resourceMap.getString("titleLabel.text")); // NOI18N
|
||||||
|
titleLabel.setName("titleLabel"); // 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
|
||||||
|
versionLabel.setName("versionLabel"); // NOI18N
|
||||||
|
|
||||||
|
licenseLabel.setText(resourceMap.getString("licenseLabel.text")); // NOI18N
|
||||||
|
licenseLabel.setName("licenseLabel"); // NOI18N
|
||||||
|
|
||||||
|
authorsLabel.setText(resourceMap.getString("authorsLabel.text")); // NOI18N
|
||||||
|
authorsLabel.setName("authorsLabel"); // NOI18N
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1026, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(titleLabel, javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(descriptionLabel, javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(authorsLabel, javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(licenseLabel, javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(versionLabel, 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))
|
||||||
|
.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, 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))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addComponent(templateField, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(templateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(archField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 311, Short.MAX_VALUE)
|
||||||
|
.addComponent(timesField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 311, Short.MAX_VALUE)
|
||||||
|
.addComponent(outputCombo, javax.swing.GroupLayout.Alignment.LEADING, 0, 311, Short.MAX_VALUE)
|
||||||
|
.addComponent(encoderCombo, javax.swing.GroupLayout.Alignment.LEADING, 0, 311, 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)))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(templateWorkingCheck)
|
||||||
|
.addGap(154, 154, 154)))
|
||||||
|
.addGap(195, 195, 195))))
|
||||||
|
);
|
||||||
|
mainPanelLayout.setVerticalGroup(
|
||||||
|
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(titleLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(descriptionLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(authorsLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(licenseLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(generateButton)
|
||||||
|
.addComponent(displayButton)
|
||||||
|
.addComponent(saveButton)
|
||||||
|
.addComponent(handleButton))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.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(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))
|
||||||
|
.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))
|
||||||
|
.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))
|
||||||
|
.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))
|
||||||
|
.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(templateButton)
|
||||||
|
.addComponent(templateWorkingCheck))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
jScrollPane1.setViewportView(mainPanel);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 752, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void generateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateButtonActionPerformed
|
||||||
|
try {
|
||||||
|
Map options = new HashMap();
|
||||||
|
for(Object obj : elementVector){
|
||||||
|
String name = ((JLabel)((Component[])obj)[0]).getName();
|
||||||
|
String val = ((JTextField)((Component[])obj)[1]).getText();
|
||||||
|
if(val.length() > 0)
|
||||||
|
options.put(name, val);
|
||||||
|
}
|
||||||
|
Map data = (Map) rpcConn.execute("module.execute", new Object[]{"payload", fullName,options});
|
||||||
|
//Basic info
|
||||||
|
if(!data.get("result").equals("success"))
|
||||||
|
return;
|
||||||
|
String rawHex = data.get("payload").toString();
|
||||||
|
|
||||||
|
if(saveButton.isSelected()){ //Encode and output
|
||||||
|
byte[] 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);
|
||||||
|
File tmpFile = File.createTempFile("msftmp",".raw");
|
||||||
|
String path = tmpFile.getAbsolutePath();
|
||||||
|
FileOutputStream fout = new FileOutputStream(tmpFile);
|
||||||
|
fout.write(buffer);
|
||||||
|
fout.close();
|
||||||
|
|
||||||
|
ArrayList commandBuilder = new ArrayList();
|
||||||
|
commandBuilder.add("msfencode");
|
||||||
|
commandBuilder.add("-o");
|
||||||
|
commandBuilder.add(outputPathField.getText());
|
||||||
|
commandBuilder.add("-e");
|
||||||
|
commandBuilder.add(encoderCombo.getSelectedItem());
|
||||||
|
commandBuilder.add("-t");
|
||||||
|
commandBuilder.add(outputCombo.getSelectedItem());
|
||||||
|
commandBuilder.add("-i");
|
||||||
|
commandBuilder.add(path);
|
||||||
|
if(timesField.getText().length() > 0){
|
||||||
|
commandBuilder.add("-c");
|
||||||
|
commandBuilder.add(timesField.getText());
|
||||||
|
}
|
||||||
|
if(archField.getText().length() > 0){
|
||||||
|
commandBuilder.add("-a");
|
||||||
|
commandBuilder.add(archField.getText());
|
||||||
|
}
|
||||||
|
if(templateField.getText().length() > 0){
|
||||||
|
commandBuilder.add("-x");
|
||||||
|
commandBuilder.add(templateField.getText());
|
||||||
|
if(templateWorkingCheck.isSelected())
|
||||||
|
commandBuilder.add("-k");
|
||||||
|
}
|
||||||
|
new ProcessWindow(MsfguiApp.startMsfProc(commandBuilder)).setVisible(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
outputPane.setText("Payload "+fullName+" "+options+" "+(rawHex.length()/2)+" bytes.");
|
||||||
|
boolean isPlain = true;
|
||||||
|
StringBuilder plain = new StringBuilder("");
|
||||||
|
for(int i = 0; i < rawHex.length(); i += 2){
|
||||||
|
int chint = Integer.parseInt(rawHex.substring(i,i+2),16);
|
||||||
|
if (!Character.isISOControl(chint))// or check isLetterOrDigit isWhitespace or " , . (){}-_+=<>.,?/'"; etc.
|
||||||
|
plain.append((char)chint);
|
||||||
|
else
|
||||||
|
isPlain = false;
|
||||||
|
}
|
||||||
|
if(isPlain)
|
||||||
|
outputPane.append("\n\nplain text\n"+plain);
|
||||||
|
StringBuilder rubyHex = new StringBuilder("\"");
|
||||||
|
for(int i = 0; i < rawHex.length(); i += 20){
|
||||||
|
for(int j = 0; j < 20 && i + j + 2 <= rawHex.length(); j += 2){
|
||||||
|
rubyHex.append("\\x");
|
||||||
|
rubyHex.append(rawHex.substring(i + j, i + j + 2));
|
||||||
|
}
|
||||||
|
rubyHex.append("\"");
|
||||||
|
if(i + 20 < rawHex.length())
|
||||||
|
rubyHex.append("+\n\"");
|
||||||
|
}
|
||||||
|
outputPane.append("\n\nruby\n"+rubyHex);
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(this, ex);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
JOptionPane.showMessageDialog(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
|
||||||
|
Map options = new HashMap();
|
||||||
|
for(Object obj : elementVector){
|
||||||
|
String name = ((JLabel)((Component[])obj)[0]).getName();
|
||||||
|
String val = ((JTextField)((Component[])obj)[1]).getText();
|
||||||
|
if(val.length() > 0)
|
||||||
|
options.put(name, val);
|
||||||
|
}
|
||||||
|
options.put("PAYLOAD",fullName);
|
||||||
|
options.put("TARGET","0");
|
||||||
|
try{
|
||||||
|
final Object[] args = new Object[]{"exploit", "multi/handler", options};
|
||||||
|
Map data = (Map) rpcConn.execute("module.execute",args);
|
||||||
|
MsfguiApp.addRecentModule(args, mainFrame.recentMenu, rpcConn);
|
||||||
|
}catch (MsfException ex){
|
||||||
|
JOptionPane.showMessageDialog(this, ex);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_handleButtonActionPerformed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JTextField archField;
|
||||||
|
private javax.swing.JLabel archLabel;
|
||||||
|
private javax.swing.JLabel authorsLabel;
|
||||||
|
private javax.swing.ButtonGroup buttonGroup1;
|
||||||
|
private javax.swing.JButton choosePathButton;
|
||||||
|
private javax.swing.JLabel descriptionLabel;
|
||||||
|
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.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JLabel licenseLabel;
|
||||||
|
private javax.swing.JPanel mainPanel;
|
||||||
|
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;
|
||||||
|
private javax.swing.JLabel titleLabel;
|
||||||
|
private javax.swing.JLabel versionLabel;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
}
|
199
external/source/gui/msfguijava/src/msfgui/PersistenceOptionsDialog.form
vendored
Executable file
|
@ -0,0 +1,199 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="44" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Component id="intervalLabel" max="32767" attributes="1"/>
|
||||||
|
<Component id="ipLabel" max="32767" attributes="1"/>
|
||||||
|
<Component id="portLabel" alignment="0" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="portField" pref="338" max="32767" attributes="1"/>
|
||||||
|
<Component id="ipField" alignment="0" pref="338" max="32767" attributes="1"/>
|
||||||
|
<Component id="intervalField" alignment="0" pref="338" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||||
|
<Component id="handlerBox" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Component id="autostartBox" alignment="0" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="loginRestartBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="177" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="autostartBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="loginRestartBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="handlerBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="ipLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="ipField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="portField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="portLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="intervalField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="intervalLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="ipLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="4"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="ipLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="ipLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="portLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="4"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="portLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="portLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="ipField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="ipField" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[50, 27]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="portField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="portField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="portField" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[50, 27]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="cancelButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="cancelButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="cancelButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="autostartBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="autostartBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="autostartBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="autostartBoxActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="handlerBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="handlerBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="handlerBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="intervalField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="intervalField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="intervalField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="intervalLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="4"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="intervalLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="intervalLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="loginRestartBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="loginRestartBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="loginRestartBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="loginRestartBoxActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
215
external/source/gui/msfguijava/src/msfgui/PersistenceOptionsDialog.java
vendored
Executable file
|
@ -0,0 +1,215 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
autostartBox = new javax.swing.JCheckBox();
|
||||||
|
handlerBox = new javax.swing.JCheckBox();
|
||||||
|
intervalField = new javax.swing.JTextField();
|
||||||
|
intervalLabel = new javax.swing.JLabel();
|
||||||
|
loginRestartBox = 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
autostartBox.setSelected(true);
|
||||||
|
autostartBox.setText(resourceMap.getString("autostartBox.text")); // NOI18N
|
||||||
|
autostartBox.setName("autostartBox"); // NOI18N
|
||||||
|
autostartBox.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
autostartBoxActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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, 338, Short.MAX_VALUE)
|
||||||
|
.addComponent(ipField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
|
||||||
|
.addComponent(intervalField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 338, 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(autostartBox, 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)
|
||||||
|
.addContainerGap(177, 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(autostartBox)
|
||||||
|
.addComponent(loginRestartBox))
|
||||||
|
.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();
|
||||||
|
}// </editor-fold>//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(autostartBox.isSelected())
|
||||||
|
cmd.append(" -X ");
|
||||||
|
if(loginRestartBox.isSelected())
|
||||||
|
cmd.append(" -U ");
|
||||||
|
cmd.append(" -i "+Integer.parseInt(intervalField.getText()));
|
||||||
|
cmd.append(" -p "+Integer.parseInt(portField.getText()));
|
||||||
|
cmd.append(" -r "+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 autostartBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_autostartBoxActionPerformed
|
||||||
|
if(autostartBox.isSelected())
|
||||||
|
loginRestartBox.setSelected(false);
|
||||||
|
}//GEN-LAST:event_autostartBoxActionPerformed
|
||||||
|
|
||||||
|
private void loginRestartBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginRestartBoxActionPerformed
|
||||||
|
if(loginRestartBox.isSelected())
|
||||||
|
autostartBox.setSelected(false);
|
||||||
|
}//GEN-LAST:event_loginRestartBoxActionPerformed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JCheckBox autostartBox;
|
||||||
|
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;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public abstract class PopupMouseListener extends MouseAdapter{
|
||||||
|
public void mousePressed(MouseEvent e) {
|
||||||
|
showPopup(e);
|
||||||
|
}
|
||||||
|
public void mouseReleased(MouseEvent e) {
|
||||||
|
showPopup(e);
|
||||||
|
}
|
||||||
|
public void mouseClicked(MouseEvent e){ //show interaction window on double-click
|
||||||
|
try{
|
||||||
|
if(e.getClickCount() == 2)
|
||||||
|
doubleClicked(e);
|
||||||
|
}catch(MsfException xre){
|
||||||
|
JOptionPane.showMessageDialog(null, "action failed " + xre);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public abstract void doubleClicked (MouseEvent e) throws MsfException;
|
||||||
|
public abstract void showPopup(MouseEvent e);
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
|
||||||
|
<EventHandler event="windowOpened" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowOpened"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="807" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="refreshButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="588" max="32767" attributes="0"/>
|
||||||
|
<Component id="killButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="migrateButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" pref="602" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="migrateButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="killButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="refreshButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="migrateButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="migrateButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="migrateButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="migrateButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="killButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="killButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="killButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="killButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="processTable">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
|
<Table columnCount="5" rowCount="0">
|
||||||
|
<Column editable="true" title="Name" type="java.lang.String"/>
|
||||||
|
<Column editable="true" title="PID" type="java.lang.String"/>
|
||||||
|
<Column editable="true" title="User" type="java.lang.String"/>
|
||||||
|
<Column editable="true" title="Session" type="java.lang.String"/>
|
||||||
|
<Column editable="true" title="Path" type="java.lang.String"/>
|
||||||
|
</Table>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="processTable" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="refreshButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="refreshButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="refreshButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="refreshButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,231 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.HeadlessException;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.Timer;
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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;
|
||||||
|
|
||||||
|
/** Creates new form ProcessList */
|
||||||
|
public ProcessList(final RpcConnection rpcConn, final Map session, Map sessionPopupMap) {
|
||||||
|
super("Meterpreter remote process list");
|
||||||
|
initComponents();
|
||||||
|
model = new DefaultTableModel(){
|
||||||
|
public boolean isCellEditable(int row, int col){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
processTable.setModel(model);
|
||||||
|
processTable.setShowHorizontalLines(false);
|
||||||
|
processTable.setShowVerticalLines(false);
|
||||||
|
this.rpcConn = rpcConn;
|
||||||
|
this.session = session;
|
||||||
|
this.lock = ((InteractWindow)sessionPopupMap.get(session.get("uuid"))).lock;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Lists the processes that are running */
|
||||||
|
protected void listProcs() throws HeadlessException {
|
||||||
|
try {
|
||||||
|
rpcConn.execute("session.meterpreter_write", new Object[]{session.get("id"), Base64.encode(("ps\n").getBytes())});
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
if (ex.getMessage().equals("unknown session"))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
readTimer = new Timer(300, new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
try {
|
||||||
|
Map received = (Map) rpcConn.execute("session.meterpreter_read", new Object[]{session.get("id")});
|
||||||
|
if (!received.get("encoding").equals("base64")) {
|
||||||
|
JOptionPane.showMessageDialog(null, "uhoh. encoding changed. Time to update msfgui?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
byte[] decodedBytes = Base64.decode(received.get("data").toString());
|
||||||
|
if (decodedBytes.length == 0)
|
||||||
|
return;
|
||||||
|
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().equals("unknown session"))
|
||||||
|
readTimer.stop();
|
||||||
|
JOptionPane.showMessageDialog(null, ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
readTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
migrateButton = new javax.swing.JButton();
|
||||||
|
killButton = new javax.swing.JButton();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
processTable = new javax.swing.JTable();
|
||||||
|
refreshButton = new javax.swing.JButton();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
addWindowListener(new java.awt.event.WindowAdapter() {
|
||||||
|
public void windowClosing(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowClosing(evt);
|
||||||
|
}
|
||||||
|
public void windowOpened(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowOpened(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(ProcessList.class);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 807, Short.MAX_VALUE)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(refreshButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 588, Short.MAX_VALUE)
|
||||||
|
.addComponent(killButton)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(migrateButton)))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 602, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(migrateButton)
|
||||||
|
.addComponent(killButton)
|
||||||
|
.addComponent(refreshButton))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
|
||||||
|
lock.unlock();
|
||||||
|
}//GEN-LAST:event_formWindowClosing
|
||||||
|
|
||||||
|
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
|
||||||
|
lock.lock();
|
||||||
|
listProcs();
|
||||||
|
}//GEN-LAST:event_formWindowOpened
|
||||||
|
|
||||||
|
private void migrateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_migrateButtonActionPerformed
|
||||||
|
try {
|
||||||
|
rpcConn.execute("session.meterpreter_write", new Object[]{session.get("id"),
|
||||||
|
Base64.encode(("migrate "+processTable.getModel().getValueAt(processTable.getSelectedRow(),0) + "\n").getBytes())});
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
listProcs();
|
||||||
|
}//GEN-LAST:event_migrateButtonActionPerformed
|
||||||
|
|
||||||
|
private void killButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_killButtonActionPerformed
|
||||||
|
try {
|
||||||
|
rpcConn.execute("session.meterpreter_write", new Object[]{session.get("id"),
|
||||||
|
Base64.encode(("kill "+processTable.getModel().getValueAt(processTable.getSelectedRow(),0) + "\n").getBytes())});
|
||||||
|
} catch (Exception ex) {
|
||||||
|
JOptionPane.showMessageDialog(null, ex);
|
||||||
|
}
|
||||||
|
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.JButton migrateButton;
|
||||||
|
private javax.swing.JTable processTable;
|
||||||
|
private javax.swing.JButton refreshButton;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="538" max="32767" attributes="0"/>
|
||||||
|
<Component id="outputField" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Component id="outputField" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" pref="308" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="outputField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="outputField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="outputField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="outputPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,91 @@
|
||||||
|
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class ProcessWindow extends MsfFrame {
|
||||||
|
private final InputStreamReader[] streams;
|
||||||
|
|
||||||
|
/** Creates new form ProcessWindow */
|
||||||
|
public ProcessWindow(Process proc) {
|
||||||
|
initComponents();
|
||||||
|
streams = new InputStreamReader[2];
|
||||||
|
streams[0] = new InputStreamReader(proc.getInputStream());
|
||||||
|
streams[1] = new InputStreamReader(proc.getErrorStream());
|
||||||
|
for(int i = 0; i < 2; i++){
|
||||||
|
final InputStreamReader stream = streams[i];
|
||||||
|
new Thread(){
|
||||||
|
public void run(){
|
||||||
|
try{
|
||||||
|
char[] cbuf = new char[1000];
|
||||||
|
int read;
|
||||||
|
while ((read = stream.read(cbuf)) != -1)
|
||||||
|
outputPane.append(new String(cbuf,0,read));
|
||||||
|
if(read == -1)
|
||||||
|
outputField.setText("Completed");
|
||||||
|
}catch(IOException iox){
|
||||||
|
outputField.setText("Done");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
outputField = new javax.swing.JLabel();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
outputPane = new javax.swing.JTextArea();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(msfgui.MsfguiApp.class).getContext().getResourceMap(ProcessWindow.class);
|
||||||
|
outputField.setText(resourceMap.getString("outputField.text")); // NOI18N
|
||||||
|
outputField.setName("outputField"); // NOI18N
|
||||||
|
|
||||||
|
outputPane.setEditable(false);
|
||||||
|
jScrollPane1.setViewportView(outputPane);
|
||||||
|
|
||||||
|
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(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
|
||||||
|
.addComponent(outputField))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(outputField)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JLabel outputField;
|
||||||
|
private javax.swing.JTextArea outputPane;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="addressField" pref="340" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Component id="jLabel4" max="32767" attributes="1"/>
|
||||||
|
<Component id="jLabel2" alignment="0" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="passField" alignment="1" pref="361" max="32767" attributes="0"/>
|
||||||
|
<Component id="userField" alignment="0" pref="361" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Component id="okButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="addressField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="userField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="passField" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="addressField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="addressField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="addressField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="userField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="userField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="userField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="passField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,137 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class RemoteWinenumOptionsDialog extends OptionsDialog {
|
||||||
|
|
||||||
|
/** Creates new form NetenumOptionsDialog */
|
||||||
|
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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class RpcAction implements ActionListener {
|
||||||
|
protected Object arg = null;
|
||||||
|
protected MainFrame parent = null;
|
||||||
|
public String getCmd(){
|
||||||
|
return arg.toString();
|
||||||
|
}
|
||||||
|
public RpcAction(){
|
||||||
|
}
|
||||||
|
public RpcAction(Object arg, MainFrame parent){
|
||||||
|
this.arg = arg;
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
public void actionPerformed(ActionEvent e){
|
||||||
|
try{
|
||||||
|
action();
|
||||||
|
}catch(Exception ex){
|
||||||
|
if(!ex.getMessage().equals("cancelled"))
|
||||||
|
JOptionPane.showMessageDialog(null, "Error in RPC call: "+ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Default action executes session.meterpreter_script and shows console window. */
|
||||||
|
public void action() throws Exception{
|
||||||
|
if(arg != null)
|
||||||
|
parent.rpcConn.execute("session.meterpreter_script", new Object[]{parent.session.get("id"), getCmd()});
|
||||||
|
else if (parent == null)
|
||||||
|
throw new MsfException("Error: no parent. If using default constructor, must override action().");
|
||||||
|
parent.showInteractWindow();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,300 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
import javax.xml.transform.TransformerFactory;
|
||||||
|
import javax.xml.transform.dom.DOMSource;
|
||||||
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
import org.jdesktop.application.Task;
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
import org.w3c.dom.Node;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* 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 RpcConnection {
|
||||||
|
private String rpcToken;
|
||||||
|
private Map callCache = new HashMap();
|
||||||
|
public static String defaultUser = "msf",defaultPass = null;
|
||||||
|
public static int defaultPort = 55553;
|
||||||
|
private Socket connection;
|
||||||
|
private OutputStream sout; //socket output/input
|
||||||
|
private InputStream sin;
|
||||||
|
private final Object lockObject = new Object();//to synchronize one request at a time
|
||||||
|
|
||||||
|
/** Constructor sets up a connection and authenticates. */
|
||||||
|
RpcConnection(String username, char[] password, String host, int port) throws MsfException {
|
||||||
|
boolean haveRpcd=false;
|
||||||
|
String message = "";
|
||||||
|
try {
|
||||||
|
connection = new Socket(host, port);
|
||||||
|
sout = connection.getOutputStream();
|
||||||
|
sin = connection.getInputStream();
|
||||||
|
Object[] params = new Object[]{username, new String(password)};
|
||||||
|
Map results = exec("auth.login",params);
|
||||||
|
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){
|
||||||
|
}
|
||||||
|
if(!haveRpcd)
|
||||||
|
throw new MsfException("Error connecting. "+message);
|
||||||
|
}
|
||||||
|
/** Destructor cleans up. */
|
||||||
|
protected void finalize() throws Throwable{
|
||||||
|
connection.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Method that sends a call to the server and received a response; only allows one at a time */
|
||||||
|
protected Map exec (String methname, Object[] params) throws MsfException{
|
||||||
|
try{
|
||||||
|
synchronized(lockObject){ //Only one method call at a time!
|
||||||
|
writeCall(methname, params);
|
||||||
|
return (Map)readResp();
|
||||||
|
}
|
||||||
|
}catch(Exception ex){ //any weirdness gets wrapped in a MsfException
|
||||||
|
if(! (ex instanceof MsfException))
|
||||||
|
throw new MsfException("Error in call: "+ex.getLocalizedMessage(), ex);
|
||||||
|
throw (MsfException)ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Creates an XMLRPC call from the given method name and parameters and sends it */
|
||||||
|
protected void writeCall(String methname, Object[] params) throws Exception{
|
||||||
|
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");
|
||||||
|
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);
|
||||||
|
Element subvalEl = doc.createElement("value");
|
||||||
|
subvalEl.appendChild(doc.createTextNode(ent.getValue().toString()));
|
||||||
|
membEl.appendChild(subvalEl);
|
||||||
|
structEl.appendChild(membEl);
|
||||||
|
}
|
||||||
|
valEl.appendChild(structEl);
|
||||||
|
}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{
|
||||||
|
valEl.appendChild(doc.createTextNode(param.toString()));
|
||||||
|
}
|
||||||
|
paramEl.appendChild(valEl);
|
||||||
|
paramsEl.appendChild(paramEl);
|
||||||
|
}
|
||||||
|
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||||
|
TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(bout));
|
||||||
|
sout.write(bout.toByteArray());
|
||||||
|
sout.write(0);
|
||||||
|
}
|
||||||
|
/** Receives an XMLRPC response and converts to an object */
|
||||||
|
protected Object readResp() throws Exception{
|
||||||
|
//read bytes
|
||||||
|
ByteArrayOutputStream cache = new ByteArrayOutputStream();
|
||||||
|
int val;
|
||||||
|
try{
|
||||||
|
while((val = sin.read()) != 0)
|
||||||
|
cache.write(val);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
throw new MsfException("Error reading response.");
|
||||||
|
}
|
||||||
|
//parse the response: <methodResponse><params><param><value>...
|
||||||
|
Document root = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||||
|
.parse(new ByteArrayInputStream(cache.toByteArray()));
|
||||||
|
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 */
|
||||||
|
private Object parseVal(Node submemb) throws MsfException {
|
||||||
|
Node type = submemb.getFirstChild();
|
||||||
|
String typeName = type.getNodeName();
|
||||||
|
if(typeName.equals("string")){//<struct><member><name>jobs</name><value><struct/></value></member></struct>
|
||||||
|
return type.getTextContent(); //String returns java string
|
||||||
|
}else if (typeName.equals("array")){ //Array returns Object[]
|
||||||
|
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.toArray();
|
||||||
|
}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 new Boolean(type.getTextContent().equals("1"));
|
||||||
|
}else{
|
||||||
|
throw new MsfException("Error reading val: unknown type " + typeName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Runs command with no args */
|
||||||
|
public Object execute(String methodName) throws MsfException{
|
||||||
|
return execute(methodName, new Object[]{});
|
||||||
|
}
|
||||||
|
/** 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")){
|
||||||
|
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)
|
||||||
|
return result;
|
||||||
|
result = exec(methodName, params);
|
||||||
|
callCache.put(key, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return exec(methodName, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Attempts to start msfrpcd and connect to it.*/
|
||||||
|
public static Task startRpcConn(final MainFrame mainFrame){
|
||||||
|
return new Task<RpcConnection, Void>(mainFrame.getApplication()){
|
||||||
|
private RpcConnection myRpcConn;
|
||||||
|
@Override
|
||||||
|
protected RpcConnection doInBackground() throws Exception {
|
||||||
|
setTitle("Starting new msfrpcd");
|
||||||
|
setMessage("Setting up and saving parameters.");
|
||||||
|
setProgress(0.0f);
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
Element root = MsfguiApp.getPropertiesNode();
|
||||||
|
root.setAttribute("username", defaultUser);
|
||||||
|
root.setAttribute("password", defaultPass);
|
||||||
|
root.setAttribute("host", "127.0.0.1");
|
||||||
|
root.setAttribute("port", Integer.toString(defaultPort));
|
||||||
|
|
||||||
|
setMessage("Starting msfrpcd. \"msfrpcd -P " + defaultPass + " -S -U metasploit -a 127.0.0.1\"");
|
||||||
|
setProgress(0.2f);
|
||||||
|
Process proc = null;
|
||||||
|
try {
|
||||||
|
proc = MsfguiApp.startMsfProc(new String[]{
|
||||||
|
"msfrpcd","-P",defaultPass,"-S","-U",defaultUser,"-a","127.0.0.1"});
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
setMessage("msfrpcd not found.");
|
||||||
|
setProgress(1f);
|
||||||
|
throw new MsfException("Could not find or start msfrpcd"); //darn
|
||||||
|
}
|
||||||
|
|
||||||
|
setMessage("Started msfrpcd. Waiting for initialization to finish.");
|
||||||
|
proc.waitFor();
|
||||||
|
//Connect to started daemon
|
||||||
|
setMessage("Connecting to new msfrpcd...");
|
||||||
|
setProgress(0.7f);
|
||||||
|
boolean connected = false;
|
||||||
|
for (int tries = 0; tries < 10; tries++) { //it usually takes a second to get started
|
||||||
|
try {
|
||||||
|
myRpcConn = new RpcConnection(defaultUser, defaultPass.toCharArray(), "127.0.0.1", defaultPort);
|
||||||
|
connected = true;
|
||||||
|
break;
|
||||||
|
} catch (MsfException 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.getModules();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
|
@ -0,0 +1,319 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="whenGroup">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||||
|
<Component id="startupButton" alignment="1" max="32767" attributes="1"/>
|
||||||
|
<Component id="loginButton" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Component id="dailyButton" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Component id="hourlyButton" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Component id="minuteButton" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Component id="immediateButton" alignment="0" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="remoteScheduleBox" alignment="0" pref="513" max="32767" attributes="1"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="remoteSystemField" pref="420" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadedArgs" pref="363" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="uploadButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadField" pref="250" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="howManyField" pref="442" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="usernameField" min="-2" pref="161" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="passwordField" pref="159" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="commandField" pref="553" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="goButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="startupButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="loginButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="uploadedArgs" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="dailyButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="hourlyButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="howManyField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="minuteButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="immediateButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="remoteScheduleBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="remoteSystemField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="passwordField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="usernameField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="goButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="commandField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="startupButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="whenGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="startupButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="startupButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="loginButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="whenGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="loginButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="loginButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="dailyButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="whenGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="dailyButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="dailyButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="hourlyButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="whenGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="hourlyButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="hourlyButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="minuteButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="whenGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="minuteButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="minuteButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="immediateButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="whenGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="immediateButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="immediateButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="uploadField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="uploadField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="uploadField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="uploadButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="uploadButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="uploadButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="uploadButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="goButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="goButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="goButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="goButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="commandField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="commandField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="commandField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="uploadedArgs">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="uploadedArgs.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="uploadedArgs" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="remoteScheduleBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="remoteScheduleBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="remoteScheduleBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="remoteSystemField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="remoteSystemField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="remoteSystemField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="howManyField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="howManyField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="howManyField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel5.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel5" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="passwordField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel6.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel6" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="usernameField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="usernameField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="usernameField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel7.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel7" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel8.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel8" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,308 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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 "+howManyField.getText());
|
||||||
|
else if(hourlyButton.isSelected())
|
||||||
|
cmd.append(" -hr "+howManyField.getText());
|
||||||
|
else if(minuteButton.isSelected())
|
||||||
|
cmd.append(" -m "+howManyField.getText());
|
||||||
|
if(remoteScheduleBox.isSelected())
|
||||||
|
cmd.append(" -r -t "+remoteSystemField.getText());
|
||||||
|
if(usernameField.getText().length() > 0)
|
||||||
|
cmd.append(" -u "+usernameField.getText()+" -p "+passwordField.getText());
|
||||||
|
if(uploadField.getText().length() > 0)
|
||||||
|
cmd.append(" -e \"" + MsfguiApp.doubleBackslashes(uploadField.getText()) + "\" -o \""
|
||||||
|
+ MsfguiApp.doubleBackslashes(uploadedArgs.getText()) + "\"");
|
||||||
|
cmd.append(" -c \"" + MsfguiApp.doubleBackslashes(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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,152 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="customButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="customField" pref="296" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="passButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="win9xButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="officeButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="dirField" pref="285" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" alignment="1" min="-2" pref="67" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="dirField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="officeButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="win9xButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="passButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="customButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="customField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="7" max="32767" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="dirField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="dirField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="dirField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="officeButton">
|
||||||
|
<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="officeButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="officeButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="win9xButton">
|
||||||
|
<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="win9xButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="win9xButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="passButton">
|
||||||
|
<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="passButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="customButton">
|
||||||
|
<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="customButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="customButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="customField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="customField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="customField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,166 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class SearchDwldOptionsDialog extends OptionsDialog {
|
||||||
|
|
||||||
|
/** Creates new form SearchDwldOptionsDialog */
|
||||||
|
public SearchDwldOptionsDialog(java.awt.Frame parent, String currentDir) {
|
||||||
|
super(parent, "Schedule Task 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
officeButton = new javax.swing.JRadioButton();
|
||||||
|
win9xButton = new javax.swing.JRadioButton();
|
||||||
|
passButton = new javax.swing.JRadioButton();
|
||||||
|
customButton = new javax.swing.JRadioButton();
|
||||||
|
customField = new javax.swing.JTextField();
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
buttonGroup1.add(officeButton);
|
||||||
|
officeButton.setSelected(true);
|
||||||
|
officeButton.setText(resourceMap.getString("officeButton.text")); // NOI18N
|
||||||
|
officeButton.setName("officeButton"); // NOI18N
|
||||||
|
|
||||||
|
buttonGroup1.add(win9xButton);
|
||||||
|
win9xButton.setText(resourceMap.getString("win9xButton.text")); // NOI18N
|
||||||
|
win9xButton.setName("win9xButton"); // NOI18N
|
||||||
|
|
||||||
|
buttonGroup1.add(passButton);
|
||||||
|
passButton.setText(resourceMap.getString("passButton.text")); // NOI18N
|
||||||
|
passButton.setName("passButton"); // NOI18N
|
||||||
|
|
||||||
|
buttonGroup1.add(customButton);
|
||||||
|
customButton.setText(resourceMap.getString("customButton.text")); // NOI18N
|
||||||
|
customButton.setName("customButton"); // NOI18N
|
||||||
|
|
||||||
|
customField.setText(resourceMap.getString("customField.text")); // NOI18N
|
||||||
|
customField.setName("customField"); // 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(customButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(customField, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE))
|
||||||
|
.addComponent(passButton)
|
||||||
|
.addComponent(win9xButton)
|
||||||
|
.addComponent(officeButton)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(dirField, javax.swing.GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE))
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addComponent(okButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.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)
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(officeButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(win9xButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(passButton)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(customButton)
|
||||||
|
.addComponent(customField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
|
||||||
|
.addComponent(okButton)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||||
|
StringBuilder cmd = new StringBuilder("search_dwld \""+MsfguiApp.doubleBackslashes(dirField.getText())+"\"");
|
||||||
|
if(officeButton.isSelected())
|
||||||
|
cmd.append(" office");
|
||||||
|
else if(win9xButton.isSelected())
|
||||||
|
cmd.append(" win9x");
|
||||||
|
else if(passButton.isSelected())
|
||||||
|
cmd.append(" passwd");
|
||||||
|
else if(customButton.isSelected())
|
||||||
|
cmd.append(" free "+customField.getText());
|
||||||
|
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 doClose() {
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.ButtonGroup buttonGroup1;
|
||||||
|
private javax.swing.JRadioButton customButton;
|
||||||
|
private javax.swing.JTextField customField;
|
||||||
|
private javax.swing.JTextField dirField;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel2;
|
||||||
|
private javax.swing.JRadioButton officeButton;
|
||||||
|
private javax.swing.JButton okButton;
|
||||||
|
private javax.swing.JRadioButton passButton;
|
||||||
|
private javax.swing.JRadioButton win9xButton;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,237 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="typeGroup">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="detailGroup">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="jScrollPane1" alignment="0" pref="578" max="32767" attributes="0"/>
|
||||||
|
<Component id="searchField" alignment="0" pref="578" max="32767" attributes="1"/>
|
||||||
|
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="searchBox" pref="501" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="exploitsRadioButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="auxiliaryRadioButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="payloadsRadioButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="descriptionRadioButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="referenceRadioButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="searchButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="launchButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="searchBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="exploitsRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="auxiliaryRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="payloadsRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="descriptionRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="referenceRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="searchField" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="searchButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" pref="133" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="launchButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="exploitsRadioButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="typeGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="exploitsRadioButton.text"/>
|
||||||
|
<Property name="actionCommand" type="java.lang.String" resourceKey="exploitsRadioButton.actionCommand"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="exploitsRadioButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="auxiliaryRadioButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="typeGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="auxiliaryRadioButton.text"/>
|
||||||
|
<Property name="actionCommand" type="java.lang.String" resourceKey="auxiliaryRadioButton.actionCommand"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="auxiliaryRadioButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="payloadsRadioButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="typeGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="payloadsRadioButton.text"/>
|
||||||
|
<Property name="actionCommand" type="java.lang.String" resourceKey="payloadsRadioButton.actionCommand"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="payloadsRadioButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="searchBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="true"/>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="1">
|
||||||
|
<StringItem index="0" value="type name here"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="searchBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="searchBoxActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="descriptionRadioButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="detailGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="descriptionRadioButton.text"/>
|
||||||
|
<Property name="actionCommand" type="java.lang.String" resourceKey="descriptionRadioButton.actionCommand"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="descriptionRadioButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="referenceRadioButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="detailGroup"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="referenceRadioButton.text"/>
|
||||||
|
<Property name="actionCommand" type="java.lang.String" resourceKey="referenceRadioButton.actionCommand"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="referenceRadioButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="searchField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="searchField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="searchField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="searchButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="searchButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="searchButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="searchButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JList" name="resultList">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
|
||||||
|
<StringArray count="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="resultList" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="launchButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="launchButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="launchButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="launchButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,307 @@
|
||||||
|
|
||||||
|
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;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author osama
|
||||||
|
*/
|
||||||
|
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();
|
||||||
|
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.hidePopup();
|
||||||
|
searchBox.showPopup();
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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", new Object[]{modInfo[0], modInfo[1]});
|
||||||
|
if(detail.equals("reference")){
|
||||||
|
Object references = info.get("references");
|
||||||
|
if(references != null){
|
||||||
|
Object[] refArray = (Object[])references;
|
||||||
|
for(int i = 0; i < refArray.length; i++){
|
||||||
|
Object[] ref = (Object[])refArray[i];
|
||||||
|
if(ref[1].toString().toLowerCase().contains(toSearch)
|
||||||
|
|| (ref[0].toString().toLowerCase()+"-"+ref[1]).contains(toSearch)){
|
||||||
|
mod.addElement(modInfo[1]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(info.get("name").toString().toLowerCase().contains(toSearch)
|
||||||
|
|| info.get("description").toString().toLowerCase().contains(toSearch))
|
||||||
|
mod.addElement(modInfo[1]);
|
||||||
|
}
|
||||||
|
} catch (MsfException ex) {
|
||||||
|
JOptionPane.showMessageDialog(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) && modInfo[1].equals(name))
|
||||||
|
((ActionListener) modInfo[2]).actionPerformed(null);
|
||||||
|
}
|
||||||
|
}//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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import org.jdesktop.swingworker.SwingWorker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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"));
|
||||||
|
}
|
||||||
|
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", new Object[]{session.get("id"),Base64.encode(("\n"
|
||||||
|
+sess.getCommand(session, this)+"\n").getBytes())});
|
||||||
|
}
|
||||||
|
}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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 "info", "workspace", "target_host", "username", "exploit_uuid"
|
||||||
|
this.columnNames = new String[]{"type","tunnel_local","tunnel_peer","via_exploit","via_payload","desc","uuid"};
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
import javax.swing.table.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class TableHelper {
|
||||||
|
|
||||||
|
/** 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.getDefaultRenderer(model.getColumnClass(col));
|
||||||
|
int width = tcr.getTableCellRendererComponent(mainTable,
|
||||||
|
model.getColumnName(col), false, false, 0, col).getPreferredSize().width;
|
||||||
|
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)
|
||||||
|
width = c.getPreferredSize().width;
|
||||||
|
}
|
||||||
|
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))){
|
||||||
|
output.add(val.toString().trim());
|
||||||
|
val.delete(0, val.length());
|
||||||
|
}
|
||||||
|
if(line.length() > i)
|
||||||
|
val.append(line.charAt(i));
|
||||||
|
lastWhitespace = Character.isWhitespace(headerRow.charAt(i));
|
||||||
|
}
|
||||||
|
output.add(val.toString().trim());
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,160 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="chooseButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="verboseBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" pref="67" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="removeBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="optionsField" pref="281" max="32767" attributes="0"/>
|
||||||
|
<Component id="fileField" alignment="0" pref="281" max="32767" attributes="0"/>
|
||||||
|
<Component id="pathField" alignment="0" pref="281" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="chooseButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="fileField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="optionsField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="pathField" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="removeBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="verboseBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace pref="7" max="32767" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="chooseButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="chooseButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="chooseButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chooseButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fileField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="fileField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="fileField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="optionsField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="optionsField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="optionsField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="pathField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="pathField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="pathField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="verboseBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="verboseBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="verboseBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="removeBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="removeBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="removeBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,184 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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 \""+MsfguiApp.doubleBackslashes(optionsField.getText())+"\"");
|
||||||
|
if(pathField.getText().length() > 0)
|
||||||
|
cmd.append(" -p \""+MsfguiApp.doubleBackslashes(pathField.getText())+"\"");
|
||||||
|
cmd.append(" -e \""+MsfguiApp.doubleBackslashes(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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,139 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="44" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Component id="passwordLabel" max="32767" attributes="1"/>
|
||||||
|
<Component id="usernameLabel" alignment="0" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="usernameField" pref="312" max="32767" attributes="1"/>
|
||||||
|
<Component id="passwordField" alignment="1" pref="312" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="dontButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="usernameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="usernameField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="passwordField" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="dontButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Component id="passwordLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="usernameLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="usernameLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="usernameLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="passwordLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordLabel.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordLabel" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="usernameField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="usernameField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="usernameField" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[50, 27]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="passwordField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordField" noResource="true"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[50, 27]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="dontButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="dontButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="dontButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dontButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,163 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import java.awt.Frame;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class UserPassDialog extends javax.swing.JDialog {
|
||||||
|
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, modal);
|
||||||
|
setTitle("Enter username and password");
|
||||||
|
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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,154 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="userButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="0" pref="159" max="32767" attributes="1"/>
|
||||||
|
<Component id="passwordButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="checkPolicyBox" pref="225" max="32767" attributes="1"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" min="-2" pref="67" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="passwordField" pref="295" max="32767" attributes="0"/>
|
||||||
|
<Component id="userField" alignment="0" pref="295" max="32767" attributes="0"/>
|
||||||
|
<Component id="loginField" alignment="0" pref="295" max="32767" attributes="0"/>
|
||||||
|
<Component id="targetField" alignment="0" pref="295" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace 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 max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="userField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="userButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="passwordField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="passwordButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="loginField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="targetField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="checkPolicyBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="okButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="okButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="okButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="userButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="userButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="userButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="userButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="userField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="userField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="userField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="passwordField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="loginField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="loginField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="loginField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="checkPolicyBox">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="checkPolicyBox.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="checkPolicyBox" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="targetField">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="targetField.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="targetField" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="passwordButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" resourceKey="passwordButton.text"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="passwordButton" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="passwordButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
|
@ -0,0 +1,190 @@
|
||||||
|
package msfgui;
|
||||||
|
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author scriptjunkie
|
||||||
|
*/
|
||||||
|
public class WinbfOptionsDialog extends OptionsDialog {
|
||||||
|
/** Creates new form UploadexecOptionsDialog */
|
||||||
|
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")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
|
||||||
|
}// </editor-fold>//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 \""+MsfguiApp.doubleBackslashes(targetField.getText())+"\"");
|
||||||
|
if(userField.getText().length() > 0)
|
||||||
|
cmd.append(" -L \""+MsfguiApp.doubleBackslashes(userField.getText())+"\"");
|
||||||
|
if(passwordField.getText().length() > 0)
|
||||||
|
cmd.append(" -p \""+MsfguiApp.doubleBackslashes(passwordField.getText())+"\"");
|
||||||
|
if(loginField.getText().length() > 0)
|
||||||
|
cmd.append(" -l \""+MsfguiApp.doubleBackslashes(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
|
||||||
|
|
||||||
|
}
|
5
external/source/gui/msfguijava/src/msfgui/resources/AutorouteOptionsDialog.properties
vendored
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
deleteRouteButton.text=Delete Route
|
||||||
|
addRouteButton.text=Add route
|
||||||
|
okButton.text=Ok
|
||||||
|
ipField.text=10.10.10.0/24
|
||||||
|
subnetLabel.text=Subnet:
|
3
external/source/gui/msfguijava/src/msfgui/resources/EditorWindow.properties
vendored
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
saveButton.text=Save
|
||||||
|
jLabel1.text=Unique hashes collected from all meterpreter sessions
|
4
external/source/gui/msfguijava/src/msfgui/resources/InteractWindow.properties
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
inputField.text=
|
||||||
|
submitButton.text=Submit
|
||||||
|
main.icon=msf_file.png
|
|
@ -0,0 +1 @@
|
||||||
|
okButton.text=OK
|
|
@ -0,0 +1,52 @@
|
||||||
|
# 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
|
||||||
|
sessionsLabel.text=Sessions
|
||||||
|
jobsLabel.text=Jobs
|
||||||
|
exploitsMenu.text=Exploits
|
||||||
|
auxiliaryMenu.text=Auxiliary
|
||||||
|
startRpcMenuItem.text=Start new msfrpcd
|
||||||
|
connectRpcMenuItem.text=Connect to msfrpcd
|
||||||
|
payloadsMenu.text=Payloads
|
||||||
|
main.icon=msf_file.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...
|
||||||
|
otherMeterpCommandMenu.text=Other
|
||||||
|
logGenerateMenuItem.text=Generate HTML Log Report
|
||||||
|
historyMenu.text=History
|
||||||
|
killSessionsMenuItem.text=Kill all sessions
|
||||||
|
changeLFMenuItem.text=Change Look and Feel
|
||||||
|
collectedCredsMenuItem.text=Show collected hashes
|
||||||
|
searchButton.text=Search
|
8
external/source/gui/msfguijava/src/msfgui/resources/MeterpFileBrowser.properties
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
uploadButton.text=Upload
|
||||||
|
downloadButton.text=Download
|
||||||
|
deleteButton.text=Delete
|
||||||
|
dirButton.text=Make Directory
|
||||||
|
refreshButton.text=Refresh
|
||||||
|
pwdLabel.text=Listing Current Directory
|
||||||
|
upButton.text=Go up
|
||||||
|
recSearchDownloadButton.text=Recursive search/download
|
|
@ -0,0 +1,11 @@
|
||||||
|
authorsLabel.text=Authors
|
||||||
|
licenseLabel.text=License
|
||||||
|
versionLabel.text=Version
|
||||||
|
targetsLabel.text=<html><h2>Targets</h2></html>
|
||||||
|
exploitButton.text=Run Exploit
|
||||||
|
titleLabel.text=Title
|
||||||
|
requiredLabel.text=<html><h2>Required</h2></html>
|
||||||
|
optionalLabel.text=<html><h2>Optional</h2></html>
|
||||||
|
main.icon=msf_file.png
|
||||||
|
advancedLabel.text=<html><h2>Advanced</h2></html>
|
||||||
|
exploitButton1.text=Run Exploit
|
16
external/source/gui/msfguijava/src/msfgui/resources/MsfguiAboutBox.properties
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
title = About: ${Application.title}
|
||||||
|
|
||||||
|
closeAboutBox.Action.text = &Close
|
||||||
|
|
||||||
|
appDescLabel.text=<html>A Java GUI to the Metasploit Framework created by scriptjunkie.</html>
|
||||||
|
|
||||||
|
versionLabel.text=Version\:
|
||||||
|
|
||||||
|
vendorLabel.text=Vendor\:
|
||||||
|
|
||||||
|
homepageLabel.text=Homepage\:
|
||||||
|
|
||||||
|
#NOI18N
|
||||||
|
imageLabel.icon=splash.png
|
||||||
|
targetsLabel.text=<html><h2>Targets</h2></html>
|
||||||
|
main.icon=msf_file.png
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Application global resources
|
||||||
|
|
||||||
|
Application.name = msfguiJDesktop
|
||||||
|
Application.title = msfgui
|
||||||
|
Application.version = 5
|
||||||
|
Application.vendor = Metasploit LLC
|
||||||
|
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
|
7
external/source/gui/msfguijava/src/msfgui/resources/MulticommandOptionsDialog.properties
vendored
Normal file
|
@ -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
|
13
external/source/gui/msfguijava/src/msfgui/resources/NetenumOptionsDialog.properties
vendored
Normal file
|
@ -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
|
15
external/source/gui/msfguijava/src/msfgui/resources/OpenConnectionDialog.properties
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
passwordField.text=
|
||||||
|
usernameField.text=msf
|
||||||
|
hostField.text=127.0.0.1
|
||||||
|
portField.text=55553
|
||||||
|
connectButton.text=Connect
|
||||||
|
usernameLabel.text=Username
|
||||||
|
titleLabel.text=<html><h1>Connect to msfrpcd</h1></html>
|
||||||
|
passwordLabel.text=Password
|
||||||
|
hostLabel.text=Host
|
||||||
|
portLabel.text=Port
|
||||||
|
cancelButton.text=Cancel
|
||||||
|
Form.title=msfgui - connection
|
||||||
|
main.icon=msf_file.png
|
||||||
|
startNewButton.text=Start new msfrpcd
|
||||||
|
pathButton.text=Change path
|
|
@ -0,0 +1,24 @@
|
||||||
|
versionLabel.text=Version
|
||||||
|
licenseLabel.text=License
|
||||||
|
authorsLabel.text=Authors
|
||||||
|
descriptionLabel.text=Description
|
||||||
|
titleLabel.text=Title
|
||||||
|
main.icon=msf_file.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
|
13
external/source/gui/msfguijava/src/msfgui/resources/PersistenceOptionsDialog.properties
vendored
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
jLabel1.text=<html><h2>Options</h2> </html>
|
||||||
|
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
|
||||||
|
autostartBox.text=Restart each boot
|
||||||
|
handlerBox.text=Start handler now
|
||||||
|
intervalField.text=10
|
||||||
|
intervalLabel.text=Interval for connect-back
|
||||||
|
loginRestartBox.text=Restart at current user login
|
3
external/source/gui/msfguijava/src/msfgui/resources/ProcessList.properties
vendored
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
migrateButton.text=Migrate
|
||||||
|
killButton.text=Kill
|
||||||
|
refreshButton.text=Refresh
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
outputField.text=Output (Running)
|
9
external/source/gui/msfguijava/src/msfgui/resources/RemoteWinenumOptionsDialog.properties
vendored
Normal file
|
@ -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=
|
24
external/source/gui/msfguijava/src/msfgui/resources/ScheduleTaskOptionsDialog.properties
vendored
Normal file
|
@ -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
|
9
external/source/gui/msfguijava/src/msfgui/resources/SearchDwldOptionsDialog.properties
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
okButton.text=Go
|
||||||
|
jLabel1.text=Base directory:
|
||||||
|
dirField.text=%USERPROFILE%
|
||||||
|
jLabel2.text=Filter:
|
||||||
|
customField.text='\\.(jpg|png|gif)$'
|
||||||
|
officeButton.text=(MS|Open)office
|
||||||
|
win9xButton.text=Win9x '\\.pwl$'
|
||||||
|
passButton.text=Password '(pass|pwd)'
|
||||||
|
customButton.text=Custom:
|
17
external/source/gui/msfguijava/src/msfgui/resources/SearchWindow.properties
vendored
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
jLabel1.text=<html><b>Search for modules</b></html>
|
||||||
|
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
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
inputField.text=
|
||||||
|
submitButton.text=Submit
|
||||||
|
main.icon=msf_file.png
|
10
external/source/gui/msfguijava/src/msfgui/resources/UploadexecOptionsDialog.properties
vendored
Normal file
|
@ -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
|
7
external/source/gui/msfguijava/src/msfgui/resources/UserPassDialog.properties
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
passwordField.text=rocks
|
||||||
|
usernameField.text=metasploit
|
||||||
|
usernameLabel.text=Username:
|
||||||
|
passwordLabel.text=Password:
|
||||||
|
jLabel1.text=<html><h2>Enter credentials</h2> Note: special characters and quotes don't always work.</html>
|
||||||
|
dontButton.text=Dont add user
|
||||||
|
okButton.text=OK
|
10
external/source/gui/msfguijava/src/msfgui/resources/WinbfOptionsDialog.properties
vendored
Normal file
|
@ -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
|
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon0.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon1.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon10.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon11.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon12.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon13.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon14.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon2.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon3.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
external/source/gui/msfguijava/src/msfgui/resources/busyicons/busy-icon4.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |