69 lines
2.2 KiB
XML
69 lines
2.2 KiB
XML
<?xml version="1.0"?>
|
|
<project name="JavaPayload4Meterpreter" default="deploy">
|
|
|
|
<target name="clean">
|
|
<delete dir="build" />
|
|
</target>
|
|
|
|
<target name="compile">
|
|
<mkdir dir="build" />
|
|
<javac srcdir="src" destdir="build" source="1.1" target="1.1" classpath="lib/servlet-api-2.2.jar" debug="no" />
|
|
</target>
|
|
|
|
<target name="jar" depends="compile">
|
|
<!-- example: spawning bind -->
|
|
<propertyfile file="build/metasploit.dat">
|
|
<entry key="Spawn" value="2"/>
|
|
<entry key="LPORT" value="5555" />
|
|
</propertyfile>
|
|
<jar destfile="example-spawn-bind.jar">
|
|
<manifest>
|
|
<attribute name="Main-Class" value="metasploit.Payload"/>
|
|
</manifest>
|
|
<fileset dir="build">
|
|
<include name="metasploit/Payload.class"/>
|
|
<include name="metasploit.dat"/>
|
|
</fileset>
|
|
</jar>
|
|
<delete file="build/metasploit.dat"/>
|
|
</target>
|
|
|
|
<target name="buildrmi" depends="compile">
|
|
<!-- build dummy jar used for capturing communication and for testing -->
|
|
<propertyfile file="build/metasploit.dat">
|
|
<entry key="LPORT" value="4444" />
|
|
<entry key="LHOST" value="127.0.0.1" />
|
|
</propertyfile>
|
|
<jar destfile="rmidummy.jar">
|
|
<manifest>
|
|
<attribute name="Main-Class" value="metasploit.Payload"/>
|
|
</manifest>
|
|
<fileset dir="build">
|
|
<include name="metasploit/RMILoader.class"/>
|
|
<include name="metasploit/RMIPayload.class"/>
|
|
<include name="metasploit/Payload.class"/>
|
|
<include name="metasploit.dat"/>
|
|
</fileset>
|
|
</jar>
|
|
|
|
<!-- rename local metasploit/RMILoader.class to ensure a classloader URL will be serialized -->
|
|
<move file="build/metasploit/RMILoader.class" tofile="build/metasploit/RMILoader.class.tmp" />
|
|
|
|
<!-- run the capture server -->
|
|
<java classpath="build" classname="rmi.RMICaptureServer" />
|
|
|
|
<!-- rename back -->
|
|
<move file="build/metasploit/RMILoader.class.tmp" tofile="build/metasploit/RMILoader.class" />
|
|
</target>
|
|
|
|
<target name="deploy" depends="compile">
|
|
<copy todir="../../../data/java">
|
|
<fileset dir="build">
|
|
<exclude name="metasploit/PayloadApplet.class" />
|
|
<exclude name="rmi/**" />
|
|
<exclude name="metasploit.dat" />
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
</project>
|