How to perform OSINT with Shodan
In some of my previous articles we had the opportunity to explore different techniques to perform intelligence gathering including Human intelligence,signal intelligence, Geospatial intelligence and Open source intelligence. In this article we will dive deep into a powerful open source intelligence online tool called Shodan.
What is Open source intelligence?
Wikipedia defines OSINT as follows:
"Open-source intelligence is data collected from publicly available sources to be used in an intelligence context. In the intelligence community, the term "open" refers to overt, publicly available sources. It is not related to open-source software or collective intelligence"
Open source intelligence is like any methodological process is going thru a defined number of steps.In order to perform an open source intelligence you can follow the following phases:
- Direction and planning: in this phase you need to identify the sources,in other words where you can find information
- Collection: in this phase you will collect and harvest information from the selected sources
- Processing and collation: during this phase you need to process information to get useful insights.
- Analysis and integration: in this phase you need to join all the information and analyse them
- Production, dissemination and feedback: finally when you finish the analysis you need to present the findings and report them.
What is Shodan?
Shodan is a search engine that lets the user find specific types of computers (webcams, routers, servers, etc.) connected to the internet using a variety of filters. Some have also described it as a search engine of service banners, which are metadata that the server sends back to the client. This can be information about the server software, what options the service supports, a welcome message or anything else that the client can find out before interacting with the server.
You can use it by visiting the official website: www.shodan.io
As a start, Shodan gives you the ability to start exploring some pre-selected search queries. Some of the findings are:
- Webcams
- Industrial control systems
- Databases
- Passwords and so on
For example, in the Industrial control systems section, you can search for
- XZERES Wind Turbines
- PIPS Automated License Plate Readers
It supports many ICS protocols too.
Furthermore, you can use shodan map for more geo-centric searches
Now let's explore how to perform some shodan queries.
To perform search, you will simply use the search bar in the main page
To simpliest search form is typing the "term" you are looking for, like a website name, service or something and shodan will give pages of results that you can filter later
Queries can be more specific. Shodan provides a list of advanced queries that you can use in order to get more accurate information. Some of them are the following:
To select a specific country type:
country: <Country Symbol>
For example, Germany code is: DE. So the query will be:
country:DE
County codes can be found here: https://github.com/postmodern/shodan-ruby/blob/master/lib/shodan/countries.rb
To select specific ports type:
port: <Ports_HERE>
For example:
port:80
To search for a specifit operating system(OS) type:
os: <OS_HERE>