SlideShare a Scribd company logo
Make Packet Filtering Rule
With Genetic Algorithm
발표자 소개
김현우
선린인터넷고등학교
98년생 고3 아 수능.. 대학가고싶다
기계학습 관심 많으나 수학을 못함
파이썬 & 혼자 연구 하는거 좋아함
현재 PJHS 팀에서 무선 보안 프로젝트 중
내가 표현하고 싶었던 발표로 준비한 내용
유전 알고리즘이란
프로그램 제작 일지 (디버깅..etc)
결과 분석
유전 알고리즘이란?
"유전 알고리즘(Genetic Algorithm)은 자연세계의 진화과정에
기초한 계산 모델로서 존 홀랜드(John Holland)에 의해서
1975년에 개발된 전역 최적화 기법으로, 최적화 문제를 해결하는
기법의 하나이다. 생물의 진화를 모방한 진화 연산의 대표적인
기법으로, 실제 진화의 과정에서 많은 부분을 차용하였으며, 변이
(돌연변이), 교배 연산 등이 존재한다. 또한 세대, 인구 등의
용어도 문제 풀이 과정에서 사용된다." - 위키피디아
유전 알고리즘이란?
우수한 데이터를 섞어
더 우수한 데이터를 만든다.
용어 설명
1. 유전자
최적화를 목표로 하는 데이터
2. 세대
유전자들의 주기
3. 적합도
유전자의 우월한 정도를 보여주는 지수
유전 알고리즘 순서
1. 세대 생성
2. 세대 적합도 평가
3. 목표 적합도에 도달?
4. 결과
돌연변이
부모 유전자 선택
부모 유전자 교배
유전 알고리즘 활용
유전 알고리즘 활용
+ =
참고자료: http://1.genetic.o-r.kr
유전 알고리즘 활용
유전 알고리즘으로 이족 보행 학습
유전 알고리즘 활용
유전 알고리즘으로 그림 모방
필터링 규칙 진화 과정
1. 필터링 규칙 초기 세대 생성
2. 세대 적합도 측정
3. 목표 적합도 도달 판단
4. 반복 & 반복
필터링 규칙 요소
필터링 규칙은 아래와 같이 이루어 진다
IP
Port
Type(src, dst)
Active
DNA 요소들
필터링 규칙 예시
IP info
ip src 192.168.0.1 and not dst port 80
출발지
Port Info
주소 번호도착지
"출발지 IP 주소가 192.168.0.1 이면서, 도착지 포트 번호가 80이
아닌"
필터링 방법
Use pcapy package
- open_offline func
- setfilter func
Follow standard of linux
https://linux.die.net/man/7/pcap-filter
참고자료: http://genetic.o-r.kr
첫 세대 만들기
모든 IP, Port 를 가져옴
Src, Dst 간 구분함
→ 상관없는 규칙을 줄임
→ 세대 낭비를 줄임
세대 진화
발생한 문제
(이상하게도) 한 규칙만
따라간다.
No exceptions...
디버깅... 디버깅...
(Photo By 변준우)
문제가 뭔지 감이 오시나요?
세상에...
선출된 부모가 똑같음
문제를 찾아라 ㅡㅅㅡ
for 문은 순차적으로 돈다
for... 이 나쁜 자식...
앞에 있는 부모가 먼저 선출되어 버리니,
뒤에 있는 부모가 선출되지 않음
발생한 문제2
???
None Rule
자식 Rule 이 알맞은 Rule 인지 확인해 주어야 함.
https://github.com/Kcrong/genetic-packet-filter/commit/2491e089b44e90608
323a51c995e2dc90731262c
그랬더니...
오류가!
데이터 분석을 해봅시다!
'좋은' 규칙의 기준
Shortest
Unable
Bypass
Fusibility
Best Rule
좋은 규칙 만들기
간결하며(Shortest) 정확하고 (Unable Bypass) 가용성 높은 (Fusibility)
Input: Telnet Packet
Input: Telnet Packet
- Attack IP: 192.168.44.1
- Server IP: 192.168.44.129
- Telnet Protocol (port 23)
Input: Telnet Packet - 결과
Input: Telnet Packet - 결과 분석
“ip src 192.168.44.1 and dst port 23 and dst port 58634”
Attack IP
Attack
Protocol
Leak Point
Input: Telnet Packet - 결과 분석
누구냐, 넌...
떨어진 구간의 정체는
도태된 돌연변이
하지만, 나쁜 것만은 아니다!
돌연변이 후, 전체적 적합도는 상승
연구 한계
- 퍼포먼스에 대한 테스트가 미흡
Snort, Suricata 와 같은 오픈소스를 이용해 테스트
- Packet Filtering Element 가 부족
단순히 IP, Port 만으로 패킷을 필터링 하는 것은 매우 위험.
Content 와 같은 요소를 추가하여 돌리면 흥미로운 결과가 기대됨.
- Genetic 에 대한 적합도 함수 최적화
더욱 적은 세대에서 최적 데이터를 구함. (아 수학...)
마치며
Full-Source : https://github.com/kcrong/genetic-packet-filter
Genetic Info: http://1.genetic.o-r.kr
Ask: fb.com/kcr0ng ← ‘0’ == Zero
Thank you

