fozavci/metasploit-framework — pull request #4 by jhart-r7 (2014-11-05 16:20:36+00:00)
Title: Return SRV records more inline with the real SRV records

With:

```
set TARGETACTION BYPASS
set TARGETDOMAIN *.google.com
set TARGETHOST 1.2.3.4
```

When I query for the Jabber SRV record, I can confirm that the results in BYPASS mode are identical (enough) to what I'd get if I hit another non-fake DNS server

Real:
```
~ $ dig srv _jabber._tcp.google.com @4.2.2.1 +nostats +noquestion

; <<>> DiG 9.8.1-P1 <<>> srv _jabber._tcp.google.com @4.2.2.1 +nostats +noquestion
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40932
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; ANSWER SECTION:
_jabber._tcp.google.com. 900	IN	SRV	5 0 5269 xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt2.xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt3.xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt1.xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt4.xmpp-server.l.google.com.
```

Fake:
```
~ $ dig srv _jabber._tcp.google.com @localhost +nostats +noquestion

; <<>> DiG 9.8.1-P1 <<>> srv _jabber._tcp.google.com @localhost +nostats +noquestion
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40132
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; ANSWER SECTION:
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt1.xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt3.xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	5 0 5269 xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt4.xmpp-server.l.google.com.
_jabber._tcp.google.com. 900	IN	SRV	20 0 5269 alt2.xmpp-server.l.google.com.
```

With:

```
set TARGETACTION FAKE
set TARGETDOMAIN *.google.com
set TARGETHOST 1.2.3.4
```

You can see that we get one SRV record as well as an A record to hopefully prevent the subsequent A record lookup:

```
~ $ dig srv _jabber._tcp.google.com @localhost +nostats +noquestion

; <<>> DiG 9.8.1-P1 <<>> srv _jabber._tcp.google.com @localhost +nostats +noquestion
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19005
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; ANSWER SECTION:
_jabber._tcp.google.com. 10	IN	SRV	5 0 5060 _jabber._tcp.google.com.

;; ADDITIONAL SECTION:
_jabber._tcp.google.com. 60	IN	A	1.2.3.4
```