aboutsummaryrefslogtreecommitdiff
path: root/Tests/Exfiltration.tests.ps1
diff options
context:
space:
mode:
authorMatt Graeber <mattifestation@users.noreply.github.com>2016-05-12 08:08:54 -0700
committerMatt Graeber <mattifestation@users.noreply.github.com>2016-05-12 08:08:54 -0700
commiteec3704f40f457bde6a5c5d1bb7c93c463e2e0ac (patch)
tree7d887dde644520e2876626787cad3cef8de2374a /Tests/Exfiltration.tests.ps1
parent30324b7c5e934fb0d5b42280bba4b12c961147e1 (diff)
parentdebe4a565ebd51b740855e3e83b331a6d5fd7e33 (diff)
downloadPowerSploit-eec3704f40f457bde6a5c5d1bb7c93c463e2e0ac.tar.gz
PowerSploit-eec3704f40f457bde6a5c5d1bb7c93c463e2e0ac.zip
Merge pull request #139 from sixdub/dev
Added Get-MicrophoneAudio.ps1 and associated Pester tests
Diffstat (limited to 'Tests/Exfiltration.tests.ps1')
-rw-r--r--Tests/Exfiltration.tests.ps131
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/Exfiltration.tests.ps1 b/Tests/Exfiltration.tests.ps1
index e4f60d5..ed98f45 100644
--- a/Tests/Exfiltration.tests.ps1
+++ b/Tests/Exfiltration.tests.ps1
@@ -52,3 +52,34 @@ Describe 'Get-Keystrokes' {
Remove-Item -Force "$($env:TEMP)\key.log"
}
+
+Describe "Get-MicrophoneAudio" {
+
+ $RecordPath = "$env:TEMP\test_record.wav"
+ $RecordLen = 2
+ Context 'Successful Recording' {
+ BeforeEach {
+ #Ensure the recording as been removed prior to testing
+ Remove-Item -Path $RecordPath -ErrorAction SilentlyContinue
+ }
+
+ AfterEach {
+ #Remove the recording after testing
+ Remove-Item -Path $RecordPath -ErrorAction SilentlyContinue
+ }
+
+ It 'should record audio from the microphone and save it to a specified path' {
+ $result = Get-MicrophoneAudio -Path $RecordPath -Length $RecordLen
+ $result | Should Not BeNullOrEmpty
+ $result.Length | Should BeGreaterThan 0
+ }
+
+ }
+
+ Context 'Invalid Arguments' {
+ It 'should not allow invalid paths to be used' {
+ { Get-MicrophoneAudio -Path "c:\FAKEPATH\yay.wav" -Length RecordLen} | Should Throw
+ }
+ }
+
+}