More Related Content

Viewers also liked

Design Patterns for Large-Scale Real-Time Learning
Design Patterns for Large-Scale Real-Time LearningDesign Patterns for Large-Scale Real-Time Learning
Design Patterns for Large-Scale Real-Time Learning
Swiss Big Data User Group
 
Realtime Data Analysis Patterns
Realtime Data Analysis PatternsRealtime Data Analysis Patterns
Realtime Data Analysis Patterns
Mikio L. Braun
 
Hortonworks Data In Motion Series Part 3 - HDF Ambari
Hortonworks Data In Motion Series Part 3 - HDF Ambari Hortonworks Data In Motion Series Part 3 - HDF Ambari
Hortonworks Data In Motion Series Part 3 - HDF Ambari
Hortonworks
 
Performance Comparison of Streaming Big Data Platforms
Performance Comparison of Streaming Big Data PlatformsPerformance Comparison of Streaming Big Data Platforms
Performance Comparison of Streaming Big Data Platforms
DataWorks Summit/Hadoop Summit
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking Data
James Sirota
 
Hortonworks Data In Motion Series Part 4
Hortonworks Data In Motion Series Part 4Hortonworks Data In Motion Series Part 4
Hortonworks Data In Motion Series Part 4
Hortonworks
 
How to Use Apache Zeppelin with HWX HDB
How to Use Apache Zeppelin with HWX HDBHow to Use Apache Zeppelin with HWX HDB
How to Use Apache Zeppelin with HWX HDB
Hortonworks
 
Webinar Series Part 5 New Features of HDF 5
Webinar Series Part 5 New Features of HDF 5Webinar Series Part 5 New Features of HDF 5
Webinar Series Part 5 New Features of HDF 5
Hortonworks
 
Real-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiReal-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFi
Manish Gupta
 
Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...
Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...
Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...
Kevin Mao
 
Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security
DataWorks Summit/Hadoop Summit
 
Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...
Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...
Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...
Hortonworks
 
Spark at Scale
Spark at ScaleSpark at Scale
Spark at Scale
Yuta Imai
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 

Viewers also liked (14)

Design Patterns for Large-Scale Real-Time Learning
Design Patterns for Large-Scale Real-Time LearningDesign Patterns for Large-Scale Real-Time Learning
Design Patterns for Large-Scale Real-Time Learning
 
Realtime Data Analysis Patterns
Realtime Data Analysis PatternsRealtime Data Analysis Patterns
Realtime Data Analysis Patterns
 
