Shodan ports in config
This commit is contained in:
parent
638216e8fa
commit
bd3f108d12
|
@ -13,6 +13,9 @@ go build
|
||||||
// config.yml
|
// config.yml
|
||||||
shodan:
|
shodan:
|
||||||
key: String (Required)
|
key: String (Required)
|
||||||
|
ports:
|
||||||
|
- 80
|
||||||
|
- 443
|
||||||
|
|
||||||
// do not forget to set up kafka and create the topic
|
// do not forget to set up kafka and create the topic
|
||||||
kafka:
|
kafka:
|
||||||
|
|
2
main.go
2
main.go
|
@ -116,7 +116,7 @@ func main() {
|
||||||
// shodan
|
// shodan
|
||||||
client := shodan.NewEnvClient(nil)
|
client := shodan.NewEnvClient(nil)
|
||||||
ch := make(chan *shodan.HostData)
|
ch := make(chan *shodan.HostData)
|
||||||
err = client.GetBannersByPorts(context.Background(), []int{80, 443, 8443, 53}, ch)
|
err = client.GetBannersByPorts(context.Background(), viper.GetIntSlice("shodan.ports"), ch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Panic(err)
|
logrus.Panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue