Announcing PSShareTru

Announcing PSShareTru

A PowerShell module for accessing the API of the ShareTru SFTP SaaS app.

Background

Look, this is a niche module and I know it. There are probably only dozens of us who pay for this enterprise tier. And even fewer of us care about having a PowerShell module to interact with the API. But you know what? I just wanted an easier way to do recon. And so, if I’m going to do it for me, I might as well do it for you all as well.

You can access the project over on gitlab and read more about using it.

Something that I really like about this module is that you can chain all the commands together, which is especially nice for interactive usage and troubleshooting. And since it has various argument completers, they help you on the interactive terminal to get to the root of issues even faster.

I also REALLY like that their SFTP activity history endpoint has activity data instantly and in manageable chunks. The days of waiting 2-3 minutes and then downloading an SFTP log to diagnose IP address restrictions vs no ssh key provided vs bad username vs wrong upload path are finally over for me. Woo!

Usage

Here are a few examples showing how you can use the individual cmdlets as well as how you can chain them together:

# Get all users where username contains the text "bob"
Get-STUser bob

# Get all users where email address ends with "@gallerd.com"
Get-STUser -Email @gallerd.com -EmailOperator "ends"

# Get all IP address restrictions for users with "bob" in their username
Get-STUser bob | Get-STIpRestriction

# Start a log trace for entries where username, file path, or arguments
# contains the text "bob@ballerd.com"
Get-STLog bob@gallerd.com

# Start a log trace for entries coming from a specific IP address
Get-STLog 1.222.333.45 | ft

# Start a log trace for requests from suspended users
Get-STUser -Status suspended -StatusOp "=" | Get-STLog | ogv

# Start a log trace for entries coming from an IP address in the IP allow-list
# for bob@gallerd.com (including ranges), which is especially useful for someone
# who isn't sure what username is actually being used by their automation.
Get-STUser bob@gallerd.com | Get-STIpRestriction | Get-STLog | ogv

Wrapping up

If you want to say something about this blog post, come say hi in the comment thread I made in r/powershell. Enjoy!

If you are sitting there wondering what the heck is going on with my version numbers, then I’ll refer you to my post, Minor Versions Are Useless.