오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...Amazon Web Services Korea
서비스 런칭을 위해 라이온하트와 카카오게임즈가 어떻게 최적 성능의 인스턴스를 선택하고, Windows 운영 체제를 최적화하며, 왜 Amazon Aurora를 기본 데이터베이스로 채택하였는지를 설명합니다. 또한, 출시부터 운영까지의 과정에서 MMORPG가 어떻게 AWS 상에서 설계되고, 게임 서버 성능을 극대할 수 있었는지에 대해 전달해드립니다.
Insecure Direct Object References occur when an application provides direct access to objects based on user-supplied input. As a result of this vulnerability attackers can bypass authorization and access resources in the system directly, for example database records or files.
This presentation explain how to discover this vulnerability in application, how to test and how to mitigate the risk.
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...Amazon Web Services Korea
서비스 런칭을 위해 라이온하트와 카카오게임즈가 어떻게 최적 성능의 인스턴스를 선택하고, Windows 운영 체제를 최적화하며, 왜 Amazon Aurora를 기본 데이터베이스로 채택하였는지를 설명합니다. 또한, 출시부터 운영까지의 과정에서 MMORPG가 어떻게 AWS 상에서 설계되고, 게임 서버 성능을 극대할 수 있었는지에 대해 전달해드립니다.
Insecure Direct Object References occur when an application provides direct access to objects based on user-supplied input. As a result of this vulnerability attackers can bypass authorization and access resources in the system directly, for example database records or files.
This presentation explain how to discover this vulnerability in application, how to test and how to mitigate the risk.
Attacking ADFS Endpoints with PowerShell Karl Fosaaen - @kfosaaen Active Directory Federation Services (ADFS) has become increasingly popular in the last few years. As a penetration tester, I'm seeing organizations opening themselves up to attacks on ADFS endpoints across the Internet. Manually completing attacks against these endpoints can be tedious. The current native Microsoft management tools are handy, but what if we weaponized them. During this talk, I will show you how to identify domains that support ADFS, confirm email addresses for users of the domain, and help you guess passwords for those users. We'll cover how you can set up your own hosted ADFS domain (on the cheap), and use it to attack other federated domains. On top of that, we'll show you how you can wrap all of the native functionality with PowerShell to automate your attacks. This talk should give penetration testers an overview on how they can start leveraging ADFS endpoints during a penetration test.
https://www.derbycon.com/events/attacking-adfs-endpoints-with-powershell/
XSS is much more than just <script>alert(1)</script>. Thousands of unique vectors can be built and more complex payloads to evade filters and WAFs. In these slides, cool techniques to bypass them are described, from HTML to javascript. See also http://brutelogic.com.br/blog
발표 영상 - https://www.youtube.com/watch?v=a6XAdK1-ZBE
AWS re:Invent는 매년 신규 서비스를 통해 클라우드 기술의 미래를 조망하고, 새로운 기술을 익히고 배우는 글로벌 기술 컨퍼런스입니다. 분야별 클라우드 기술 전문가이신 AWS Hero와 함께 개발자, 아키텍트 및 데브옵스 엔지니어, 데이터과학자 및 분석가 등 직무별로 새해 주목할 만한 AWS 신규 서비스를 고객의 입장에서 생생하게 전달해 드리고자 합니다.
Slides for Building Better Backdoors with WMI - DerbyCon 2017 - Legacy
Code:
https://github.com/0xbadjuju/PowerProvider/
https://github.com/0xbadjuju/WheresMyImplant
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...Garage4hackers.com
Presentation slides of Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified At XSS by Rafay Baloch. Ask all your question's related to the webcast here http://goo.gl/Vv10hJ. Don't forget to leave you feedback here https://goo.gl/YrBeic.
Attacking ADFS Endpoints with PowerShell Karl Fosaaen - @kfosaaen Active Directory Federation Services (ADFS) has become increasingly popular in the last few years. As a penetration tester, I'm seeing organizations opening themselves up to attacks on ADFS endpoints across the Internet. Manually completing attacks against these endpoints can be tedious. The current native Microsoft management tools are handy, but what if we weaponized them. During this talk, I will show you how to identify domains that support ADFS, confirm email addresses for users of the domain, and help you guess passwords for those users. We'll cover how you can set up your own hosted ADFS domain (on the cheap), and use it to attack other federated domains. On top of that, we'll show you how you can wrap all of the native functionality with PowerShell to automate your attacks. This talk should give penetration testers an overview on how they can start leveraging ADFS endpoints during a penetration test.
https://www.derbycon.com/events/attacking-adfs-endpoints-with-powershell/
XSS is much more than just <script>alert(1)</script>. Thousands of unique vectors can be built and more complex payloads to evade filters and WAFs. In these slides, cool techniques to bypass them are described, from HTML to javascript. See also http://brutelogic.com.br/blog
발표 영상 - https://www.youtube.com/watch?v=a6XAdK1-ZBE
AWS re:Invent는 매년 신규 서비스를 통해 클라우드 기술의 미래를 조망하고, 새로운 기술을 익히고 배우는 글로벌 기술 컨퍼런스입니다. 분야별 클라우드 기술 전문가이신 AWS Hero와 함께 개발자, 아키텍트 및 데브옵스 엔지니어, 데이터과학자 및 분석가 등 직무별로 새해 주목할 만한 AWS 신규 서비스를 고객의 입장에서 생생하게 전달해 드리고자 합니다.
Slides for Building Better Backdoors with WMI - DerbyCon 2017 - Legacy
Code:
https://github.com/0xbadjuju/PowerProvider/
https://github.com/0xbadjuju/WheresMyImplant
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...Garage4hackers.com
Presentation slides of Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified At XSS by Rafay Baloch. Ask all your question's related to the webcast here http://goo.gl/Vv10hJ. Don't forget to leave you feedback here https://goo.gl/YrBeic.
High-Volume Data Collection and Real Time Analytics Using Rediscacois
In this talk, we describe using Redis, an open source, in-memory key-value store, to capture large volumes of data from numerous remote sources while also allowing real-time monitoring and analytics. With this approach, we were able to capture a high volume of continuous data from numerous remote environmental sensors while consistently querying our database for real time monitoring and analytics.
* See more of my work at http://www.codehenge.net
Redis Use Patterns (DevconTLV June 2014)Itamar Haber
An introduction to Redis for the SQL practitioner, covering data types and common use cases.
The video of this session can be found at: https://www.youtube.com/watch?v=8Unaug_vmFI
Noah Davis & Luke Melia of Weplay share a series of examples of Redis in the real world. In doing so, they cover a survey of Redis' features, approach, history and philosophy. Most examples are drawn from the Weplay team's experience using Redis to power features on Weplay.com, a social site for youth sports.
Obfuscation 101
: 난독화, 프로가드, R8, 트랜스포머 API
김용욱
카카오뱅크
영화와 커피를 좋아하는 은행원. 반지 원정대는 극장에서만 15번을 보았다. 데이터베이스를 전공했지만 급변하는 모바일 환경에 반해 안드로이드에 승선했고 Realm을 통해 모바일과 데이터베이스를 융합했다. 그후 새로운 가능성을 찾아 금융으로 왔다.
node.js를 처음 접하는 개발자를 위한 스터디 자료입니다.
실습 위주로, 간단한 웹 페이지를 만들어 보는 것을 목표로 하며,
express를 활용하기에 앞서, node.js 기본 API만으로 GET/POST 처리 방식을 알아봅니다.
내용의 깊이가 있지는 않으며, 단지 node.js의 입문을 위한 가벼운 수준으로 내용이 구성되었습니다.
12. 읽음 처리 요구 사항 변경
1. 메시지 창에서 메시지의 읽음 횟수 출력.
a. 몇 명의 사용자가 메시지를 읽었는지 조회.
b. 메시지 아이디에 대한 읽음 건수 저장.
c. 메시지가 삭제되면 메시지 읽음 건수도 삭제.
2. 동일한 사용자가 API를 여러 번 호출하더라
도 읽음 횟수는 단 1회만 증가!
13. 읽음 건수 데이터 설계 v2 (논리)
1. 방 번호, 메시지 번호로 구성된 키로 Set생성.
2. Set에 메시지를 읽은 사용자의 사용자 번호
저장.
3. 데이터의 조회는 scard 명령을 사용.
14. 읽음 건수 데이터 설계(물리)
Name KeyName Data type 포함정보
메시지 읽음 rcnt:<user>:<room>:<message seq> set {read user}
15. 구현 v2(2/2)
1. 메시지 읽음 횟수 저장
- sadd rcnt:<user>:<room>:<message seq> <read
user>
2. 특정 메시지의 읽음 횟수 조회
- scard rcnt:<user>:<room>:<message seq>
3. 여러 메시지의 읽음 횟수 조회
- scard rcnt:<user>:<room>:<message seq1>
- scard rcnt:<user>:<room>:<message seq2>
18. 토큰 발행 요구사항
1. 만료가 가능한 토큰을 발행한다.
2. 만료일은 발행 시간으로부터 3일로 지정한다
3. 새로운 토큰이 발행되면 이전 토큰은 만료
전까지 사용 가능하다.
4. 토큰은 부가적인 인증 정보를 가진다.
(ex. email, nickname, token issue date)
19. 토큰 데이터 설계(논리)
1. 토큰의 만료는 redis의 expire를 사용.
2. 인증토큰의 부가 정보는 json 문자열로 저장.
3. token은 사용자의 id와 발행 시점의
timestamp를 조합한 문자열에 sha-256 해시를
수행한 값을 사용.
4. 문자열에 token을 키로 하여 인증 정보를 저
장
20. 토큰 데이터 설계(물리)
Name KeyName Data type 포함정보
인증토큰 token:<token string> String {email, userno, nick}
25. 토큰 데이터 설계 v2 (논리)
1. 만료기능은 redis의 expire를 사용
2. 인증과 관련된 추가 정보는 json 문자열로 저장.
3. token은 사용자의 id와 발행 시점의 timestamp를 조합
한 문자열에 sha-256 해시를 수행한 값을 사용.
4. 문자열에 token을 키로 하여 인증 정보를 저장.
5. 사용자 번호로 hash를 생성.
6. hash에 사용자 token과 timestamp를 저장.
26. 토큰 데이터 설계 v2 (물리)
Name KeyName Data type 포함정보
인증토큰 token:<token
string>
String {email, userno, nick}
토큰목록 tokenlist:<userNo> hash {token, expire date}
33. Redis Keyspace Notifications
1. 키의 변경이 발생하면 PUB/SUB을 통해서 확인가능.
- 즉, expire된 키의 이름을 알 수 있음.
- config set notify-keyspace-events Ex
- psubscribe "__keyevent@*"
※ SUB을 받아서 처리하는 별도의 프로그램 작성 필요.
※ 더 많은 내용 http://redis.io/topics/notifications 참조
K Keyspace events, published with __keyspace@<db>__ prefix.
E Keyevent events, published with __keyevent@<db>__ prefix.
g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
...
35. Redis data 설계 주안점 (1/2)
1. 모든 데이터를 키에 저장할 수 있는가?
- 키 만 조회 하여 업무를 처리할 수 있도록 구성.
2. 자료구조 Set, Hash, List등으로 구현이 가능한가?
- 여러개의 명령을 사용하더라도 실행시간이 O(1)인지.
- 우리에겐 Lua가 있다.
4. 데이터 사용 성향에 따라 다른 데이터 구조 선택 필요.
- 빠른 쓰기가 필요한지 빠른 읽기가 필요한지
- Hash와 Sorted set에 대한 trade 가능하면 Hash로.
36. Redis data 설계 주안점 (2/2)
5. 단순한 데이터 조회 패턴을 가지는가?
- RDB의 where 필터링은 불가!!!
6. 숫자 데이터가 많은가?
- 카운터와 같은 숫자 데이터 저장에 강함.
3. Lua 사용시 전체 시간복잡도는 O(log n)을 초과 하지 않
도록 하라.
37. Lua 사용 주의사항
1. 예측 불가능한 Loop문을 사용하지 말것.
- ex) while(true)
※ Lua 스크립트의 실행은 원자성을 가짐.
2. 에러 처리에 신경쓸것.
- ex) 조회한 데이터가 존재하는지 확인.
Editor's Notes
몇 가지 예제를 통해서 데이터 구조를 설계하는 방법을 알아봄.
예제는 읽음 카운트 저장, 인증 토큰 발행, 그리고 시간이 허락한다면 검색어 자동완성
이걸 RDB로 구현 하자면 살짝 머리 아파 집니다.
먼저 구체적으로 요구 사항을 정리해보죠.
레디스의 어떤 데이터형으로 이것을 처리 할 수 있을지 먼저 생각하는것이 중요.
RDB의 테이블에서 인덱스를 구성하고 인덱스 만으로 조회할 수 있도록 데이터를 구성.
이 논리 설계에는 아래의 전재가 깔림
1. 메시지는 영구 저장되지 않음.
2. “한 명의 사용자가 하나의 방에서 수만 건의 메세지를 전송하지 않을 것이다”
hincrby rcnt:6333:8259 12345 1
사용자 번호 6333
방번호 8259
메세지 일련번호 12345
ex) 6333사용자가 8259 방에서 120번 사용자의 메시지인 “hi”를 읽었는데, 해당 메시지 번호는 12345
hincrby rcnt:120:34984 26554 1
여기서 끝나면 너무 싱겁죠.
어떻게 구현해야 할까?
동일한 요청인지 어떻게 구분하지?
플래그 처리? 플래그는 bitset으로 처리 가능
레디스에서 지원하는 데이터 구조 중에 Set데이터를 사용하여 처리 하도록 결정.
실제로 여기서는 이 방법이 가장 무난함.
redis benchmark
몇 가지 선택 사항이 존재.
특정 방의 읽음 횟수 조회 API를 제거하는 방법.
읽음 횟수를 100건씩 잘라서 가져오는 API를 만드는 방법.
예제 보기
기본적으로 Lua 스크립트는 레디스 Command와 동일한 레벨의 실행 수준임.
즉, 스크립트는 완전 독립적으로 실행되며 Lua가 실행되는 동안 다른 명령의 수행이 이루어지지 않음.