Tab completion of RHOST options based the available services and the current RPORT
git-svn-id: file:///home/svn/framework3/trunk@3894 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
6c4999ad92
commit
6b4105db8e
|
@ -1198,8 +1198,26 @@ class Core
|
||||||
res << Rex::Socket.source_address()
|
res << Rex::Socket.source_address()
|
||||||
return res if not framework.db.active
|
return res if not framework.db.active
|
||||||
|
|
||||||
framework.db.each_host do |host|
|
# List only those hosts with matching open ports?
|
||||||
res << host.address
|
mport = self.active_module.datastore['RPORT']
|
||||||
|
if (mport)
|
||||||
|
mport = mport.to_i
|
||||||
|
hosts = {}
|
||||||
|
framework.db.each_service do |service|
|
||||||
|
if (service.port == mport)
|
||||||
|
hosts[ service.host.address ] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
hosts.keys.each do |host|
|
||||||
|
res << host
|
||||||
|
end
|
||||||
|
|
||||||
|
# List all hosts in the database
|
||||||
|
else
|
||||||
|
framework.db.each_host do |host|
|
||||||
|
res << host.address
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Reference in New Issue