diff --git a/main.go b/main.go index 1942cc7..95e62cc 100644 --- a/main.go +++ b/main.go @@ -89,6 +89,7 @@ func printCSVDescending(data []Data) { fmt.Printf("%s\n", d.Attributes.AssetIdentifier) } } +func help() {} func main() { @@ -98,15 +99,15 @@ func main() { flag.BoolVar(&showHelp, "h", false, "Show help message") flag.Parse() - if showHelp { + if showHelp || program == "" || username == "" || apiKey == "" { asciiArt := ` - _ _ __ _ _ -| |__ / | ___ ___ ___ _ __ ___ / _| ___| |_ ___| |__ ___ _ __ -| '_ \| | / __|/ __/ _ \| '_ \ / _ \ | |_ / _ \ __/ __| '_ \ / _ \ '__| -| | | | | \__ \ (_| (_) | |_) | __/ | _| __/ || (__| | | | __/ | -|_| |_|_| |___/\___\___/| .__/ \___| |_| \___|\__\___|_| |_|\___|_| - |_| -` + _ _ __ _ _ + | |__ / | ___ ___ ___ _ __ ___ / _| ___| |_ ___| |__ ___ _ __ + | '_ \| | / __|/ __/ _ \| '_ \ / _ \ | |_ / _ \ __/ __| '_ \ / _ \ '__| + | | | | | \__ \ (_| (_) | |_) | __/ | _| __/ || (__| | | | __/ | + |_| |_|_| |___/\___\___/| .__/ \___| |_| \___|\__\___|_| |_|\___|_| + |_| + ` fmt.Println(asciiArt) fmt.Println("\"h1 scope fetcher\" is a tool to fetch all inscope assets of HackerOne programs for integration in your automation and hacking workflow.") @@ -116,11 +117,6 @@ func main() { return } - if program == "" || username == "" || apiKey == "" { - fmt.Println("Please provide program name, API username, and API key.\n Try -h for help.") - return - } - baseURL := fmt.Sprintf("https://api.hackerone.com/v1/hackers/programs/%s/structured_scopes?page%%5Bsize%%5D=100", program) allData, err := fetchAllPages(baseURL)