[BUG] stager retry-timeouts [ CSharp dropper does not exit() after exceeding retry condition ]
polarlotus opened this issue · comments
Description
The newly implemented "stager retry" functionality works and as expected, EXCEPT that the dropper process should die if the stager timeouts are exceeded as defined in the config.yml configuration file.
Prior versions such as 7.0, did not have easily configurable timeouts, but did exit "eventually" after 25 minutes of no C2 response at startup.
This does not effect C2 / turtle timeouts which is after stage initialisation. This is purely startup timeouts.
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.1.0 (39c4727 2020-12-01 14:40:06) |
OS & version | Debian 5.9.6 |
Using Docker/containerisation? | No |
Implant Info
-
What implant does the problem occur on? PowerShell/C#/Python
C# -
How was the implant created? Running a default payload? Inject-shellcode? Custom payload?
EXE, DLL, shellcode same behaviour.
Defensive Technologies
- Is the target environment running any particular defensive products? AVs/EDRs etc?
None
To Reproduce
Steps to reproduce the behavior:
-
Generate standard Csharp dropper payload with desired timeouts.
Example:
PayloadStageRetries: false
PayloadStageRetriesInitialWait: 5
PayloadStageRetriesLimit: 1 -
DON'T start the Posh server.
-
Execute the payload on target and observe the packets in Wireshark.
-
Observe the payload in task manager. Wait for exit.
Expected behaviour
The stager process should exit() if the startup timeout values in the config.yml are exceeded.
Screenshots
N/A
Attach files if required
N/A
Additional context
N/A
Are these limits not bound to the "new" configurable stager limits? Anyhow, the "process" should die after timeouts are exceeded. Unless i'm misunderstanding you here.
Thanks for the feedback, i somehow missed the C++ aspect in the payloads starting with the name "Sharp" and "Posh" - Now the behaviour is indeed as expected and this non-bug can be closed.