skelsec / aardwolf

Asynchronous RDP client for Python (headless)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to logoff user when terminating context

jborean93 opened this issue · comments

I'm using connection.terminate() but I've found that while it closes the connection the remote session still exists in a disconnected state. Is there a way to also log this session off before terminating connection, say through a specific RDP command or would I have to find some other mechanism like sending keystrokes to achieve this?

Hello!
No need to send additional keystrokes, this functionality is present in the protocol itself but not in the implementation.
Will add is asap.

Please try git pull and let me know if the new mechanism matches your needs. Added disconnect request.

Hi I just tried out the latest commit, unfortunately it the session is still disconnected and not logged off. I don't know much about RDP but the spec seems to indicate the PDU added is more for disconnections https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/27915739-8f77-487e-9927-55008af7fd68. I could totally be wrong though.

you are correct. In this case however I have no clue if that's even possible on the protocol level.

I spoke to @awakecoding about this and he was unaware of any builtin mechanisms to achieve what I am looking for unfortunately. I'll have to look at integrating it as part of my virtual channel exe or seeing if it's at all feasible to send the keystrokes required.

Appreciate you looking into this!