Skip to content

Commit bf70df6

Browse files
committed
Land rapid7#4995, db_nmap arguments fix
2 parents 9fadc39 + 548a710 commit bf70df6

File tree

1 file changed

+7
-7
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+7
-7
lines changed

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ def cmd_db_nmap(*args)
17401740
return
17411741
end
17421742
save = false
1743-
arguments = ''
1743+
arguments = []
17441744
while (arg = args.shift)
17451745
case arg
17461746
when 'save'
@@ -1749,7 +1749,7 @@ def cmd_db_nmap(*args)
17491749
cmd_db_nmap_help
17501750
return
17511751
else
1752-
arguments << arg + ' '
1752+
arguments << arg
17531753
end
17541754
end
17551755

@@ -1773,15 +1773,15 @@ def cmd_db_nmap(*args)
17731773
# Custom function needed because cygpath breaks on 8.3 dirs
17741774
tout = Rex::Compat.cygwin_to_win32(fd.path)
17751775
fout = Rex::Compat.cygwin_to_win32(fo.path)
1776-
args.push('-oX', tout)
1777-
args.push('-oN', fout)
1776+
arguments.push('-oX', tout)
1777+
arguments.push('-oN', fout)
17781778
else
1779-
args.push('-oX', fd.path)
1780-
args.push('-oN', fo.path)
1779+
arguments.push('-oX', fd.path)
1780+
arguments.push('-oN', fo.path)
17811781
end
17821782

17831783
begin
1784-
nmap_pipe = ::Open3::popen3([nmap, 'nmap'], arguments)
1784+
nmap_pipe = ::Open3::popen3([nmap, 'nmap'], *arguments)
17851785
temp_nmap_threads = []
17861786
temp_nmap_threads << framework.threads.spawn("db_nmap-Stdout", false, nmap_pipe[1]) do |np_1|
17871787
np_1.each_line do |nmap_out|

0 commit comments

Comments
 (0)