Also, why do I feel like this is the 3rd or 4th time I've seen a submission similar to this?

-Josh

On Jun 3, 2013, at 11:13, Borja Merino <notifications@github.com> wrote:

> In modules/post/windows/gather/externalip.rb:
> 
> > +
> > +		output = cmd_exec("cscript",vbs_file)
> > +		output.each_line do |l|
> > +			print_good("#{l}") if l =~ /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/
> > +		end
> > +		file_rm(vbs_file)
> > +	end
> > +
> > +
> > +	def create_vbs
> > +		vbs_dir = expand_path("%TEMP%")
> > +		vbs_file = vbs_dir << "\\" << Rex::Text.rand_text_alpha((rand(8)+6)) << ".vbs"
> > +
> > +		conf_conn =  "Dim msf\r\n"
> > +		conf_conn += "Set msf = CreateObject(\"MSXML2.XMLHTTP\")\r\n"
> > +		conf_conn += "msf.open \"GET\", \"http://icanhazip.com\", False\r\n"
> @wchen-r7 Not sure if it's reliable enough to be hardcoded. Initially I used ifconfig.me/ip but I found that icanhazip.com is much more faster. It's been up a couple of years. If you want I can set an OptString with a default resolver value. Another option is to put several services like these in a list and set a timeout. If I get no reponse in X seconds I use the next one. 
> Let me know what you think is best.
> 
> —
> Reply to this email directly or view it on GitHub.