diff options
| author | s <[email protected]> | 2025-11-13 22:25:02 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-13 22:25:02 -0500 |
| commit | 07662d9403eb85b39e1ffcf91014bbf36efd1c5a (patch) | |
| tree | 1181435223899bae039a947c5fc4fdeec085f91b /cmd/crawl.go | |
| parent | 239936e87183a10a33ce593709eb16c92a04af98 (diff) | |
| download | dborg-1.0.1.tar.gz dborg-1.0.1.zip | |
refactor: break down large osint.go file into separate command modules and add helper functionsv1.0.1
Diffstat (limited to 'cmd/crawl.go')
| -rw-r--r-- | cmd/crawl.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cmd/crawl.go b/cmd/crawl.go new file mode 100644 index 0000000..3587eb0 --- /dev/null +++ b/cmd/crawl.go @@ -0,0 +1,37 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +var crawlCmd = &cobra.Command{ + Use: "crawl [domain]", + Short: "Crawl domain", + Long: `Resolves a domain using httpx and crawls it using katana. Returns discovered links as plain text, one per line, streamed in real-time. Supports both http:// and https:// URLs.`, + Args: cobra.ExactArgs(1), + RunE: runCrawl, +} + +func init() { + rootCmd.AddCommand(crawlCmd) +} + +func runCrawl(cmd *cobra.Command, args []string) error { + c, err := newUnauthenticatedClient() + if err != nil { + return err + } + + err = c.CrawlDomain(args[0], func(line string) error { + fmt.Println(line) + return nil + }) + + if err != nil { + return err + } + + return nil +} |
