mirror of
https://github.com/lunchcat/sif.git
synced 2025-12-05 20:40:08 -08:00
feat: only send header if API mode isn't enabled
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/charmbracelet/log"
|
||||
"github.com/dropalldatabases/sif"
|
||||
"github.com/dropalldatabases/sif/internal/styles"
|
||||
"github.com/dropalldatabases/sif/pkg/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(styles.Box.Render(" _____________\n__________(_)__ __/\n__ ___/_ /__ /_ \n_(__ )_ / _ __/ \n/____/ /_/ /_/ \n"))
|
||||
fmt.Println(styles.Subheading.Render("\nhttps://sif.sh\nman's best friend\n\ncopyright (c) 2023-2024 lunchcat and contributors.\n\n"))
|
||||
|
||||
settings := config.Parse()
|
||||
|
||||
app, err := sif.New(settings)
|
||||
|
||||
18
sif.go
18
sif.go
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/dropalldatabases/sif/pkg/config"
|
||||
"github.com/dropalldatabases/sif/pkg/logger"
|
||||
"github.com/dropalldatabases/sif/pkg/scan"
|
||||
"github.com/dropalldatabases/sif/pkg/utils"
|
||||
)
|
||||
|
||||
// App is a client instance. It is first initialised using New and then ran
|
||||
@@ -29,6 +30,11 @@ type App struct {
|
||||
func New(settings *config.Settings) (*App, error) {
|
||||
app := &App{settings: settings}
|
||||
|
||||
if !settings.ApiMode {
|
||||
fmt.Println(styles.Box.Render(" _____________\n__________(_)__ __/\n__ ___/_ /__ /_ \n_(__ )_ / _ __/ \n/____/ /_/ /_/ \n"))
|
||||
fmt.Println(styles.Subheading.Render("\nhttps://sif.sh\nman's best friend\n\ncopyright (c) 2023-2024 lunchcat and contributors.\n\n"))
|
||||
}
|
||||
|
||||
if len(settings.URLs) > 0 {
|
||||
app.targets = settings.URLs
|
||||
} else if settings.File != "" {
|
||||
@@ -96,16 +102,8 @@ func (app *App) Run() error {
|
||||
scan.Ports(app.settings.Ports, url, app.settings.Timeout, app.settings.Threads, app.settings.LogDir)
|
||||
}
|
||||
|
||||
if app.settings.Dorking {
|
||||
scan.Dork(url, app.settings.Timeout, app.settings.Threads, app.settings.LogDir)
|
||||
}
|
||||
|
||||
if app.settings.Git {
|
||||
scan.Git(url, app.settings.Timeout, app.settings.Threads, app.settings.LogDir)
|
||||
}
|
||||
|
||||
if app.settings.Nuclei {
|
||||
scan.Nuclei(url, app.settings.Timeout, app.settings.Threads, app.settings.LogDir)
|
||||
if app.settings.ApiMode {
|
||||
utils.ReturnApiOutput()
|
||||
}
|
||||
|
||||
// TODO: WHOIS
|
||||
|
||||
Reference in New Issue
Block a user