-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathmain.go
44 lines (36 loc) · 948 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"context"
"fmt"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/uncover"
"github.com/projectdiscovery/uncover/sources"
)
func main() {
opts := uncover.Options{
Agents: []string{"shodan"},
Queries: []string{"ssl:'hackerone.com'"},
Limit: 50,
MaxRetry: 2,
Timeout: 20,
}
u, err := uncover.New(&opts)
if err != nil {
panic(err)
}
allagents := u.AllAgents()
gologger.Info().Msgf("Available uncover agents/sources :")
for _, v := range allagents {
fmt.Println(v)
}
fmt.Println("\n\n- Uncover Results:")
result := func(result sources.Result) {
fmt.Println(result.IpPort())
}
// Execute executes and returns a channel with all results
// ch , err := u.Execute(context.Background())
// Execute with Callback calls u.Execute() internally and abstracts channel handling logic
if err := u.ExecuteWithCallback(context.TODO(), result); err != nil {
panic(err)
}
}