Skip to content

Commit

Permalink
Add scan link
Browse files Browse the repository at this point in the history
  • Loading branch information
alex27riva committed Oct 24, 2024
1 parent ccb65a1 commit 5803da9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/urlscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type urlScanResult struct {
Country string `json:"country"`
IP string `json:"ip"`
} `json:"page"`
Task struct {
ReportURL string `json:"reportURL"`
}
Verdict struct {
Malicious bool `json:"malicious"`
} `json:"verdicts"`
Expand Down Expand Up @@ -116,6 +119,7 @@ func displayResults(scanResult urlScanResult) {
fmt.Printf("Domain: %s\n", scanResult.Page.Domain)
fmt.Printf("Country: %s\n", scanResult.Page.Country)
fmt.Printf("IP: %s\n", scanResult.Page.IP)
fmt.Printf("Link: %s\n", scanResult.Task.ReportURL)
if scanResult.Verdict.Malicious {
fmt.Println("Verdict: " + color.RedString("MALICIOUS"))
} else {
Expand All @@ -137,8 +141,7 @@ var urlScanCmd = &cobra.Command{
log.Fatalf("Error submitting URL for scan: %v", err)
}

fmt.Printf("Scan ID: %s\n", scanID)
fmt.Println("URL submitted successfully. Awaiting results...")
color.Blue("URL submitted successfully. Awaiting results...")

// Fetch the scan results
scanResult, err := fetchURLScanResult(scanID)
Expand Down

0 comments on commit 5803da9

Please sign in to comment.