Skip to content

Commit

Permalink
chore<format>: gofmt whitespace removal
Browse files Browse the repository at this point in the history
  • Loading branch information
vmfunc committed Oct 15, 2024
1 parent ee77dd8 commit aff6fea
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 66 deletions.
2 changes: 1 addition & 1 deletion cmd/sif/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
2 changes: 1 addition & 1 deletion internal/nuclei/format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
2 changes: 1 addition & 1 deletion internal/nuclei/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
8 changes: 4 additions & 4 deletions internal/styles/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down Expand Up @@ -66,13 +66,13 @@ var (

// Severity level styles for color-coding vulnerability severities
var (
SeverityLow = lipgloss.NewStyle().
SeverityLow = lipgloss.NewStyle().
Foreground(lipgloss.Color("#00ff00"))

SeverityMedium = lipgloss.NewStyle().
SeverityMedium = lipgloss.NewStyle().
Foreground(lipgloss.Color("#ffff00"))

SeverityHigh = lipgloss.NewStyle().
SeverityHigh = lipgloss.NewStyle().
Foreground(lipgloss.Color("#ff8800"))

SeverityCritical = lipgloss.NewStyle().
Expand Down
42 changes: 21 additions & 21 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand All @@ -32,26 +32,26 @@ import (
)

type Settings struct {
Dirlist string
Dnslist string
Debug bool
LogDir string
NoScan bool
Ports string
Dorking bool
Git bool
Whois bool
Threads int
Nuclei bool
JavaScript bool
Timeout time.Duration
URLs goflags.StringSlice
File string
ApiMode bool
Template string
CMS bool
Headers bool
CloudStorage bool
Dirlist string
Dnslist string
Debug bool
LogDir string
NoScan bool
Ports string
Dorking bool
Git bool
Whois bool
Threads int
Nuclei bool
JavaScript bool
Timeout time.Duration
URLs goflags.StringSlice
File string
ApiMode bool
Template string
CMS bool
Headers bool
CloudStorage bool
SubdomainTakeover bool
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
11 changes: 5 additions & 6 deletions pkg/scan/cloudstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand All @@ -27,9 +27,9 @@ package scan
import (
"fmt"
"net/http"
"os"
"strings"
"time"
"os"

"github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles"
Expand Down Expand Up @@ -92,19 +92,19 @@ func CloudStorage(url string, timeout time.Duration, logdir string) ([]CloudStor
}

func extractPotentialBuckets(url string) []string {
// This is a simple implementation.
// This is a simple implementation.
// TODO: add more cases
parts := strings.Split(url, ".")
var buckets []string
for i, part := range parts {
buckets = append(buckets, part)
buckets = append(buckets, part+"-s3")
buckets = append(buckets, "s3-"+part)

if i < len(parts)-1 {
domainExtension := part + "-" + parts[i+1]
buckets = append(buckets, domainExtension)
buckets = append(buckets, parts[i+1] + "-" + part)
buckets = append(buckets, parts[i+1]+"-"+part)
}
}
return buckets
Expand All @@ -121,4 +121,3 @@ func checkS3Bucket(bucket string, client *http.Client) (bool, error) {
// If we can access the bucket listing, it's public
return resp.StatusCode == http.StatusOK, nil
}

5 changes: 2 additions & 3 deletions pkg/scan/cms.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand All @@ -28,9 +28,9 @@ import (
"fmt"
"io"
"net/http"
"os"
"strings"
"time"
"os"

"github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles"
Expand All @@ -57,7 +57,6 @@ func CMS(url string, timeout time.Duration, logdir string) (*CMSResult, error) {
cmslog := log.NewWithOptions(os.Stderr, log.Options{
Prefix: "CMS 🔍",
}).With("url", url)


client := &http.Client{
Timeout: timeout,
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/dirlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/dnslist.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
4 changes: 2 additions & 2 deletions pkg/scan/dork.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down Expand Up @@ -132,4 +132,4 @@ func Dork(url string, timeout time.Duration, threads int, logdir string) ([]Dork
wg.Wait()

return dorkResults, nil
}
}
2 changes: 1 addition & 1 deletion pkg/scan/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
5 changes: 2 additions & 3 deletions pkg/scan/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand All @@ -27,9 +27,9 @@ package scan
import (
"fmt"
"net/http"
"os"
"strings"
"time"
"os"

"github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles"
Expand Down Expand Up @@ -81,4 +81,3 @@ func Headers(url string, timeout time.Duration, logdir string) ([]HeaderResult,

return results, nil
}

3 changes: 1 addition & 2 deletions pkg/scan/js/frameworks/next.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
║ research or educational purposes must purchase a license ║
║ 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
_buildManifest.js which lists all routes and script files ever referenced in
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/js/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/js/supabase.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/nuclei.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
║ research or educational purposes must purchase a license ║
║ from https://lunchcat.dev ║
║ ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ For more information, visit: https://github.com/lunchcat/sif ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
Expand Down
3 changes: 1 addition & 2 deletions pkg/scan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
║ research or educational purposes must purchase a license ║
║ 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.
//
// Each scanning function typically returns a slice of custom result structures and an error.
Expand Down
16 changes: 8 additions & 8 deletions pkg/scan/subdomaintakeover.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ package scan

import (
"fmt"
"github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles"
"github.com/dropalldatabases/sif/pkg/logger"
"io"
"net"
"net/http"
"strings"
"time"
"os"
"strings"
"sync"
"github.com/charmbracelet/log"
"github.com/dropalldatabases/sif/internal/styles"
"github.com/dropalldatabases/sif/pkg/logger"
"time"
)

// SubdomainTakeoverResult represents the outcome of a subdomain takeover vulnerability check.
// It includes the subdomain tested, whether it's vulnerable, and the potentially vulnerable service.
type SubdomainTakeoverResult struct {
Subdomain string `json:"subdomain"`
Vulnerable bool `json:"vulnerable"`
Service string `json:"service,omitempty"`
Subdomain string `json:"subdomain"`
Vulnerable bool `json:"vulnerable"`
Service string `json:"service,omitempty"`
}

// SubdomainTakeover checks for potential subdomain takeover vulnerabilities.
Expand Down
Loading

0 comments on commit aff6fea

Please sign in to comment.