diff --git a/src/Nmap/Nmap.php b/src/Nmap/Nmap.php index c804a17..3254c14 100644 --- a/src/Nmap/Nmap.php +++ b/src/Nmap/Nmap.php @@ -67,10 +67,11 @@ public function __construct(ProcessExecutor $executor = null, $outputFile = null /** * @param array $targets * @param array $ports + * @param array $extraOptions * * @return Host[] */ - public function scan(array $targets, array $ports = array()) + public function scan(array $targets, array $ports = array(), array $extraOptions = array()) { $targets = implode(' ', array_map(function ($target) { return ProcessUtils::escapeArgument($target); @@ -103,7 +104,13 @@ public function scan(array $targets, array $ports = array()) $options[] = '-Pn'; } + if( !empty($extraOptions) ) { + + $options = array_merge($options, $extraOptions); + } + $options[] = '-oX'; + $command = sprintf('%s %s %s %s', $this->executable, implode(' ', $options),