From e99213cfa6dbe97ffbcb6ef0fdb5c9926cef3f17 Mon Sep 17 00:00:00 2001 From: Carrie Roberts Date: Mon, 20 Jul 2020 17:23:24 -0600 Subject: [PATCH] configurable host to scan (#1148) --- atomics/T1046/T1046.yaml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/atomics/T1046/T1046.yaml b/atomics/T1046/T1046.yaml index 6ded3967..3c64514c 100644 --- a/atomics/T1046/T1046.yaml +++ b/atomics/T1046/T1046.yaml @@ -59,27 +59,24 @@ atomic_tests: supported_platforms: - windows input_arguments: - file_name: - description: defining NMap install exe - type: path - default: $env:temp\nmap-7.80-setup.exe nmap_url: - description: defining nmap download url + description: NMap installer download URL type: url default: https://nmap.org/dist/nmap-7.80-setup.exe + host_to_scan: + description: The host to scan with NMap + type: string + default: 127.0.0.1 dependency_executor_name: powershell dependencies: - description: | - NMap must be installed at #{file_name} - prereq_command: 'if (cmd /c "where nmap >nul 2>&1") {exit 0} else {exit 1}' + NMap must be installed + prereq_command: 'if (cmd /c nmap 2>nul) {exit 0} else {exit 1}' get_prereq_command: | - Invoke-WebRequest -OutFile "#{file_name}" #{nmap_url} - Start-Process #{file_name} /S + Invoke-WebRequest -OutFile $env:temp\nmap-7.80-setup.exe #{nmap_url} + Start-Process $env:temp\nmap-7.80-setup.exe /S executor: command: |- - nmap 127.0.0.1 - cleanup_command: |- - try {Start-Process 'C:\Program Files (x86)\Nmap\Uninstall.exe' "/S"} catch{} - Remove-Item #{file_name} -erroraction ignore + nmap #{host_to_scan} name: powershell elevation_required: true