|
57 | 57 | </plugin>
|
58 | 58 | </plugins>
|
59 | 59 | </build>
|
| 60 | + <profiles> |
| 61 | + <profile> |
| 62 | + <!-- deploy built files to Metasploit data directory --> |
| 63 | + <id>deploy</id> |
| 64 | + <build> |
| 65 | + <plugins> |
| 66 | + <plugin> |
| 67 | + <artifactId>maven-antrun-plugin</artifactId> |
| 68 | + <version>1.7</version> |
| 69 | + <executions> |
| 70 | + <execution> |
| 71 | + <phase>package</phase> |
| 72 | + <goals> |
| 73 | + <goal>run</goal> |
| 74 | + </goals> |
| 75 | + <configuration> |
| 76 | + <target> |
| 77 | + <condition property="dx.filename" value="dx.bat"> |
| 78 | + <os family="windows" /> |
| 79 | + </condition> |
| 80 | + <property name="dx.filename" value="dx" /> |
| 81 | + |
| 82 | + <echo>Building shell</echo> |
| 83 | + <delete dir="${project.basedir}/target/dx" /> |
| 84 | + <mkdir dir="${project.basedir}/target/dx/shell" /> |
| 85 | + <copy todir="${project.basedir}/target/dx/shell"> |
| 86 | + <fileset dir="${project.basedir}/target/classes"> |
| 87 | + <include name="androidpayload/stage/Shell.class" /> |
| 88 | + <include name="androidpayload/stage/Stage.class" /> |
| 89 | + </fileset> |
| 90 | + <zipfileset src="${com.metasploit:Metasploit-JavaPayload:jar}" includes="javapayload/stage/StreamForwarder.class" /> |
| 91 | + </copy> |
| 92 | + <exec executable="${android.sdk.path}/platform-tools/${dx.filename}" failonerror="true"> |
| 93 | + <arg value="--verbose" /> |
| 94 | + <arg value="--dex" /> |
| 95 | + <arg value="--output=${project.basedir}/../../../../../data/android/shell.jar" /> |
| 96 | + <arg value="${project.basedir}/target/dx/shell" /> |
| 97 | + </exec> |
| 98 | + |
| 99 | + <echo>Building meterpreter stage</echo> |
| 100 | + <mkdir dir="${project.basedir}/target/dx/metstage" /> |
| 101 | + <copy todir="${project.basedir}/target/dx/metstage"> |
| 102 | + <fileset dir="${project.basedir}/target/classes"> |
| 103 | + <include name="androidpayload/stage/Meterpreter.class" /> |
| 104 | + <include name="androidpayload/stage/Stage.class" /> |
| 105 | + </fileset> |
| 106 | + </copy> |
| 107 | + <exec executable="${android.sdk.path}/platform-tools/${dx.filename}" failonerror="true"> |
| 108 | + <arg value="--verbose" /> |
| 109 | + <arg value="--dex" /> |
| 110 | + <arg value="--output=${project.basedir}/../../../../../data/android/metstage.jar" /> |
| 111 | + <arg value="${project.basedir}/target/dx/metstage" /> |
| 112 | + </exec> |
| 113 | + |
| 114 | + <echo>Building meterpreter</echo> |
| 115 | + <mkdir dir="${project.basedir}/target/dx/meterpreter" /> |
| 116 | + <copy todir="${project.basedir}/target/dx/meterpreter"> |
| 117 | + <fileset dir="${project.basedir}/target/classes" includes="com/metasploit/meterpreter/**/*.class" /> |
| 118 | + </copy> |
| 119 | + <exec executable="${android.sdk.path}/platform-tools/${dx.filename}" failonerror="true"> |
| 120 | + <arg value="--verbose" /> |
| 121 | + <arg value="--dex" /> |
| 122 | + <arg value="--output=${project.basedir}/../../../../../data/android/meterpreter.jar" /> |
| 123 | + <arg value="${project.basedir}/target/dx/meterpreter" /> |
| 124 | + <arg value="${com.metasploit:Metasploit-Java-Meterpreter:jar}" /> |
| 125 | + <arg value="${com.metasploit:Metasploit-Java-Meterpreter-stdapi:jar}" /> |
| 126 | + </exec> |
| 127 | + </target> |
| 128 | + </configuration> |
| 129 | + </execution> |
| 130 | + </executions> |
| 131 | + </plugin> |
| 132 | + </plugins> |
| 133 | + </build> |
| 134 | + </profile> |
| 135 | + </profiles> |
60 | 136 | </project>
|
0 commit comments