How to Install Shodan in Linux Ubuntu 18.04

Posted on

Introduction

This is an article where the process of shodan installation is the main focus. Before starting the installation, a brief explanation about shodan will be just perfect. According to Wikipedia, shodan is a search engine that lets the user find specific types of computers 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. It is quite a useful tool to have.

Installation Steps

The installation of shodan is important in order to use it in the system. In all of the steps following, try to use one user account. For an example, just use a normal user in the operating system. So, using the following steps, install it in on the system :

1. Using ‘pip’ command, execute it for the installation of shodan. Just type the following command :

pip install shodan

Therefore, using the command above, execute it in the command line. The following output of the above command execution will appear as follows :

user@hostname:~$ pip install shodan
Collecting shodan
  Downloading https://files.pythonhosted.org/packages/24/36/87e5e4cab32ffeba1c7304f7dadc00b93491bc3b3de0b599ccacfa3b3671/shodan-1.10.4.tar.gz (44kB)
    100% |████████████████████████████████| 51kB 578kB/s 
Collecting XlsxWriter (from shodan)
  Downloading https://files.pythonhosted.org/packages/8d/d0/f4ee9c621902d18807dd88b0a0ff4426666af8dd1e952c4943a9415f3eeb/XlsxWriter-1.1.4-py2.py3-none-any.whl (142kB)
    100% |████████████████████████████████| 143kB 239kB/s 
Collecting click (from shodan)
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
    100% |████████████████████████████████| 81kB 271kB/s 
Collecting click-plugins (from shodan)
  Downloading https://files.pythonhosted.org/packages/95/dd/fef84cf1678418f241ef542c0288bdf215bdd3e35f1fe03dc5223a2e80ba/click_plugins-1.0.4-py2.py3-none-any.whl
Collecting colorama (from shodan)
  Downloading https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Collecting requests>=2.2.1 (from shodan)
  Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 172kB/s 
Collecting urllib3<1.25,>=1.21.1 (from requests>=2.2.1->shodan)
  Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
    100% |████████████████████████████████| 122kB 261kB/s 
Collecting certifi>=2017.4.17 (from requests>=2.2.1->shodan)
  Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 248kB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.2.1->shodan)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 158kB/s 
Collecting idna<2.9,>=2.5 (from requests>=2.2.1->shodan)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 71kB/s 
Building wheels for collected packages: shodan
  Running setup.py bdist_wheel for shodan ... done
  Stored in directory: /home/user/.cache/pip/wheels/b3/b9/7f/6a49be594c397f32c88f110e76eb0d0bd162a56998c1669037
Successfully built shodan
Installing collected packages: XlsxWriter, click, click-plugins, colorama, urllib3, certifi, chardet, idna, requests, shodan
Successfully installed XlsxWriter-1.1.4 certifi-2018.11.29 chardet-3.0.4 click-7.0 click-plugins-1.0.4 colorama-0.4.1 idna-2.8 requests-2.21.0 shodan-1.10.4 urllib3-1.24.1
user@hostname:~$

2. Next step, test the installed ‘shodan’. Just execute the command to start using shodan by typing it in the command line :

user@hostname:~$ shodan
Usage: shodan [OPTIONS] COMMAND [ARGS]...
Options:
  -h, --help  Show this message and exit.
Commands:
  alert       Manage the network alerts for your account
  convert     Convert the given input data file into a different format.
  count       Returns the number of results for a search
  data        Bulk data access to Shodan
  download    Download search results and save them in a compressed JSON...
  honeyscore  Check whether the IP is a honeypot or not.
  host        View all available information for an IP address
  info        Shows general information about your account
  init        Initialize the Shodan command-line
  myip        Print your external IP address
  org         Manage your organization's access to Shodan
  parse       Extract information out of compressed JSON files.
  radar       Real-Time Map of some results as Shodan finds them.
  scan        Scan an IP/ netblock using Shodan.
  search      Search the Shodan database
  stats       Provide summary information about a search query
  stream      Stream data in real-time.
user@hostname:~$

Conclusion

Finally, just remember one thing for sure. In the end, the installation of the above program does not apply to other user. It is only the user whom install the program that can actually execute it. In order for another user to be able to use ‘shodan’, it is necessary for that user to install it first. So, the installation of shodan for this user is a success.

Leave a Reply