# 專題 project
###### tags: `專題`
| 成員 1 | 成員 2 | 成員 3 | 成員 4 |
| -------- | -------- | -------- | ------- |
| 黃彥豪 | 曾峻麒 | 洪碩星 | 潘建沂
## info
黃仁竑
Ren-Hung Hwang
pro email
- rhhwang@ccu.edu.tw
pro phone
- 0988301166
gmail
- blackpig22017@gmail.com
- shhung@csie.io
- wastim0505@gmail.com
- tcc3810@gmail.com
eng
- Jian-Yi Pan
- Shuo-Hsing Hung
- Chun-Chi Tseng
group gmail
- IotScanner2021@gmail.com
cloud
- [link](https://drive.google.com/drive/u/0/folders/1adPq38Oa-JKW0ugq9LJVLBVYA3v4ZzoB)
## 研究目標

流程 : 整合資料庫 -> 判斷弱點 -> 整理解決方法
>整理資料庫 : Shodan、Censys、Zoomeye、IVRE..
判斷弱點 : OWASP IOT top 10
整理解決方法 :
# Subject
**12 月底前**
* 掃描物聯網設備的open source 工具
* 揭露最新物聯網設備的情資網站
* 物聯網攻擊工具(如mirai)
## Discussion
**12/04**
1. 整理報告
2. shodan 使用
**12/11**
1. zoomeye、censys、IVRE使用
2. 用python統整三個偵查工具
3. 用什麼查找
**12/18**
1. 揭露情資網站
2. 研究
**12/23**
1. QA
2. 得到搜尋軟體的data
3. IOT設備對應的port
### 12/04
**整理報告**
統整Shodan、Zoomeye、Censys資料,來匹配IOT裝置
**shodan**
shodan sdk:
[link](https://help.shodan.io/developer-fundamentals/looking-up-ip-info)
shodan filter:
[link](https://beta.shodan.io/search/filters)
* hostname :搜索指定的主机或域名,例如 hostname:"google"
* port : 搜索指定的端口或服务,例如 port:"21"
* asn :區域自治编号
* http.html :网页内容
* html.title :网页标题
* vuln :CVE漏洞编号,例如:vuln:CVE-2014-0723

**OWASP**
OWASP IOT top 10

### 12/11
**ZoomEye**
ZoomEye SDK
[link](https://github.com/knownsec/ZoomEye)
```=python
import zoomeye.sdk as zoomeye
zm = zoomeye.ZoomEye(api_key="3******f-b**9-a***c-3**5-28******fd8") #API-KEY for 認證
pattern = 'apache country:cn'
data = zm.dork_search(pattern)
zoomeye.show_site_ip(data) # as it says, ex:None 69.163.238.224
zoomeye.show_ip_port(data) # as it says, ex:45.116.241.186 40000
```
pattern attribute
[link](https://www.zoomeye.org/doc#host-search-filters)

**censys**
Censys sdk
[link](https://github.com/censys/censys-python)
Censys filter
[link](https://censys.io/ipv4/help/definitions?q=&)
pattern attribute
**IVRE**
IVRE + docker + vagrant 安裝
[link](https://blog.csdn.net/weixin_38830346/article/details/85170953)
弱掃45.32.14.0/24 以下網段
```
ivre runscans --network 45.32.14.0/24 --output=XMLFor
ivre scan2db -c ROUTABLE,ROUTABLE-001 -s MySource -r scan
```
### 12/20
#### 揭露最新物聯網設備的情資網站
##### Exploit-db
[link](https://www.exploit-db.com/)
##### CVE
[link](http://cve.mitre.org/index.html)
##### Insecam
[link](https://www.insecam.org/)
##### 台灣電腦網路危機處理暨協調中心
[link](https://www.twcert.org.tw/tw/mp-1.html)
##### CVSS score calculate
[link](https://www.first.org/cvss/calculator/3.0)
#### IOT攻擊工具
##### expliot
web
[link](https://expliot.readthedocs.io/en/latest/)
##### FACT
goal : Analyzing the firmware (and finding vulnerabilities)
[link](https://fkie-cad.github.io/FACT_core/main.html#easy-to-extend-easy-to-integrate)
##### FwAnalysis
goal:analyze (ext2/3/4), FAT/VFat, SquashFS, UBIFS filesystem images, cpio archives, and directory content using a set of configurable rule
* ext2/3/4 : 格式化硬碟
[reference](https://github.com/fkie-cad/awesome-embedded-and-iot-security#analysis-frameworks)
- bashlite
- linux.wifatch
##### 掃描IoT設備
* IoTseeker
* ping -> IoTseeker
* https://www.youtube.com/watch?v=8ItGOGVUzrc&ab_channel=NetVN(ping script)
### 12/26
#### Question
* 要如何確認掃描到的IP是物聯網設備
* IOTseeker
* 掃到IOT設備後,要如何找到弱點
* OWASP
#### noting
##### Shodan
net:140.123.0.0/16 port:9100
port table
[link](https://web.mit.edu/rhel-doc/4/RH-DOCS/rhel-sg-zh_tw-4/ch-ports.html)
9100: 印表機
515 : 行列式印表機排存程序
##### Zoomeye
pattern attribute
[link](https://www.zoomeye.org/doc#host-search-filters)

##### Censys
censys 資訊
[link](https://github.com/gelim/censys)

##### IVRE
### 12/28(老師meeting)
提供
* 檢測的物聯網設備
* 網路攝影機
* 門禁系統
* 網路印表機
* 無線AP/路由器檢測
* 環控系統檢測
* Nessus
* (教育板)https://zh-tw.tenable.com/products/nessus
目標
* 整合python library
### 01/22
goal:整合python library資訊
使用搜尋軟體的sdk,shodan(chi)、zoomeye(shuo)、censys(pan),掃學校的ip區段,印出以下資料
1. os
2. ip_str
3. ports
python library
* 前端
* ip搜尋
* 後端
* shodan、censys、zoomeye 整理
* ip_str
* os
* ports
* https://i.imgur.com/iQJH2UJ.png
swoole
https://www.youtube.com/watch?v=WugoE2T3jsw&t=721s
nessus
1. 不是專門的iot ip掃描
2. 缺少功能(預設帳密或無密碼、open DNS resolver)
nessus檢測的弱點
https://www.tenable.com/plugins
### 01/29
**shodan**
probl.
>太慢
**zoomeye**
prbl.
>只能掃20個
**censys**
probl.
>只能掃1000個
### 02/02
* 檢測的物聯網設備
* 網路攝影機
* 門禁系統
* 網路印表機
* 無線AP/路由器檢測
* 環控系統檢測
下次
1. 整理跟iot相關的漏洞
2. 討論物聯網設備
printer
1. port : 515、9100
無線AP
1. SNMP(161、162)
2. DCPH(67,68)
網路攝影機
1. [link](https://www.exploitee.rs/index.php/Main_Page)
環控系統
1. Modbus協定(502)
### 02/22
資安檢測常用工具
>Nessus Pro
OpenVAS
ZAP
Acunetix
metasploit
### 02/26
printer
* 140.123.33.213
* 140.123.97.128
router
* 213.91.235.17
* 77.222.136.210
webcam
* 140.123.174.33
門禁
* 140.123.15.16
* 140.123.15.15
#### 測試ip
shodan
>printer
140.123.13.50
router
140.123.1.7
webcam
140.123.13.136
zoomeye
>printer
140.123.90.231
router
140.123.39.67
webcam
140.123.39.179
censys
>printer
140.123.33.213
shodan 特徵
* devicetype
* port : 515、9100
* server
zoomeye 特徵
* device
* application
### 03/01
仁泓lab
router
* 140.123.230.51~56
>51:no
52~56:yes
>TP-link
>型號:EL-WR1043ND
>製造年份:2015
printer
* 140.123.103.93
網通設備:網路設備+無線通訊設備
### 03/05
1. Nessus Pro 要講的內容
2. 程式碼
### 03/07
1. 弱點
* 型號
* CVE
* 特殊port
下禮拜
>型號找CVE
學校
printer (44個)
router (162個)
camera (35個)
### 03/14
door-stop system
* 一帆
* GeoVision
camera
* vacron
* axis
* blueeyes
備註:camera default pass
printer
* HP
* Epson
* Canon
HP 弱點網站
https://support.hp.com/us-en/security-bulletins
Epson 弱點網站
https://epson.com/Support/wa00826
Canon
https://www.usa.canon.com/internet/portal/us/home/support/product-advisories/detail/the-vulnerability-in-canon-digital-cameras
router
* tp-link
* d-link
* Asus
下一周
* 設備型號
* 打弱點
* AIOT競賽
### 03/20
camera
* 網路問題
router
* d-link
* cve-details找不到
* tp-link
socket
* cve-details找不道
下一周
* shodan升級升級升級升級升級update升級update
* zoomeye找型號
* 找弱點
* 打camera弱點
* 如何連到iot設備
* 公網
### 03/27
https://cve.mitre.org/cve/search_cve_list.html
"打打"的馬蹄 是駭不進的"設備"
找solution
>cve、資料庫
### 04/17
* 找品牌、型號
* 爬網站頁面
* 品牌關鍵字
* UI
* 更改UI
* 帳戶
* 關鍵字搜索html
* cve score
### 04/24
競賽
* https://innoserve.tca.org.tw/method_2_2021.aspx
Demo
1. 前端
2. 找到cvee
問題
1. 判斷有沒有換密碼
2. zoomeye 搜尋額度不夠, shodan
3. 駭入設備
4. 提醒版本需要更新,不確定版本是什麼
future
1. 在iot設備提醒功能
* router
* camera
2. 找設備vendor(找台灣常用的iot設備廠商)
ex,printer
* HP
* Epson
router
* tp-link
* d-link
### 04/27
改進
* 可視化
* 設備分類
* 設備數量
* 院區對應ip
* 定期更新
* 增加設備(NAS、門控系統)
* 競賽內容(報名)
競賽
https://innoserve.tca.org.tw/method_1_2021.aspx
https://niicc.cilab.csie.ncu.edu.tw/schedule
出賽繳交
1. 企劃書
2. 需求書
3. 影片
企劃書大綱
1. 前言
2. 目標
3. 展示
資安論壇
1. darknet
2. exploit-db
問題
1. 哪些資安論壇
2. 免費ip (csie.io)
this week
1. 設備分類(nas,門控)
2. 看競賽內容
xfdauasdfan 好fa可af愛
dxdfuan dasfi loasdfve yfodsau
下禮拜
1. w3-school
### 05/01
1. w3-school
### 05/09
應用創新
https://innoserve.tca.org.tw/method_1_2021.aspx
期限: 9-27~10-8
繳交:

>大會專題類
智慧創新
https://niicc.cilab.csie.ncu.edu.tw/rule
期限:05/01 - 07/02
繳交:

>物聯網組
資料
ssl加密
https://letsencrypt.org/zh-tw/
### 06/06
200字報告
xuan so sexy tcc love sexy girl
1. 字體
2. 改ip bug
pan
1. 數量container(數量呈現的太小了)
2. cpe scirpt
shou
1. zoomeye vuln script
2. 增加設備數量
yen
>定期更新
問題
1. 判斷設備
2. zoomeye 丟到資料庫
06/21
xuan so sexy
定期更新

確認定期更新
>https://coder.tw/?p=7284
>grep CRON /var/log/syslog*
printer
>epson、hp laserjet
nas
>qnap
router
>asus router
camera
>dlink dcs-936L,dlink dcs-5036l
>Dahua DHI-XVR5104HS-S2,Dahua PC-NVR-V3.0
更換資料夾
cens.py:1個(direc)
find_cve:2個(filename)
summary(filename)
>output(),deviceModelProcessing()
* 增加設備個數
printer
>server: Virata-EmWeb/R6_2_1 + title:hp
>epson、hp laserjet
camera
>dahua
建立設備廠商 - 設備型號表
>廠商不一定只賣單一產品,如果加上型號,就一定得知設備種類。像hp不一定只賣印表機,但加上laserjet就是
* 討論各自工作
* 進程
>寄信:找老師
>資料庫
* 各自工作
>潘:
>曾:ip js更改 + shodan更新新帳號
## 問題討論
1. 最後是要用nmap還是censys,shoden,zoomeye
說明:
老師信裡面說最終要用nmap實做,所以是指單用nmap找資料,還是把nmap合併shodan之類的偵查引擎找資料
2. 需不需要弱點驗證
說明:
需不需要把老師幾天前要我們做的弱點驗證內容放到我們iotscanner系統裡面嗎,還是只要判斷型號找出可能的弱點就夠了?
3. 需不需要分兩個掃ip方式
說明:
需不需要分兩個掃ip方式,一個是我們現在做的即時判斷,直接去偵查引擎找資料,另一個是非即時判斷,把偵查出來的資料寫入db裡。
4. 弱點驗證優先還是db優先
5. 網頁部份如何改進
6. 今後方向,還有哪裡需要加強
7. 如何增加設備數量(設備特徵)
8. 比賽有什麼需要注意的重點
說明:
比賽有什麼需要注意的重點,像評審在意哪方面的重點,可以讓我們系統展示更有特色
1.最終要用nmap改進,其他api可以留下(zmap)
2.chrone table
3.網頁頁面直接顯示搜尋結果,加上更新按鈕和手動增加設備
4.先做資料庫->做增加減少->更新按鈕->CVE檢測
5.新增CVE檢測功能(手動跟自動)(是否驗證過)(自動顯示存在的漏洞)
6.比賽遇到的問題:第一次進入要掃描,但是如果要當場掃其他Domain怎麼辦?要建立新的資料庫,舊的不要砍掉(下拉選項可以選擇subnet)
資料庫設計:已有的做更新、未有的做新增
* 建議:
1. 增加功能:手動加物聯網設備(給使用者手動加入)
2. 獨立設定(portable:cry:)
3. ip建立config分類
4. 搜尋問題 (tokenize)
5. auto pentest :排程、手動、每日結果
多花時間做完????
培養資安能力????
找工作有優勢????
以後影響很大????
中科院提計畫?下學期通過有錢拿!!!!!!!!!!!!!
挖糙 仁宏好罩!!!!!!!!!!!!!!!!!!!!!!!!!!
乾那鬼
甘迺迪
6. tokenize(word separate) whitespace嗎?
7. NVD可以參考
我們不是用cve detail嗎 用廠牌分類的吧
cve :+1: cvee :-1:
弱點驗證用mataexploit現有的 沒有再說 不要理他
metasploit automate
我覺得即時性的話只提供掃單一ip就好,網段查資料庫,網段太久,除非使用者要求。
一鍵駭入 :laughing:
恩恩好像是...吧
往段感覺不太需要及時欸 就昨天講的那樣
網頁即時性or not問題 : 我覺得聽起來像是都是預先掃完 給使用者加入就好欸 不太需要再做即時性的更新
:100:
應該是指說我們CVEdetail的東西要去判斷CVE是不是真的有這方面的問題 沒有的話就不算是(無法驗證)
提供不同的資料庫給予使用這查詢
:panda_face:
感覺差不多ㄌ? :call_me_hand: :yum: :angel:
老師今天好慈祥 :angel:
work
1. DB(finish)
2. ip分類表建立config檔
3. 手動加物聯網設備(給使用者手動加入)
4. 弱點驗證(finish)
5. ...
### 07/13
db資料寫進網頁
* site網頁
* ip網頁
* home網頁
### 大端院校競賽
初賽
deadline 08/13 23:59
書面資料 10頁
注意事項
1. 禁止任何學校系所標誌、教授姓名等等
2. 同時入圍競賽決賽,需放棄其他競賽資格

#### 企劃書
1. 動機
2. background(運用哪些技術、api)
3. 系統簡介
#### 需求書
1. 使用案例
2. 功能需求
使用案例說明
>讓評審快速檢查自己的系統
功能需求
>案例說明+功能需求配對
非功能需求
1. 穩定性
2. 速度
功能需求
1. 前端
2. 後端
3. api
決賽
中央大學
### 0727
需求書(碩哥、曾狗)
企劃書(豪、潘哥)
deadline: 0802
### 0803
數目
我們的 nas 148 router 35 printer 26 camera 13
shodan nas 94 router 31 printer 20 camera 11
censys nas 58 router 14 printer 12 camera 5
找cve
弱點驗證
1. ip分類表建立config檔
2. 手動加物聯網設備(給使用者手動加入)
3. nmap找ip資訊(cve)
1. 弱點驗證
2. 完整api
3. 提供其他客製化服務
- 位置與ip對應表
- 手動新增物聯網設備
### 0806
1. 新增單一IOT設備進資料庫
2. 弱點驗證的網頁
3. 輸入型號找出設備
4. 即時搜索設備並匯入資料庫
5. nmap 搜索出CVE
printer
cve CVE-2017-2741
221個 ip
###
代學生證、切結書
----
## 修正 12/13(一) 金桔學苑12:30
豪:debug
豪:exploit.py demo
豪:msf
清大:全部做完
清大推甄仔:mysql table 說明
成大仔:nginx 設定檔案
成大仔:http/https
demo圖
他沒開這個 沒事
### mysql說明
1. db create + use db


2. table create
```=py
create table ip(
ip char(20),
os char(50),
site char(20),
session text,
product_model char(50),
device_type char(50),
primary key (ip)
);
create table cvee(
cvee_ip char(20),
cvee_id char(50),
description text,
cvss float,
primary key (cvee_id),
foreign key (cvee_ip) references ip(ip) on delete cascade on update cascade
);
create table port(
port_ip char(20),
port int,
foreign key (port_ip) references ip(ip) on delete cascade on update cascade
);
```
## [這支手機講話聽得到](https://www.apple.com/tw/iphone-13/)
--------------------------------
-------------------------
確保學姊開心 大家放心
---
哇 體貼 再一起 再一起 在一起
哭啊 獎三小
---
# crontab
```script=
sudo crontab -e //進入編輯介面
```
加入排程指令
```script=
# m d dom mon dow command
59 23 * * * php /var/www/html/ccu_proj_manyPorts/www/update.php
```
# nginx
# exploit