forked from cSploit/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMsfRpcd.java
More file actions
45 lines (37 loc) · 1.18 KB
/
Copy pathMsfRpcd.java
File metadata and controls
45 lines (37 loc) · 1.18 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package org.csploit.android.tools;
import org.csploit.android.core.*;
import org.csploit.android.core.System;
import org.csploit.android.events.Event;
import org.csploit.android.events.Ready;
/**
* MetaSploit RPC Daemon
*/
public class MsfRpcd extends Msf {
public static abstract class MsfRpcdReceiver extends Child.EventReceiver {
@Override
public void onEvent(Event e) {
if(e instanceof Ready)
onReady();
}
public abstract void onReady();
}
public MsfRpcd() {
mHandler = "msfrpcd";
}
/**
* start an MsfRpcd
* @param receiver will be notified when the daemon it's ready to accept connections
*/
public Child async(String user, String pswd, int port, boolean ssl, MsfRpcdReceiver receiver) throws ChildManager.ChildNotStartedException {
return async(
String.format("-P '%s' -U '%s' -p '%d' -a 127.0.0.1 -n %s -t Msg -f",
pswd, user, port, (ssl ? "" : "-S")),
receiver);
}
/*public static boolean isLocal() {
return System.getSettings().getString("MSF_RPC_HOST", "127.0.0.1").equals("127.0.0.1");
}*/
public static boolean isInstalled() {
return System.getLocalMsfVersion() != null;
}
}