summaryrefslogtreecommitdiffstats
path: root/internal/client/osint.go
diff options
context:
space:
mode:
authors <[email protected]>2025-11-08 02:44:13 -0500
committers <[email protected]>2025-11-08 02:44:13 -0500
commitdfcf52f30cdbde3a4e1400024b0c27451d179e5d (patch)
treecdcac72f0d58b0689777644c771e80d53b502434 /internal/client/osint.go
parent486a369f05125a3b86d663ea94684466e0658099 (diff)
downloaddborg-dfcf52f30cdbde3a4e1400024b0c27451d179e5d.tar.gz
dborg-dfcf52f30cdbde3a4e1400024b0c27451d179e5d.zip
feat: add unauthenticated client support and new osint/x commands
Diffstat (limited to 'internal/client/osint.go')
-rw-r--r--internal/client/osint.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/internal/client/osint.go b/internal/client/osint.go
index 20f53ce..95e3550 100644
--- a/internal/client/osint.go
+++ b/internal/client/osint.go
@@ -55,3 +55,36 @@ func (c *Client) SearchBreachForum(params *models.BreachForumSearchParams) (*mod
return &response, nil
}
+
+func (c *Client) SearchOpenDirectoryFiles(params *models.OpenDirectorySearchParams) (*models.OpenDirectorySearchResponse, error) {
+ path := fmt.Sprintf("/osint/files/%s", url.PathEscape(params.URL))
+
+ queryParams := url.Values{}
+ if params.Filename != "" {
+ queryParams.Add("filename", params.Filename)
+ }
+ if params.Extension != "" {
+ queryParams.Add("extension", params.Extension)
+ }
+ if params.Exclude != "" {
+ queryParams.Add("exclude", params.Exclude)
+ }
+ if params.Size > 0 {
+ queryParams.Add("size", fmt.Sprintf("%d", params.Size))
+ }
+ if params.From > 0 {
+ queryParams.Add("from", fmt.Sprintf("%d", params.From))
+ }
+
+ data, err := c.Get(path, queryParams)
+ if err != nil {
+ return nil, err
+ }
+
+ var response models.OpenDirectorySearchResponse
+ if err := json.Unmarshal(data, &response); err != nil {
+ return nil, fmt.Errorf("failed to parse open directory search response: %w", err)
+ }
+
+ return &response, nil
+}