Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ya no se juega al veo veo
Search
Alex
February 08, 2015
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ya no se juega al veo veo
Alex
February 08, 2015
Other Decks in Programming
See All in Programming
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4k
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
270
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
590
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
1
190
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
360
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
140
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
Dockerfile CMD for Node.js
grazie1999
0
120
React本体のコードリーディング
high_g_engineer
1
150
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
300
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
170
初めての模倣学習とVLA
natsutan
0
190
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
380
Mobile First: as difficult as doing things right
swwweet
225
10k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Discover your Explorer Soul
emna__ayadi
2
1.3k
BBQ
matthewcrist
89
10k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
280
Being A Developer After 40
akosma
91
590k
GraphQLとの向き合い方2022年版
quramy
50
15k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
280
Side Projects
sachag
455
43k
Transcript
Alejandro Morais Ya no se juega al veo veo Except
where otherwise noted, this work is licensed under: http://creativecommons.org/licenses/by-nc-sa/3.0/ Leganés 12-13 Febrero 2015
2 • Introducción • Técnicas de Ofuscación en Javascript •
Herramientas • Problemas con streaming de música, videos… • Posibles Soluciones • Conclusión (Es decir, un mejunje JS + Agenda
3 Bienvenido s
4 Y….
5
Aburrido…
¡¡Series!!
Seriesly antes molaba
Publicidad, publicidad, publicidad Hemos picado todos…
• Publicidad Y • Reproductor JWPlayer
Todo el mundo quiere a JWPlayer
Hmm… ¿Seguridad?
Probemos…
Chrome -> Inspect -> “file: **”
Automatizando… (Con PHP, claro)
Froxy
Pero no todo es un camino de piruletas
Cachis… ¿eval? ¿packed?
Ofuscando
Ofuscando: Técnicas • Minimizar • Como funciona eval() • ASCII
• Unicode • XOR • Split de Strings • Packed • Encriptado Simple • Técnicas Avanzadas
Warning Antes de empezar a ofuscar código siempre hay que
hacer una o varias copias del original (siempre se pierden las copias)
• Minimizar Ofuscando: Técnicas • Uso de variables con longitudes
más cortas • Eliminación de espacios y tabs
• Minimizar Ofuscando: Técnicas Twitter: https://abs.twimg.com/c/swift/es/bundle/fro ntpage...js 269 KB ->
compresión (solo espacios) -> 196 KB ¡¡ Ahorro del 27.2 % !! (Con variables ~ 30%)
• Cómo funciona Eval() Ofuscando: Técnicas Pero se sigue viendo
el código directamente… Hmm…
• ASCII Ofuscando: Técnicas
• Unicode Ofuscando: Técnicas
• XOR (ASCII) Ofuscando: Técnicas Clave: 173 xor_str(“var a =
…”); Misma función, encripta y desencripta
• XOR (Character Encoding) Ofuscando: Técnicas Clave: 173 Misma función,
encripta y desencripta xor_str(“var a = …”);
• Split de Strings Ofuscando: Técnicas Un poco cutre
Ofuscando: Técnicas • Packed
• Encriptado Simple Ofuscando: Técnicas La encriptación es fuerte en
el algoritmo o en la contraseña
• Técnica del “Espacio en blanco” Ofuscando: Técnicas Usar “document”
o “eval”, canta mucho… Lo mismo hacemos con “getElementById”, “innerHtml”,…
• Técnica del “Espacio en blanco” Ofuscando: Técnicas
• Técnica del “Espacio en blanco” Ofuscando: Técnicas El código
original están en el código que desofusca
Un poco de tabulación…
Eval fuera
Variables “e” y “d” no se usan “c.toString(a)” => Convierte
“c” en base “a” Por lo tanto base “36”
Resultado
Automatizando…
https://github.com /alxhotel/unpack-js
Herramientas • UglifyJS https://github.com/mishoo/UglifyJS • Jscrambler https://jscrambler.com/es/ • YuiCompressor http://yui.github.io/yuicompressor/
• Jsbeautifier http://jsbeautifier.org/
Volviendo al streaming…
Los videos están al alcance de un copy paste
Pero esto son casos aislados… ¿no?
Buscando…
Caso Grooveshark • “Session”: valor de la cookie • “Uuid”:
buscamos en JS • “Token”: buscamos en JS JS minimizado. Hmm…
Caso Grooveshark El veo veo hardcore: 1. Ctrl + F
2. Buscar palabra clave 3. Probar 4. Si no funciona vuelve al 1.
Caso Grooveshark • “Uuid”: encontrado en app.min.js • “Token”: de
la peticion getCommunicationToken JS minimizado no tiene “protección”
Algo falla… Necesitamos Seguridad
Posible Soluciones • Token / URLs Firmadas • Encriptación AES
• DRM (~ AES) • Bloquear por localización • Marcas de Agua • Limitar Velocidad
Netflix
Conclusión
Da igual
En streaming todavía tenemos medidas de seguridad
Pero… Seguimos teniendo que desencriptar el archivo en nuestro ordenador
P2P
La ofuscación es útil cuando se usa una combinación de
técnicas
Pero… No debería ser el muro de seguridad sino una
capa más
Ya no se juega al veo veo
Gracias Twitter: @alxhotel Linkedin: /in/alexmorais Github: @alxhotel