Shodan ports in config

This commit is contained in:
Christopher Talib 2020-02-12 16:54:14 +01:00
parent 638216e8fa
commit bd3f108d12
2 changed files with 4 additions and 1 deletions

View file

@ -13,6 +13,9 @@ go build
// config.yml
shodan:
key: String (Required)
ports:
- 80
- 443
// do not forget to set up kafka and create the topic
kafka:

View file

@ -116,7 +116,7 @@ func main() {
// shodan
client := shodan.NewEnvClient(nil)
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 {
logrus.Panic(err)
}