2012-12-20 23:56:21 +01:00
|
|
|
To compile JavaPayload for Metasploit (including Java Meterpreter), you need
|
|
|
|
Maven 3.0 or above. Just run
|
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
mvn package
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
|
|
|
|
to package all the files, or
|
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
mvn -P deploy package
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
|
|
|
|
to package all the files and copy them into the correct place for Metasploit
|
2013-06-12 23:44:57 +02:00
|
|
|
(`../metasploit-framework/data/java`). If you get spurious compilation errors,
|
|
|
|
make sure that there is an exclude rule in your antivirus for the Metasploit
|
|
|
|
directory (or that your antivirus is disabled).
|
|
|
|
|
|
|
|
If the path to your metasploit framework repository is not `../metasploit-framework`,
|
|
|
|
but for example `../msf3`, use
|
|
|
|
|
|
|
|
```
|
|
|
|
mvn -D deploy.path=../msf3 -P deploy package
|
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
|
|
|
|
In case you want to edit/debug JavaPayload for Metasploit or Java Meterpreter,
|
|
|
|
Maven provides plugins to auto-generate project files for your favourite IDE
|
|
|
|
(at least for Eclipse, Netbeans or IntelliJ). I use Eclipse, so to generate
|
|
|
|
project files I use
|
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
mvn eclipse:eclipse
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
This will generate project files that can be imported via
|
2012-12-20 23:56:21 +01:00
|
|
|
|
2013-06-12 23:44:57 +02:00
|
|
|
**File->Import->Existing Projects into Workspace**
|
2012-12-20 23:56:21 +01:00
|
|
|
|
|
|
|
into your Eclipse workspace.
|
|
|
|
|
|
|
|
(Note that if this is your first Maven project you want to use in Eclipse, you
|
2013-06-11 23:58:53 +02:00
|
|
|
also have to run
|
2012-12-20 23:56:21 +01:00
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
mvn -Declipse.workspace=/path/to/your/workspace eclipse:configure-workspace
|
2013-06-11 23:58:53 +02:00
|
|
|
```
|
2012-12-20 23:56:21 +01:00
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
to set up path variables like `M2_REPO` to point to the correct location.)
|
2012-12-20 23:56:21 +01:00
|
|
|
|
|
|
|
For NetBeans or IntelliJ IDEA, refer to the documentation at
|
|
|
|
|
|
|
|
http://maven.apache.org/netbeans-module.html
|
|
|
|
http://maven.apache.org/plugins/maven-idea-plugin/
|
|
|
|
|
2013-06-12 00:02:15 +02:00
|
|
|
## Android
|
|
|
|
|
2013-06-11 23:58:53 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
mvn package -Dandroid.sdk.path=/path/to/android-sdk-linux/
|
|
|
|
```
|
|
|
|
|
|
|
|
|