-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdns.go
More file actions
35 lines (28 loc) · 951 Bytes
/
dns.go
File metadata and controls
35 lines (28 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"fmt"
"context"
"net"
"time"
"strings"
)
func main() {
domain := "example.com"
r := &net.Resolver{
PreferGo: true,
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
d := net.Dialer {
Timeout: time.Millisecond * time.Duration(10000),
}
return d.DialContext(ctx, "udp", "127.0.0.1:5053")
},
}
txt_records, _ := r.LookupTXT(context.Background(), domain)
fmt.Println("[+] TXT Record Data:", txt_records)
msg_b64 := txt_records[0]
msg_b64_split := strings.Split(msg_b64, "::")
ciphertext_b64 := msg_b64_split[0]
iv_b64 := msg_b64_split[1]
fmt.Println("[+] Ciphertext:", ciphertext_b64)
fmt.Println("[+] IV :", iv_b64)
}