Hortonworks Data In Motion Series Part 3 - HDF Ambari
Hortonworks Data In Motion Series Part 3 - HDF Ambari Hortonworks Data In Motion Series Part 3 - HDF Ambari
Hortonworks Data In Motion Series Part 3 - HDF Ambari
 
Performance Comparison of Streaming Big Data Platforms
Performance Comparison of Streaming Big Data PlatformsPerformance Comparison of Streaming Big Data Platforms
Performance Comparison of Streaming Big Data Platforms
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking Data
 
Hortonworks Data In Motion Series Part 4
Hortonworks Data In Motion Series Part 4Hortonworks Data In Motion Series Part 4
Hortonworks Data In Motion Series Part 4
 
How to Use Apache Zeppelin with HWX HDB
How to Use Apache Zeppelin with HWX HDBHow to Use Apache Zeppelin with HWX HDB
How to Use Apache Zeppelin with HWX HDB
 
Webinar Series Part 5 New Features of HDF 5
Webinar Series Part 5 New Features of HDF 5Webinar Series Part 5 New Features of HDF 5
Webinar Series Part 5 New Features of HDF 5
 
Real-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiReal-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFi
 
Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...
Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...
Achieving Real-time Ingestion and Analysis of Security Events through Kafka a...
 
Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security
 
Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...
Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...
Hortonworks Data in Motion Webinar Series Part 7 Apache Kafka Nifi Better Tog...
 
Spark at Scale
Spark at ScaleSpark at Scale
Spark at Scale
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 

Similar to 유전 알고리즘으로 패킷 필터링 규칙 만들기

강동호 - The simple story of genetic algorithm (2014Y07M26D)
강동호 - The simple story of genetic algorithm (2014Y07M26D)강동호 - The simple story of genetic algorithm (2014Y07M26D)
강동호 - The simple story of genetic algorithm (2014Y07M26D)
Ubuntu Korea Community
 
메이크챗봇 자연어기초
메이크챗봇 자연어기초메이크챗봇 자연어기초
메이크챗봇 자연어기초
김용범 | 무영인터내쇼날
 
이미 와있는 미래와 소프트웨어씽킹
이미 와있는 미래와 소프트웨어씽킹이미 와있는 미래와 소프트웨어씽킹
이미 와있는 미래와 소프트웨어씽킹
JeongHeon Lee
 
언리얼 리플렉션 & CDO.pptx
언리얼 리플렉션 & CDO.pptx언리얼 리플렉션 & CDO.pptx
언리얼 리플렉션 & CDO.pptx
MUUMUMUMU
 
Python을 활용한 챗봇 서비스 개발 2일차
Python을 활용한 챗봇 서비스 개발 2일차Python을 활용한 챗봇 서비스 개발 2일차
Python을 활용한 챗봇 서비스 개발 2일차
Taekyung Han
 
Workshop 210417 dhlee
Workshop 210417 dhleeWorkshop 210417 dhlee
Workshop 210417 dhlee
Dongheon Lee
 
해킹 대회 리뷰 및 실전 해킹
해킹 대회 리뷰 및 실전 해킹해킹 대회 리뷰 및 실전 해킹
해킹 대회 리뷰 및 실전 해킹
totodeung
 
ChatGPT에 대한 인문학적 이해
ChatGPT에 대한 인문학적 이해ChatGPT에 대한 인문학적 이해
ChatGPT에 대한 인문학적 이해
Wonjun Hwang
 
[216]딥러닝예제로보는개발자를위한통계 최재걸
[216]딥러닝예제로보는개발자를위한통계 최재걸[216]딥러닝예제로보는개발자를위한통계 최재걸
[216]딥러닝예제로보는개발자를위한통계 최재걸
NAVER D2
 
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
동현 김
 
[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)
[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)
[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)
NAVER D2
 
제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요
제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요
제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요
NAVER D2
 
Nationality recognition
Nationality recognitionNationality recognition
Nationality recognition
준영 박
 
