chore<format>: gofmt whitespace removal

This commit is contained in:
vmfunc
2024-10-15 02:32:48 +02:00
parent ee77dd8f91
commit aff6fea45d
23 changed files with 63 additions and 68 deletions

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
@@ -66,13 +66,13 @@ var (
// Severity level styles for color-coding vulnerability severities // Severity level styles for color-coding vulnerability severities
var ( var (
SeverityLow = lipgloss.NewStyle(). SeverityLow = lipgloss.NewStyle().
Foreground(lipgloss.Color("#00ff00")) Foreground(lipgloss.Color("#00ff00"))
SeverityMedium = lipgloss.NewStyle(). SeverityMedium = lipgloss.NewStyle().
Foreground(lipgloss.Color("#ffff00")) Foreground(lipgloss.Color("#ffff00"))
SeverityHigh = lipgloss.NewStyle(). SeverityHigh = lipgloss.NewStyle().
Foreground(lipgloss.Color("#ff8800")) Foreground(lipgloss.Color("#ff8800"))
SeverityCritical = lipgloss.NewStyle(). SeverityCritical = lipgloss.NewStyle().

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
@@ -32,26 +32,26 @@ import (
) )
type Settings struct { type Settings struct {
Dirlist string Dirlist string
Dnslist string Dnslist string
Debug bool Debug bool
LogDir string LogDir string
NoScan bool NoScan bool
Ports string Ports string
Dorking bool Dorking bool
Git bool Git bool
Whois bool Whois bool
Threads int Threads int
Nuclei bool Nuclei bool
JavaScript bool JavaScript bool
Timeout time.Duration Timeout time.Duration
URLs goflags.StringSlice URLs goflags.StringSlice
File string File string
ApiMode bool ApiMode bool
Template string Template string
CMS bool CMS bool
Headers bool Headers bool
CloudStorage bool CloudStorage bool
SubdomainTakeover bool SubdomainTakeover bool
} }

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
@@ -27,9 +27,9 @@ package scan
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"os"
"strings" "strings"
"time" "time"
"os"
"github.com/charmbracelet/log" "github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles" "github.com/dropalldatabases/sif/internal/styles"
@@ -92,7 +92,7 @@ func CloudStorage(url string, timeout time.Duration, logdir string) ([]CloudStor
} }
func extractPotentialBuckets(url string) []string { func extractPotentialBuckets(url string) []string {
// This is a simple implementation. // This is a simple implementation.
// TODO: add more cases // TODO: add more cases
parts := strings.Split(url, ".") parts := strings.Split(url, ".")
var buckets []string var buckets []string
@@ -100,11 +100,11 @@ func extractPotentialBuckets(url string) []string {
buckets = append(buckets, part) buckets = append(buckets, part)
buckets = append(buckets, part+"-s3") buckets = append(buckets, part+"-s3")
buckets = append(buckets, "s3-"+part) buckets = append(buckets, "s3-"+part)
if i < len(parts)-1 { if i < len(parts)-1 {
domainExtension := part + "-" + parts[i+1] domainExtension := part + "-" + parts[i+1]
buckets = append(buckets, domainExtension) buckets = append(buckets, domainExtension)
buckets = append(buckets, parts[i+1] + "-" + part) buckets = append(buckets, parts[i+1]+"-"+part)
} }
} }
return buckets return buckets
@@ -121,4 +121,3 @@ func checkS3Bucket(bucket string, client *http.Client) (bool, error) {
// If we can access the bucket listing, it's public // If we can access the bucket listing, it's public
return resp.StatusCode == http.StatusOK, nil return resp.StatusCode == http.StatusOK, nil
} }

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
@@ -28,9 +28,9 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"os"
"strings" "strings"
"time" "time"
"os"
"github.com/charmbracelet/log" "github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles" "github.com/dropalldatabases/sif/internal/styles"
@@ -57,7 +57,6 @@ func CMS(url string, timeout time.Duration, logdir string) (*CMSResult, error) {
cmslog := log.NewWithOptions(os.Stderr, log.Options{ cmslog := log.NewWithOptions(os.Stderr, log.Options{
Prefix: "CMS 🔍", Prefix: "CMS 🔍",
}).With("url", url) }).With("url", url)
client := &http.Client{ client := &http.Client{
Timeout: timeout, Timeout: timeout,

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
@@ -132,4 +132,4 @@ func Dork(url string, timeout time.Duration, threads int, logdir string) ([]Dork
wg.Wait() wg.Wait()
return dorkResults, nil return dorkResults, nil
} }

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
@@ -27,9 +27,9 @@ package scan
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"os"
"strings" "strings"
"time" "time"
"os"
"github.com/charmbracelet/log" "github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles" "github.com/dropalldatabases/sif/internal/styles"
@@ -81,4 +81,3 @@ func Headers(url string, timeout time.Duration, logdir string) ([]HeaderResult,
return results, nil return results, nil
} }

View File

@@ -17,12 +17,11 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
/* /*
What we are doing is abusing a internal file in Next.js pages router called What we are doing is abusing a internal file in Next.js pages router called
_buildManifest.js which lists all routes and script files ever referenced in _buildManifest.js which lists all routes and script files ever referenced in

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,12 +17,11 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */
// The scan package provides a collection of security scanning functions. // The scan package provides a collection of security scanning functions.
// //
// Each scanning function typically returns a slice of custom result structures and an error. // Each scanning function typically returns a slice of custom result structures and an error.

View File

@@ -2,24 +2,24 @@ package scan
import ( import (
"fmt" "fmt"
"io"
"net"
"net/http"
"strings"
"time"
"os"
"sync"
"github.com/charmbracelet/log" "github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles" "github.com/dropalldatabases/sif/internal/styles"
"github.com/dropalldatabases/sif/pkg/logger" "github.com/dropalldatabases/sif/pkg/logger"
"io"
"net"
"net/http"
"os"
"strings"
"sync"
"time"
) )
// SubdomainTakeoverResult represents the outcome of a subdomain takeover vulnerability check. // SubdomainTakeoverResult represents the outcome of a subdomain takeover vulnerability check.
// It includes the subdomain tested, whether it's vulnerable, and the potentially vulnerable service. // It includes the subdomain tested, whether it's vulnerable, and the potentially vulnerable service.
type SubdomainTakeoverResult struct { type SubdomainTakeoverResult struct {
Subdomain string `json:"subdomain"` Subdomain string `json:"subdomain"`
Vulnerable bool `json:"vulnerable"` Vulnerable bool `json:"vulnerable"`
Service string `json:"service,omitempty"` Service string `json:"service,omitempty"`
} }
// SubdomainTakeover checks for potential subdomain takeover vulnerabilities. // SubdomainTakeover checks for potential subdomain takeover vulnerabilities.

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

View File

@@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║ ║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║ ║ from https://lunchcat.dev ║
║ ║ ║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║ ║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════════════════════════════════════════════════════╝
*/ */

4
sif.go
View File

@@ -253,11 +253,11 @@ func (app *App) Run() error {
if !app.settings.ApiMode { if !app.settings.ApiMode {
scansRunList := " • " + strings.Join(scansRun, "\n • ") scansRunList := " • " + strings.Join(scansRun, "\n • ")
if app.settings.LogDir != "" { if app.settings.LogDir != "" {
fmt.Println(styles.Box.Render(fmt.Sprintf("🌿 All scans completed!\n📂 Output saved to files: %s\n\n🔍 Ran scans:\n%s", fmt.Println(styles.Box.Render(fmt.Sprintf("🌿 All scans completed!\n📂 Output saved to files: %s\n\n🔍 Ran scans:\n%s",
strings.Join(app.logFiles, ", "), strings.Join(app.logFiles, ", "),
scansRunList))) scansRunList)))
} else { } else {
fmt.Println(styles.Box.Render(fmt.Sprintf("🌿 All scans completed!\n\n🔍 Ran scans:\n%s", fmt.Println(styles.Box.Render(fmt.Sprintf("🌿 All scans completed!\n\n🔍 Ran scans:\n%s",
scansRunList))) scansRunList)))
} }
} }