diff options
author | Matt Graeber <mattgraeber@gmail.com> | 2013-07-04 05:50:31 -0700 |
---|---|---|
committer | Matt Graeber <mattgraeber@gmail.com> | 2013-07-04 05:50:31 -0700 |
commit | 9de59e9e3f3c3721f7c93e58b60ea2738590fa8e (patch) | |
tree | 4597854529816ef945539096612cbe80604a0173 | |
parent | 29329e1707f3ca4d7d7374ecd7ddd074e8a372cc (diff) | |
parent | 2f28a290745c0ab216cbddf036175f8b44a6e611 (diff) | |
download | PowerSploit-9de59e9e3f3c3721f7c93e58b60ea2738590fa8e.tar.gz PowerSploit-9de59e9e3f3c3721f7c93e58b60ea2738590fa8e.zip |
Merge pull request #9 from obscuresec/master
Bug fix for error handling
-rw-r--r-- | Exfiltration/Get-GPPPassword.ps1 | 2 | ||||
-rw-r--r-- | Exfiltration/Get-TimedScreenshot.ps1 | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Exfiltration/Get-GPPPassword.ps1 b/Exfiltration/Get-GPPPassword.ps1 index 6e6594d..7204a45 100644 --- a/Exfiltration/Get-GPPPassword.ps1 +++ b/Exfiltration/Get-GPPPassword.ps1 @@ -57,7 +57,7 @@ return [System.Text.UnicodeEncoding]::Unicode.GetString($OutBlock) } - catch {Write-Error "$Error[0]"} + catch {Write-Error $Error[0]} } #ensure that machine is domain joined and script is running as a domain account diff --git a/Exfiltration/Get-TimedScreenshot.ps1 b/Exfiltration/Get-TimedScreenshot.ps1 index e1c44d0..c14c723 100644 --- a/Exfiltration/Get-TimedScreenshot.ps1 +++ b/Exfiltration/Get-TimedScreenshot.ps1 @@ -50,7 +50,7 @@ https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-Timed )
#Define helper function that generates and saves screenshot
- Function GenScreenshot {
+ Function Get-Screenshot {
$ScreenBounds = [Windows.Forms.SystemInformation]::VirtualScreen
$ScreenshotObject = New-Object Drawing.Bitmap $ScreenBounds.Width, $ScreenBounds.Height
$DrawingGraphics = [Drawing.Graphics]::FromImage($ScreenshotObject)
@@ -86,7 +86,7 @@ https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-Timed [String] $FilePath = (Join-Path $Path $FileName)
#run screenshot function
- GenScreenshot
+ Get-Screenshot
Write-Verbose "Saved screenshot to $FilePath. Sleeping for $Interval seconds"
@@ -94,8 +94,8 @@ https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-Timed }
#note that this will run once regardless if the specified time as passed
- While ((Get-Date -Format HH:%m) -lt $EndTime)
+ While ((Get-Date -Format HH:mm) -lt $EndTime)
}
- Catch {Write-Warning "$Error[0].ToString() + $Error[0].InvocationInfo.PositionMessage"}
-}
\ No newline at end of file + Catch {Write-Error $Error[0].ToString() + $Error[0].InvocationInfo.PositionMessage}
+}
|