[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래
[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래
[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래
Taehoon Ko
 
Things Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in MindThings Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in Mind
Dataya Nolja
 
Meetup history
Meetup historyMeetup history
Meetup history
Mk Kim
 
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
동현 김
 
Coding interview
Coding interviewCoding interview
Coding interview
Soohan Ahn
 
Machine Learning with Apache Spark and Zeppelin
Machine Learning with Apache Spark and ZeppelinMachine Learning with Apache Spark and Zeppelin
Machine Learning with Apache Spark and Zeppelin
Dataya Nolja
 
Sw학생교재소개(초)
Sw학생교재소개(초)Sw학생교재소개(초)
Sw학생교재소개(초)
성훈 김
 

Similar to 유전 알고리즘으로 패킷 필터링 규칙 만들기 (20)

강동호 - The simple story of genetic algorithm (2014Y07M26D)
강동호 - The simple story of genetic algorithm (2014Y07M26D)강동호 - The simple story of genetic algorithm (2014Y07M26D)
강동호 - The simple story of genetic algorithm (2014Y07M26D)
 
메이크챗봇 자연어기초
메이크챗봇 자연어기초메이크챗봇 자연어기초
메이크챗봇 자연어기초
 
이미 와있는 미래와 소프트웨어씽킹
이미 와있는 미래와 소프트웨어씽킹이미 와있는 미래와 소프트웨어씽킹
이미 와있는 미래와 소프트웨어씽킹
 
언리얼 리플렉션 & CDO.pptx
언리얼 리플렉션 & CDO.pptx언리얼 리플렉션 & CDO.pptx
언리얼 리플렉션 & CDO.pptx
 
Python을 활용한 챗봇 서비스 개발 2일차
Python을 활용한 챗봇 서비스 개발 2일차Python을 활용한 챗봇 서비스 개발 2일차
Python을 활용한 챗봇 서비스 개발 2일차
 
Workshop 210417 dhlee
Workshop 210417 dhleeWorkshop 210417 dhlee
Workshop 210417 dhlee
 
해킹 대회 리뷰 및 실전 해킹
해킹 대회 리뷰 및 실전 해킹해킹 대회 리뷰 및 실전 해킹
해킹 대회 리뷰 및 실전 해킹
 
ChatGPT에 대한 인문학적 이해
ChatGPT에 대한 인문학적 이해ChatGPT에 대한 인문학적 이해
ChatGPT에 대한 인문학적 이해
 
[216]딥러닝예제로보는개발자를위한통계 최재걸
[216]딥러닝예제로보는개발자를위한통계 최재걸[216]딥러닝예제로보는개발자를위한통계 최재걸
[216]딥러닝예제로보는개발자를위한통계 최재걸
 
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
 
[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)
[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)
[Kerference] 쉽고 빠르게 시작하는 Volatility plugin 개발 - 김동현(BoB)
 
제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요
제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요
제12회 IT4U 강연회 - 악성코드 분석 잘하고 싶어요
 
Nationality recognition
Nationality recognitionNationality recognition
Nationality recognition
 
[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래
[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래
[오컴 Clip IT 세미나] 머신러닝과 인공지능의 현재와 미래
 
Things Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in MindThings Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in Mind
 
Meetup history
Meetup historyMeetup history
Meetup history
 
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
[HYSS 2016] 쉽고 빠르게 시작하는 Volatility Plugin 개발
 
Coding interview
Coding interviewCoding interview
Coding interview
 
Machine Learning with Apache Spark and Zeppelin
Machine Learning with Apache Spark and ZeppelinMachine Learning with Apache Spark and Zeppelin
Machine Learning with Apache Spark and Zeppelin
 
Sw학생교재소개(초)
Sw학생교재소개(초)Sw학생교재소개(초)
Sw학생교재소개(초)
 

유전 알고리즘으로 패킷 필터링 규칙 만들기