What is Shodan?
- Shodan 是個針對網路連接設備的搜尋引擎
- 可以探查整個網路,其中功能大概有
- 找到有連接在網路上的設備,或者是網路服務
- 監控網路安全
- 做出全球統計 … 等等
- 主要的應用在幾個領域:
- Network Security
- Market Research
- Cyber Risk
- Scanning IoT Devices
- Tracking Ransomware
- Shodan 的網站、資料庫都是大範圍網路埠號掃描的結果
Shodan interfaces
- 在這邊主要說明連接 Shodan 的幾個方法:
- 網路(較為廣泛知道)
- 官方的 Python Command-line 介面工具與函式庫
- 其他不同語言的函式庫
- 官方的 REST API
REST,Resource Representational State Transfer,可譯為具象狀態傳輸
Server / Client 的一種呼叫服務形式,透過既定規則來滿足約束條件和原則的應用程式設計
簡單來說,一個單從發出的HTTP要求裡面所包含的資訊,就可直接預期這種要求會收到怎樣類型的資料,也就是「人眼看得懂」
CLI tool
- 官方的 Shodan Command-line 介面是由 Python 所寫的
Install
- 透過 Python 安裝,可使用
easy_install
或者pip
以 Python 3.x 以上的版本來安裝
1
easy_install shodan
1
pip install shodan
- 如果是使用 Linux / MacOS 需要以 root 身份安裝
1
sudo python3 -m easy_install shodan
1
sudo pip3 install shodan
- 如果是使用 Linux / MacOS 需要以 root 身份安裝
- 在安裝完後需要設定 API Token
1
shodan init <YOUR_API_KEY>
Command Overview
- 下面會說明幾個比較直觀的指令
--help
1 | shodan --help |
- 會看到下列回應:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25Usage: 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
domain View all available information for a domain
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.
version Print version of this tool.
info
- 如果設定好 API token,可以確認個人的 credit
1
2
3shodan info
Query credis available : 100
Scan credits availabe: 100 - Query credit 用在搜尋 Shodan 上;而 Scan credit 用在掃描 IP 上
一個搜尋的 request 花費一個 query credit
掃描一個 IP 花費一個 scan credit
version
- 確認版本
1
2shodan version
1.22.0
count
- 會回傳結果的搜尋數量
1
shodan count openssh
download
1 | shodan download -h |
- Shodan 搜尋後下載的結果進入檔案中會以 JSON banner 的樣式呈現
- 預設下載 1000 筆結果,可以使用
--limit
來設定數量 - 這個指令會儲存結果,並在之後能讓
parse
指令來處理如果經常搜尋相同的 query 可以節省 credit
[color=#B399FF] - Export credit 是用來從網站上下載資料
一個 export credit 下載 10000 筆結果
這個 credit 是一次性的,不會每個月自動回補
[color=#B399FF]- 如果沒有 export credit,可以一個 query credit 來存 100 筆結果
- e.g. 下載 1000 筆 openssh query 的資料
1
shodan download openssh-data openssh
host
- 可以針對某個 host 來查看其資訊,比如所在地、開放的埠號、IP 所屬的組織…
1
shodan host 1.1.1.1
1
shodan host 138.201.81.199
myip
- 可以回傳個人的實體 IP
1
shodan myip
parse
1 | shodan parse -h |
- 可以用來分析下載下來的檔案
- 可以過濾一些有興趣的欄位,然後將 JSON 格式轉換成 CSV
- e.g. 將先前下載的 openssh 做過濾
1
shodan parse --fields location.country_code3, ip_str, hostnames -f port:2222 openssh-data.json.gz
1
shodan parse --fields port, ip_str, location.city, location.postal_code -f location.country_code:FR --separator , openssh-data.json.gz
search
1 | shodan search -h |
- 此指令會搜尋 Shodan,並且以 terminal 習慣的格式輸出
- 預設都會輸出 IP、port、hostname、資料
- 可以使用
--fields
來印有興趣的 banner
- 可以使用
- 一個簡單的 query 不會花費任何 credit,但如果使用 filter 或者檢索第二頁以後的結果就需要花費 credit
- e.g. 不會花費 credit
1
shodan search --fields ip_str, port, os smb
- e.g. 會花費一個 credit (因為使用 filter)
1
shodan search --fields ip_str, port, org, info product:mongodb
scan
1 | shodan scan -h |
- 掃描 IP / netblock
- 只要掃描一個 IP 便會花費一個 scan credit
- 預設掃描的結果會以標準輸出顯示,但可以將其存為檔案,以便之後進行爬取
- e.g.
1
shodan scan submit --filename 104.27.154.244_scan.json.gz 104.27.154.244
24 小時內不能掃描同一個 host,除非花錢升級
[color=red] - e.g. 可以看前面掃描的結果,其 ID 跟狀態
1
shodan scan list
- 為了節省 credit 不一定要用
--filename
,可以單純就掃描,接著在根據 ID 來儲存1
shodan download --limit -1 scan-results.json.gz
- 掃描可以不同步,可以在任何時候確認掃描的狀態
1
shodan scan status <SCAN_ID>
- 可以看掃描時較長的內容
1
shodan scan submit --verbose 13.226.145.4
- Enterprise 版本的可以針對特定埠號、協定、module 做掃描
1
shodan scan internet 8080 wemo-http
stats
1 | shodan stats -h |
- 根據搜尋的 query 來給出統合資料
- 一般預設看十筆,且不是所有面相的資料
1
shodan stats nginx
- 但可以調整成自己想要統合的資料數據
1
shodan stats --facets domain, port, asn --limit 5 nginx
Website
Main interface
- Shodan 的主要介面就是一個搜尋引擎
- 主要跟 CLI Tool 中的搜尋指令一樣,但會有著比較花俏的 WebUI 來呈現結果
- 顯示每個 host 的摘要
- 顯示符合 query 的 host 總數 => 類似 CLI 中的
count
,加上一些stat
- 如果選擇其中一個 host,便能夠看到特定的表格、會影響 host 的漏洞、開啟的 port、已開啟 port 的 banner
Downloading data
- 在檢索過後,能夠下載結果
- 接著可以選擇下載的檔案類型:JSON / CSV / XML
- 只有 JSON 格式會包含所有資料且與 Shodan CLI Tool 相容
- CSV 格式僅包含 IP, port, banner, organization , hostname
- XML 格式被 Shodan 所不贊成,因其耗費比 JSON 還多的空間
- 可以看到下載的紀錄
Generating reports
網站可以根據檢索的 query 來產生報表
- 包含圖表 => 可看到大局上的網路分佈(免費)
要產生報表,只要按下在搜尋結果頁面下的
Create Report
- 命名報表名稱
需要幾分鐘的時間
- 命名報表名稱
可以看到先前所有報表在 report 頁面
報表不會自動更新
Maps
- 功能與指令的
stats
相差不大,唯一的不同只是結果是以互動式的地圖顯示- 其中地點都是基於 host 的物理位置
- 其中地點都是基於 host 的物理位置
- 本身不會顯示超過一千筆結果,可以拉近或拉遠來看其他結果
Images
- 能夠搜尋被爬到裝置的螢幕截圖
- 基本上圖片的資料包含五種不同的結果:
- VNC
- RDP (Remote Desktop)
- RTSP (Real Time Streaming Protocol)
- Webcam
- X Windows
has_screenshot:true
可以用在全域檢索引擎,這樣可以顯示有螢幕截圖的 host
Exploits
- 本身為一個搜尋引擎,主要會檢索多個漏洞資料庫來找漏洞利用的裝置
Developer dashboard
- 顯示個人的 credit 使用量,以及 API 的方案
Network monitor
- 會持續追蹤已經由該名使用者暴露在網路上的裝置
- 設定通知、啟動掃描、取得所有可見資訊
- 該監控面板能夠追蹤自身的裝置,偵測到可疑之處:
- 發出警告
- 啟動掃描
- 顯示結果再面板上
- 在開始使用 => 加上 IP / IP 範圍 / 域名來監控,選擇要提醒的服務
- 可以管理資產,從此處可以啟動掃描或修改觸發規則
- 可以選擇觸發告警的事件
- Dashboard 會顯示揭露的服務
ICS radar
- 是個將 Industrial Control System (ICS) 出現在 Shodan 的設備以 3D 地圖呈現
Honeypot score
- 這服務稱為 Honeypot or not?
- 從 IP 來判斷是不是 Honeypot
- 從 IP 來判斷是不是 Honeypot
- 在 CLI 上也有一樣的功能
1
2
3$ shodan honeyscore [IP_Address]
Not a honeypot
Score: 0.3
Shodan 2000
- Shodan 2000是個類似 Tron 的介面,會隨機展示一個 Host
Community queries
- 可以 explore query => 輸出或分享
- 分享出來的 query 都會有個標題跟描述
- 可以點 Share Search
REST API
- 可以用在基於 Shodan 的網站應用服務,或者建立一個函式庫(沒有最想使用的語言時)
- API 的基礎 URL:
https://api.shodan.io
- 所有 API method 流量上限: 1 request / second
- API 需要認證 => 若無則會出現 HTTP 401 錯誤
HTTP 401 Unauthorized
- 查詢 API 資訊的範例:
1
$ curl -s https://api.shodan.io/api-info?key={YOUR_API_KEY} | jq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15{
"scan_credits": 95,
"usage_limits": {
"scan_credits": 100,
"query_credits": 100,
"monitored_ips": 16
},
"plan": "dev",
"https": false,
"unlocked": true,
"query_credits": 94,
"monitored_ips": 2,
"unlocked_left": 94,
"telnet": false
} - 其他查詢 host 資訊
1
$ curl -s https://api.shodan.io/shodan/host/1.1.1.1?key={YOUR_API_KEY} | jq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44"region_code": null,
"ip": 16843009,
"postal_code": null,
"country_code": "AU",
"city": null,
"dma_code": null,
"last_update": "2020-01-25T15:55:54.880090",
"latitude": -33.494,
"tags": [],
"area_code": null,
"country_name": "Australia",
"hostnames": [
"one.one.one.one"
],
"org": "Nountain View Communications",
"data": [
"shodan": {
"id": "f4218ca0-2728-4d7b-97f8-875f4f04149d",
"options": {
"referrer": "601b650e-3cc7-4189-babe-921fdf53a9e2",
"hostname": "www.1yhaoduo.com"
},
"ptr": true,
"module": "http",
"crawler": "d264629436af1b777b3b513ca6ed1404d7395d80"
},
"hash": -237371161,
"os": null,
"opts": {},
"ip": 16843009,
"isp": "APNIC and Cloudflare DNS Resolver project",
"http": {
"html_hash": 1145258596,
"robots_hash": null,
"redirects": [],
"securitytxt": null,
"title": "DNS resolution error | www.1yhaoduo.com | Cloudflare",
"sitemap_hash": null,
"waf": "CloudFlare",
"robots": null,
"favicon": null,
...
}
] - 完整的描述可參考 REST API Documentation
Language wrappers (libraries)
- 可以使用包好的函式庫來連接工具與 Shodan API
- 官方:Python
- 社群:Ruby, PHP, Haskell, Rust, Perl, Node.js, Go, PowerShell, Java, C#
Python - shodan-python
雖然函式庫在 Python 2 跟 3 都可以運作,但這邊以 Python 3 為主
- 安裝就跟一般 CLI 工具一樣
- 在虛擬 Python 環境:
1
$ easy_install shodan
- 在 BlackArch 上也可以透過下列方式安裝:
1
# pacman -S python-shodan
- 在虛擬 Python 環境:
- 使用 API 初始化
1
2
3
4
5import shodan
SHODAN_API_KEY = "API key here"
api = shodan.Shodan(SHODAN_API_KEY) - 基本查詢:
1
2
3
4
5
6
7
8
9
10
11
12try:
# Search Shodan
results = api.search("apache")
## Show results
print("Results found: {}".format(result['total']))
for result in results['matches']:
print("IP: {}".format(result['ip_str']))
print(result['data'])
print()
except shodan.APIError as e:
print("Error: {}".format(e)) - 查詢 Host 開啟的 Port
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19try:
# Lookup the host
host = api.host('1.1.1.1')
# Print general info
print("""
IP: {}
Organization: {}
Operating System: {}
""".format(host['ip_str'], host.get('org', 'n/a'), host.get('os', 'n/a')))
# Print all banners
for item in host['data']:
print("""
Port: {}
Banner: {}
""".format(item['port'], item['data']))
except shodan.APIError as e:
print("Error: {}".format(e)) - 顯示統計數據
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39# The list of properties we want summary information on
FACETS = [
("org", 3),
"domain",
"port",
"asn",
("country", 10),
]
FACET_TITLES = {
"org": "Top 3 Organizations",
"domain": "Top 5 Domains",
"port": "Top 5 Ports",
"asn": "Top 5 Autonomous Systems",
"country": "Top 10 Contries",
}
try:
# Query
query = 'apache 2.4'
# Count results
result = api.count(query, facets = FACETS)
print("Shodan Summary Information")
print("Query: %s" % query)
print("Total Results: %s\n" % result['total'])
# Print the summary info from the facets
for facet in result['facets']:
print(FACET_TITLES[facet])
for term in result['facets'][facet]:
print("%s: %s" % (term['value'], term['count']))
# Print an empty line between summary info
print()
except shodan.APIError as e:
print("Error: {}".format(e)) - 這些範例都是參考自 Official Documentation
Ruby - shodanz
- 在虛擬 Ruby 環境安裝:
1
$ gem install shodanz
- 使用 API key 初始化
1
2
3require 'shodanz'
api = Shodanz.client.new(key: 'YOUR_API_KEY')- 如果是專案,可以透過環境變數
SHODAN_API_KEY
來讀取 API key
- 如果是專案,可以透過環境變數
- 基本查詢
1
2
3
4
5
6
7
8
9# Search Shodan
results = api.host_search('apache')
# Show results
puts "Results found: #{results['total']}"
results['matches'].each do |result|
puts "IP: #{result['ip_str']}"
puts result['data'] + "\n"
end - 查詢 Host 開啟的 Port
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18# Lookup the host
host = api.host('1.1.1.1')
# Print general info
puts "
IP: #{host['ip_str']}
Organization: #{host['org'] || 'n/a'}
Operating System: #{host['os'] || 'n/a'}
"
# Print all banners
host['data'].each do |item|
puts "
Port: #{item['port'] || 'n/a'}
Banner: #{item['data'] || 'n/a'}
"
end - 顯示統計數據
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37# The list of properties we want summary information on
FACETS = {
'org': 3,
'domain': 5,
'port': 5,
'asn': 5,
'country': 10,
}
FACET_TITLES = {
'org': 'Top 3 Organizations',
'domain': 'Top 5 Domains',
'port': 'Top 5 Ports',
'asn': 'Top 5 Autonomous Systems',
'country': 'Top 10 Countries',
}
# Query
query = 'apache 2.4'
# Count results
result = api.host_count(query, facets: FACETS)
puts "Shodan Summary Information"
puts "Query: #{query}"
puts "Total Results: #{result['total']}\n"
# Print the summary info from the facets
result['facets'].each do |facet, _v|
puts FACETS_TITLES[facet]
result['facets'][facet].each do |term|
puts "#{term['value']}: #{term['count']}"
end
# Print an empty line between summary info
puts ''
end - Async 支援串流 API
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20require 'async'
require 'shodanz'
api = Shodanz.client.new(key: 'YOUR_API_KEY')
# Asynchronously stream banner info from shodan and check any
# IP addresses against the experimental honeypot scoring service
api.streaming_api.banners do |banner|
if ip = banner['ip_str']
Async do
score = api.rest_api.honeypot_score(ip).wait
puts "#{ip} has a #{score * 100}% chance of being a honeypot"
rescue Shodanz::Errors::RateLimited
sleep rand
retry
rescue # any other errors
next
end
end
end注意! 要使用串流 API 的話,免費版跟開發者版沒有
此範例來自 shodanz 文件 - 有用的 method
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23# Returns all the protocols that can be used when launching an Internet scan
api.protocols
# Returns a list of port numbers that the Shodan crawlers are looking for
api.ports
# Returns information about the Shodan account linked to this API key
api.profile
# Look up the IP address for the provided list of hostnames
api.resolve('archlinux.org', 'blackarch.org')
# Look up the hostnames that have been defined for the given list of IP addresses
api.reverse_lookup('138.201.81.199', '176.31.253.211')
# Get your current IP address as seen from the Internet
api.my_ip
# Calculates a honeypot probability score ranging from 0 (not a honeypot) to 1.0 (is a honeypot)
api.honeypot_score('1.1.1.1')
# API Plan Information
api.info - Exploits API
1
2puts client.exploit_count(port: 22, page: 1)
puts client.exploit_search('rce couchdb', type: 'remote', platform: 'linux', author: 'Metasploit') - 可以找到更多的範例,或讀 shodanz API Documentation
Node.js - shodan-client
- 在虛擬 nodejs 環境安裝:
1
$ npm i shodan-client
- 使用 API key 初始化
1
2
3
4const util = require('util');
const api = require('shodan-client');
const key = "API key here"; - 基本查詢
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17const searchOpts = {};
const searchQuery = "apache";
api
.search(searchQuery, key, searchOpts) // Search Shodan
.then(results => {
console.log("Results found: " + results['total'] + "\n"); // Show results
for (const result of results['matches']) {
console.log(`IP: ${result['ip_str']}`);
console.log(result['data'] + "\n");
}
})
.catch(err => {
console.log("Error: ");
console.log(err);
}); - 查詢 Host 開啟的 Port
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26const searchOpts = {};
const ip = "1.1.1.1";
api
.host(ip, key, searchOpts) // Lookup the host
.then(host => {
// Print general info
console.log(`
IP: ${host['ip_str']}
Organization: ${host['org'] || 'n/a'}
Operating System: ${host['os'] || 'n/a'}
`);
// Print all banners
for (const item of host['data']) {
console.log(`
Port: ${item['port'] || 'n/a'}
Banner: ${item['data'] || 'n/a'}
`);
}
})
.catch(err => {
console.log("Error: ");
console.log(err);
}); - 顯示統計數據
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48const FACETS = {
"org": 3,
"domain": 5,
"port": 5,
"asn": 5,
"country": 10,
};
const FACET_TITLES = {
"org": "Top 3 Organizations",
"domain": "Top 5 Domains",
"port": "Top 5 Ports",
"asn": "Top 5 Autonomous Systems",
"country": "Top 10 Countries",
};
// https://github.com/jesusprubio/shodan-client/issues/34
// const opts = {facets: FACETS};
const opts = { facets:
JSON.stringify(FACETS).replace(/["{}]/g, '')
};
// Query
const query = 'apache 2.4';
api
.count(query, key, opts) // Count results
.then(result => {
console.log("Shodan Summary Information");
console.log(`Query: ${query}`);
console.log(`Total Results: ${result['total']}\n`);
// Print the summary info from the facets
for (const facet in result['facets']){
console.log(FACET_TITLES[facet]);
for (const term of result['facets'][facet]) {
console.log(`${term['value']}: ${term['count']}`);
}
// Print an empty line between summary info
console.log();
}
})
.catch(err => {
console.log("Error: ");
console.log(err);
});
Plugins
Firefox
- 會從 Shodan.io 蒐集當前瀏覽頁面的資訊
- 顯示一般的資訊:組織、開啟的 Port
Chromium
- 會顯示網站的位置(國家、程式),誰擁有 IP、有什麼服務或 Port 是開啟的
Shodan Search Query Syntax
Banner and properties
- 在 Shodan 當中,一個「banner」代表者一個包含某服務資訊的物件
- e.g. 官方文件中有一個簡化的 banner 範例
1
2
3
4
5
6
7
8
9
10
11
12{
"data": "Moxa Nport Device
Status: Authentication disabled
Name: NP5232I_4728
MAC: 00:90:e8:47:10:2d",
"ip_str": "46.252.132.235",
"port": 4800,
"org": "Starhub Mobile",
"location": {
"country_code": "SG"
}
}- 每個 dictionary 的 key 都可稱為一個 property (data、ip_str、port等)
- 每個 property 都存有不同型別的某服務的資訊
- 預設上 Shodan 僅能讀取資料的屬性
Search filters
- 要找到前一個範例 banner
- 可以檢索 Moxa Nport Device
- 但前提是要限縮莊志維 Starhub Mobile,否則不一定會回傳預期的結果
原因就是 Shodan 預設僅搜尋資料 property
[color=#B399FF]
- 要用其他 property 檢索資料,必須要使用 filter
- search filter 是在 Shodan 中輸入特殊關鍵字來找預期的 property
- filter 主要的格式都是
key:value
- e.g.
- 找 Starhub 行動網路的裝置 =>
org:"Starhub Mobile"
- 找在新加坡的裝置 =>
country:SG
- 可以結合 =>
org:"Starhub Mobile" country:SG
- 找 Starhub 行動網路的裝置 =>
- filter 主要的格式都是
Properties / filters specification
- 有完整的 banner 屬性清單在官方文件
General properties
Property | Type | Description |
---|---|---|
asn | String | 獨立系統編號 (e.g. “AS4837”) |
data | String | 包含服務的 banner 資訊 |
ip | Integer | host 的 IP (整數型態) |
ip_str | String | host 的 IP (字串型態) |
ipv6 | String | host 的 IPv6 (字串型態),如果有此項則不會出現”ip”、”ip_str”兩項 |
port | Integer | 運行服務的埠號 |
timestamp | String | banner 從在 UTC 時區的裝置取回的時籤 |
hostnames | String[] | 所有該裝置 IP 位置的主機名稱 |
domains | String[] | 所有該裝置最高層級域名,在過濾 TLD 時很好用,能處理域名中有多個點的狀況 (e.g. “co.uk”) |
location | Object | 包含所有裝置所在位置資訊的物件 |
location.area_code | Integer | 區域號碼 (僅在美國有效) |
location.city | String | 裝置位置的城市名 |
location.country_code | String | 裝置位置的城市名 (兩個字母) |
location.country_code3 | String | 裝置位置的城市名 (三個字母) |
location.country_name | String | 裝置位置的國家名 |
location.dma_code | Integer | 裝置所在指定的市場區域號碼(僅在美國有效) |
location.latitude | Double | 裝置所在緯度 |
location.longitude | Double | 裝置所在經度 |
location.postal_code | String | 裝置位置的郵遞區號 |
location.region_code | String | 裝置位置區域名稱 |
opts | Object | 包含服務的實驗性資料和支援性資料,可包含 SSL 憑證、robots.txt、其他未正規化的資訊到 Banner |
org | String | 給予裝置 IP 空間的組織名稱 |
isp | String | 提供裝置 IP 空間組織的 ISP,可認為是組織的母機構,有 IP 的所有權 |
os | String | 裝置的作業系統 |
transport | String | 為 udp 或 tcp,標明 IP 傳輸協定 |
Optional properties
Property | Type | Description |
---|---|---|
uptime | Integer | 裝置在線時間(分鐘) |
link | String | 網路連線類型,可能的值有 1. Ethernet / Modem 2. Generic Tunnel / VPN 3. DSL 4. IPIP / SIT 5. IPSec / GRE 6. VLAN 7. Jumbo Ethernet 8. Google 9. GIF 10. PPTP 11. Loopback 12. AX.25 Radio Modem |
title | String | 從 HTML 輸出的網站標題 |
html | String | 網站的 HTML 原始碼 |
product | String | 產生 banner 的產品名稱 |
version | String | 產生 banner 的產品版本 |
devicetype | String | 裝置類型 (e.g. webcam, router, etc.) |
info | String | 產品的其他資訊 |
cpe | String | 相關產品的 CPE 或已知漏洞,更多資訊可查詢 CPE 官網或字典 |
SSL properties
Property | Type | Description |
---|---|---|
ssl.cert | Object | 憑證屬性,包含頒發時間、SSL 副檔、頒發者等等 |
ssl.cipher | Object | SSL 連線偏好加密演算法 |
ssl.chain | Array | 憑證的陣列,每個字串都是一個 PEM 加密 SSL 憑證,其中包含使用者 SSL 憑證到 root 憑證 |
ssl.dhparams | Object | Diffie-Hellman 參數: 1. prime 2. public_key 3. bits 4. generator 5. fingerprint (optional) 假設知道一個程式產生這些參數 |
ssl.versions | Array | Server 支援的 SSL 版本清單,如果版本不支援會在前面加上 “-“ e.g. ["TLSv1", "-SSLv2"] 表示支援 TLSv1,但不支援 SSLv2 |
Miscellaneous
Shodan dorks & use cases
- 從一些簡單的 Shodan Snippets 開始
- Number of devices vulnerable to Heartbleed
1
$ shodan count vuln:cve-2014-0160
- Get a list of subdomains for a domain
1
$ shodan domain cnn.com
- Create a private firehose for your network and subscribe to it
1
$ shodan alert create mynetwork 198.20.58.0/24 && shodan stream --alerts=all
- Find the top 10 most common vulnerabilities in Switzerland
1
$ shodan stats --facets vuln country:CH
- Number of devices vulnerable to Heartbleed
- 一些公開的 Shared Queries
- D-Link Internet Camera DCS-5300 series, without authentication
1
$ shodan search 'd-Link Internet Camera, 200 OK'
- FTP server with anonymous authentication enabled
1
$ shodan search '230 login successful port:21'
- Databases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26# MySQL
$ shodan search 'product:MySQL'
# MongoDB
$ shodan search 'product:MongoDB'
# elastic
$ shodan search 'port:9200 json'
# Memcached
$ shodan search 'product:Memcached'
# CouchDB
$ shodan search 'product:CouchDB'
# PostgreSQL
$ shodan search 'port:5432 PostgreSQL'
# Riak
$ shodan search 'port:8087 Riak'
# Redis
$ shodan search 'product:Redis'
# Cassandra
$ shodan search 'product:Cassandra' - Games
1
2
3
4
5
6
7
8
9
10
11# Minecraft
$ shodan search 'Minecraft Server port:25565'
# Counter-Strike: Global Offensive
$ shodan search 'product: "Counter-Strike Global Offensive"'
# Starbound
$ shodan search 'product:Starbound'
# ARK: Survival Evolved
$ shodan search 'product:"ARK Survival Evolved"' - Industrial Control Systems
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50# XZERES Wind Turbine
$ shodan search 'title:"xzeres wind"'
# PIPS Automated License Plate Reader
$ shodan search 'html:"PIPS Technology ALPR Processors"'
# Modbus
$ shodan search 'port:502'
# Niagara Fox
$ shodan search 'port:1911,4911 product:Niagara'
# GE-SRTP
$ shodan search 'port:18245,18246 product:"general electric"'
# MELSEC-Q
$ shodan search 'port:5006,5007 product:mitsubishi'
# CODESYS
$ shodan search 'port:2455 operating system'
# S7
$ shodan search 'port:102'
# BACnet
$ shodan search 'port:47808'
# HART-IP
$ shodan search 'port:5094 hart-ip'
# Omron FINS
$ shodan search 'port:9600 response code'
# IEC 60870-5-104
$ shodan search 'port:2404 asdu address'
# DNP3
$ shodan search 'port:20000 source address'
# EtherNet/IP
$ shodan search 'port:44818'
# PCWorx
$ shodan search 'port:1962 PLC'
# Crimson v3.0
$ shodan search 'port:789 product:"Red Lion Controls"'
# ProConOS
$ shodan search 'port:20547 PLC'
- D-Link Internet Camera DCS-5300 series, without authentication
- 由 dalmoz 找到的 Shodan Dork
- ASCII video examples
- Hacked Ubiquiti Network Device
1
$ shodan search 'hacked-router-help-sos'
- Surveillance cameras, user: admin, no password
1
$ shodan search 'hacked-router-help-sos'
- Home routers’ storage/attached USB storage
1
$ shodan search 'IPC$ all storage devices'
- PBX phone gateways without authentication
1
$ shodan search 'port:23 console gateway -password'
- Lantronix ethernet adapter’s admin interface without password
1
$ shodan search 'Press Enter for Setup Mode port:9999'
- Polycom video-conference system no-auth shell
1
$ shodan search '"polycom command shell"''
- VNC servers without authentication
1
$ shodan search '"authentication disabled" port:5900,5901'
- NPort serial-to-eth / MoCA devices without password
1
$ shodan search 'nport -keyin port:23'
- 一些 PenTestIT 的 query
- Default Jenkins installations
1
$ shodan search 'http.favicon.hash:81586312'
- SonarQube installations
1
$ shodan search 'http.favicon.hash:1485257654'
- IBM WebSphere version disclosure
1
$ shodan search 'WASRemoteRuntimeVersion'
- Default Jenkins installations
- 一些不錯的檢索 query: Awesome Shodan Search Queries
References: