Advertisement
jessemoore

PSRemoting2Win

Feb 4th, 2021 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Enable PSRemoting on remote machine
  2. # Enable-PSRemoting
  3. #
  4. # PSRemoting
  5. # https://github.com/redcanaryco/invoke-atomicredteam/wiki/Execute-Atomic-Tests-(Remote)
  6. $sess = New-PSSession -ComputerName WIN-AD -Credential campus\Administrator
  7. #
  8. # Import Module
  9. # https://github.com/redcanaryco/invoke-atomicredteam/wiki/Import-the-Module
  10. Import-Module "C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psd1" -Force
  11. #
  12. # Add this to your $profile  aka notepad $profile
  13. # Magic: set custom default values for cmdlet parameters and advanced functions
  14. $PSDefaultParameterValues = @{"Invoke-AtomicTest:PathToAtomicsFolder"="C:\AtomicRedTeam\atomics"}
  15. #
  16. # Statically assign prompt location this goes in the $profile too
  17. set-location C:\AtomicRedTeam\atomics
  18. #
  19. # Find what PSSessions are running
  20. # Get-PSSession
  21. #
  22. # When returning to PSRemoting session (aka enter into a session)
  23. # Enter-PSSession $sess
  24. #
  25. # Remove PSSession
  26. # Remove-PSSession -Id <3>
  27. #
  28. # T1070.001-1 Clear Logs
  29. Invoke-AtomicTest T1070.001 -Session $sess -ShowDetailsBrief
  30. Invoke-AtomicTest T1070.001 -Session $sess -TestNumbers 1
  31. #
  32. # When returning to a PSRemoting Session
  33. # Enter-PSSession $sess
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement