第一次使用Shodan.io就上手

53
第一次使用shodan.io就上手 Tony Lin @TDOH Conf 2016 (12.07)

Transcript of 第一次使用Shodan.io就上手

Page 1: 第一次使用Shodan.io就上手

第一次使用shodan.io就上手

TonyLin@TDOHConf 2016(12.07)

Page 2: 第一次使用Shodan.io就上手

自我介紹

交作業大學 電機系

業餘資安愛好者

Data Science for IoT

Page 3: 第一次使用Shodan.io就上手

shodan.io是做什麼的?

Page 4: 第一次使用Shodan.io就上手

給 黑客 玩耍的大平台 / 搜尋引擎

Page 5: 第一次使用Shodan.io就上手
Page 6: 第一次使用Shodan.io就上手
Page 7: 第一次使用Shodan.io就上手

全名 Sentient Hyper-Optimized Data Access Network

2009年上線,掃描網路世界,爬取Banner

Page 8: 第一次使用Shodan.io就上手

搜尋所有連接到網路上的裝置

攝影機、VoIP、電冰箱、風力發電廠…

Page 9: 第一次使用Shodan.io就上手

用途一: 滲透測試 / 安全研究

1. Reconnaissance(偵查)

2. Scanning (掃描)

3. Gaining Access

4. Maintaining Access

5. Clearing Track

6. Reporting

自由軟體鑄造場_20121202_網路安全測試實務_翁浩正(Allen Own)

Page 10: 第一次使用Shodan.io就上手

用途二: 市場調查

Apache vs Nginx在日本的市佔率?

某漏洞會影響世界上多少台機器?

有多少比例的人在管理後台使用預設帳密?

在紐約有多少台FTP允許匿名登入?

Page 11: 第一次使用Shodan.io就上手

登入帳號,使用進階filter

創一個暫時的email帳號來註冊shodan10分鐘信箱 https://10minutemail.com/

Page 12: 第一次使用Shodan.io就上手

在Explore可以找到一些熱門分類

Page 13: 第一次使用Shodan.io就上手

Shodan Filters

• net: 搜尋特定IP網段• net:140.113.0.0/16

• country: 國家代碼• country:TW

• city: 城市• city:Taipei

• port:• port:3389

• os: 作業系統• os:"Windows XP"

• hostname: 網域• hostname:edu.tw

• org: 網路供應商(ISPs)• org:"Taiwan Academic Network"

• product: 產品/軟體• product:mongodb

• version: 版本• version:2.2.22

Page 14: 第一次使用Shodan.io就上手

搜尋範例

Page 15: 第一次使用Shodan.io就上手

1. 在TANet內開遠端桌面連線的機器

port:3389 org:"Taiwan Academic Network" has_screenshot:True

Page 16: 第一次使用Shodan.io就上手

2.在北京開MongoDB的機器

product:MongoDB city:beijing

Page 17: 第一次使用Shodan.io就上手

3. 在Windows XP開Apache的機器

apache os:"Windows XP"

Page 18: 第一次使用Shodan.io就上手
Page 19: 第一次使用Shodan.io就上手

產生Report

Page 20: 第一次使用Shodan.io就上手

這邊要等一、兩小時

Page 21: 第一次使用Shodan.io就上手
Page 22: 第一次使用Shodan.io就上手
Page 23: 第一次使用Shodan.io就上手

淺談SCADA系統

• 全名Supervisory Control And Data Acquisition• 資料採集與監控系統(廢水處理場、機場捷運中控)

分散式控制系統• Distributed Control Systems

可編程邏輯控制器• Programmable Logic Controllers

• RTU 遠程終端控制系統• Remote Terminal Units

• HMI 人機介面• Human-Machine Interfaces

Page 24: 第一次使用Shodan.io就上手

長得大概像這樣

Page 25: 第一次使用Shodan.io就上手

ICS (Industrial Control System)

~=

SCADA (Supervisory Control And Data Acquisition)

~=

DCS (Distributed Control System)

