-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from hueristiq/dev
Development version 0.2.0
Showing
16 changed files
with
491 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package bevigil | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/hueristiq/xurlfind3r/pkg/xurlfind3r/httpclient" | ||
"github.com/hueristiq/xurlfind3r/pkg/xurlfind3r/sources" | ||
"github.com/valyala/fasthttp" | ||
) | ||
|
||
type response struct { | ||
Domain string `json:"domain"` | ||
URLs []string `json:"urls"` | ||
} | ||
|
||
type Source struct{} | ||
|
||
func (source *Source) Run(config *sources.Configuration) (URLsChannel chan sources.URL) { | ||
URLsChannel = make(chan sources.URL) | ||
|
||
go func() { | ||
defer close(URLsChannel) | ||
|
||
var ( | ||
key string | ||
err error | ||
res *fasthttp.Response | ||
headers = map[string]string{} | ||
) | ||
|
||
key, err = sources.PickRandom(config.Keys.Bevigil) | ||
if key == "" || err != nil { | ||
return | ||
} | ||
|
||
if len(config.Keys.Bevigil) > 0 { | ||
headers["X-Access-Token"] = key | ||
} | ||
|
||
reqURL := fmt.Sprintf("https://osint.bevigil.com/api/%s/urls/", config.Domain) | ||
|
||
res, err = httpclient.Request(fasthttp.MethodGet, reqURL, "", headers, nil) | ||
if err != nil { | ||
return | ||
} | ||
|
||
body := res.Body() | ||
|
||
var results response | ||
|
||
if err = json.Unmarshal(body, &results); err != nil { | ||
return | ||
} | ||
|
||
for _, i := range results.URLs { | ||
URLsChannel <- sources.URL{Source: source.Name(), Value: i} | ||
} | ||
}() | ||
|
||
return | ||
} | ||
|
||
func (source *Source) Name() string { | ||
return "bevigil" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
pkg/xurlfind3r/sources/list.go → pkg/xurlfind3r/sources/sources.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package sources | ||
|
||
var List = []string{ | ||
"bevigil", | ||
"commoncrawl", | ||
"github", | ||
"intelx", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters