SlideShare a Scribd company logo
1 of 108
Download to read offline
Securing and Hacking
LINE OA Integration
ฉบับ สอนแฮกเว็บแบบแมว ๆ
For Educational Purposes Only
Responsible: Mr. Pichaya Morimoto
Version (Date): 1.0 (2023-06-10)
Confidentiality class: Public
บจก.สยามถนัดแฮก
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
2
# whoami
Pichaya (LongCat) Morimoto
ที่ปรึกษาด้านความมั่นคงปลอดภัยฯ
บริษัท สยามถนัดแฮก จํากัด
ความเชี่ยวชาญ
Penetration Testing (Pentest)
อื่น ๆ
- (อดีต) ผู้ดูแลเพจ สอนแฮกเว็บแบบแมวๆ
- หนึ่งในผู้ดูแลกลุ่ม 2600 Thailand
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
3
# whoami
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
4
Disclaimer
- จุดประสงค์ของ Session นี้เพื่อแบ่งปันความรู้ ทางด ้านความปลอดภัยระบบสารสนเทศ
ไม่สนับสนุนการนําความรู้ทางด ้านความปลอดภัยฯ ไปใช ้ในทางที่ผิดกฎหมายทั้งหมด
- ตัวอย่างโค ้ด และรูปใน Session นี้ เป็นระบบจําลอง ไม่ใช่ระบบลูกค ้า และไม่ใช่ระบบจริงคนอื่น
- ทาง บจก. สยามถนัดแฮก (STH) ต ้องขอบคุณลูกค ้าทุกท่าน
ที่ไว ้วางใจให ้ทาง STH ทดสอบเจาะระบบ LINE OA รวมถึงระบบต่าง ๆ
และได ้นําความรู้ที่ได ้ทําและศึกษาเพิ่มเติมมาแบ่งปันในวันนี้
- ถ ้าหาก บริษัทใด สนใจใช ้บริการ ทดสอบเจาะระบบ Network, Web, Mobile
หรือแม ้แต่ ระบบ LINE OA ของตนเองสามารถติดต่อทาง STH ได ้เลย :)
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
1. MSN Messenger
- Potential Threats
- Client, Server, User
- Emoji DoS Attack
2. LINE Messenger
- LINE (Personal)
- Potential Threats
- LINE (Business - LINE OA)
3. LINE OA Integration Architecture
- Messaging API
- WebHook
- LINE Front-end Framework (LIFF)
- WebView
Overview
บจก.สยามถนัดแฮก
5
4. Attack Surface
a. LINE Message & WebHook
b. LINE Messaging API & SDK
c. LINE LIFF & SDK
d. App Specific
5. LINE OA Attack Scenarios
-> Securing Side <-
6. Securing LINE OA Integration
a. Apply OWASP Top 10 Defenses
b. Validate LINE User Access Token
c. Secure Secret Management
d. WebHook Signature Validation
e. Network-Level Access Control
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
5. LINE OA Attack Scenarios
- Injection via LINE Message
- Unprotected Web Hook
- API Key Leakage
- Vulns in App Specific
- Use LINE User ID as Credential
- Cross-Channel Access Token
Overview
บจก.สยามถนัดแฮก
6
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
1. MSN Messenger
- Potential Threats
- Client, Server, User
- Emoji DoS Attack
2. LINE Messenger
- LINE (Personal)
- Potential Threats
- LINE (Business - LINE OA)
3. LINE OA Integration Architecture
- Messaging API
- WebHook
- LINE Front-end Framework (LIFF)
- WebView
Overview
บจก.สยามถนัดแฮก
7
4. Attack Surface
a. LINE Message & WebHook
b. LINE Messaging API & SDK
c. LINE LIFF & SDK
d. App Specific
5. LINE OA Attack Scenarios
-> Securing Side <-
6. Securing LINE OA Integration
a. Apply OWASP Top 10 Defenses
b. Validate LINE User Access Token
c. Secure Secret Management
d. WebHook Signature Validation
e. Network-Level Access Control
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
8
ที่มา: https://www.youtube.com/watch?v=T322TDmOKJI
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
9
ที่มา: CREATIVE TALK
https://www.blockdit.com/posts/64367935353e45142bde5bd8
ที่มา: วัยรุนยุค90
https://www.facebook.com/90teenager/photos/a.350347115140971/1998634730312193/?type=3
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
10
MSN Messenger
ที่มา: https://www.her.ie/life/types-of-msn-conversations-we-all-had-283931
Alice
Bob
- สมัคร บัญชี
- เข ้าสู่ระบบ
- เพิ่มผู้ติดต่อ
- สนทนากันด ้วย
ข ้อความ/เสียง
- ส่งไฟล์
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
11
MSN Messenger - Potential Threats
MSN
Messenger
MSN
Messenger
MSN Server
Client A Client B
- Remote
- Local
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
12
MSN Messenger - Potential Threats
MSN
Messenger
MSN
Messenger
MSN Server
Client A Client B
ที่มา: https://www.csoonline.com/article/2222257/microsoft-patches-hotmail-after-0-day-remote-password-reset-exploited-in-the-wild.html,
https://twitter.com/msftsecresponse/status/195568235654021121
แฮกเกอรรับจาง
20 USD (700 บาท)
สามารถ แฮกบัญชี
Hotmail ใครก็ได
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
13
MSN Messenger -
Potential Threats
ที่มา: https://twitter.com/msftsecresponse/status/195568235654021121,
https://www.youtube.com/watch?v=INq6CirLgt0, https://www.youtube.com/watch?v=juzniDuLISg
HTTP Parameter Tampering
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
14
MSN Messenger - Potential Threats
MSN
Messenger
MSN
Messenger
MSN Server
Client A Client B
Server-Side
Vulnerability
แฮกเกอรรับจาง
20 USD (700 บาท)
สามารถ แฮกบัญชี
Hotmail ใครก็ได
User Error
ถูก Phishing หลอก
เอารหัสผาน หรือถูก
หลอกติดตั้งไฟล
Malware
Client /
Client-Side
Vulnerability
บจก.สยามถนัดแฮก
15
My MSN (Script Kiddy) Exploit
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
16
MSN Messenger
Alice
Bob
- สามารถส่ง Emoji
หากันและกันได ้
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
17
MSN Messenger
Bob
- สามารถส่ง Emoji
หากันและกันได ้
- แต่ละ Emoji จะ
สามารถส่งด ้วยตัว
อักษรแทนได ้
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
18
MSN Messenger
:'(
ตัวอักษร Emoji
พิมพ์
จะได ้
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
19
MSN Messenger
:'(
Emoji ตัวอักษร
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
20
MSN Messenger
Attacker
:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(
:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(
:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(
:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(
:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(
TEXT in MSN
RAM = 2 GB
Victim
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
21
MSN Messenger
Attacker Victim
Emojis in MSN
RAM => 8 GB
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
22
MSN Messenger
Attacker Victim
Emojis in MSN
RAM => 8 GB
TEXT in MSN
RAM = 2 GB
ที่มา:
https://www.polygon.com/2014/7/7/5876983/how-to-play-street
-fighter-fighting-game-primer
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
23
MSN Messenger
Emojis in MSN
RAM => 8 GB
(ส่วนมากเหยื่อค ้างตั้งแต่ยังไม่ทัน
เห็นว่าถูกส่ง Emoji มาด ้วยซํ้า)
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
1. MSN Messenger
- Potential Threats
- Client, Server, User
- Emoji DoS Attack
2. LINE Messenger
- LINE (Personal)
- Potential Threats
- LINE (Business - LINE OA)
3. LINE OA Integration Architecture
- Messaging API
- WebHook
- LINE Front-end Framework (LIFF)
- WebView
Overview
บจก.สยามถนัดแฮก
24
4. Attack Surface
a. LINE Message & WebHook
b. LINE Messaging API & SDK
c. LINE LIFF & SDK
d. App Specific
5. LINE OA Attack Scenarios
-> Securing Side <-
6. Securing LINE OA Integration
a. Apply OWASP Top 10 Defenses
b. Validate LINE User Access Token
c. Secure Secret Management
d. WebHook Signature Validation
e. Network-Level Access Control
บจก.สยามถนัดแฮก
25
Fast Forward 10 years to LINE
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE (Personal)
26
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE (Personal)
27
Alice
Bob
- สมัคร บัญชี
- เข ้าสู่ระบบ
- เพิ่มผู้ติดต่อ
- สนทนากันด ้วย
ข ้อความ/เสียง
- ส่งไฟล์
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE (Personal) -
Potential Threat
28
LINE
Application
LINE
Application
LINE Server
Client A Client B
Server-Side
Vulnerability
User Error
Client /
Client-Side
Vulnerability
บจก.สยามถนัดแฮก
29
What is quite new here?
10 Years
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE (Business)
30
ลูกคา
Eve
Agent
Bob
Agent
Alice
- บัญชีธุรกิจ
(LINE OA)
- มี Agent หลายคน
ช่วยกันตอบ Chat ได ้
- ตอบด ้วย Bot ได ้
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE (Business)
31
Notice a major difference between left
and right chat rooms.
LINE Official Account (OA)
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE (Business)
32
ไม่ยืนยัน ยืนยัน พรีเมี่ยม
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE OA
33
LINE Official Account (OA)
ไม่ยืนยัน ยืนยัน พรีเมี่ยม
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE OA
34
ที่มา: https://www.scb.co.th/th/personal-banking/stories/tips-for-you/fake-line-connect.html
ไม่ยืนยัน ยืนยัน พรีเมี่ยม
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE OA - Apps
35
แอป Official Account
(แยกจาก LINE) เว็บ LINE OA Manager
(แยกจาก LINE)
- สําหรับฝั่ง Operation
(Agent)
- ตอบ Chat ลูกค ้า
- Bot ตอบ
- คนตอบ
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
LINE Official Account (OA) for Developers
36
เว็บ LINE OA Manager เว็บ LINE Developers
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
ตัวอย่าง LINE OA
37
ที่มา: https://linedevth.line.me/th/case-study
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
1. MSN Messenger
- Potential Threats
- Client, Server, User
- Emoji DoS Attack
2. LINE Messenger
- LINE (Personal)
- Potential Threats
- LINE (Business - LINE OA)
3. LINE OA Integration Architecture
- Messaging API
- WebHook
- LINE Front-end Framework (LIFF)
- WebView
Overview
บจก.สยามถนัดแฮก
38
4. Attack Surface
a. LINE Message & WebHook
b. LINE Messaging API & SDK
c. LINE LIFF & SDK
d. App Specific
5. LINE OA Attack Scenarios
-> Securing Side <-
6. Securing LINE OA Integration
a. Apply OWASP Top 10 Defenses
b. Validate LINE User Access Token
c. Secure Secret Management
d. WebHook Signature Validation
e. Network-Level Access Control
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
39
Siam Don Hack Bank (SDH)
A fictional organization.
https://www.facebook.com/sdhbank/
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
40
LINE OA Integration Architecture (High-Level)
User
LINE App
Message
SDH
Web API
SDH Web
Application
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
41
LINE Official Account (OA) for Developers
ที่มา: https://developers.line.biz/en/
- Messaging API
- LINE Login
- LINE Front-end
Framework (LIFF)
- LINE Things
- LINE MINI App
- LINE Pay
- LINE Notify
- Blockchain Service
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
42
LINE OA Integration Architecture
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
LIFF SDK
LIFF API,
LINE Login
Web API
SDH Bank
Back-Office
Web Application
WebView
Msg. API SDK
Get
User Info
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
43
LINE OA Integration Architecture
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
LIFF SDK
LIFF API,
LINE Login
Web API
SDH Bank
Back-Office
Web Application
WebView
Msg. API SDK
Get
User Info
1
2
3
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
44
LINE OA Integration Architecture
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
LIFF SDK
LIFF API,
LINE Login
Web API
SDH Bank
Back-Office
Web Application
WebView
Msg. API SDK
Get
User Info
1
2
3
4
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
45
LINE OA Integration Architecture
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
LIFF SDK
LIFF API,
LINE Login
Web API
SDH Bank
Back-Office
Web Application
WebView
Msg. API SDK
Get
User Info
Messaging
API
1
LIFF
2
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
46
LINE Official Account (OA) for Developers
1. Messaging API
- LINE BOT
- WebHook
- Messaging API SDK
2. LINE Front-end Framework (LIFF)
- LINE URL Scheme
- WebView
- LINE Login
- LIFF SDK
Messaging API LIFF
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
47
LINE OA - LINE User ID
ที่มา: https://developers.line.biz/en/docs/messaging-api/getting-user-ids/#what-is-user-id
- User ID (UID) เป็นค่า ที่ระบบที่มาต่อ
กับไลน์ใช ้อ ้างอิงผู้ใช ้งาน แต่ละคน
- ผู้ใช ้งานคนเดียวกัน แต่ใช ้แอปใน LINE
OA ต่างกันฝั่งระบบของแต่ละบัญชี LINE
OA จะได ้UID ผู้ใช ้งานคนเดียวกันคนละ
ค่ากัน เช่น
LINE User UID แอปใน LINE OA
นาย A 1111 แอป X
นาย A 2222 แอป Y
นาย B 3333 แอป X
นาย B 4444 แอป Y
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
48
1 - Messaging API
แบบสรุปเข ้าใจง่าย ๆ มันคือ Chat BOT, ต่อกับ API ภายนอก LINE ได ้
1
2
3
- Reply
- Push
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
49
1 - Messaging API - WebHook
1 - ฝง LINE
2 - ฝงคนเอา
ระบบมาตอ
WebHook
URL
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
50
1 - Messaging API - WebHook
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
51
2 - LINE Front-end Framework (LIFF)
ที่มา: https://www.collinsdictionary.com/dictionary/english/lift
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
52
2 - LINE Front-end Framework (LIFF)
เว็บที่ทํางานผ่านห ้อง Chat ใน LINE และอ่านข ้อมูล Profile ผู้ใช ้งาน LINE
เข ้ามาในเว็บได ้(แต่ผู้ใช ้งานต ้องกดยินยอมก่อน) เรียกว่า LIFF App
หน้าเว็บจะมี แสดงได ้3 แบบตามความสูงในห ้อง Chat
- Full
- Tall
- Compact
เบื้องหลังคือใช ้
- LIFF SDK
(JavaScript)
- LINE Login
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
53
2 - LINE Front-end Framework (LIFF)
ที่มา: https://linedevth.line.me/th/liff
- ทําให ้เปิดเว็บ (WebView) ใน LINE OA ได ้
- เรียกว่า LIFF App
- ใช ้LINE Login ไปอ่านค่า User Profile ได ้
- ชื่อ (Display Name)
- URL ของรูป Profile
- ข ้อความสถานะ (Status Message)
- อีเมล ** (ต ้องขอ OAuth Scope เพิ่ม,
เพิ่มรายการขอใน Consent ตอน Login)
- Access Token, User ID
- ส่งข ้อความกลับมาที่ห ้อง Chat
(Share Target Picker)
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
54
2 - LINE Front-end Framework (LIFF)
1
2
3
4
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
55
2 - LINE LIFF - LINE URL Scheme
เป็นลิงก์ที่กดใน Chat แล ้วจะเปิด LIFF App
- https://liff.line.me/{liffId} <- ปัจจุบันแนะนําอันนี้
- https://line.me/R/{liffId}
- line://{liffId} (Deprecated - LINE ไม่แนะนําให ้ใช ้แล ้ว, แต่ยังกดได ้อยู่)
ที่มา: https://developers.line.biz/en/docs/messaging-api/using-line-url-scheme/
ที่มา: https://linedevth.line.me/th/liff
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
56
2 - LINE Login
- User Consent
OAuth 2 / OIDC Scope:
- profile (ค่าเริ่มต ้นมีเฉพาะ profile)
- chat_message.write
- email
- openid https://liff.line.me/{liffId}
1
2
3
4
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
1. MSN Messenger
- Potential Threats
- Client, Server, User
- Emoji DoS Attack
2. LINE Messenger
- LINE (Personal)
- Potential Threats
- LINE (Business - LINE OA)
3. LINE OA Integration Architecture
- Messaging API
- WebHook
- LINE Front-end Framework (LIFF)
- WebView
Overview
บจก.สยามถนัดแฮก
57
4. Attack Surface
a. LINE Message & WebHook
b. LINE Messaging API & SDK
c. LINE LIFF & SDK
d. App Specific
5. LINE OA Attack Scenarios
-> Securing Side <-
6. Securing LINE OA Integration
a. Apply OWASP Top 10 Defenses
b. Validate LINE User Access Token
c. Secure Secret Management
d. WebHook Signature Validation
e. Network-Level Access Control
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
58
Attack Surface (?)
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
1
5.2 Web API
2
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
59
Attack Surface (!!)
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
1
2
5.2 Web API
5
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
3
4
5.1
WebView
5.3
3.1 API SDK
- (บัญชีไลน์ถูกแฮก ?)
- 1+2 LINE Message
& API for WebHook
- 3 LINE Messaging API & SDK
- 4 LINE LIFF & SDK
- 5 App Specific
- WebView for LIFF
- Web API for WebView
- Back-Office Web
Application
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
60
[1] LINE Message -> [2] API for WebHook
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
1
2
5.2 Web API
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
61
[1] LINE Message -> [2] API for WebHook
User
1+2 LINE Message
& API for WebHook
SDH API
Server
API for
WebHook
Attacker
Attack
Payload
Attack
Payload
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
62
[1] LINE Message -> [2] API for WebHook
User
1+2 LINE Message
& API for WebHook
SDH API
Server
API for
WebHook
Attack
Payload
Attacker
- No HMAC check, or
- HMAC Key is leaked
(Channel secret)
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
63
[3] LINE Messaging API & SDK
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
5.2 Web API
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
3
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
64
[3] LINE Messaging API & SDK
3 LINE Messaging API & SDK
LINE
Platform
SDH API
Server
3.2 Get
User Info
3.1 API SDK
Attacker
Attack
Payload
+ Channel
Access Token
Get
User Info
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
65
[4] LINE LIFF API & SDK
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
5.2 Web API
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
4
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
66
[4] LINE LIFF API & SDK
4 LINE LIFF API & SDK
LINE
Platform
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login SDH Web
Application
Attacker
Attack
Payload
+ Victim’s
Access Token
+ Victim
Profile Info
Attack
Payload
Get Victim’s
Profile Info
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
67
[5] App Specific - WebView, Web API, Apps
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
5.2 Web API
5
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
68
[5] App Specific - WebView, Web API, Apps
5 App Specific
- WebView for LIFF
- Web API for WebView
- Back-Office Web Application
SDH API
Server
SDH Web
Application
SDH
Database
5.2 Web API
SDH Bank
Back-Office
Web Application
5.1
WebView
5.3
Attacker
Attack
Payload
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
69
(Incomplete) Defender’s Point of View
User
LINE App
Message
SDH
Web API
SDH Web
Application
1
2
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
70
Attacker’s Point of View
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
1
2
5.2 Web API
5
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
3
4
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
Topic/Theme: LINE OA Integration
-> Hacking Side <-
1. MSN Messenger
- Potential Threats
- Client, Server, User
- Emoji DoS Attack
2. LINE Messenger
- LINE (Personal)
- Potential Threats
- LINE (Business - LINE OA)
3. LINE OA Integration Architecture
- Messaging API
- WebHook
- LINE Front-end Framework (LIFF)
- WebView
Overview
บจก.สยามถนัดแฮก
71
4. Attack Surface
a. LINE Message & WebHook
b. LINE Messaging API & SDK
c. LINE LIFF & SDK
d. App Specific
5. LINE OA Attack Scenarios
-> Securing Side <-
6. Securing LINE OA Integration
a. Apply OWASP Top 10 Defenses
b. Validate LINE User Access Token
c. Secure Secret Management
d. WebHook Signature Validation
e. Network-Level Access Control
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
72
LINE OA (Common) Attack Scenarios
LINE Platform for LINE OA is pretty secure,
the issues occur from wrong implementations.
1. Injection via LINE Message
2. Unprotected Web Hook
3. API Key Leakage
4. Vulns in App Specific
4.1 Use LINE User ID as Credential
4.2 Cross-Channel Access Token
4.3 Broken Access Control (Back Office)
5. Attacks on LINE Platforms
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
73
1 - Injection via LINE Message
Web API for WebHook
LINE App
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
74
1 - Injection via LINE Message
- รับข ้อความจาก Chat
- ส่งต่อไป API ของ
WebHook
ดีจ ้า
ดีจ ้า
2
1
ดีจ ้า
3
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
75
1 - Injection via LINE Message
5
6
7
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
76
1 - Injection via LINE Message
SQL Injection:
!show ' and 1>2 union select sqlite_version()--
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
1 - Injection via LINE Message
Solution:
All input is evil, until proven otherwise,
So apply standard API security protections
on the API endpoints for WebHook.
- Parameterized Query
- Input Validation
- Authentication/Authorization Check
- Secure server configuration
- …
ที่มา:
https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
78
2 - Unprotected Web Hook
Web API for WebHook
LINE App
Attack
Payload
Attacker
Attack Prerequisites:
- No HMAC check, or
- Channel secret is leaked
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
79
2 - Unprotected Web Hook
ที่มา: https://developers.line.biz/en/docs/messaging-api/receiving-messages/
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
80
2 - Unprotected Web Hook
LINE User ID
Data
Victim’s info
Or actions
Impact:
- Impersonate victim’s identity
- Call unauthorized functions
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
81
Protect LINE Web Hook: x-line-signature
ที่มา: https://developers.line.biz/en/docs/partner-docs/development-guidelines/#webhook-and-auto-reply-settings
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
82
Protect LINE Web Hook: x-line-signature
ที่มา: https://developers.line.biz/en/docs/partner-docs/development-guidelines/#webhook-and-auto-reply-settings
HMAC SHA-256 ( JSON Body,
Channel Secret )
-> Base 64 Encode -> x-line-signature
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
83
Protect LINE Web Hook: x-line-signature
ที่มา: https://medium.com/linedevth/x-line-signature-ตัวชวยจาก-line-ที่จะชวยยกระดับความปลอดภัยใหกับ-webhook-ของคุณ-7a94d9548f34
อ่านฉบับภาษา
ไทยเพิ่มเติม
ได ้ที่…
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
84
Protect LINE Web Hook: IP Allowlisting
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
5.2 Web API
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
3
5.1
WebView
5.3
3.1 API SDK
2
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
85
Protect LINE Web Hook: IP Allowlisting
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
86
3 - API Key Leakage
Common places:
- Verbose error messages
- Publicly available source
code repositories
- Mobile client
- Client-side HTML, CSS, and
JavaScript files
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
87
3 - API Key Leakage
- Verbose error messages
"channel_secret":
"xxxxxxxx"
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
88
3 - API Key Leakage
- Publicly available source code repositories
"channel_secret":
"xxxxxxxx"
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
89
3 - API Key Leakage
- Client-side HTML, CSS, and JavaScript files
"channel_secret":
"xxxxxxxx"
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
90
3 - API Key Leakage
"channel_secret":
"xxxxxxxx"
Attacker
Attack
Payload
สร ้าง x-line-signature
ยิงเข ้า API สําหรับ
WebHook เองได ้
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
91
3 - API Key Leakage
Solution:
- No hard-coded secrets in client side
- No secret in code repo
- Use .gitignore for .env and config files
- Inject secrets in environment variables
- Secret Vault
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
92
Attacker’s Point of View
User
LINE App
LINE
Platform
LINE OA Web
Portal (Dev)
Configure
SDH API
Server
WebHook
Message
SDH Web
Application
SDH
Database
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
1
2
5.2 Web API
5
3.2 Get
User Info
SDH Bank
Back-Office
Web Application
3
4
5.1
WebView
5.3
3.1 API SDK
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
93
4.1 Use LINE User ID as Credential
Victim
LINE App
LINE
Platform
SDH Web
Application
4.1 LIFF SDK
4.2 LIFF API,
4.3 LINE Login
UID=1337
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
94
4.1 Use LINE User ID as Credential
Victim
LINE App
SDH Web
Application
SDH
Database
UID=1337
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
95
4.1 Use LINE User ID as Credential
Victim
LINE App
SDH Web
Application
SDH
Database
UID=1337
https://api.sth.sh/api/get
UserById=1337
Attack
Payload
- แอปอาจจะเผลอตอบ UID ของผู้ใช ้
งานคนอื่นออกมาจากฟังก์ชันการใช ้
งานปกติ
- ถ ้าเช็ค AuthN ด ้วย LINE UID = แตก
Attacker
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
96
4.1 Use LINE User ID as Credential
ที่มา:
https://developers.line.biz/en/docs/liff/using-user-profile/#use-u
ser-info-in-liff-app
- อย่าเชื่อค่า User Profile
ที่ส่งจาก LIFF App (ฝั่ง Client Side)
ยิงกลับมาหา App Server
ข ้อมูลพวกนี้ใช ้เฉพาะโชว์ใน UI
- ถ ้าจะเก็บให ้เอา Access Token ไปขอ
User Profile กับ LINE Platform
แล ้วยิงกลับมาเก็บเป็น แบบ
Server-to-Server API
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
97
4.1 Use LINE User ID as Credential
ที่มา: https://medium.com/linedevth/ระวัง-คุณยังสง-user-id-จาก-frontend-ไป-backend-อยูหรือไม-7b38bfb9efd2
อ่านฉบับภาษา
ไทยเพิ่มเติม
ได ้ที่…
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
98
4.2 Cross-Channel Access Token
Victim
Real SDH Bank
Web Application
Fake SDH Web
Application
@sdhbank
Attacker’s LINE OA Account
@sdhbank888
Attacker
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
99
4.2 Cross-Channel Access Token
Victim
Real SDH Bank
Web Application
Fake SDH Web
Application
Send Fake SDH
Bank LINE OA
Account
@sdhbank888
Attacker’s LINE OA Account
@sdhbank888
Attacker
1
2
@sdhbank
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
100
4.2 Cross-Channel Access Token
Victim
Real SDH Bank
Web Application
Fake SDH Web
Application
Send Fake SDH
Bank LINE OA
Account
@sdhbank888
Attacker’s LINE OA Account
@sdhbank888
Attacker
LINE
Platform
1
2
3
4
LINE Login
Victim
Login
Victim’s Access Token
@sdhbank
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
101
4.2 Cross-Channel Access Token
Victim
Real SDH Bank
Web Application
Fake SDH Web
Application
Send Fake SDH
Bank LINE OA
Account
@sdhbank888
Attacker’s LINE OA Account
@sdhbank888
Attacker
LINE
Platform
1
2
3
4
LINE Login
Victim
Login
Victim’s Access Token
Victim’s Access Token
5
Get Profile w/ Victim’s Access
Token, but not verify client_id
(Chanel ID)
6
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
102
4.2 Cross-Channel Access Token
Victim
Real SDH Bank
Web Application
Fake SDH Web
Application
Send Fake SDH
Bank LINE OA
Account
@sdhbank888
Attacker’s LINE OA Account
@sdhbank888
Attacker
LINE
Platform
1
2
3
4
LINE Login
Victim
Login
Victim’s Access Token
Victim’s Access Token
5
Get victim’s identity
on SDH Bank Web App
Get Profile w/ Victim’s Access
Token, but not verify client_id
(Chanel ID)
6
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
103
4.2 Cross-Channel
Access Token
ที่มา:
https://developers.line.biz/en/docs/liff/using-user-profile/#sending-access-token
- ต ้องเอา Access Token ไป
ตรวจสอบ client_id ก่อนใช ้
- อย่าเชื่อค่า User Profile
จาก LIFF App ส่งมา, ต ้อง
เชื่อจาก LINE Platform
(Server-to-Server API)
เท่านั้น
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
104
4.2 Cross-Channel
Access Token
ที่มา: https://developers.line.biz/en/reference/line-login/
https://api.line.me/oauth2/v2.1/verif
y?access_token=eyJhbGciOiJIUzI1
NiJ9.UnQ_o-GP0VtnwDjbK0C8E_
NvK...
{
"scope": "profile",
"client_id": "1440057261",
"expires_in": 2591659
}
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
105
LINE Login Security
ที่มา: https://developers.line.biz/en/docs/line-login/secure-login-process/#using-access-tokens
- อย่าเชื่อค่า User Profile
จาก User ส่งมา, ต ้องเชื่อ
จาก LINE Platform
(Server-to-Server API)
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
106
LINE Login Security
ที่มา: https://developers.line.biz/en/docs/line-login/secure-login-process/#using-access-tokens
- อย่าเชื่อค่า User Profile
จาก User ส่งมา, ต ้องเชื่อ
จาก LINE Platform
(Server-to-Server API)
Attacker
บจก.สยามถนัดแฮก
Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10)
Confidentiality class: Public
107
LINE Login Security
ที่มา:
https://developers.line.biz/en/docs/line-login/integrate-line-login/#receiving-the-authorization-code
- อย่าเชื่อค่า User Profile
จาก User ส่งมา, ต ้องเชื่อ
จาก LINE Platform
(Server-to-Server API)
We offer Pentest Service ❤
Contact us 👇
Email: pentest@sth.sh
LINE: @siamthanathack
บจก.สยามถนัดแฮก

More Related Content

What's hot

Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappshacktivity
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...CODE BLUE
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.Mikhail Egorov
 
A story of the passive aggressive sysadmin of AEM
A story of the passive aggressive sysadmin of AEMA story of the passive aggressive sysadmin of AEM
A story of the passive aggressive sysadmin of AEMFrans Rosén
 
OWASP Top 10 2021 What's New
OWASP Top 10 2021 What's NewOWASP Top 10 2021 What's New
OWASP Top 10 2021 What's NewMichael Furman
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration Tariq Islam
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesAbraham Aranguren
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesSoftware Guru
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing ReportAman Srivastava
 
Time based CAPTCHA protected SQL injection through SOAP-webservice
Time based CAPTCHA protected SQL injection through SOAP-webserviceTime based CAPTCHA protected SQL injection through SOAP-webservice
Time based CAPTCHA protected SQL injection through SOAP-webserviceFrans Rosén
 
API Security : Patterns and Practices
API Security : Patterns and PracticesAPI Security : Patterns and Practices
API Security : Patterns and PracticesPrabath Siriwardena
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...Noppadol Songsakaew
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by defaultSecuRing
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityMohammed Fazuluddin
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Understanding Active Directory Enumeration
Understanding Active Directory EnumerationUnderstanding Active Directory Enumeration
Understanding Active Directory EnumerationDaniel López Jiménez
 
Web Application Security Testing
Web Application Security TestingWeb Application Security Testing
Web Application Security TestingMarco Morana
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksRaghav Bisht
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingAnurag Srivastava
 

What's hot (20)

Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
 
A story of the passive aggressive sysadmin of AEM
A story of the passive aggressive sysadmin of AEMA story of the passive aggressive sysadmin of AEM
A story of the passive aggressive sysadmin of AEM
 
OWASP Top 10 2021 What's New
OWASP Top 10 2021 What's NewOWASP Top 10 2021 What's New
OWASP Top 10 2021 What's New
 
HTTP Security Headers
HTTP Security HeadersHTTP Security Headers
HTTP Security Headers
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing Report
 
Time based CAPTCHA protected SQL injection through SOAP-webservice
Time based CAPTCHA protected SQL injection through SOAP-webserviceTime based CAPTCHA protected SQL injection through SOAP-webservice
Time based CAPTCHA protected SQL injection through SOAP-webservice
 
API Security : Patterns and Practices
API Security : Patterns and PracticesAPI Security : Patterns and Practices
API Security : Patterns and Practices
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Understanding Active Directory Enumeration
Understanding Active Directory EnumerationUnderstanding Active Directory Enumeration
Understanding Active Directory Enumeration
 
Web Application Security Testing
Web Application Security TestingWeb Application Security Testing
Web Application Security Testing
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 

Similar to Securing and Hacking LINE OA Integration

ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...
ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...
ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...Pichaya Morimoto
 
Web Hacking with Object Deserialization
Web Hacking with Object DeserializationWeb Hacking with Object Deserialization
Web Hacking with Object DeserializationPichaya Morimoto
 
Privacy, Confidentiality & Security (April 28, 2018)
Privacy, Confidentiality & Security (April 28, 2018)Privacy, Confidentiality & Security (April 28, 2018)
Privacy, Confidentiality & Security (April 28, 2018)Nawanan Theera-Ampornpunt
 
Health Information Privacy and Security (March 30, 2016)
Health Information Privacy and Security (March 30, 2016)Health Information Privacy and Security (March 30, 2016)
Health Information Privacy and Security (March 30, 2016)Nawanan Theera-Ampornpunt
 
Health Information Privacy and Security Management
Health Information Privacy and Security ManagementHealth Information Privacy and Security Management
Health Information Privacy and Security ManagementNawanan Theera-Ampornpunt
 
Exploiting Blind Vulnerabilities
Exploiting Blind VulnerabilitiesExploiting Blind Vulnerabilities
Exploiting Blind VulnerabilitiesPichaya Morimoto
 
Health Information Privacy and Security (October 7, 2018)
Health Information Privacy and Security (October 7, 2018)Health Information Privacy and Security (October 7, 2018)
Health Information Privacy and Security (October 7, 2018)Nawanan Theera-Ampornpunt
 
Health Information Privacy and Security (August 3, 2019)
Health Information Privacy and Security (August 3, 2019)Health Information Privacy and Security (August 3, 2019)
Health Information Privacy and Security (August 3, 2019)Nawanan Theera-Ampornpunt
 
Health Information Privacy and Security (September 13, 2020)
Health Information Privacy and Security (September 13, 2020)Health Information Privacy and Security (September 13, 2020)
Health Information Privacy and Security (September 13, 2020)Nawanan Theera-Ampornpunt
 
Health Information Privacy and Security (August 28, 2021)
Health Information Privacy and Security (August 28, 2021)Health Information Privacy and Security (August 28, 2021)
Health Information Privacy and Security (August 28, 2021)Nawanan Theera-Ampornpunt
 

Similar to Securing and Hacking LINE OA Integration (11)

ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...
ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...
ยกระดับศักยภาพของทีม IT Security องค์กรด้วย CTF & Cybersecurity Online Platfo...
 
Web Hacking with Object Deserialization
Web Hacking with Object DeserializationWeb Hacking with Object Deserialization
Web Hacking with Object Deserialization
 
Privacy, Confidentiality & Security (April 28, 2018)
Privacy, Confidentiality & Security (April 28, 2018)Privacy, Confidentiality & Security (April 28, 2018)
Privacy, Confidentiality & Security (April 28, 2018)
 
Health Information Privacy and Security (March 30, 2016)
Health Information Privacy and Security (March 30, 2016)Health Information Privacy and Security (March 30, 2016)
Health Information Privacy and Security (March 30, 2016)
 
Health Information Privacy and Security Management
Health Information Privacy and Security ManagementHealth Information Privacy and Security Management
Health Information Privacy and Security Management
 
Exploiting Blind Vulnerabilities
Exploiting Blind VulnerabilitiesExploiting Blind Vulnerabilities
Exploiting Blind Vulnerabilities
 
Health Information Privacy and Security (October 7, 2018)
Health Information Privacy and Security (October 7, 2018)Health Information Privacy and Security (October 7, 2018)
Health Information Privacy and Security (October 7, 2018)
 
Health Information Privacy and Security (August 3, 2019)
Health Information Privacy and Security (August 3, 2019)Health Information Privacy and Security (August 3, 2019)
Health Information Privacy and Security (August 3, 2019)
 
Data & Cybersecurity (July 31, 2018)
Data & Cybersecurity (July 31, 2018)Data & Cybersecurity (July 31, 2018)
Data & Cybersecurity (July 31, 2018)
 
Health Information Privacy and Security (September 13, 2020)
Health Information Privacy and Security (September 13, 2020)Health Information Privacy and Security (September 13, 2020)
Health Information Privacy and Security (September 13, 2020)
 
Health Information Privacy and Security (August 28, 2021)
Health Information Privacy and Security (August 28, 2021)Health Information Privacy and Security (August 28, 2021)
Health Information Privacy and Security (August 28, 2021)
 

More from Pichaya Morimoto

Docker Plugin For DevSecOps
Docker Plugin For DevSecOpsDocker Plugin For DevSecOps
Docker Plugin For DevSecOpsPichaya Morimoto
 
Mysterious Crypto in Android Biometrics
Mysterious Crypto in Android BiometricsMysterious Crypto in Android Biometrics
Mysterious Crypto in Android BiometricsPichaya Morimoto
 
Burp Extender API for Penetration Testing
Burp Extender API for Penetration TestingBurp Extender API for Penetration Testing
Burp Extender API for Penetration TestingPichaya Morimoto
 
Bug Bounty แบบแมว ๆ
Bug Bounty แบบแมว ๆ Bug Bounty แบบแมว ๆ
Bug Bounty แบบแมว ๆ Pichaya Morimoto
 
Pentest 101 @ Mahanakorn Network Research Laboratory
Pentest 101 @ Mahanakorn Network Research LaboratoryPentest 101 @ Mahanakorn Network Research Laboratory
Pentest 101 @ Mahanakorn Network Research LaboratoryPichaya Morimoto
 
Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)Pichaya Morimoto
 
From Web Vulnerability to Exploit in 15 minutes
From Web Vulnerability to Exploit in 15 minutesFrom Web Vulnerability to Exploit in 15 minutes
From Web Vulnerability to Exploit in 15 minutesPichaya Morimoto
 
Exploiting WebApp Race Condition Vulnerability 101
Exploiting WebApp Race Condition Vulnerability 101Exploiting WebApp Race Condition Vulnerability 101
Exploiting WebApp Race Condition Vulnerability 101Pichaya Morimoto
 
CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?
CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?
CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?Pichaya Morimoto
 
Vulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP FrameworkVulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP FrameworkPichaya Morimoto
 
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya MorimotoSQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya MorimotoPichaya Morimoto
 
Art of Web Backdoor - Pichaya Morimoto
Art of Web Backdoor - Pichaya MorimotoArt of Web Backdoor - Pichaya Morimoto
Art of Web Backdoor - Pichaya MorimotoPichaya Morimoto
 

More from Pichaya Morimoto (12)

Docker Plugin For DevSecOps
Docker Plugin For DevSecOpsDocker Plugin For DevSecOps
Docker Plugin For DevSecOps
 
Mysterious Crypto in Android Biometrics
Mysterious Crypto in Android BiometricsMysterious Crypto in Android Biometrics
Mysterious Crypto in Android Biometrics
 
Burp Extender API for Penetration Testing
Burp Extender API for Penetration TestingBurp Extender API for Penetration Testing
Burp Extender API for Penetration Testing
 
Bug Bounty แบบแมว ๆ
Bug Bounty แบบแมว ๆ Bug Bounty แบบแมว ๆ
Bug Bounty แบบแมว ๆ
 
Pentest 101 @ Mahanakorn Network Research Laboratory
Pentest 101 @ Mahanakorn Network Research LaboratoryPentest 101 @ Mahanakorn Network Research Laboratory
Pentest 101 @ Mahanakorn Network Research Laboratory
 
Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)
 
From Web Vulnerability to Exploit in 15 minutes
From Web Vulnerability to Exploit in 15 minutesFrom Web Vulnerability to Exploit in 15 minutes
From Web Vulnerability to Exploit in 15 minutes
 
Exploiting WebApp Race Condition Vulnerability 101
Exploiting WebApp Race Condition Vulnerability 101Exploiting WebApp Race Condition Vulnerability 101
Exploiting WebApp Race Condition Vulnerability 101
 
CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?
CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?
CTF คืออะไร เรียนแฮก? ลองแฮก? แข่งแฮก?
 
Vulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP FrameworkVulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP Framework
 
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya MorimotoSQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
 
Art of Web Backdoor - Pichaya Morimoto
Art of Web Backdoor - Pichaya MorimotoArt of Web Backdoor - Pichaya Morimoto
Art of Web Backdoor - Pichaya Morimoto
 

Securing and Hacking LINE OA Integration

  • 1. Securing and Hacking LINE OA Integration ฉบับ สอนแฮกเว็บแบบแมว ๆ For Educational Purposes Only Responsible: Mr. Pichaya Morimoto Version (Date): 1.0 (2023-06-10) Confidentiality class: Public บจก.สยามถนัดแฮก
  • 2. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 2 # whoami Pichaya (LongCat) Morimoto ที่ปรึกษาด้านความมั่นคงปลอดภัยฯ บริษัท สยามถนัดแฮก จํากัด ความเชี่ยวชาญ Penetration Testing (Pentest) อื่น ๆ - (อดีต) ผู้ดูแลเพจ สอนแฮกเว็บแบบแมวๆ - หนึ่งในผู้ดูแลกลุ่ม 2600 Thailand
  • 3. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 3 # whoami
  • 4. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 4 Disclaimer - จุดประสงค์ของ Session นี้เพื่อแบ่งปันความรู้ ทางด ้านความปลอดภัยระบบสารสนเทศ ไม่สนับสนุนการนําความรู้ทางด ้านความปลอดภัยฯ ไปใช ้ในทางที่ผิดกฎหมายทั้งหมด - ตัวอย่างโค ้ด และรูปใน Session นี้ เป็นระบบจําลอง ไม่ใช่ระบบลูกค ้า และไม่ใช่ระบบจริงคนอื่น - ทาง บจก. สยามถนัดแฮก (STH) ต ้องขอบคุณลูกค ้าทุกท่าน ที่ไว ้วางใจให ้ทาง STH ทดสอบเจาะระบบ LINE OA รวมถึงระบบต่าง ๆ และได ้นําความรู้ที่ได ้ทําและศึกษาเพิ่มเติมมาแบ่งปันในวันนี้ - ถ ้าหาก บริษัทใด สนใจใช ้บริการ ทดสอบเจาะระบบ Network, Web, Mobile หรือแม ้แต่ ระบบ LINE OA ของตนเองสามารถติดต่อทาง STH ได ้เลย :)
  • 5. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 1. MSN Messenger - Potential Threats - Client, Server, User - Emoji DoS Attack 2. LINE Messenger - LINE (Personal) - Potential Threats - LINE (Business - LINE OA) 3. LINE OA Integration Architecture - Messaging API - WebHook - LINE Front-end Framework (LIFF) - WebView Overview บจก.สยามถนัดแฮก 5 4. Attack Surface a. LINE Message & WebHook b. LINE Messaging API & SDK c. LINE LIFF & SDK d. App Specific 5. LINE OA Attack Scenarios -> Securing Side <- 6. Securing LINE OA Integration a. Apply OWASP Top 10 Defenses b. Validate LINE User Access Token c. Secure Secret Management d. WebHook Signature Validation e. Network-Level Access Control
  • 6. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 5. LINE OA Attack Scenarios - Injection via LINE Message - Unprotected Web Hook - API Key Leakage - Vulns in App Specific - Use LINE User ID as Credential - Cross-Channel Access Token Overview บจก.สยามถนัดแฮก 6
  • 7. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 1. MSN Messenger - Potential Threats - Client, Server, User - Emoji DoS Attack 2. LINE Messenger - LINE (Personal) - Potential Threats - LINE (Business - LINE OA) 3. LINE OA Integration Architecture - Messaging API - WebHook - LINE Front-end Framework (LIFF) - WebView Overview บจก.สยามถนัดแฮก 7 4. Attack Surface a. LINE Message & WebHook b. LINE Messaging API & SDK c. LINE LIFF & SDK d. App Specific 5. LINE OA Attack Scenarios -> Securing Side <- 6. Securing LINE OA Integration a. Apply OWASP Top 10 Defenses b. Validate LINE User Access Token c. Secure Secret Management d. WebHook Signature Validation e. Network-Level Access Control
  • 8. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 8 ที่มา: https://www.youtube.com/watch?v=T322TDmOKJI
  • 9. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 9 ที่มา: CREATIVE TALK https://www.blockdit.com/posts/64367935353e45142bde5bd8 ที่มา: วัยรุนยุค90 https://www.facebook.com/90teenager/photos/a.350347115140971/1998634730312193/?type=3
  • 10. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 10 MSN Messenger ที่มา: https://www.her.ie/life/types-of-msn-conversations-we-all-had-283931 Alice Bob - สมัคร บัญชี - เข ้าสู่ระบบ - เพิ่มผู้ติดต่อ - สนทนากันด ้วย ข ้อความ/เสียง - ส่งไฟล์
  • 11. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 11 MSN Messenger - Potential Threats MSN Messenger MSN Messenger MSN Server Client A Client B - Remote - Local
  • 12. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 12 MSN Messenger - Potential Threats MSN Messenger MSN Messenger MSN Server Client A Client B ที่มา: https://www.csoonline.com/article/2222257/microsoft-patches-hotmail-after-0-day-remote-password-reset-exploited-in-the-wild.html, https://twitter.com/msftsecresponse/status/195568235654021121 แฮกเกอรรับจาง 20 USD (700 บาท) สามารถ แฮกบัญชี Hotmail ใครก็ได
  • 13. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 13 MSN Messenger - Potential Threats ที่มา: https://twitter.com/msftsecresponse/status/195568235654021121, https://www.youtube.com/watch?v=INq6CirLgt0, https://www.youtube.com/watch?v=juzniDuLISg HTTP Parameter Tampering
  • 14. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 14 MSN Messenger - Potential Threats MSN Messenger MSN Messenger MSN Server Client A Client B Server-Side Vulnerability แฮกเกอรรับจาง 20 USD (700 บาท) สามารถ แฮกบัญชี Hotmail ใครก็ได User Error ถูก Phishing หลอก เอารหัสผาน หรือถูก หลอกติดตั้งไฟล Malware Client / Client-Side Vulnerability
  • 16. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 16 MSN Messenger Alice Bob - สามารถส่ง Emoji หากันและกันได ้
  • 17. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 17 MSN Messenger Bob - สามารถส่ง Emoji หากันและกันได ้ - แต่ละ Emoji จะ สามารถส่งด ้วยตัว อักษรแทนได ้
  • 18. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 18 MSN Messenger :'( ตัวอักษร Emoji พิมพ์ จะได ้
  • 19. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 19 MSN Messenger :'( Emoji ตัวอักษร
  • 20. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 20 MSN Messenger Attacker :'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'( :'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'( :'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'( :'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'( :'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'( TEXT in MSN RAM = 2 GB Victim
  • 21. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 21 MSN Messenger Attacker Victim Emojis in MSN RAM => 8 GB
  • 22. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 22 MSN Messenger Attacker Victim Emojis in MSN RAM => 8 GB TEXT in MSN RAM = 2 GB ที่มา: https://www.polygon.com/2014/7/7/5876983/how-to-play-street -fighter-fighting-game-primer
  • 23. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 23 MSN Messenger Emojis in MSN RAM => 8 GB (ส่วนมากเหยื่อค ้างตั้งแต่ยังไม่ทัน เห็นว่าถูกส่ง Emoji มาด ้วยซํ้า)
  • 24. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 1. MSN Messenger - Potential Threats - Client, Server, User - Emoji DoS Attack 2. LINE Messenger - LINE (Personal) - Potential Threats - LINE (Business - LINE OA) 3. LINE OA Integration Architecture - Messaging API - WebHook - LINE Front-end Framework (LIFF) - WebView Overview บจก.สยามถนัดแฮก 24 4. Attack Surface a. LINE Message & WebHook b. LINE Messaging API & SDK c. LINE LIFF & SDK d. App Specific 5. LINE OA Attack Scenarios -> Securing Side <- 6. Securing LINE OA Integration a. Apply OWASP Top 10 Defenses b. Validate LINE User Access Token c. Secure Secret Management d. WebHook Signature Validation e. Network-Level Access Control
  • 26. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE (Personal) 26
  • 27. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE (Personal) 27 Alice Bob - สมัคร บัญชี - เข ้าสู่ระบบ - เพิ่มผู้ติดต่อ - สนทนากันด ้วย ข ้อความ/เสียง - ส่งไฟล์
  • 28. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE (Personal) - Potential Threat 28 LINE Application LINE Application LINE Server Client A Client B Server-Side Vulnerability User Error Client / Client-Side Vulnerability
  • 30. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE (Business) 30 ลูกคา Eve Agent Bob Agent Alice - บัญชีธุรกิจ (LINE OA) - มี Agent หลายคน ช่วยกันตอบ Chat ได ้ - ตอบด ้วย Bot ได ้
  • 31. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE (Business) 31 Notice a major difference between left and right chat rooms. LINE Official Account (OA)
  • 32. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE (Business) 32 ไม่ยืนยัน ยืนยัน พรีเมี่ยม
  • 33. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE OA 33 LINE Official Account (OA) ไม่ยืนยัน ยืนยัน พรีเมี่ยม
  • 34. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE OA 34 ที่มา: https://www.scb.co.th/th/personal-banking/stories/tips-for-you/fake-line-connect.html ไม่ยืนยัน ยืนยัน พรีเมี่ยม
  • 35. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE OA - Apps 35 แอป Official Account (แยกจาก LINE) เว็บ LINE OA Manager (แยกจาก LINE) - สําหรับฝั่ง Operation (Agent) - ตอบ Chat ลูกค ้า - Bot ตอบ - คนตอบ
  • 36. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public LINE Official Account (OA) for Developers 36 เว็บ LINE OA Manager เว็บ LINE Developers
  • 37. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public ตัวอย่าง LINE OA 37 ที่มา: https://linedevth.line.me/th/case-study
  • 38. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 1. MSN Messenger - Potential Threats - Client, Server, User - Emoji DoS Attack 2. LINE Messenger - LINE (Personal) - Potential Threats - LINE (Business - LINE OA) 3. LINE OA Integration Architecture - Messaging API - WebHook - LINE Front-end Framework (LIFF) - WebView Overview บจก.สยามถนัดแฮก 38 4. Attack Surface a. LINE Message & WebHook b. LINE Messaging API & SDK c. LINE LIFF & SDK d. App Specific 5. LINE OA Attack Scenarios -> Securing Side <- 6. Securing LINE OA Integration a. Apply OWASP Top 10 Defenses b. Validate LINE User Access Token c. Secure Secret Management d. WebHook Signature Validation e. Network-Level Access Control
  • 39. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 39 Siam Don Hack Bank (SDH) A fictional organization. https://www.facebook.com/sdhbank/
  • 40. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 40 LINE OA Integration Architecture (High-Level) User LINE App Message SDH Web API SDH Web Application
  • 41. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 41 LINE Official Account (OA) for Developers ที่มา: https://developers.line.biz/en/ - Messaging API - LINE Login - LINE Front-end Framework (LIFF) - LINE Things - LINE MINI App - LINE Pay - LINE Notify - Blockchain Service
  • 42. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 42 LINE OA Integration Architecture User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database LIFF SDK LIFF API, LINE Login Web API SDH Bank Back-Office Web Application WebView Msg. API SDK Get User Info
  • 43. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 43 LINE OA Integration Architecture User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database LIFF SDK LIFF API, LINE Login Web API SDH Bank Back-Office Web Application WebView Msg. API SDK Get User Info 1 2 3
  • 44. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 44 LINE OA Integration Architecture User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database LIFF SDK LIFF API, LINE Login Web API SDH Bank Back-Office Web Application WebView Msg. API SDK Get User Info 1 2 3 4
  • 45. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 45 LINE OA Integration Architecture User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database LIFF SDK LIFF API, LINE Login Web API SDH Bank Back-Office Web Application WebView Msg. API SDK Get User Info Messaging API 1 LIFF 2
  • 46. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 46 LINE Official Account (OA) for Developers 1. Messaging API - LINE BOT - WebHook - Messaging API SDK 2. LINE Front-end Framework (LIFF) - LINE URL Scheme - WebView - LINE Login - LIFF SDK Messaging API LIFF
  • 47. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 47 LINE OA - LINE User ID ที่มา: https://developers.line.biz/en/docs/messaging-api/getting-user-ids/#what-is-user-id - User ID (UID) เป็นค่า ที่ระบบที่มาต่อ กับไลน์ใช ้อ ้างอิงผู้ใช ้งาน แต่ละคน - ผู้ใช ้งานคนเดียวกัน แต่ใช ้แอปใน LINE OA ต่างกันฝั่งระบบของแต่ละบัญชี LINE OA จะได ้UID ผู้ใช ้งานคนเดียวกันคนละ ค่ากัน เช่น LINE User UID แอปใน LINE OA นาย A 1111 แอป X นาย A 2222 แอป Y นาย B 3333 แอป X นาย B 4444 แอป Y
  • 48. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 48 1 - Messaging API แบบสรุปเข ้าใจง่าย ๆ มันคือ Chat BOT, ต่อกับ API ภายนอก LINE ได ้ 1 2 3 - Reply - Push
  • 49. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 49 1 - Messaging API - WebHook 1 - ฝง LINE 2 - ฝงคนเอา ระบบมาตอ WebHook URL
  • 50. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 50 1 - Messaging API - WebHook
  • 51. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 51 2 - LINE Front-end Framework (LIFF) ที่มา: https://www.collinsdictionary.com/dictionary/english/lift
  • 52. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 52 2 - LINE Front-end Framework (LIFF) เว็บที่ทํางานผ่านห ้อง Chat ใน LINE และอ่านข ้อมูล Profile ผู้ใช ้งาน LINE เข ้ามาในเว็บได ้(แต่ผู้ใช ้งานต ้องกดยินยอมก่อน) เรียกว่า LIFF App หน้าเว็บจะมี แสดงได ้3 แบบตามความสูงในห ้อง Chat - Full - Tall - Compact เบื้องหลังคือใช ้ - LIFF SDK (JavaScript) - LINE Login
  • 53. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 53 2 - LINE Front-end Framework (LIFF) ที่มา: https://linedevth.line.me/th/liff - ทําให ้เปิดเว็บ (WebView) ใน LINE OA ได ้ - เรียกว่า LIFF App - ใช ้LINE Login ไปอ่านค่า User Profile ได ้ - ชื่อ (Display Name) - URL ของรูป Profile - ข ้อความสถานะ (Status Message) - อีเมล ** (ต ้องขอ OAuth Scope เพิ่ม, เพิ่มรายการขอใน Consent ตอน Login) - Access Token, User ID - ส่งข ้อความกลับมาที่ห ้อง Chat (Share Target Picker)
  • 54. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 54 2 - LINE Front-end Framework (LIFF) 1 2 3 4
  • 55. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 55 2 - LINE LIFF - LINE URL Scheme เป็นลิงก์ที่กดใน Chat แล ้วจะเปิด LIFF App - https://liff.line.me/{liffId} <- ปัจจุบันแนะนําอันนี้ - https://line.me/R/{liffId} - line://{liffId} (Deprecated - LINE ไม่แนะนําให ้ใช ้แล ้ว, แต่ยังกดได ้อยู่) ที่มา: https://developers.line.biz/en/docs/messaging-api/using-line-url-scheme/ ที่มา: https://linedevth.line.me/th/liff
  • 56. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 56 2 - LINE Login - User Consent OAuth 2 / OIDC Scope: - profile (ค่าเริ่มต ้นมีเฉพาะ profile) - chat_message.write - email - openid https://liff.line.me/{liffId} 1 2 3 4
  • 57. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 1. MSN Messenger - Potential Threats - Client, Server, User - Emoji DoS Attack 2. LINE Messenger - LINE (Personal) - Potential Threats - LINE (Business - LINE OA) 3. LINE OA Integration Architecture - Messaging API - WebHook - LINE Front-end Framework (LIFF) - WebView Overview บจก.สยามถนัดแฮก 57 4. Attack Surface a. LINE Message & WebHook b. LINE Messaging API & SDK c. LINE LIFF & SDK d. App Specific 5. LINE OA Attack Scenarios -> Securing Side <- 6. Securing LINE OA Integration a. Apply OWASP Top 10 Defenses b. Validate LINE User Access Token c. Secure Secret Management d. WebHook Signature Validation e. Network-Level Access Control
  • 58. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 58 Attack Surface (?) User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 1 5.2 Web API 2 3.2 Get User Info SDH Bank Back-Office Web Application 5.1 WebView 5.3 3.1 API SDK
  • 59. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 59 Attack Surface (!!) User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 1 2 5.2 Web API 5 3.2 Get User Info SDH Bank Back-Office Web Application 3 4 5.1 WebView 5.3 3.1 API SDK - (บัญชีไลน์ถูกแฮก ?) - 1+2 LINE Message & API for WebHook - 3 LINE Messaging API & SDK - 4 LINE LIFF & SDK - 5 App Specific - WebView for LIFF - Web API for WebView - Back-Office Web Application
  • 60. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 60 [1] LINE Message -> [2] API for WebHook User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 1 2 5.2 Web API 3.2 Get User Info SDH Bank Back-Office Web Application 5.1 WebView 5.3 3.1 API SDK
  • 61. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 61 [1] LINE Message -> [2] API for WebHook User 1+2 LINE Message & API for WebHook SDH API Server API for WebHook Attacker Attack Payload Attack Payload
  • 62. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 62 [1] LINE Message -> [2] API for WebHook User 1+2 LINE Message & API for WebHook SDH API Server API for WebHook Attack Payload Attacker - No HMAC check, or - HMAC Key is leaked (Channel secret)
  • 63. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 63 [3] LINE Messaging API & SDK User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 5.2 Web API 3.2 Get User Info SDH Bank Back-Office Web Application 3 5.1 WebView 5.3 3.1 API SDK
  • 64. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 64 [3] LINE Messaging API & SDK 3 LINE Messaging API & SDK LINE Platform SDH API Server 3.2 Get User Info 3.1 API SDK Attacker Attack Payload + Channel Access Token Get User Info
  • 65. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 65 [4] LINE LIFF API & SDK User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 5.2 Web API 3.2 Get User Info SDH Bank Back-Office Web Application 4 5.1 WebView 5.3 3.1 API SDK
  • 66. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 66 [4] LINE LIFF API & SDK 4 LINE LIFF API & SDK LINE Platform 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login SDH Web Application Attacker Attack Payload + Victim’s Access Token + Victim Profile Info Attack Payload Get Victim’s Profile Info
  • 67. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 67 [5] App Specific - WebView, Web API, Apps User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 5.2 Web API 5 3.2 Get User Info SDH Bank Back-Office Web Application 5.1 WebView 5.3 3.1 API SDK
  • 68. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 68 [5] App Specific - WebView, Web API, Apps 5 App Specific - WebView for LIFF - Web API for WebView - Back-Office Web Application SDH API Server SDH Web Application SDH Database 5.2 Web API SDH Bank Back-Office Web Application 5.1 WebView 5.3 Attacker Attack Payload
  • 69. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 69 (Incomplete) Defender’s Point of View User LINE App Message SDH Web API SDH Web Application 1 2
  • 70. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 70 Attacker’s Point of View User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 1 2 5.2 Web API 5 3.2 Get User Info SDH Bank Back-Office Web Application 3 4 5.1 WebView 5.3 3.1 API SDK
  • 71. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public Topic/Theme: LINE OA Integration -> Hacking Side <- 1. MSN Messenger - Potential Threats - Client, Server, User - Emoji DoS Attack 2. LINE Messenger - LINE (Personal) - Potential Threats - LINE (Business - LINE OA) 3. LINE OA Integration Architecture - Messaging API - WebHook - LINE Front-end Framework (LIFF) - WebView Overview บจก.สยามถนัดแฮก 71 4. Attack Surface a. LINE Message & WebHook b. LINE Messaging API & SDK c. LINE LIFF & SDK d. App Specific 5. LINE OA Attack Scenarios -> Securing Side <- 6. Securing LINE OA Integration a. Apply OWASP Top 10 Defenses b. Validate LINE User Access Token c. Secure Secret Management d. WebHook Signature Validation e. Network-Level Access Control
  • 72. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 72 LINE OA (Common) Attack Scenarios LINE Platform for LINE OA is pretty secure, the issues occur from wrong implementations. 1. Injection via LINE Message 2. Unprotected Web Hook 3. API Key Leakage 4. Vulns in App Specific 4.1 Use LINE User ID as Credential 4.2 Cross-Channel Access Token 4.3 Broken Access Control (Back Office) 5. Attacks on LINE Platforms
  • 73. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 73 1 - Injection via LINE Message Web API for WebHook LINE App
  • 74. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 74 1 - Injection via LINE Message - รับข ้อความจาก Chat - ส่งต่อไป API ของ WebHook ดีจ ้า ดีจ ้า 2 1 ดีจ ้า 3
  • 75. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 75 1 - Injection via LINE Message 5 6 7
  • 76. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 76 1 - Injection via LINE Message SQL Injection: !show ' and 1>2 union select sqlite_version()--
  • 77. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 1 - Injection via LINE Message Solution: All input is evil, until proven otherwise, So apply standard API security protections on the API endpoints for WebHook. - Parameterized Query - Input Validation - Authentication/Authorization Check - Secure server configuration - … ที่มา: https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html
  • 78. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 78 2 - Unprotected Web Hook Web API for WebHook LINE App Attack Payload Attacker Attack Prerequisites: - No HMAC check, or - Channel secret is leaked
  • 79. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 79 2 - Unprotected Web Hook ที่มา: https://developers.line.biz/en/docs/messaging-api/receiving-messages/
  • 80. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 80 2 - Unprotected Web Hook LINE User ID Data Victim’s info Or actions Impact: - Impersonate victim’s identity - Call unauthorized functions
  • 81. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 81 Protect LINE Web Hook: x-line-signature ที่มา: https://developers.line.biz/en/docs/partner-docs/development-guidelines/#webhook-and-auto-reply-settings
  • 82. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 82 Protect LINE Web Hook: x-line-signature ที่มา: https://developers.line.biz/en/docs/partner-docs/development-guidelines/#webhook-and-auto-reply-settings HMAC SHA-256 ( JSON Body, Channel Secret ) -> Base 64 Encode -> x-line-signature
  • 83. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 83 Protect LINE Web Hook: x-line-signature ที่มา: https://medium.com/linedevth/x-line-signature-ตัวชวยจาก-line-ที่จะชวยยกระดับความปลอดภัยใหกับ-webhook-ของคุณ-7a94d9548f34 อ่านฉบับภาษา ไทยเพิ่มเติม ได ้ที่…
  • 84. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 84 Protect LINE Web Hook: IP Allowlisting User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 5.2 Web API 3.2 Get User Info SDH Bank Back-Office Web Application 3 5.1 WebView 5.3 3.1 API SDK 2
  • 85. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 85 Protect LINE Web Hook: IP Allowlisting
  • 86. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 86 3 - API Key Leakage Common places: - Verbose error messages - Publicly available source code repositories - Mobile client - Client-side HTML, CSS, and JavaScript files
  • 87. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 87 3 - API Key Leakage - Verbose error messages "channel_secret": "xxxxxxxx"
  • 88. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 88 3 - API Key Leakage - Publicly available source code repositories "channel_secret": "xxxxxxxx"
  • 89. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 89 3 - API Key Leakage - Client-side HTML, CSS, and JavaScript files "channel_secret": "xxxxxxxx"
  • 90. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 90 3 - API Key Leakage "channel_secret": "xxxxxxxx" Attacker Attack Payload สร ้าง x-line-signature ยิงเข ้า API สําหรับ WebHook เองได ้
  • 91. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 91 3 - API Key Leakage Solution: - No hard-coded secrets in client side - No secret in code repo - Use .gitignore for .env and config files - Inject secrets in environment variables - Secret Vault
  • 92. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 92 Attacker’s Point of View User LINE App LINE Platform LINE OA Web Portal (Dev) Configure SDH API Server WebHook Message SDH Web Application SDH Database 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login 1 2 5.2 Web API 5 3.2 Get User Info SDH Bank Back-Office Web Application 3 4 5.1 WebView 5.3 3.1 API SDK
  • 93. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 93 4.1 Use LINE User ID as Credential Victim LINE App LINE Platform SDH Web Application 4.1 LIFF SDK 4.2 LIFF API, 4.3 LINE Login UID=1337
  • 94. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 94 4.1 Use LINE User ID as Credential Victim LINE App SDH Web Application SDH Database UID=1337
  • 95. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 95 4.1 Use LINE User ID as Credential Victim LINE App SDH Web Application SDH Database UID=1337 https://api.sth.sh/api/get UserById=1337 Attack Payload - แอปอาจจะเผลอตอบ UID ของผู้ใช ้ งานคนอื่นออกมาจากฟังก์ชันการใช ้ งานปกติ - ถ ้าเช็ค AuthN ด ้วย LINE UID = แตก Attacker
  • 96. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 96 4.1 Use LINE User ID as Credential ที่มา: https://developers.line.biz/en/docs/liff/using-user-profile/#use-u ser-info-in-liff-app - อย่าเชื่อค่า User Profile ที่ส่งจาก LIFF App (ฝั่ง Client Side) ยิงกลับมาหา App Server ข ้อมูลพวกนี้ใช ้เฉพาะโชว์ใน UI - ถ ้าจะเก็บให ้เอา Access Token ไปขอ User Profile กับ LINE Platform แล ้วยิงกลับมาเก็บเป็น แบบ Server-to-Server API
  • 97. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 97 4.1 Use LINE User ID as Credential ที่มา: https://medium.com/linedevth/ระวัง-คุณยังสง-user-id-จาก-frontend-ไป-backend-อยูหรือไม-7b38bfb9efd2 อ่านฉบับภาษา ไทยเพิ่มเติม ได ้ที่…
  • 98. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 98 4.2 Cross-Channel Access Token Victim Real SDH Bank Web Application Fake SDH Web Application @sdhbank Attacker’s LINE OA Account @sdhbank888 Attacker
  • 99. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 99 4.2 Cross-Channel Access Token Victim Real SDH Bank Web Application Fake SDH Web Application Send Fake SDH Bank LINE OA Account @sdhbank888 Attacker’s LINE OA Account @sdhbank888 Attacker 1 2 @sdhbank
  • 100. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 100 4.2 Cross-Channel Access Token Victim Real SDH Bank Web Application Fake SDH Web Application Send Fake SDH Bank LINE OA Account @sdhbank888 Attacker’s LINE OA Account @sdhbank888 Attacker LINE Platform 1 2 3 4 LINE Login Victim Login Victim’s Access Token @sdhbank
  • 101. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 101 4.2 Cross-Channel Access Token Victim Real SDH Bank Web Application Fake SDH Web Application Send Fake SDH Bank LINE OA Account @sdhbank888 Attacker’s LINE OA Account @sdhbank888 Attacker LINE Platform 1 2 3 4 LINE Login Victim Login Victim’s Access Token Victim’s Access Token 5 Get Profile w/ Victim’s Access Token, but not verify client_id (Chanel ID) 6
  • 102. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 102 4.2 Cross-Channel Access Token Victim Real SDH Bank Web Application Fake SDH Web Application Send Fake SDH Bank LINE OA Account @sdhbank888 Attacker’s LINE OA Account @sdhbank888 Attacker LINE Platform 1 2 3 4 LINE Login Victim Login Victim’s Access Token Victim’s Access Token 5 Get victim’s identity on SDH Bank Web App Get Profile w/ Victim’s Access Token, but not verify client_id (Chanel ID) 6
  • 103. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 103 4.2 Cross-Channel Access Token ที่มา: https://developers.line.biz/en/docs/liff/using-user-profile/#sending-access-token - ต ้องเอา Access Token ไป ตรวจสอบ client_id ก่อนใช ้ - อย่าเชื่อค่า User Profile จาก LIFF App ส่งมา, ต ้อง เชื่อจาก LINE Platform (Server-to-Server API) เท่านั้น
  • 104. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 104 4.2 Cross-Channel Access Token ที่มา: https://developers.line.biz/en/reference/line-login/ https://api.line.me/oauth2/v2.1/verif y?access_token=eyJhbGciOiJIUzI1 NiJ9.UnQ_o-GP0VtnwDjbK0C8E_ NvK... { "scope": "profile", "client_id": "1440057261", "expires_in": 2591659 }
  • 105. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 105 LINE Login Security ที่มา: https://developers.line.biz/en/docs/line-login/secure-login-process/#using-access-tokens - อย่าเชื่อค่า User Profile จาก User ส่งมา, ต ้องเชื่อ จาก LINE Platform (Server-to-Server API)
  • 106. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 106 LINE Login Security ที่มา: https://developers.line.biz/en/docs/line-login/secure-login-process/#using-access-tokens - อย่าเชื่อค่า User Profile จาก User ส่งมา, ต ้องเชื่อ จาก LINE Platform (Server-to-Server API) Attacker
  • 107. บจก.สยามถนัดแฮก Responsible / Version (Date): Mr. Pichaya Morimoto / 1.0 (2023-06-10) Confidentiality class: Public 107 LINE Login Security ที่มา: https://developers.line.biz/en/docs/line-login/integrate-line-login/#receiving-the-authorization-code - อย่าเชื่อค่า User Profile จาก User ส่งมา, ต ้องเชื่อ จาก LINE Platform (Server-to-Server API)
  • 108. We offer Pentest Service ❤ Contact us 👇 Email: pentest@sth.sh LINE: @siamthanathack บจก.สยามถนัดแฮก