Files
sif/internal/scan/whois.go
T
janandGitHub 96092dafab style: apply gofmt to source tree (#232)
Ran `gofmt -w .` accross the repo to fix formatting drift.

Mechanical `gofmt -w .` only. No functional or behavioural changes.

CONTRIBUTING.md requires gofmt-clean code; these files had slipped.
2026-06-25 18:19:17 -07:00

42 lines
1.7 KiB
Go

/*
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
: :
: █▀ █ █▀▀ · Blazing-fast pentesting suite :
: ▄█ █ █▀ · BSD 3-Clause License :
: :
: (c) 2022-2026 vmfunc, xyzeva, :
: lunchcat alumni & contributors :
: :
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
*/
package scan
import (
"github.com/charmbracelet/log"
"github.com/likexian/whois"
"github.com/vmfunc/sif/internal/logger"
"github.com/vmfunc/sif/internal/output"
)
func Whois(url string, logdir string) {
output.ScanStart("WHOIS lookup")
sanitizedURL := stripScheme(url)
if logdir != "" {
if err := logger.WriteHeader(sanitizedURL, logdir, " WHOIS scanning"); err != nil {
output.Error("Error creating log file: %v", err)
return
}
}
result, err := whois.Whois(sanitizedURL)
if err == nil {
log.Info(result)
logger.Write(sanitizedURL, logdir, result)
output.ScanComplete("WHOIS lookup", 1, "completed")
} else {
output.Error("WHOIS lookup failed: %v", err)
}
}