rapid7/metasploit-framework — pull request #1734 by Meatballs1 (2013-04-14 10:11:00+00:00)
Title: Add IP resolution to STDAPI

Added some IP resolution to STDAPI. This is to avoid having to do multiple railgun calls to resolve an IP and allows multiple hosts to be done at the same time.

Framework side of: https://github.com/rapid7/meterpreter/pull/8/files

```
msf post(resolve_hosts) > run

[*] Attempting to resolve 'google.com, localhost, drake, unknown1111, ipv6.cybernode.com, 8.8.8.8' on WIN7-X86
Hostname IP
-------- --
google.com 173.194.34.134
localhost 127.0.0.1
drake 192.168.1.117
unknown1111
ipv6.cybernode.com
8.8.8.8 8.8.8.8
[*] Post module execution completed
msf post(resolve_hosts) > set SESSION 2
SESSION => 2
msf post(resolve_hosts) > run

[*] Attempting to resolve 'google.com, localhost, drake, unknown1111, ipv6.cybernode.com, 8.8.8.8' on WIN7-X64
Hostname IP
-------- --
google.com 173.194.34.137
localhost 127.0.0.1
drake 192.168.1.117
unknown1111
ipv6.cybernode.com
8.8.8.8 8.8.8.8
[*] Post module execution completed
```

Also does a single host:
```
meterpreter > irb
[*] Starting IRB shell
[*] The 'client' variable holds the meterpreter client

>> client.net.resolve.resolve_host("google.com")
=> {:hostname=>"google.com", :ip=>"173.194.34.131"}
>> client.net.resolve.resolve_host("localhost")
=> {:hostname=>"localhost", :ip=>"127.0.0.1"}
>> exit
```