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)
There is a missing argument to the ChannelError constructor - ch (channel). Because of this, many explicitly passed error messages are simply rejected. There is a minor typo correction as well, 'writiers' -> 'writers'.
Socket-based channels now raise ChannelClosed if no connection is active
and a recv/send method is called. Also, the close method no longer
raises an exception if the channel is not active. It is silently ignored
as a NOOP.
Also fixed a tangential problem which arose regarding the group
enumerations which caused a recursive call the enumerate groups
from within the group enumeration.
The recv method did not used to handle an empty result properly. It now
raises a ChannelClosed exception properly. Also, odly, the
`Manager.find_session_by_channel` method had never been implemented.
It appears that you need to send every C-d twice, but I can't figure out
why. All manual testing only requires a single C-d, but double each
seems to correctly behave with file IO.
### Changed
- Changed session tracking so session IDs aren't reused
- Changed zsh prompt to match CWD of other shell prompts
### Fixed
- Fixed syntax for f-strings in escalation command
I will release a patch version once a couple other bugs
are fixed. Namely, the dockerhub building problems and
exception issues. In the meantime, the changes are listed
under "Unreleased".
These changes do not affect the working of `pwncat`. You had an older version of `python-black`, and allowed me to apply the changes. As per the provided template, I have also ran `isort` and `flake8`, they reported no errors and/or modifications.
NOTE: This is for linux! This change will add ID management for the sessions, so that each session gets a unique ID (for a single `pwncat` process) and killing a session will not affect other session IDs. This is useful when we are pivoting using `pwncat`, and removes the confusion with ID management since the current implementation uses a List and works with list indices instead of session IDs