惊雷无声 发表于 2024-11-26 15:38:38

零底子学安全--shodan学习

目次

免责声明
shodan简介
shodan安装
下载包
切换文件夹、并且安装
初始化shodan,这个api_key在你的账户里面
shodan使用
命令行
domain
scan
submit
status
search
country、--limit、---fields
city
os
has_vuln
device
 tp-link
http.title
net
org
http.waf
html
product
host
--history
download
parse 
count
honeyscore
myip
更多指令 
网页使用
搜索0708漏洞,直接使用特性来搜索
搜索摄像头
截图搜索
 实例
如何批量的去寻找cve-2019-0708的漏洞
如何寻找空VNC 
搜索思科的一个弱口令设备
搜索Mongodb未授权登陆
搜索Jenkins
学习毗连
shodan(1)_哔哩哔哩_bilibili 泷羽-sec

免责声明

本文只做学习使用,一切后果与本人无关
shodan简介

Shodan是一个基于网络的互联网毗连设备搜索平台。Shodan能够扫描环球互联网上的设备,包括服务器、路由器、网络摄像头、物联网设备、工业控制系统等,并收集这些设备的状态信息,如开放端口、操作系统版本、服务类型等。
shodan安装

下载包

git clone https://github.com/achillean/shodan-python.git 切换文件夹、并且安装

cd shodan-python
python setup.py install 初始化shodan,这个api_key在你的账户里面

shodan init api_key 那一片蓝色的就是你的key 
https://i-blog.csdnimg.cn/direct/48692effaaed4eb389a55ff5cdc61107.png
初始化成功 
https://i-blog.csdnimg.cn/direct/089a1a16d0f04144b1c86539dcdd1e48.png
shodan使用

host
命令行

domain

查询域名信息
   shodan domain baidu.com
https://i-blog.csdnimg.cn/direct/7539f80e1e2e48fe86a665e8d5a65f68.png
scan

实时扫描
submit

查询IP地址
   shodan scan submit 153.3.238.102
https://i-blog.csdnimg.cn/direct/93ed3c182c8349aa85a3a1db7d304624.png
status

统计某种信息
   shodan stats --facets ssl.version country:cn has_ssl:true http
搜索ssl各版本在中国使用数目
https://i-blog.csdnimg.cn/direct/9523a47fbf1a481082752cac29c02d69.png
search

很明显这是一个用来搜索的选项
country、--limit、---fields

这个字段用来搜索国家
   搜索日本地域的IP,--limit选项是用来限定查询的条数
shodan search --limit 10 country:jp
https://i-blog.csdnimg.cn/direct/7cdf12a42cfd4379bf296aacce0e00fe.png
上面搜索出来的东西很多,但是我们可能只需要IP和端口,我们可以使用--fields,来过滤我们需要的东西
shodan --limit 10 --fields ip_str,port country:jp
https://i-blog.csdnimg.cn/direct/4007119f38154a65b56b5d466153b980.png
city

用来搜索是哪个城市的
   下面就是搜索条目10条,过滤IP和端口号为3389且是中国深圳的IP地址
shodan search --limit 10 --fields ip_str port:3389 country:cn city:shenzhen 
https://i-blog.csdnimg.cn/direct/0f1f0e3b1b5244ff94b108fe75c6a65f.png
os

搜索操作系统
   shodan search --limit 10 --fields ip_str port:3389 country:cn city:shenzhen os:windows
搜索在中国深圳的Windows的IP,且仅显示IP和端口为3389,且显示数目为10条
https://i-blog.csdnimg.cn/direct/6c2587611c2545b9821076d456e92675.png
has_vuln

   查询是否具有漏洞
shodan search --limit 10 --fields ip_str port:3389 country:cn city:shenzhen os:windows has_vuln:ture
https://i-blog.csdnimg.cn/direct/d173739a687a4b32b720228edaa41f3d.png
device

   查看设备是什么
 shodan search --limit 10 --fields ip_str  country:cn city:shenzhen  device:webcam
查看摄像头设备
https://i-blog.csdnimg.cn/direct/8d127324895a405193726887a65ac638.png

shodan search --limit 10 --fields ip_str  country:cn city:shenzhen  device:router
查看路由器设备
https://i-blog.csdnimg.cn/direct/b0e030a7a2eb466c9d0259211eb7c1ea.png
 tp-link

   查看一些web端的设备 
https://i-blog.csdnimg.cn/direct/d2f74cf1043b4477bc1e1a1434ccf154.png
http.title

搜索网页标题内容
   搜索网页标题带有hack的网站
shodan search --limit 10 --fields ip_str,port http.title:hack 
https://i-blog.csdnimg.cn/direct/65c9f7cc0d4c4f31b45c6ac0c5be1b69.png

net

搜索某个网段
   shodan search --limit 10 --fields ip_str,post net:208.88.84.0/24
搜索208.88.84.0/24网段
org

搜索某个构造
   shodan search --limit 10 --fields ip_str,post org:baidu
https://i-blog.csdnimg.cn/direct/e2cd25c90b1f4081958036f5d8ac78a4.png
http.waf

搜索存在某种防火墙的
   shodan search --limit 10 --fields ip_str,port http.waf:safedog
搜索存在安全狗防火墙的IP
https://i-blog.csdnimg.cn/direct/cc40bbfe57c9402f8a77cd3a43e03acf.png
html

查询html页面里面存在某个关键字
   shodan search --limit 10 --fields ip_str,port html:login
https://i-blog.csdnimg.cn/direct/99e6e44e32b2449a923cb478bfcb6436.png
随便点进去看一下,这里是一个登陆框
https://i-blog.csdnimg.cn/direct/647757c6fa634a31a6e260437b924bbd.png
product

