diff options
| author | s <[email protected]> | 2025-11-08 02:44:13 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-08 02:44:13 -0500 |
| commit | dfcf52f30cdbde3a4e1400024b0c27451d179e5d (patch) | |
| tree | cdcac72f0d58b0689777644c771e80d53b502434 /cmd/osint.go | |
| parent | 486a369f05125a3b86d663ea94684466e0658099 (diff) | |
| download | dborg-dfcf52f30cdbde3a4e1400024b0c27451d179e5d.tar.gz dborg-dfcf52f30cdbde3a4e1400024b0c27451d179e5d.zip | |
feat: add unauthenticated client support and new osint/x commands
Diffstat (limited to 'cmd/osint.go')
| -rw-r--r-- | cmd/osint.go | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/cmd/osint.go b/cmd/osint.go index 5aa8799..6b97464 100644 --- a/cmd/osint.go +++ b/cmd/osint.go @@ -41,11 +41,20 @@ var osintBreachForumCmd = &cobra.Command{ RunE: runOsintBreachForumSearch, } +var osintFilesCmd = &cobra.Command{ + Use: "files [url]", + Short: "Search open directory files", + Long: `Search for files in open directories using various filters (free OSINT endpoint)`, + Args: cobra.ExactArgs(1), + RunE: runOsintFilesSearch, +} + func init() { rootCmd.AddCommand(osintCmd) osintCmd.AddCommand(osintUsernameCmd) osintCmd.AddCommand(osintBSSIDCmd) osintCmd.AddCommand(osintBreachForumCmd) + osintCmd.AddCommand(osintFilesCmd) osintUsernameCmd.Flags().StringSliceP("sites", "s", []string{}, "Specific sites to check (comma-separated)") osintUsernameCmd.Flags().BoolP("fuzzy", "f", false, "Enable fuzzy validation mode") @@ -56,13 +65,18 @@ func init() { osintBSSIDCmd.Flags().BoolP("osm", "o", false, "Include OpenStreetMap URL for the location") osintBreachForumCmd.Flags().IntP("max_hits", "m", 10, "Maximum number of hits to return") + + osintFilesCmd.Flags().StringP("filename", "n", "", "Search term to match in filenames") + osintFilesCmd.Flags().StringP("extension", "e", "", "Filter by file extension(s) - comma-separated (e.g., pdf,doc,txt)") + osintFilesCmd.Flags().StringP("exclude", "x", "html,HTML", "Exclude file extension(s) - comma-separated") + osintFilesCmd.Flags().IntP("size", "s", 10, "Number of results to return (max 40)") + osintFilesCmd.Flags().IntP("from", "f", 0, "Starting offset for pagination") } func runOsintUsernameCheck(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() - c, err := client.New(cfg) + c, err := client.NewUnauthenticated(cfg) if err != nil { return err } @@ -131,3 +145,28 @@ func runOsintBreachForumSearch(cmd *cobra.Command, args []string) error { return utils.PrintJSON(response) } + +func runOsintFilesSearch(cmd *cobra.Command, args []string) error { + cfg := config.New() + + c, err := client.NewUnauthenticated(cfg) + if err != nil { + return err + } + + params := &models.OpenDirectorySearchParams{ + URL: args[0], + } + params.Filename, _ = cmd.Flags().GetString("filename") + params.Extension, _ = cmd.Flags().GetString("extension") + params.Exclude, _ = cmd.Flags().GetString("exclude") + params.Size, _ = cmd.Flags().GetInt("size") + params.From, _ = cmd.Flags().GetInt("from") + + response, err := c.SearchOpenDirectoryFiles(params) + if err != nil { + return err + } + + return utils.PrintJSON(response) +} |
