tweaks
This commit is contained in:
parent
e38ebda0cc
commit
b9960f42ed
|
@ -8,15 +8,26 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// Detected software types
|
||||
// Detected software types
|
||||
NSD = "nsd"
|
||||
BIND = "bind"
|
||||
|
||||
// Vendors
|
||||
ISC = "ISC"
|
||||
NLNETLABS = "NLnet Labs"
|
||||
// Vendors
|
||||
ISC = "ISC"
|
||||
NLNETLABS = "NLnet Labs"
|
||||
)
|
||||
|
||||
func startParse(addr string) {
|
||||
l := new(lexer)
|
||||
l.addr = addr
|
||||
l.client = new(dns.Client)
|
||||
l.fp = new(fingerprint)
|
||||
l.items = make(chan item)
|
||||
for l.state = lexDoBitMirror; l.state != nil; l.state = l.state(l) {
|
||||
// l.state = l.state(l)
|
||||
}
|
||||
}
|
||||
|
||||
// SendProbe creates a packet and sends it to the nameserver.
|
||||
// Connection errors are returned as:
|
||||
// ...
|
||||
|
|
|
@ -45,13 +45,15 @@ func (l *lexer) emit(i *item) {
|
|||
// "Lexer" functions
|
||||
|
||||
// Check if the server returns the DO-bit when set in the request.
|
||||
func lexDoBitMirorred(l *lexer) stateFn {
|
||||
func lexDoBitMirror(l *lexer) stateFn {
|
||||
// The important part here is that the DO bit is on
|
||||
l.fp.SetString("QUERY,NOERROR,qr,aa,tc,RD,ad,cd,z,1,0,0,0,DO,0")
|
||||
l.q = dns.Question{".", dns.TypeNS, dns.ClassINET}
|
||||
if l.probe().Do {
|
||||
l.emit(&item{itemSoftware, NSD})
|
||||
println(NSD)
|
||||
// l.emit(&item{itemSoftware, NSD})
|
||||
}
|
||||
l.emit(&item{itemSoftware, BIND})
|
||||
//l.emit(&item{itemSoftware, BIND})
|
||||
println(BIND)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -110,6 +110,10 @@ Flags:
|
|||
if *dnssec || *nsid {
|
||||
m.SetEdns0(dns.DefaultMsgSize, true)
|
||||
}
|
||||
if *fp {
|
||||
startParse(nameserver)
|
||||
return
|
||||
}
|
||||
for _, v := range qname {
|
||||
m.Question[0] = dns.Question{v, qtype, qclass}
|
||||
m.Id = dns.Id()
|
||||
|
|
Loading…
Reference in New Issue