我们可以安装在linux机器上

1
sudo pip install shodan

当然前提是我们先注册好shodan并且去拿到它的api_key。

image-20230522150124412

然后可以在python中运行shodan

1
2
3
4
import shodan
api = shodan.Shodan('api_key')
info = api.host('ip')
print(info)#即可

我们在搜索框中搜索,会更加方便,其语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#搜索ip可以直接输入ip
country:"CN"
city:"ShangHai"
hostname:.org
hostname:"google"
hostname:baidu.com
org:"alibaba"
os:"Linux 2.6.x"
port:22
port:80
net:"59.56.19.0/24"#设置子网
product:"nginx"
product:"mysql"
http.status:200
http.server:Apache/2.4.7
http.server:PHP
geo:"123.23,56.2"#这是指定经纬度的ip扫描