Skip to content

Commit

Permalink
feat: only send header if API mode isn't enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
vmexec committed Feb 4, 2024
1 parent ff8c1bd commit 31bc7d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
6 changes: 0 additions & 6 deletions cmd/sif/main.go
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
18 changes: 8 additions & 10 deletions sif.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 != "" {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 31bc7d0

Please sign in to comment.