mirror of
https://github.com/lunchcat/sif.git
synced 2026-01-14 22:03:20 -08:00
@@ -16,6 +16,7 @@ type Settings struct {
|
||||
Ports string
|
||||
Dorking bool
|
||||
Git bool
|
||||
Whois bool
|
||||
Threads int
|
||||
Nuclei bool
|
||||
Timeout time.Duration
|
||||
@@ -58,6 +59,7 @@ func Parse() *Settings {
|
||||
flagSet.BoolVar(&settings.Git, "git", false, "Enable git repository scanning"),
|
||||
flagSet.BoolVar(&settings.Nuclei, "nuclei", false, "Enable scanning using nuclei templates"),
|
||||
flagSet.BoolVar(&settings.NoScan, "noscan", false, "Do not perform base URL (robots.txt, etc) scanning"),
|
||||
flagSet.BoolVar(&settings.Whois, "whois", false, "Enable WHOIS lookup"),
|
||||
)
|
||||
|
||||
flagSet.CreateGroup("runtime", "Runtime",
|
||||
|
||||
36
pkg/scan/whois.go
Normal file
36
pkg/scan/whois.go
Normal file
@@ -0,0 +1,36 @@
|
||||
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, " port 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user