Skip to content

Commit

Permalink
Add native whois lookup
Browse files Browse the repository at this point in the history
Add native whois lookup. Removed the use of the HackerTarget API and
replaced it with a native function.
  • Loading branch information
naltun committed Aug 21, 2018
1 parent a89f0e5 commit f481bde
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"net"
"net/http"
"os"

whois "github.com/likexian/whois-go"
)

/**************
Expand Down Expand Up @@ -61,6 +63,15 @@ func menu() {
`)
}

func whoIs(url string) string {
res, err := whois.Whois(url)
if err != nil {
panic(err)
display()
}
return res
}

func eyes() {
fmt.Print("What do you want to do? ")
fmt.Scanln(&choice)
Expand All @@ -69,8 +80,7 @@ func eyes() {
case "1":
fmt.Print("Enter a domain or IP address: ")
fmt.Scanln(&target)
apiUrl := "http://api.hackertarget.com/whois/?q=" + target
fmt.Println(curlReq(apiUrl))
fmt.Println(whoIs(target))
display()

case "2":
Expand Down

0 comments on commit f481bde

Please sign in to comment.