Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Autumn-27 committed Jun 14, 2024
1 parent cba3999 commit e6696c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ func AutoGetDevices() *EtherTable {
packet, err := packetSource.NextPacket()
gologger.Printf(".")
if err != nil {
fmt.Println(fmt.Sprintf("%v", err))
continue
}
if dnsLayer := packet.Layer(layers.LayerTypeDNS); dnsLayer != nil {
dns, _ := dnsLayer.(*layers.DNS)
if !dns.QR {
gologger.Printf("!")
continue
}
for _, v := range dns.Questions {
fmt.Println(v.Name)
if string(v.Name) == domain {
ethLayer := packet.Layer(layers.LayerTypeEthernet)
if ethLayer != nil {
Expand Down

0 comments on commit e6696c3

Please sign in to comment.