1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-24 18:16:24 +01:00

Land , fix ls on relative paths

This commit is contained in:
Tim W 2019-08-28 11:09:57 +08:00
commit 444419c122
No known key found for this signature in database
GPG Key ID: 217FBA50ABBAABEF

@ -10,8 +10,8 @@ import com.metasploit.meterpreter.command.Command;
public class stdapi_fs_ls implements Command {
public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {
stdapi_fs_stat statCommand = (stdapi_fs_stat) meterpreter.getCommandManager().getCommand("stdapi_fs_stat");
String path = request.getStringValue(TLVType.TLV_TYPE_DIRECTORY_PATH);
String[] entries = new File(path).list();
File path = Loader.expand(request.getStringValue(TLVType.TLV_TYPE_DIRECTORY_PATH));
String[] entries = path.list();
for (int i = 0; i < entries.length; i++) {
if (entries[i].equals(".") || entries[i].equals(".."))
continue;