@@ -635,7 +635,8 @@ def stats(limit, facets, filename, query):
635635@click .option ('--alert' , help = 'The network alert ID or "all" to subscribe to all network alerts on your account.' , default = None , type = str )
636636@click .option ('--tags' , help = 'A comma-separated list of tags to grab data on.' , default = None , type = str )
637637@click .option ('--compresslevel' , help = 'The gzip compression level (0-9; 0 = no compression, 9 = most compression' , default = 9 , type = int )
638- def stream (color , fields , separator , limit , datadir , ports , quiet , timeout , streamer , countries , asn , alert , tags , compresslevel ):
638+ @click .option ('--vulns' , help = 'A comma-separated list of vulnerabilities to grab data on.' , default = None , type = str )
639+ def stream (color , fields , separator , limit , datadir , ports , quiet , timeout , streamer , countries , asn , alert , tags , compresslevel , vulns ):
639640 """Stream data in real-time."""
640641 # Setup the Shodan API
641642 key = get_api_key ()
@@ -663,9 +664,11 @@ def stream(color, fields, separator, limit, datadir, ports, quiet, timeout, stre
663664 stream_type .append ('alert' )
664665 if tags :
665666 stream_type .append ('tags' )
667+ if vulns :
668+ stream_type .append ('vulns' )
666669
667670 if len (stream_type ) > 1 :
668- raise click .ClickException ('Please use --ports, --countries, --tags OR --asn. You cant subscribe to multiple filtered streams at once.' )
671+ raise click .ClickException ('Please use --ports, --countries, --tags, --vulns OR --asn. You cant subscribe to multiple filtered streams at once.' )
669672
670673 stream_args = None
671674
@@ -689,6 +692,9 @@ def stream(color, fields, separator, limit, datadir, ports, quiet, timeout, stre
689692
690693 if tags :
691694 stream_args = tags .split (',' )
695+
696+ if vulns :
697+ stream_args = vulns .split (',' )
692698
693699 # Flatten the list of stream types
694700 # Possible values are:
@@ -710,6 +716,7 @@ def _create_stream(name, args, timeout):
710716 'countries' : api .stream .countries (args , timeout = timeout ),
711717 'ports' : api .stream .ports (args , timeout = timeout ),
712718 'tags' : api .stream .tags (args , timeout = timeout ),
719+ 'vulns' : api .stream .vulns (args , timeout = timeout ),
713720 }.get (name , 'all' )
714721
715722 stream = _create_stream (stream_type , stream_args , timeout = timeout )
0 commit comments