동아리방에 지금 누가 있나요?
Who is in the club room?

Freeradius부터 ARP Scanner까지
From Freeradius to ARP Scanner

발표자 소개 Speaker Information

Sangwan Jeon's Profile Picture

전상완 Sangwan Jeon

  • 연세대학교 전기전자공학부 학부생
  • YCC (Yonsei Computer Club) 임원진
https://app.sli.do/event/eMg1YyHjegm9KN9qpbB5T5

Q&A

발표 주제 Presentation Topic

Demo Site Screenshot
  1. 동아리방에 있는 WiFi에 802.1x을 적용하는 방법
  2. WiFi를 이용해 동아리방에 누가 있는지
    실시간으로 확인할 수 있는 서비스를 구축하는 방법
  1. Applying 802.1x to the WiFi in the club room
  2. Making a service that can check
    who is in the club room in real time using WiFi

그런게 왜 필요했는데?
Why did you need a such a thing?

Reason 1

Yonsei Computer Club Notice Kakao Talk Room

회원수 188명의 대형 동아리

그런게 왜 필요했는데?
Why did you need a such a thing?

Reason 1

Yonsei Computer Club Talking about the WiFi Password Leak

비밀번호 유출 사건의 발생

그런게 왜 필요했는데?
Why did you need a such a thing?

Reason 1

Yonsei Computer Club Talking about the WiFi Password Leak

비밀번호 유출 사건의 발생

=> 주기적으로 비밀번호를 바꾸는 방법

그런게 왜 필요했는데?
Why did you need a such a thing?

Reason 1

Yonsei Computer Club Talking about the WiFi Password Leak

비밀번호 유출 사건의 발생

=> 주기적으로 비밀번호를 바꾸는 방법

=> 아니면, 부원마다 다른 비밀번호를?

그런게 왜 필요했는데?
Why did you need a such a thing?

Reason 2

A chat asking who is at the club room 1 A chat asking who is at the club room 2 A chat asking who is at the club room 3 A chat asking who is at the club room 4 A chat asking who is at the club room 5

반복되는 질문

비밀번호 유출 문제 해결하기
Solving the password leak problem

해결 방법들 Solutions

  1. 주기적으로 비밀번호를 바꾼다

해결 방법들 Solutions

  1. 주기적으로 비밀번호를 바꾼다

해결 방법들 Solutions

  1. 주기적으로 비밀번호를 바꾼다
  2. 부원마다 다른 비밀번호를 부여한다

WiFi 인증 방식
WiFi Authentication Methods

WiFi 인증 방식
WiFi Authentication Methods

Open

A WiFi network with no password

비밀번호가 없는 WiFi

- 누구나 접속 가능

WiFi 인증 방식
WiFi Authentication Methods

PSK (Pre-Shared Key)

A WiFi network with pre-shared key

비밀번호가 있는 WiFi

- 비밀번호를 알면 접속 가능

- 비밀번호 유출 시 제지할 수 있는 수단이 없음

WiFi 인증 방식
WiFi Authentication Methods

EAP (Extensible Authentication Protocol)

A WiFi network with EAP

로그인 방식의 WiFi

- 개인에게 할당된 비밀번호가 다름

- 비밀번호 유출 시 제지할 수 있는 수단이 있음

802.1x

로컬 영역 네트워크에서 상대 기기와 연결하는 기기에 대한 인증을 제공하는 방식을 정의한 표준

An ipTime router setup page

RADIUS?

RADIUS?

Remote Authentication Dial In User Service

RADIUS?

Remote Authentication Dial In User Service

네트워크 자원에 대한 접근을 인증(Authenticate)하고 허가(Authorize)하며 관리(Accounting)

RADIUS?

Remote Authentication Dial In User Service

네트워크 자원에 대한 접근을 인증(Authenticate)하고 허가(Authorize)하며 관리(Accounting)

802.1x 위에서 인증을 담당하는 서버

RADIUS Server
RADIUS Server
802.1x
File
RADIUS Server
802.1x
LDAP
File
SQL Database
RADIUS Server
802.1x
LDAP
File
SQL Database
RADIUS Server
802.1x

LDAP

LDAP

Lightweight Directory Access Protocol

Why LDAP?

RADIUS를 포함한 여러 서비스들이 User Federation 용도로 사용

Screenshot of a Keycloak LDAP configuration

LDAP Entry Structure

Screenshot of a LDAP entry

