Open adfoster-r7 opened 1 year ago
There's another issue too, even on Python 3: Junction points always fail, because islink
return false even on Python 3.
So it might be that the solution for 2.7 should just be the "Windows" solution.
New acceptance test, running on Python 3:
[-] [should delete a junction target] FAILED: should delete a junction target
[-] [should delete a junction target] Exception: Rex::Post::Meterpreter::RequestError: stdapi_fs_delete_dir: Operation failed: Unknown error
When running the file deletion tests in Metasploit, the sym link tests fail on Python 2.7
https://github.com/rapid7/metasploit-payloads/blob/cbf451bcde93fbe3fce9b793f2004d98392d929a/python/meterpreter/ext_server_stdapi.py#L1895-L1896
Python 2.7's
islink
implementation is not implemented correctly https://stackoverflow.com/questions/15258506/os-path-islink-on-windows-with-pythonExample showing different runtimes providing different results:
This could be updated to use ctypes, but I believe the required unlink implementation is also broken - I haven't confirmed.