More tempfile nonsense
git-svn-id: file:///home/svn/framework3/trunk@5247 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
d6e5b0a25d
commit
5e2f1ea7cc
|
@ -379,6 +379,8 @@ module Db
|
|||
end
|
||||
|
||||
fd = Tempfile.new('dbnmap')
|
||||
fd.close
|
||||
|
||||
args.push('-oX', fd.path)
|
||||
args.unshift(nmap)
|
||||
|
||||
|
@ -391,11 +393,9 @@ module Db
|
|||
end
|
||||
end
|
||||
|
||||
data = fd.read
|
||||
data = File.read(fd.path)
|
||||
|
||||
fd.close
|
||||
|
||||
File.unlink(x.path)
|
||||
File.unlink(fd.path)
|
||||
|
||||
load_nmap_xml(data)
|
||||
end
|
||||
|
|
|
@ -109,14 +109,14 @@ class Plugin::DBSQLite3 < Msf::Plugin
|
|||
|
||||
|
||||
tmp = Tempfile.new("sqlXXXXXXX")
|
||||
tmp.close
|
||||
|
||||
system("#{sqlite3} \"#{opts['dbfile']}\" < \"#{sql}\" >\"#{tmp.path}\" 2>&1")
|
||||
|
||||
tmp.read.each_line do |line|
|
||||
File.read(tmp.path).each_line do |line|
|
||||
print_status("OUTPUT: #{line.strip}")
|
||||
end
|
||||
|
||||
tmp.close
|
||||
File.unlink(tmp.path)
|
||||
|
||||
if (not framework.db.connect(opts))
|
||||
|
|
Loading…
Reference in New Issue