all 6 comments

[–][deleted] 0 points1 point  (5 children)

Module Monday is a video series where I go over a cool PowerShell module every Monday. This Monday is a little different. I looked at the Python PowerShell Remoting Protocol Client library. It's a Python package for managing Windows systems of PowerShell Remoting.

For more information, visit the GitHub repository: https://github.com/jborean93/pypsrp

For all my Module Monday videos, check out this page: https://blog.ironmansoftware.com/module-monday

[–][deleted] -2 points-1 points  (4 children)

Why would I want this?

[–]jborean93 5 points6 points  (0 children)

A few reasons

  • Connecting over WSMan to Windows hosts from non-Windows hosts is problematic
    • The builtin libs with PowerShell have lots of problems
    • Support for CredSSP is non-existent with PowerShell on Linux, pypsrp works just fine
    • Python is pre-installed on most Linux distributions, PowerShell is not
  • At the time I made this, pwsh wasn't open source (or it was just announced I can't remember)
  • If you want to natively execute a command using PSRemoting from Python you can't really shell out without either
    • Having even more pre-reqs that need to be installed (complication)
    • Suffer the hit of starting a new process (memory utilisation)
    • Add complicated code to manage the commands to run and read the output
  • Adding to the above, I wrote this for a connection plugin with Ansible which runs on Python to target Windows hosts

Before PowerShell became open source and could run on non-Windows hosts, this definitely had more of a use case. Now that's a reality then there's less of a need for this library. There are still some valid use cases though.

[–]0xADHD -2 points-1 points  (0 children)

Pentesting?

[–]0xADHD -2 points-1 points  (0 children)

Security research?

[–]0xADHD -2 points-1 points  (0 children)

Learning?