This will set the config variable 'verbose' to True, so we can run 'pwncat ... --verbose/-V'
and have verbose output without the need to 'set vebrose True'.
Because we do not have access to pwncat's local prompt if we run it as 'pwncat ...'
I have changed the logger name from 'str(channel)' to 'str(id(channel))' to create a logger unique to one 'channel'. Also, added a separate method to set verbose output and added a private variable to store the logging handler object
This will only keep the 'log info' in one line, the output for 'rich console'. I have 'force-pushed' to prevent git-history pollution. Oops! I forgot to use same comments :p
'socket.gaierror' is caught when we are unable to resolve the host name into the IP address. 'OSError' is caught when the host is invalid. I have now used the appropriate messages.
Previously, we were registering a new 'session' with the 'manager' before completing the setup: '__init__'. Any exception raised after we registered the 'session' didn't remove the registered session. This will allow the reuse of same 'session_id' because we have already registered the 'session' with this 'session_id', which may possibly be an invalid session because an exception is raised. And 'session_id' variable in 'manager' will not be updated because of this exception. Thus, I have shifted down the session registering part so that it occurs after the completion of session creation.
I have added warning messages so that the attacker can use 'C-c' to cancel the session when used from command line (not from local prompt). And added the message for already handled same exception. I have also changed two warning message color from 'red' to 'yellow', because 'yellow' is being used everywhere in the code.
Exception handling in the output thread was cleaned up and had Windows
platform raise the RawModeExit exception to trigger an exit when
interactive end marker was observed.
- Removed `C-d` loop in `LinuxWriter.close`
- Added double `C-d` routine based on last character written to `LinuxWriter.close`
- Changed upload success message to match size calculations from `rich.progress`.
- Added better file IO test cases (small text, large text, small binary, large binary)