sensepost / USaBUSe

Universal Serial aBUSe is a project to demonstrate the risks of hardware bypasses of software security by Rogan Dawes at SensePost.
Other
491 stars 86 forks source link

PowerShell window hiding #17

Closed k0stQs closed 5 years ago

k0stQs commented 5 years ago

Can someone please help me? What are the PowerShell commands in order to minimize the window, while the PowerShell script running?

RoganDawes commented 5 years ago

The code can be found in powershell/read_exec_long.ps1, in several places:

https://github.com/sensepost/USaBUSe/blob/master/powershell/read_exec_long.ps1#L5

provides a Powershell interface to the underlying Windows methods. And then they are called here:

https://github.com/sensepost/USaBUSe/blob/master/powershell/read_exec_long.ps1#L29

(to move the window off the screen) and here:

https://github.com/sensepost/USaBUSe/blob/master/powershell/read_exec_long.ps1#L36

(both commented out for debugging purposes).

Alternatively, you could look at @mame82's P4wnPi ALOA, which does the same thing without the C# stub:

https://github.com/mame82/P4wnP1_aloa/blob/master/dist/HIDScripts/helper.js#L27