mirror of
https://github.com/lunchcat/sif.git
synced 2026-01-13 21:36:28 -08:00
- replace proprietary license with bsd 3-clause - update all go file headers with new retro terminal style - add header-check github action to enforce license headers - completely rewrite readme to be modern, sleek, and lowercase - fix broken badges
49 lines
1.9 KiB
Go
49 lines
1.9 KiB
Go
/*
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
: :
|
|
: █▀ █ █▀▀ · Blazing-fast pentesting suite :
|
|
: ▄█ █ █▀ · BSD 3-Clause License :
|
|
: :
|
|
: (c) 2022-2025 vmfunc (Celeste Hickenlooper), xyzeva, :
|
|
: lunchcat alumni & contributors :
|
|
: :
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
*/
|
|
|
|
package scan
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/charmbracelet/log"
|
|
"github.com/dropalldatabases/sif/internal/styles"
|
|
"github.com/dropalldatabases/sif/pkg/logger"
|
|
"github.com/likexian/whois"
|
|
)
|
|
|
|
func Whois(url string, logdir string) {
|
|
fmt.Println(styles.Separator.Render("💭 Starting " + styles.Status.Render("WHOIS Lookup") + "..."))
|
|
|
|
sanitizedURL := strings.Split(url, "://")[1]
|
|
if logdir != "" {
|
|
if err := logger.WriteHeader(sanitizedURL, logdir, " WHOIS scanning"); err != nil {
|
|
log.Errorf("Error creating log file: %v", err)
|
|
return
|
|
}
|
|
}
|
|
|
|
whoislog := log.NewWithOptions(os.Stderr, log.Options{
|
|
Prefix: "WHOIS 💭",
|
|
})
|
|
|
|
whoislog.Infof("Starting WHOIS")
|
|
|
|
result, err := whois.Whois(sanitizedURL)
|
|
if err == nil {
|
|
log.Info(result)
|
|
logger.Write(sanitizedURL, logdir, result)
|
|
}
|
|
}
|