nettitude / PoshC2

A proxy aware C2 framework used to aid red teamers with post-exploitation and lateral movement.
BSD 3-Clause "New" or "Revised" License
1.78k stars 323 forks source link

[BUG] upload-file crashes when invoked with -source and -destination #256

Closed ashr closed 2 years ago

ashr commented 2 years ago

Description

upload-file implant alias crashes when invoked with 'upload-file -source sourcefilename -destination "destination"'

Execution Environment:

All of this must be filled in Data Value
Full Posh version (all the text between the === at the top of the Implant Handler) PoshC2 v7.4.0 (f6664b1 2021-04-26 19:49:40)
OS & version Ubuntu 18.04.6 LTS
Using Docker/containerisation? No

Implant Info

Defensive Technologies

To Reproduce

Steps to reproduce the behavior:

  1. Run implant on target
  2. Select implant through posh client
  3. Invoke upload-file as per the help instruction 'upload-file -source /tmp/test.exe -destination "c:\temp\test.exe"'

Expected behavior

File upload success or a File not found exception or Destination path doesn't exist exception

Screenshots

Client view: image

Attach files if required

Additional context

Typing 'upload-file' with no parameters causes a prompt for the source and destination and the functionality then works as expected. (Thank you m0rv4i for this)