Page 26: 第一次使用Shodan.io就上手

風力發電機

title:"xzeres wind"

Page 27: 第一次使用Shodan.io就上手
Page 28: 第一次使用Shodan.io就上手

法國施耐德電機

Schneider port:"80"

Page 29: 第一次使用Shodan.io就上手

居然只能用IE開,這樣要我們怎麼教小孩?

Page 30: 第一次使用Shodan.io就上手

一、丟廠商英文名字去找Schneider / Siemens / Advantech

二、先把預設帳密試一輪

https://github.com/scadastrangelove/SCADAPASS

Page 31: 第一次使用Shodan.io就上手

介紹Google Hacking

https://www.exploit-db.com/google-hacking-database/

Page 32: 第一次使用Shodan.io就上手

透過Google搜尋引擎

搜尋各種敏感資訊 / 錯誤頁面 / 潛在弱點

https://pentest-tools.com/information-gathering/google-hacking#

Page 33: 第一次使用Shodan.io就上手

Google Hacking 常用 Operators• site: 搜尋特定Domain / IP• site:140.113.*.*

• filetype/ext: 特定檔案格式• ext:doc | ext:docx | ext:ppt | ext:pdf

• Intitle: 標題含有特定字串• intitle:index.of

• Intext: 文本含有特定內容• intext:"sql syntax near"

• - 去除不想看到的內容• -mirror

https://www.sans.org/security-resources/GoogleCheatSheet.pdf

Page 34: 第一次使用Shodan.io就上手

Directory listing vulnerabilities

Page 35: 第一次使用Shodan.io就上手

Publicly exposed documents

Page 36: 第一次使用Shodan.io就上手

Shodan vs Google

https://www.exploit-db.com/docs/33859.pdf

Page 37: 第一次使用Shodan.io就上手

更多Shodan?

Page 38: 第一次使用Shodan.io就上手
Page 39: 第一次使用Shodan.io就上手

Map & Image

Page 40: 第一次使用Shodan.io就上手

Exploits

Page 41: 第一次使用Shodan.io就上手

CLI

> pip install shodan> shodan init <API Key>> shodan count microsoft iis 6.0> shodan download ms-data microsoft iis 6.0> shodan parse --fields ip_str,port,org --separator , ms-data.json.gz

https://github.com/achillean/shodan-python

Page 42: 第一次使用Shodan.io就上手
Page 43: 第一次使用Shodan.io就上手

Chrome & Firefox Plugin

速度太慢,不是很推

Page 44: 第一次使用Shodan.io就上手

Maltego Add-On

https://maltego.shodan.io/

Page 45: 第一次使用Shodan.io就上手
Page 46: 第一次使用Shodan.io就上手

營利模式

Export Credit: $5 / 10,000 results

一次買斷會員:$49黑色星期五特價 $5

開發者API Plan:$19 / 月

ScanHub: $9 / 月

Page 47: 第一次使用Shodan.io就上手

Shodan最近太不穩了

請容許我以圖片DEMO…

Page 48: 第一次使用Shodan.io就上手

1. J牌攝影機

搜尋到的裝置:41k預設帳密 admin / <blank>Bypass login內建Shell

Page 49: 第一次使用Shodan.io就上手
Page 50: 第一次使用Shodan.io就上手
Page 51: 第一次使用Shodan.io就上手

2. A牌攝影機

搜尋到的裝置:155k+預設帳密:admin/admin

約有60%的裝置採用預設帳密 (59/100)

透過curl把config檔打包帶回家curl --cookie 'Cookie:SSID=YWRtaW46YWRtaW4=' -o system.txt http://<IP>/cgi-bin/supervisor/System.cgi?action=download&filename=System.bin

https://gist.github.com/tnlin/24916131d0038a91cbafa021ec936d16

Page 52: 第一次使用Shodan.io就上手

3. RTSP (H牌攝影機)

rtsp://<IP>/<Path>

Page 53: 第一次使用Shodan.io就上手

Thank You