-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructured mfs library, divided into api and impl packages
- Loading branch information
Showing
78 changed files
with
449 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* Represent an author | ||
*/ | ||
public interface Author { | ||
String getName(); | ||
String getEmail(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* The auxiliary class acts as a base class for all modules that perform | ||
* reconnaissance, retrieve data, brute force logins, or any other action | ||
* that doesn't fit our concept of an 'exploit' (involving payloads and | ||
* targets and whatnot). | ||
*/ | ||
public interface Auxiliary extends Module { | ||
} |
4 changes: 3 additions & 1 deletion
4
...in/java/org/csploit/msf/Customizable.java → ...ava/org/csploit/msf/api/Customizable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.csploit.msf.api; | ||
|
||
import org.csploit.msf.api.module.Target; | ||
|
||
/** | ||
* Represent an exploit module | ||
*/ | ||
public interface Exploit extends Module { | ||
Target[] getTargets(); | ||
Target getTarget(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.csploit.msf.api; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A Metasploit Framework interface | ||
*/ | ||
public interface Framework { | ||
List<? extends Session> getSessions(); | ||
List<? extends Job> getJobs(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.csploit.msf.api; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* This class is the representation of an abstract job. | ||
*/ | ||
public interface Job { | ||
int getId(); | ||
String getName(); | ||
Date getStartTime(); | ||
void stop(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...rc/main/java/org/csploit/msf/License.java → ...ain/java/org/csploit/msf/api/License.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.csploit.msf; | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* A license | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* Represent a module of the MSF | ||
*/ | ||
public interface Module { | ||
|
||
String getRefname(); | ||
void setRefname(String refname); | ||
|
||
String getFullName(); | ||
String getShortName(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* An option | ||
*/ | ||
public interface Option<T> { | ||
boolean isAdvanced(); | ||
boolean haveDefaultValue(); | ||
boolean isEvasion(); | ||
boolean isRequired(); | ||
T getDefaultValue(); | ||
String getDescription(); | ||
String getName(); | ||
Module getOwner(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* This class represents the base class for a logical payload. The framework | ||
* automatically generates payload combinations at runtime which are all | ||
* extended for this Payload as a base class. | ||
*/ | ||
public interface Payload extends Module { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* A Post-exploitation module. | ||
*/ | ||
public interface Post extends Module { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.csploit.msf.api; | ||
|
||
/** | ||
* The session class represents a post-exploitation, uh, session. | ||
* Sessions can be written to, read from, and interacted with. The | ||
* underlying medium on which they are backed is arbitrary. For | ||
* instance, when an exploit is provided with a command shell, | ||
* either through a network connection or locally, the session's | ||
* read and write operations end up reading from and writing to | ||
* the shell that was spawned. The session object can be seen | ||
* as a general means of interacting with various post-exploitation | ||
* payloads through a common interface that is not necessarily | ||
* tied to a network connection. | ||
*/ | ||
public interface Session { | ||
int getId(); | ||
String getLocalTunnel(); | ||
String getPeerTunnel(); | ||
Exploit getExploit(); | ||
Payload getPayload(); | ||
String getDescription(); | ||
String getInfo(); | ||
String getWorkspace(); | ||
String getSessionHost(); | ||
int getSessionPort(); | ||
String getTargetHost(); | ||
String getUsername(); | ||
String getUuid(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...java/org/csploit/msf/module/Platform.java → .../org/csploit/msf/api/module/Platform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.csploit.msf.module; | ||
package org.csploit.msf.api.module; | ||
|
||
/** | ||
* A platform | ||
|
2 changes: 1 addition & 1 deletion
2
...ain/java/org/csploit/msf/module/Rank.java → ...java/org/csploit/msf/api/module/Rank.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.csploit.msf.module; | ||
package org.csploit.msf.api.module; | ||
|
||
/** | ||
* A module rank | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api.module; | ||
|
||
/** | ||
* A reference to some sort of information. This is typically a URL, but could | ||
* be any type of referential value that people could use to research a topic. | ||
*/ | ||
public interface Reference { | ||
String toString(); | ||
} |
8 changes: 8 additions & 0 deletions
8
msf/src/main/java/org/csploit/msf/api/module/SiteReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.csploit.msf.api.module; | ||
|
||
/** | ||
* A reference to a website. | ||
*/ | ||
public interface SiteReference extends Reference { | ||
String getUrl(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.csploit.msf.api.module; | ||
|
||
import org.csploit.msf.api.Arch; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Represent a target | ||
*/ | ||
public interface Target { | ||
String getName(); | ||
Set<Platform> getPlatform(); | ||
Set<Arch> getArch(); | ||
} |
11 changes: 11 additions & 0 deletions
11
msf/src/main/java/org/csploit/msf/api/options/AddressOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
import java.net.InetAddress; | ||
|
||
/** | ||
* Network address option. | ||
*/ | ||
public interface AddressOption extends Option<InetAddress> { | ||
} |
11 changes: 11 additions & 0 deletions
11
msf/src/main/java/org/csploit/msf/api/options/AddressRangeOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
import java.net.InetAddress; | ||
|
||
/** | ||
* Network address range option. | ||
*/ | ||
public interface AddressRangeOption extends Option<InetAddress[]> { | ||
} |
9 changes: 9 additions & 0 deletions
9
msf/src/main/java/org/csploit/msf/api/options/BooleanOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
/** | ||
* Boolean option. | ||
*/ | ||
public interface BooleanOption extends Option<Boolean> { | ||
} |
10 changes: 10 additions & 0 deletions
10
msf/src/main/java/org/csploit/msf/api/options/EnumOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
/** | ||
* Enum option. | ||
*/ | ||
public interface EnumOption extends Option<String> { | ||
String[] getValues(); | ||
} |
9 changes: 9 additions & 0 deletions
9
msf/src/main/java/org/csploit/msf/api/options/IntegerOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
/** | ||
* Integer option. | ||
*/ | ||
public interface IntegerOption extends Option<Integer> { | ||
} |
11 changes: 11 additions & 0 deletions
11
msf/src/main/java/org/csploit/msf/api/options/PathOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* File system path option. | ||
*/ | ||
public interface PathOption extends Option<File> { | ||
} |
9 changes: 9 additions & 0 deletions
9
msf/src/main/java/org/csploit/msf/api/options/PortOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
/** | ||
* Network port option. | ||
*/ | ||
public interface PortOption extends Option<Integer> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
/** | ||
* Raw, arbitrary data option. | ||
*/ | ||
public interface RawOption extends Option<byte[]> { | ||
} |
11 changes: 11 additions & 0 deletions
11
msf/src/main/java/org/csploit/msf/api/options/RegexpOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
/** | ||
* A regex option | ||
*/ | ||
public interface RegexpOption extends Option<Pattern> { | ||
} |
9 changes: 9 additions & 0 deletions
9
msf/src/main/java/org/csploit/msf/api/options/StringOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.csploit.msf.api.options; | ||
|
||
import org.csploit.msf.api.Option; | ||
|
||
/** | ||
* Option string | ||
*/ | ||
public interface StringOption extends Option<String> { | ||
} |
10 changes: 10 additions & 0 deletions
10
msf/src/main/java/org/csploit/msf/api/sessions/CommandShell.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.csploit.msf.api.sessions; | ||
|
||
/** | ||
* This class provides basic interaction with a command shell on the remote | ||
* endpoint. This session is initialized with a stream that will be used | ||
* as the pipe for reading and writing the command shell. | ||
*/ | ||
public interface CommandShell extends SingleCommandShell, Scriptable { | ||
//TODO | ||
} |
10 changes: 10 additions & 0 deletions
10
msf/src/main/java/org/csploit/msf/api/sessions/Meterpreter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.csploit.msf.api.sessions; | ||
|
||
/** | ||
* This class represents a session compatible interface to a meterpreter server | ||
* instance running on a remote machine. It provides the means of interacting | ||
* with the server instance both at an API level as well as at a console level. | ||
*/ | ||
public interface Meterpreter extends SingleCommandShell, Scriptable { | ||
//TODO | ||
} |
2 changes: 1 addition & 1 deletion
2
...it/msf/session/MultiCommandExecution.java → ...f/api/sessions/MultiCommandExecution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sploit/msf/session/MultiCommandShell.java → ...t/msf/api/sessions/MultiCommandShell.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...a/org/csploit/msf/session/Scriptable.java → .../csploit/msf/api/sessions/Scriptable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package org.csploit.msf.session; | ||
package org.csploit.msf.api.sessions; | ||
|
||
import org.csploit.msf.api.Session; | ||
|
||
/** | ||
* Represent a session that can run scripts | ||
*/ | ||
public interface Scriptable { | ||
public interface Scriptable extends Session { | ||
boolean executeFile(String path, String[] args); | ||
int executeScript(String scriptName, String[] args); | ||
} |
6 changes: 4 additions & 2 deletions
6
...t/msf/session/SingleCommandExecution.java → .../api/sessions/SingleCommandExecution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
3b75a00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App crashes for me after starting
3b75a00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah.
/data/data/org.csploit.android/files
empty except for stacktrace. No tools directory. I haven't built for about 24 hours tho so maybe a lot has changed. Nightly failed too.3b75a00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong branch?
3b75a00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.