Browse Source

added a minor dns lookup functionality to servers that have more than 0 listening services.

AETH-erial 1 year ago
parent
commit
5fb5fba691
2 changed files with 4 additions and 1 deletions
  1. 4 0
      cmd/kyoketsu/kyoketsu.go
  2. 0 1
      pkg/scanner.go

+ 4 - 0
cmd/kyoketsu/kyoketsu.go

@@ -4,6 +4,7 @@ import (
 	"flag"
 	"fmt"
 	"log"
+	"net"
 	"strings"
 	"sync"
 
@@ -32,6 +33,9 @@ func main() {
 
 				out := kyoketsu.PortWalk(addr.Addr[idx].String(), kyoketsu.PORT_MAP)
 				if len(out.ListeningPorts) > 0 {
+					dns, _ := net.LookupAddr(out.IpAddress)
+					out.Fqdn = strings.Join(dns, ", ")
+
 					fmt.Printf("%+v\n", out)
 
 				}

+ 0 - 1
pkg/scanner.go

@@ -61,7 +61,6 @@ func PortWalk(addr string, portmap map[int]string) *Host {
 	}()
 
 	host := &Host{IpAddress: addr, ListeningPorts: []map[int]string{}}
-
 	for result := range out {
 		if result.Listening {
 			host.ListeningPorts = append(host.ListeningPorts, map[int]string{