Top Banner
ON
90

ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

Aug 18, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ON

Page 2: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

SERVICES WRITE-UPS Mikhail Vyatskov aka Tris and more

Page 3: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MOTIVATION “The main goal of RuCTFE is to share experience

and knowledge in the computer security and to

have some fun together.”

— RuCTFE Rules

Page 4: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

RULES • Each team has an image

• There are some services on this image

• There are some vulnerabilities

• Hack em’ all!

Page 5: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MINISTRY OF LOVE Maxim Muzafarov aka m_messiah

Page 6: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • Python

• Tornado web server

• Momoko

• WebSockets

Page 7: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WATCH CRIMES • image

Page 8: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

REPORT A CRIME • image

Page 9: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

AUTHENTICATE • image

Page 10: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 11: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

SQL INJECTION

Page 12: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

SQL INJECTION

Page 13: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

SQL INJECTION

Page 14: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

PROFILE SPOOFING

Bind profile without authentication

Page 15: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

PROFILE SPOOFING Profile ids are visible

in open crimes

Page 16: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

SAME DATABASE • Each team has similar database

• Each team has all authentication data

Page 17: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

“BACKDOOR”

Page 18: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

bit.ly/ructfe_mol_sploit

Page 19: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MINISTRY OF TAXES Pavel Blinov aka pahaz

Page 20: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • Node.js

• Koa web framework

• Custom router

Page 21: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ADD PERSONAL DATA • image

Page 22: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

UPLOAD REPORT • image

Page 23: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

UPLOAD REPORT • image

Page 24: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 25: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WEAK ID GENERATION

So what?

Page 26: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WEAK ID GENERATION

Page 27: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

REMOTE CODE EXECUTION

Page 28: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

REMOTE CODE EXECUTION

Page 29: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

bit.ly/ructfe_tax_sploit

Page 30: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ELECTIONS FOR E-DEMOCRACY Konstantin Plotnikov aka kost

Page 31: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • C# + Mono

• Homomorphic encryption

Page 32: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ELECTIONS • TODO

Page 33: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

NOMINATE • image

Page 34: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

VOTE • image

Page 35: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

GET ELECTED • image

Page 36: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 37: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

UNFILTERED INPUT • Client-side vote generation & encryption

• Vote – vector of integers

• Election result – sum of votes

Page 38: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

UNFILTERED INPUT

break & hack

Page 39: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

UNFILTERED INPUT • Calculations are made modulo 243

• Overflow competitor's value

• Let the battle begins!

Page 40: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WEAK PRIVATE KEY GENERATOR • Calculations are made modulo 243 = 35

• Private key – random number

• Chance of them being non-coprime

• 3 divides private key ⇒ can decrypt

Page 41: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WEAK PRIVATE KEY GENERATOR • image

Page 42: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WEAK PRIVATE KEY GENERATOR • image

Page 43: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

WEAK PRIVATE KEY GENERATOR • image

Page 44: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

NASA RASA Andrey Gein aka andgein

Page 45: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • PHP

• MySQL

Page 46: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

REPORT A PLANET • image

Page 47: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

BROWSE DISCOVERED PLANETS • image

Page 48: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

BROWSE USERS • image

Page 49: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 50: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HARDCODED DB CREDENTIALS Remember about RCE?

Page 51: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

PADSPACE COLLATION • todo

⇒2

Page 52: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

bit.ly/ructfe_collations

Page 53: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HEALTH MONITOR Polina Zonova aka Klyaksa

Page 54: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • Go

• SQLite

Page 55: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

REPORT YOUR HEALTH • todo

Page 56: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

BROWSE YOUR PROGRESS • todo

Page 57: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 58: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

AUTHENTICATION

Page 59: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HARDCODED SALT

Plan: 1. Set up vulnbox 2. Change all passwords & keys 3. Win

Page 60: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

LENGTH EXTENSION ATTACK • uids are serial – we can guess

• Over 9k tools to perform MD5 LEA

Page 61: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

INTERPLANETARY MIGRATION AUTHORITY Dmitry Titarenko aka dscheg

Page 62: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • Nim

• Redis

Page 63: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

KNOW CITIZENS • TODO

Page 64: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

FILL MIGRATION FORM… • фы

Page 65: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

…BUT NOT QUITE • фыв

Page 66: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 67: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HARDCODED DB CREDENTIALS And again

Page 68: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HMAC USING EXTERNAL LIBRARY

zero-padded user has the same HMAC

Page 69: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HMAC USING EXTERNAL LIBRARY

• Login as one of citizens

• Steal flag from the filled form

Page 70: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MODIFYING LOCAL DATA • Form data stored on client side

• Form data is encrypted

• AES encryption in CBC mode

• No integrity checks

Page 71: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MODIFYING LOCAL DATA • We know plaintext – JSON with filled data

• We can modify ciphertext

Page 72: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MODIFYING LOCAL DATA • todo

Page 73: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

MITM • On step 3 we need to sign up a random value

• Only checker has the private key

• Let’s hack value generation function

• Check will sign everything for us

Page 74: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

bit.ly/ructfe_mig_sploit

Page 75: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

THE BANK Alexander Bersenev aka bay

Page 76: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ABOUT SERVICE • C

• Mongoose

• Custom dictionary

Page 77: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

CREATE ACCOUNTS • todo

Page 78: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

TRANSFER MONEY • todo

Page 79: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

HACK IT!

Page 80: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

ACCESS LOGS bank.teamX.e.ructf.org/access.log

Page 81: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

DICTIONARY

Binary Search Tree Position

Independent Code

Page 82: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

DICTIONARY • Key in BST – SHA256 from key in dict

• Value – amount of money (8 bytes)

• BST stored in array

Page 83: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

DICTIONARY Bufferoverflow

Remotecodeexecu2on

Page 84: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

DICTIONARY Shell

jmptoshell

Page 85: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

bit.ly/ructfe_bank_sploit

Page 86: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

RECOMMENDATIONS • Always change keys and passwords

• Learn Linux administration

• Stay positive & have fun!

Page 87: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

Questions?

Page 88: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

Thanks!

Page 89: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

Сервисы

Ministry of Love Interplanetary Migration Authority

Nasa Rasa

Page 90: ON - repo.zenk-security.com · and knowledge in the computer security and to have some fun together.” — RuCTFE Rules . RULES ... • Node.js • Koa web framework • Custom router

Сервисы

Electro Tax

Bank

Health Monitor