Metasploit mailing list archives

Re: How to find host in the database (db_host )


From: HD Moore <hdm () metasploit com>
Date: Tue, 06 Apr 2010 10:26:03 -0500

On 4/6/2010 4:56 AM, eski mo wrote:
Hi grp

want to find a method which returns true if supplied ip_address is
found in the hosts table (db_hosts) of the database

.. I tried

msf> db_create
<snip>..

msf > irb
[*] Starting IRB shell...
me = framework.db
me.connect({})

want to do something like
me.has_host?('192.168.1.1') (should return true/false).... but not working

host = framework.db.workspace.hosts.find_by_address('192.168.1.1')
if host
 # do stuff
end
_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework


Current thread: