mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-04-24 10:09:49 +02: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 class stdapi_fs_ls implements Command {
|
||||||
public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {
|
public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {
|
||||||
stdapi_fs_stat statCommand = (stdapi_fs_stat) meterpreter.getCommandManager().getCommand("stdapi_fs_stat");
|
stdapi_fs_stat statCommand = (stdapi_fs_stat) meterpreter.getCommandManager().getCommand("stdapi_fs_stat");
|
||||||
String path = request.getStringValue(TLVType.TLV_TYPE_DIRECTORY_PATH);
|
File path = Loader.expand(request.getStringValue(TLVType.TLV_TYPE_DIRECTORY_PATH));
|
||||||
String[] entries = new File(path).list();
|
String[] entries = path.list();
|
||||||
for (int i = 0; i < entries.length; i++) {
|
for (int i = 0; i < entries.length; i++) {
|
||||||
if (entries[i].equals(".") || entries[i].equals(".."))
|
if (entries[i].equals(".") || entries[i].equals(".."))
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user