From 4f0ee6d44c8d3f8a59fc70200c14467dd8454225 Mon Sep 17 00:00:00 2001 From: James Lee Date: Wed, 2 Jun 2010 18:36:14 +0000 Subject: [PATCH] add support for deleting files git-svn-id: file:///home/svn/framework3/trunk@9398 4d416f70-5f16-0410-b530-b9f4589650da --- data/meterpreter/meterpreter.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/data/meterpreter/meterpreter.php b/data/meterpreter/meterpreter.php index 216d939960..a1f05eaef7 100644 --- a/data/meterpreter/meterpreter.php +++ b/data/meterpreter/meterpreter.php @@ -377,6 +377,22 @@ function stdapi_fs_ls($req, &$pkt) { } } +# works +if (!function_exists('stdapi_fs_delete_file')) { +function stdapi_fs_delete_file($req, &$pkt) { + my_print("doing delete\n"); + $path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH); + $path = $path_tlv['value']; + + if ($path && is_file($path)) { + @unlink($path); + return ERROR_SUCCESS; + } else { + return ERROR_FAILURE; + } +} +} + # works if (!function_exists('stdapi_sys_config_getuid')) { function stdapi_sys_config_getuid($req, &$pkt) {