mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-24 18:16:24 +01:00
Land #358, fix ls on relative paths
This commit is contained in:
commit
444419c122
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user