[Bug] ListDirectory appears to fail when current working directory is drive root
- Dominant language
- C#
- Stars
- 4.7k
- Forks
- 822
- PR merge metrics
- No merged PRs in 30d
Description
**Feature Request or Bug**
Bug
**Describe the feature request or bug**
`ls` seems to fail when the current working directory is set to the drive root.
**To Reproduce**
Steps to reproduce the behavior:
1. `cd C:\`
2. `ls`
**Expected behavior**
Get directory output.
```
(rasta) > pwd
C:\
(rasta) > ls
System.ArgumentException: Path cannot be the empty string or all whitespace.
Parameter name: path2
at System.IO.Path.InternalCombine(String path1, String path2)
at System.IO.FileSystemEnumerableIterator`1.CommonInit()
at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
at System.IO.Directory.GetFiles(String path)
at SharpSploit.Enumeration.Host.GetDirectoryListing(String Path)
at Task.Execute(String Path)
(rasta) > ls C:\
Name Length CreationTimeUtc LastAccessTimeUtc LastWriteTimeUtc
---- ------ --------------- ----------------- ----------------
C:\$GetCurrent 0 17/06/2019 18:17:32 18/06/2019 18:52:36 18/06/2019 18:52:36
C:\$Recycle.Bin 0 11/04/2018 23:38:20 09/05/2019 17:53:44 09/05/2019 17:53:44
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.