Question: Below is Python code for scanning in shodan.io. I was wondering if there is a way I could scan a certain network (for strictly network

Below is Python code for scanning in shodan.io. I was wondering if there is a way I could scan a certain network (for strictly network security purposes) for vulerability scans such as exploitable ports? import shodan SHODAN_API_KEY = "insert API key here" api = shodan.Shodan(SHODAN_API_KEY) def ipInformation(): # Lookup the host host = api.host('insert host here') # Print general info print(""" IP: %s Organization: %s Operating System: %s """ % (host['ip_str'], host.get('org', 'n/a'), host.get('os', 'n/a'))) # Print all banners for item in host['data']: print(""" Port: %s Banner: %s """ % (item['port'], item['data'])) def portScan(): SHODAN_API_KEY = "insert API key here" api = shodan.Shodan(SHODAN_API_KEY) # Wrap the request in a try/ except block to catch errors try: # Search Shodan host = api.search("insert host ip here") for service in host['matches']: hostinfo = api.host(service['ip_str']) print (service['ip_str']) for port in hostinfo['port']: print(port) except (shodan.APIError, e): print('Error: %s' % e) 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!