Skip to content

Commit 0def2ad

Browse files
committed
Improve Output, before flags are loaded
1 parent 63558e5 commit 0def2ad

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

pkg/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ type (
5757
HeaderWordlist string
5858
ParameterWordlist string
5959

60-
Limiter *rate.Limiter `json:"-"`
61-
Website WebsiteStruct `json:"-"`
60+
Intitialized bool
61+
Limiter *rate.Limiter `json:"-"`
62+
Website WebsiteStruct `json:"-"`
6263
}
6364

6465
WebsiteStruct struct {

pkg/recon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ func addUrl(urls []string, url string, added map[string]bool, excluded map[strin
14481448
added[url] = true
14491449
} else {
14501450
msg := fmt.Sprintf("Skipped to add %s to the queue, because it doesn't satisfy RecInclude\n", url)
1451-
PrintVerbose(msg, NoColor, 1)
1451+
PrintVerbose(msg, NoColor, 2)
14521452
}
14531453
}
14541454

pkg/techniques.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,9 +1047,7 @@ func ScanCSS() reportResult {
10471047
if !strings.HasSuffix(a.Val, ".css") && !strings.Contains(a.Val, ".css?") {
10481048
break
10491049
}
1050-
Print(a.Val+"\n", Red)
10511050
tempURL := addDomain(a.Val, Config.Website.Domain)
1052-
Print(tempURL+"\n", Red)
10531051
if tempURL != "" {
10541052
urls = append(urls, tempURL)
10551053
}

pkg/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func PrintNewLine() {
2727
}
2828

2929
func PrintLog(msg string) {
30-
if !Config.NoLog {
30+
if !Config.NoLog && Config.Intitialized {
3131
log.Print(msg)
3232
}
3333
}
@@ -49,7 +49,7 @@ func PrintVerbose(msg string, c int, threshold int) {
4949
PrintLog(msg)
5050
}
5151

52-
if Config.Verbosity >= threshold {
52+
if Config.Verbosity >= threshold || !Config.Intitialized {
5353
fmt.Print(msg)
5454
}
5555
}

web-cache-vulnerability-scanner.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ func main() {
7272
log.SetOutput(f)
7373
}
7474

75+
report.Config.Intitialized = true
76+
7577
report.Command = fmt.Sprint(os.Args)
7678
report.Command = strings.TrimPrefix(report.Command, "[")
7779
report.Command = strings.TrimSuffix(report.Command, "]")
78-
pkg.PrintVerbose(report.Command, pkg.NoColor, 2)
80+
pkg.PrintVerbose(report.Command+"\n\n", pkg.Cyan, 2)
7981
/******************************************/
8082
if pkg.Config.Verbosity < 0 || pkg.Config.Verbosity > 2 {
8183
msg := fmt.Sprintf("%d is not a valid verbosity between 0 and 2!\n", pkg.Config.Verbosity)
@@ -87,6 +89,7 @@ func main() {
8789
pkg.PrintVerbose("Author: Maximilian Hildebrand\n", pkg.NoColor, 1)
8890
pkg.PrintVerbose("Repository: https://github.com/Hackmanit/Web-Cache-Vulnerability-Scanner\n\n", pkg.NoColor, 1)
8991

92+
// Print starting time
9093
msg := fmt.Sprintf("WCVS v%s started at %s\n", version, currentDate)
9194
pkg.PrintVerbose(msg, pkg.NoColor, 1)
9295

0 commit comments

Comments
 (0)