搜索产品,例如一些中心件之类的东西
   shodan search --limit 10 --fields ip_str,port product:Apache httpd
搜索apache2中心件
这里是搜索出来的一个网址
https://i-blog.csdnimg.cn/direct/254414d6c64a4562ab995f46a524509a.png
host

查看IP的具体信息
   shodan host 139.199.64.215
 查看139.199.64.215的信息https://i-blog.csdnimg.cn/direct/4c954b9312a542148975f05e726cdcd6.png
--history

查看IP汗青解析记录
   shodan host IP --historyhttps://i-blog.csdnimg.cn/direct/18fc298be7cc4f739fe0ee2cd97a4786.png
download

下载你查询到的信息
   shodan download 文件名 --limit 100 '"\x03\x00\x00\x0b\x06\xd0\x00\x00\x124\x00"' 
https://i-blog.csdnimg.cn/direct/d903ef278a99456797c0dd4fff92a508.png
https://i-blog.csdnimg.cn/direct/ce0f598fef204986ac6cdabe2d9bee9f.png
parse 

将下载的文件解析出来,这里填写绝对路径,刚刚填写相对路劲出现了问题
   shodan parse --fields ip_str ~/tool/shodan-python/0708.json.gz 
https://i-blog.csdnimg.cn/direct/2924e3e3975c4e888accfedd0295c1fe.png
将命令导入到0708文件中
shodan parse --fields ip_str ~/tool/shodan-python/0708.json.gz > 0708.txt
count

   计数
盘算这个特性的漏洞数目
https://i-blog.csdnimg.cn/direct/da7bd8c12ba14862908e7432e9c3c8d2.png
honeyscore

查看对应IP是不是蜜罐
   https://i-blog.csdnimg.cn/direct/6f4f032e05394664b84defb2a5ef2f63.png
但是这个我尝试了一下似乎没有作用
我们还可以去网站上,直接搜索
https://honeyscore.shodan.io/
就是这么个网站
https://i-blog.csdnimg.cn/direct/19cd70b0e92d41df987e9cdcb3473d55.png
myip

查看自己的IP的公网出口
   shodan myip
https://i-blog.csdnimg.cn/direct/494f3af8d5d042428e51805d2ecc605d.png
更多指令 

https://www.shodan.io/search/filters 更多指令参考官方手册
网页使用

搜索0708漏洞,直接使用特性来搜索

'"\x03\x00\x00\x0b\x06\xd0\x00\x00\x124\x00"'
https://i-blog.csdnimg.cn/direct/2bd9dd7dd51446479f2b6736e2bdb24a.png
搜索摄像头

https://i-blog.csdnimg.cn/direct/7baabbb9dc0f4e6cbddb1a53ecfd9b2d.png
截图搜索

has_screenshot:true cisco
   带有试试截图的IP,这里可能泄漏一些隐私信息
https://i-blog.csdnimg.cn/direct/110cd441de2343e496663e2ab2ec894f.png
 实例

如何批量的去寻找cve-2019-0708的漏洞

   使用cve2019-0708的十六进制漏洞特性 \x03\x00\x00\x0b\x06\xd0\x00\x124\x00 去查询,在这里是由于账号的权限不够,如果账号权限充足,则可以不消16进制特性
shodan search --limit 10  --fields ip_str,port '"\x03\x00\x00\x0b\x06\xd0\x00\x00\x124\x00"'
https://i-blog.csdnimg.cn/direct/f6bc12a28c36411fa5ad6ee6555e825b.png
留意这里扫描出了漏洞,但是不一定能够利用
使用host查看是否存在,存在尝试利用
https://i-blog.csdnimg.cn/direct/2fb3c55410f9424a81aeb6461f0c3113.png
用自己的长途桌面尝试一下,这看起来像是windows7的一台设备
然后我们可以尝试一下弱口令,或者使用msf
账号:Administrador 暗码:Administrador
 https://i-blog.csdnimg.cn/direct/15dfd920f1c84caf85475204e478315f.png
如何寻找空VNC 

shodan search --limit 30   --fields ip_str "authentication disable" port:5900
https://i-blog.csdnimg.cn/direct/f3ab418d696e41bc9bdd12dfa79ffced.png    
搜索出对应IP后可以尝试使用VNC毗连,可能寻找到没有暗码的VNC毗连,但是你搜索到的信息不一定准确,由于这个shodan不是实时的,可能你搜索到的这个信息时前段时间搜索出来的信息。人家已经把漏洞修复了。
搜索思科的一个弱口令设备

   shodan --limit 10 --fields ip_str,port "cisco -authorired port:23"
-authorired 弱口令特性
然后我们可以尝试使用某种长途毗连工具进行爆破毗连
https://i-blog.csdnimg.cn/direct/18a3d67eb54e4041aa34e3472713b023.png
搜索Mongodb未授权登陆

   shodan search --limit 10 --fields ip_str "Mongodb server information -authentication" port:27017
 https://i-blog.csdnimg.cn/direct/d74a3ee9283a4ed2806d213a018a5ea0.png
搜索Jenkins

这个插件可以完成项目标自动化测试、自动化摆设等
   要求响应头包罗"X-Jenkins" 或者 "Set-cookie:JESSIONID"
shodan search --limit 10 --fields ip_str "X-Jenkins" OR "Set-cookie:JESSIONID" http.title:"Dashboard"
https://i-blog.csdnimg.cn/direct/00106f6877a3431bb7a2a87767a24a4b.png
https://i-blog.csdnimg.cn/direct/3bee45afc2de4526abb0fd170548f3b8.png
学习毗连

shodan(1)_哔哩哔哩_bilibili 泷羽-sec


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 零底子学安全--shodan学习