컨테이너 구조 Container Structure

Certbot

PostgreSQL

OpenLDAP

FreeRadius

컨테이너 구조 Container Structure

Certbot

OpenLDAP의 TLS 설정에 필요한 Certificate를 발급하고 갱신한다
Issues and Renews Certificate for TLS settings of OpenLDAP

Entrypoint

/docker-entrypoint.sh

  1. Certificate 존재 확인
  2. Certificate이 없으면 발급
  3. Container 상태를 Healthy로 변경
  4. 24시간마다 인증서 갱신 시도

Volume Mounts

  • ./data/certbot​:/etc/letsencrypt
  • ./data/certs​:/certs
  • ./scripts/certbot/docker-entrypoint.sh​:/docker-entrypoint.sh

Port Exposure

None

컨테이너 구조 Container Structure

PostgreSQL

FreeRadius의 인증 기록과 Accounting 기록을 저장한다
Stores FreeRadius authentication and accounting records

Volume Mounts

  • ./data/database​:/data
  • ./scripts/database/initdb.d
    :/docker-entrypoint-initdb.d

Port Exposure

  • 5432

컨테이너 구조 Container Structure

OpenLDAP

FreeRadius을 통해 접근할 수 있는 유저들의 정보를 저장한다
Stores user information that can be accessed through FreeRadius

Entrypoint

  1. 기본 Organization과 Readonly User 생성
  2. Samba Schema 적용

Volume Mounts

  • ./data/ldap​:/var/lib/openldap
  • ./config/ldap​:/etc/openldap/slapd.d
  • ./data/dhparam​:/dhparam
  • ./scripts/ldap​/assets/custom-scripts

Port Exposure

  • 389
  • 636

컨테이너 구조 Container Structure

FreeRadius

802.1x 인증을 위한 RADIUS 서버
RADIUS server for 802.1x authentication

Entrypoint

  1. 기본 설정 덮어씌우기
  2. ldap, counter, sql 모듈 활성화
  3. 환경변수에서 설정 적용

Volume Mounts

  • ./config/freeradius​:/config
  • ./scripts/freeradius/init.d
    :/docker-entrypoint.d
  • ./scripts/freeradius/docker-entrypoint.sh​:/docker-entrypoint.sh
  • ./data/certs/freeradius​:/certs

Port Exposure

  • 1812
  • 1813

Done?

Nope

Password Hash

Supported hash types by authentication methods

Password Hash

Windows Supported hash types

Password Hash

Supported hash types by authentication methods

NT Hash를 따로 저장해야 함

Password Hash

Supported hash types by authentication methods

NT Hash를 따로 저장해야 함

Where? How?

Password Hash

List of attributes with password in the attribute name

SAMBA?

SAMBA?

윈도우의 파일공유 프로토콜인 SMB 프로토콜을 재 구현한 것

Re-implementation of the SMB networking protocol
which is a protocol for Windows file share

SAMBA?

samba schema

동방에 누구?

Who's in the club room?

동방에 누구?

RADIUS Accounting

RADIUS Accounting

Blank Database

RADIUS Accounting

radpostauth

Summary

What we know

What we don't know

Summary

What we know

  • 접속 시간
    Access Time

What we don't know

Summary

What we know

  • 접속 시간
    Access Time
  • MAC 주소
    MAC Address

What we don't know

Summary

What we know

  • 접속 시간
    Access Time
  • MAC 주소
    MAC Address
  • 사용자 아이디
    User ID

What we don't know

Summary

What we know

  • 접속 시간
    Access Time
  • MAC 주소
    MAC Address
  • 사용자 아이디
    User ID

What we don't know

  • 현재 접속 여부
    (연결 끊긴 시간)
    Current Connection Status
    (Disconnecction Time)

Ping?

Ping?

IP가 필요함
Need IP

Ping?

IP가 필요함
Need IP

MAC 주소를 알 수 없음
Cannot know MAC address

ARP!

ARP!

네트워크 서브넷에 있는 모든 IP에 Ping을 보내고 ARP 테이블을 확인해 보자!
Ping all the ips in the subnet and check the ARP table!

Docker

Docker

네트워크가 Host와 분리되어 있으며 ARP Cache를 Flush할 수 없다
Network is seperated with the host and cannot flush the arp cache

Raspberry Pi 3B
Raspberry Pi 3B
Raspberry Pi 3B

Demo

https://ubucon.codingbear.kr Demo QR

Thank you