Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)

Nate Lawson
Nate LawsonEngineer at Root Labs
Copy Protection Wars:
Analyzing Retro and Modern Schemes
               Nate Lawson
        Cryptography Research, Inc.
         Hackers & Threats II (1450)
             February 6th, 2007
Which copy protection era are you?


                   Disk drive…?




     2006               1996         1986
Which copy protection era are you?


                    Modchip…?




     2006             1996              1986
   (Xbox360)        (Sony PS1)       (Commodore
                                      1541 floppy)
Which copy protection era are you?


                      ANSI…?




     2006             1996           1986
Which copy protection era are you?


                     Monitor…?




     2006              1996          1986
Who am I?

 • Co-designer of the Blu-ray disc content protection layer
  (Cryptography Research)
 • Designer of ISS RealSecure network intrusion detection system
 • FreeBSD committer since 2002
   —   Author/maintainer of power management and ACPI kernel code,
       SCSI and USB

 • Contributor to C64 Preservation Project
   —   Software for imaging original floppies and replicating copy protection
       schemes bit-for-bit
Why does the past matter?

 • Approaches are still the same as for C64
   —   Killer tracks = LaserLock CD/DVD protection
   —   Track-to-track alignment = Xbox1/360 sector skew checks
   —   Custom GCR encoding = ECC tricks, weak sectors

 • Many modern hackers linked to C64 scene
   —   commodore4eva: Xbox360 drive firmware hacks
   —   Michael Steil: Xbox1 MIST PCI hack



                                =                    ?
Legal support for retro-hacking

 • Excluded from DMCA anti-circumvention clause
   —   Library of Congress ruling (every 3 years)

 • Copyright protection still applies so you must have original media
 • Seek legal advice before circumventing any protection
   —   I’m not your lawyer!


            Exemptions:
            2. Computer programs and video games distributed in formats
            that have become obsolete and that require the original media or
            hardware as a condition of access, when circumvention is
            accomplished for the purpose of preservation or archival
            reproduction of published digital works by a library or archive.
                                http://www.copyright.gov/1201/docs/2006_statement.html
Definition: asymmetry

 • Asymmetry
   —   Property where forward operation is cheaper than reverse
   —   Example:
Definition: copy protection

 • Copy protection
   —   Leveraging asymmetry between production and playback
       environment to increase cost of copying
   —   If cost of copying > profit of copying, vendor wins!
         • Note: almost no systems meet this criteria



                                             vs.
Definition: defender advantage

 • Defender advantage
   —   As first mover, defender sets the rules of the game
   —   But defender must use advantage properly!
Asymmetry used for copy protection

  •   Physical media
      —   Meta-data: production equipment can create patterns on media user
          equipment cannot
      —   Cost: pressing discs cheaper than burning recordable media

  •   Software
      —   Obscurity: executing code easier than understanding it
      —   Self-checks: creating integrity checks easier than finding them all
      —   Environment: real hw/sw have behavior different from patched or
          emulated hw/sw

  •   Crypto
      —   Encrypting data with a key easier than decrypting without it
               • Caveat: key is always somewhere in hw/sw attacker controls
Time for a remedial history lesson…



C64 Protection Methods
History: sector errors

   • Checking sector errors (1983)
     —   Asymmetry: firmware in drive cannot create sectors with errors
     —   Protection: create bad sectors during mastering and check for them
     —   Attack: create custom drive routine to detect and replicate error

   • Modern use
     —   Multi-session CD with TOC containing errors
     —   Sony PS1/Suncomm/CactusShield/key2audio (“sharpie” hack)


                    Data

                                                   Bad sector
History: gap bytes

  •   Checking gap bytes (1985)
      —   Asymmetry
             • Drive head requires time to switch from reading to writing
             • Drive finds where it is by reading header data
      —   Protection: store pattern in gap between sectors and check for it
      —   Attack: solder on more drive RAM or parallel cable so entire track can be
          written at once

  •   Modern use
      —   Store key in sub-channel data that is used to decrypt exe (SafeDisc)


                                                    Gap bytes
History: track alignment

  • Track-to-track alignment (1986)
     —   Asymmetry: “soft sector” locator method means overall physical layout
         unknown
     —   Protection: seek from track to track and immediately check first data found
     —   Attack
           • Write entire track at once (addl. RAM or parallel cable)
           • Custom drive routine to recreate alignment of original
  • Modern use
     —   CD Cops PC game protection
     —   Xbox1/360 security sector alignment
                                                                        Rotational
                                                                          delay
Who watches the watcher?

  • If you were listening, you said…
    —   “All the above schemes can be subverted if code not intact.”

  • Self-checks, obfuscation, crypto, environment checks…
    —   Would be another whole talk
    —   Asymmetries
          • Difficult for human to understand arbitrary code
          • Protection can occur anywhere within the code
          • Nearly all methods of observing/modifying code execution cause
            observable side effects
                Profound impact on detecting modern virtualization techniques
And now the main event…



C64 vs. Xbox 360
C64 drive interface

  • Serial I/O port provides command/response channel
  • Parallel I/O port added to tap data directly


           Parallel I/O
                                    Serial I/O
C64 drive interface



  Parallel port




                  Parallel I/O   Serial I/O
                                     Drive head




                   Direct taps
                                                  Index hole
                                                    sensor
Demo: C64 disk imaging process

  • PC writes to drive RAM directly via serial port
  • Custom code reads raw track data
  • PC scans raw bytes from parallel port
  • PC loads disk image into emulator for analysis
                       _flop_main:
                               SEI
                               LDA   #$ee
                               STA   $1c0c
                               LDA   #$0b
                               STA   $180c
                               LDA   $1c00
                               AND   #$f3
                               STA   $1c00
                               LDA   #$24
                               STA   $c2




                                             TRACK DATA
                                             ……#………………#……………………
                                             ………………………………………………
                                             ……………#…#.………………………
                                             ……………………………##……………
                                             ………………………………………………
                                             …#########……………………
                                             ………##………………###……..
Xbox360 drive hardware hack

  • Desolder flash chip and dump/replace using socket
  • Disassemble firmware (MN103 microcontroller)
Demo: cracking C64 disk in emulator

  • Disk image fails to boot in emulator
  • Watch command channel in emulated drive
  • Identify protection sequence in drive
    —   Vorpal (Epyx): checks gap bytes

  • Subvert protection check by patching drive RAM
Xbox 360 drive software hack

  • Unlocking drive (mode B)
    —   Send a sequence of ATA commands
    —   Ground pin on SATA connector while powering up

  • Accessing firmware
    —   Read/write a few bytes in drive RAM using cmd 0xE7
    —   Upload and execute custom trampoline code
    —   Read/write entire drive RAM using custom code
                                      // Hitachi   read memory   command (Kevin East – 7thSon)
                                      cgc.cmd[0]   = 0xE7;
                                      cgc.cmd[1]   = 0x48;
                                      cgc.cmd[2]   = 0x49;
                                      cgc.cmd[3]   = 0x54;
                                      cgc.cmd[4]   = 0x01;
                                      cgc.cmd[6]   = (unsigned   char)((addr & 0xFF000000) >> 24);
                                      cgc.cmd[7]   = (unsigned   char)((addr & 0x00FF0000) >> 16);
                                      cgc.cmd[8]   = (unsigned   char)((addr & 0x0000FF00) >> 8);
                                      cgc.cmd[9]   = (unsigned   char)(addr & 0x000000FF);
Xbox 360
Security Analysis
Xbox 360 status

  • Drive totally compromised
    —   Fully custom firmware in use
    —   Copies run from DVD-R media

  • Host completely uncompromised
    —   No Linux, user-created games, etc.
    —   All crypto keys and kernel code still secret

  • Current hacks good enough to support copied games
    —   Attacker winning this battle

  • Much still unknown about overall security
    —   Advantage: defender, but how well will they use this?
Challenge/response scheme

   1. Drive reads security sector from lead-out
   2. Drive sends encrypted data to host
   3. Host decrypts table
   4. Host chooses various challenges and sends to drive
     —   Type 0: static value from DRT table
     —   Type 1, 3: measurements of length of security sectors
     —   Type 5, 7: skew between sector locations on disc

     —   Type E0: account of all previous challenges seen

   5. Drive calculates response and replies
   6. Host checks if response matches value decrypted from table
Challenge/response attack analysis

  • Security sector stored in lead-out
    —   Asymmetry: stock firmware won’t read this data for the user
    —   Attack: read drive memory after it reads lead-out

  • C/R table is encrypted
    —   Asymmetry: only Xbox has key to decrypt table
    —   Attack: none yet, but table can be sent to host without decrypting

  • Responses to challenges derived from physical media
    —   Asymmetry: real media has strict physical layout, recorded won’t
    —   Attack: query drive from PC while real media in drive, replay values
        from patched firmware
Repairing the hole

  • Attackers only have a tenuous hold on drive and no host
    compromise
  • Examining asymmetries gives new defenses
    —   Asymmetry: real media analysis will be slightly different each time
          • Defense: check that responses vary appropriately between
            challenges of the same type
    —   Asymmetry: patched firmware can’t disable loader methods
          • Defense: use same debug commands to load disc-specific
            hashing code into drive, check for patched firmware
    —   Asymmetry: response table must be somewhere on copied media
          • Defense: look for SS.bin file via host or code loading into drive
Conclusion

  • Asymmetry is a useful concept for analyzing schemes
    —   Defender only has to increase cost of attack enough (effort/$) to
        force attackers to look elsewhere
    —   Defender starts with inherent advantage but must use it properly

  • A lot can be learned from the past
    —   Attacks and defenses still same as 1986!
    —   Retro-hacking is fun, cheap, and informative

                  Copies of the slides or comments?

                           Nate Lawson
                           nate@root.org
                           http://root.org/
1 of 30

Recommended

Managing server secrets at scale with SaltStack and a vaultless password manager by
Managing server secrets at scale with SaltStack and a vaultless password managerManaging server secrets at scale with SaltStack and a vaultless password manager
Managing server secrets at scale with SaltStack and a vaultless password managerIgnat Korchagin
591 views104 slides
Jackpot! Attacking Arcade Machines by
Jackpot! Attacking Arcade MachinesJackpot! Attacking Arcade Machines
Jackpot! Attacking Arcade MachinesPatrick Sayler
27 views86 slides
Lukas Apa - Hacking Robots Before SkyNet by
Lukas Apa - Hacking Robots Before SkyNet Lukas Apa - Hacking Robots Before SkyNet
Lukas Apa - Hacking Robots Before SkyNet NoNameCon
222 views56 slides
SeaPort Systems Rugged 4U HPC Workstation - System Data Sheet by
SeaPort Systems Rugged 4U HPC Workstation - System Data SheetSeaPort Systems Rugged 4U HPC Workstation - System Data Sheet
SeaPort Systems Rugged 4U HPC Workstation - System Data SheetDarin George
178 views3 slides
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ... by
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Ron Munitz
222 views50 slides
[ENG] IPv6 shipworm + My little Windows domain pwnie by
[ENG] IPv6 shipworm + My little Windows domain pwnie[ENG] IPv6 shipworm + My little Windows domain pwnie
[ENG] IPv6 shipworm + My little Windows domain pwnieZoltan Balazs
1.6K views51 slides

More Related Content

What's hot

Linux lv ms step by step by
Linux lv ms step by stepLinux lv ms step by step
Linux lv ms step by stepsudakarman
131 views18 slides
Gnu linux on arm for $50 - $100 by
Gnu linux on arm for $50 - $100Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100Dobrica Pavlinušić
1.3K views15 slides
IoT and IIOT at QuBit Prague 2018 by
IoT and IIOT at QuBit Prague 2018 IoT and IIOT at QuBit Prague 2018
IoT and IIOT at QuBit Prague 2018 Avast
157 views65 slides
The <$100 Cyber Sensor, You Can Build It! by
The  <$100 Cyber Sensor, You Can Build It!The  <$100 Cyber Sensor, You Can Build It!
The <$100 Cyber Sensor, You Can Build It!Ludwig Goon
513 views22 slides
UDOO IoT Platform by
UDOO IoT PlatformUDOO IoT Platform
UDOO IoT PlatformMaurizio Caporali
278 views14 slides
FreeBSD on Cavium ThunderX System on a Chip by
FreeBSD on Cavium ThunderX System on a ChipFreeBSD on Cavium ThunderX System on a Chip
FreeBSD on Cavium ThunderX System on a ChipSemihalf
1.9K views49 slides

What's hot(20)

Linux lv ms step by step by sudakarman
Linux lv ms step by stepLinux lv ms step by step
Linux lv ms step by step
sudakarman131 views
IoT and IIOT at QuBit Prague 2018 by Avast
IoT and IIOT at QuBit Prague 2018 IoT and IIOT at QuBit Prague 2018
IoT and IIOT at QuBit Prague 2018
Avast157 views
The <$100 Cyber Sensor, You Can Build It! by Ludwig Goon
The  <$100 Cyber Sensor, You Can Build It!The  <$100 Cyber Sensor, You Can Build It!
The <$100 Cyber Sensor, You Can Build It!
Ludwig Goon513 views
FreeBSD on Cavium ThunderX System on a Chip by Semihalf
FreeBSD on Cavium ThunderX System on a ChipFreeBSD on Cavium ThunderX System on a Chip
FreeBSD on Cavium ThunderX System on a Chip
Semihalf1.9K views
CPU vulnerabilities - where are we now? by DefCamp
CPU vulnerabilities - where are we now?CPU vulnerabilities - where are we now?
CPU vulnerabilities - where are we now?
DefCamp267 views
دورة الصيانة by Moamen Ayyad
دورة الصيانة دورة الصيانة
دورة الصيانة
Moamen Ayyad324 views
License protections & software cracking by blaufish
License protections & software crackingLicense protections & software cracking
License protections & software cracking
blaufish592 views
44CON 2014 - Simple Hardware Sidechannel Attacks for 10 GBP or Less, Joe Fitz... by 44CON
44CON 2014 - Simple Hardware Sidechannel Attacks for 10 GBP or Less, Joe Fitz...44CON 2014 - Simple Hardware Sidechannel Attacks for 10 GBP or Less, Joe Fitz...
44CON 2014 - Simple Hardware Sidechannel Attacks for 10 GBP or Less, Joe Fitz...
44CON1.6K views
GPU/VGA Thermal Design Power by Den Ronggo
GPU/VGA Thermal Design PowerGPU/VGA Thermal Design Power
GPU/VGA Thermal Design Power
Den Ronggo1K views
Build your own private blockchain based on ethereum by Mehran Pourvahab
Build your own private blockchain based on ethereumBuild your own private blockchain based on ethereum
Build your own private blockchain based on ethereum
Mehran Pourvahab328 views
Honeypots: Visão Geral by bernardo_mr
Honeypots: Visão GeralHoneypots: Visão Geral
Honeypots: Visão Geral
bernardo_mr1.6K views
Playing CTFs for Fun & Profit by impdefined
Playing CTFs for Fun & ProfitPlaying CTFs for Fun & Profit
Playing CTFs for Fun & Profit
impdefined1.2K views
CORSAIR VENGEANCE A4100 GAMING PC REVIEW by Dharmendra Rama
CORSAIR VENGEANCE A4100 GAMING PC REVIEWCORSAIR VENGEANCE A4100 GAMING PC REVIEW
CORSAIR VENGEANCE A4100 GAMING PC REVIEW
Dharmendra Rama 47 views
Understanding a kernel oops and a kernel panic by Joseph Lu
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Joseph Lu2.4K views
How to hide your browser 0-day @ Disobey by Zoltan Balazs
How to hide your browser 0-day @ DisobeyHow to hide your browser 0-day @ Disobey
How to hide your browser 0-day @ Disobey
Zoltan Balazs465 views

Viewers also liked

When Crypto Attacks! (Yahoo 2009) by
When Crypto Attacks! (Yahoo 2009)When Crypto Attacks! (Yahoo 2009)
When Crypto Attacks! (Yahoo 2009)Nate Lawson
3K views26 slides
ACPI and FreeBSD (Part 1) by
ACPI and FreeBSD (Part 1)ACPI and FreeBSD (Part 1)
ACPI and FreeBSD (Part 1)Nate Lawson
1.6K views16 slides
ACPI and FreeBSD (Part 2) by
ACPI and FreeBSD (Part 2)ACPI and FreeBSD (Part 2)
ACPI and FreeBSD (Part 2)Nate Lawson
3.5K views15 slides
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004) by
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)Nate Lawson
862 views30 slides
Foundations of Platform Security by
Foundations of Platform SecurityFoundations of Platform Security
Foundations of Platform SecurityNate Lawson
830 views22 slides
Crypto Strikes Back! (Google 2009) by
Crypto Strikes Back! (Google 2009)Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)Nate Lawson
3.7K views33 slides

Viewers also liked(13)

When Crypto Attacks! (Yahoo 2009) by Nate Lawson
When Crypto Attacks! (Yahoo 2009)When Crypto Attacks! (Yahoo 2009)
When Crypto Attacks! (Yahoo 2009)
Nate Lawson3K views
ACPI and FreeBSD (Part 1) by Nate Lawson
ACPI and FreeBSD (Part 1)ACPI and FreeBSD (Part 1)
ACPI and FreeBSD (Part 1)
Nate Lawson1.6K views
ACPI and FreeBSD (Part 2) by Nate Lawson
ACPI and FreeBSD (Part 2)ACPI and FreeBSD (Part 2)
ACPI and FreeBSD (Part 2)
Nate Lawson3.5K views
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004) by Nate Lawson
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)
Nate Lawson862 views
Foundations of Platform Security by Nate Lawson
Foundations of Platform SecurityFoundations of Platform Security
Foundations of Platform Security
Nate Lawson830 views
Crypto Strikes Back! (Google 2009) by Nate Lawson
Crypto Strikes Back! (Google 2009)Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)
Nate Lawson3.7K views
Highway to Hell: Hacking Toll Systems (Blackhat 2008) by Nate Lawson
Highway to Hell: Hacking Toll Systems (Blackhat 2008)Highway to Hell: Hacking Toll Systems (Blackhat 2008)
Highway to Hell: Hacking Toll Systems (Blackhat 2008)
Nate Lawson3.1K views
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007) by Nate Lawson
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Nate Lawson1.8K views
Designing and Attacking DRM (RSA 2008) by Nate Lawson
Designing and Attacking DRM (RSA 2008)Designing and Attacking DRM (RSA 2008)
Designing and Attacking DRM (RSA 2008)
Nate Lawson3.5K views
TLS Optimization by Nate Lawson
TLS OptimizationTLS Optimization
TLS Optimization
Nate Lawson7.7K views
TLS/SSL MAC security flaw by Nate Lawson
TLS/SSL MAC security flawTLS/SSL MAC security flaw
TLS/SSL MAC security flaw
Nate Lawson1.5K views
TLS/SSL Protocol Design 201006 by Nate Lawson
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006
Nate Lawson3K views
TLS/SSL Protocol Design by Nate Lawson
TLS/SSL Protocol DesignTLS/SSL Protocol Design
TLS/SSL Protocol Design
Nate Lawson8.4K views

Similar to Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)

Emulating With JavaScript by
Emulating With JavaScriptEmulating With JavaScript
Emulating With JavaScriptalexanderdickson
700 views209 slides
You suck at Memory Analysis by
You suck at Memory AnalysisYou suck at Memory Analysis
You suck at Memory AnalysisFrancisco Ribeiro
7.3K views116 slides
Feasibility of Security in Micro-Controllers by
Feasibility of Security in Micro-ControllersFeasibility of Security in Micro-Controllers
Feasibility of Security in Micro-Controllersardiri
1.8K views46 slides
Challenges Building Secure Mobile Applications by
Challenges Building Secure Mobile ApplicationsChallenges Building Secure Mobile Applications
Challenges Building Secure Mobile ApplicationsMasabi
1.1K views50 slides
All The Little Pieces by
All The Little PiecesAll The Little Pieces
All The Little PiecesAndrei Zmievski
1.3K views117 slides
got HW crypto-slides_hardwear by
got HW crypto-slides_hardweargot HW crypto-slides_hardwear
got HW crypto-slides_hardwearGunnar Alendal
1K views56 slides

Similar to Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)(20)

Feasibility of Security in Micro-Controllers by ardiri
Feasibility of Security in Micro-ControllersFeasibility of Security in Micro-Controllers
Feasibility of Security in Micro-Controllers
ardiri1.8K views
Challenges Building Secure Mobile Applications by Masabi
Challenges Building Secure Mobile ApplicationsChallenges Building Secure Mobile Applications
Challenges Building Secure Mobile Applications
Masabi1.1K views
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick by 44CON
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON2.7K views
Reverse Engineering the TomTom Runner pt. 1 by Luis Grangeia
Reverse Engineering the TomTom Runner pt. 1 Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1
Luis Grangeia2.8K views
New School Man-in-the-Middle by Tom Eston
New School Man-in-the-MiddleNew School Man-in-the-Middle
New School Man-in-the-Middle
Tom Eston2.6K views
DefCon 2012 - Gaining Access to User Android Data by Michael Smith
DefCon 2012 - Gaining Access to User Android DataDefCon 2012 - Gaining Access to User Android Data
DefCon 2012 - Gaining Access to User Android Data
Michael Smith5K views
Web 2.0 Performance and Reliability: How to Run Large Web Apps by adunne
Web 2.0 Performance and Reliability: How to Run Large Web AppsWeb 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web Apps
adunne2.4K views
Android Mind Reading: Android Live Memory Analysis with LiME and Volatility by Joe Sylve
Android Mind Reading: Android Live Memory Analysis with LiME and VolatilityAndroid Mind Reading: Android Live Memory Analysis with LiME and Volatility
Android Mind Reading: Android Live Memory Analysis with LiME and Volatility
Joe Sylve2.8K views
Matrix glitcher tutorial by José Mota
Matrix glitcher tutorialMatrix glitcher tutorial
Matrix glitcher tutorial
José Mota11.2K views
Scrambling For Video Surveillance by Kobi Magnezi
Scrambling For Video SurveillanceScrambling For Video Surveillance
Scrambling For Video Surveillance
Kobi Magnezi1.5K views
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv... by MongoDB
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
MongoDB602 views
Spark Summit EU talk by Jorg Schad by Spark Summit
Spark Summit EU talk by Jorg SchadSpark Summit EU talk by Jorg Schad
Spark Summit EU talk by Jorg Schad
Spark Summit848 views

Recently uploaded

MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
40 views8 slides
The Coming AI Tsunami.pptx by
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptxjohnhandby
14 views12 slides
Qualifying SaaS, IaaS.pptx by
Qualifying SaaS, IaaS.pptxQualifying SaaS, IaaS.pptx
Qualifying SaaS, IaaS.pptxSachin Bhandari
1.1K views8 slides
Business Analyst Series 2023 - Week 4 Session 7 by
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7DianaGray10
152 views31 slides
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
38 views38 slides
AIM102-S_Cognizant_CognizantCognitive by
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitivePhilipBasford
23 views36 slides

Recently uploaded(20)

The Coming AI Tsunami.pptx by johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby14 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10152 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro38 views
AIM102-S_Cognizant_CognizantCognitive by PhilipBasford
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitive
PhilipBasford23 views
Cocktail of Environments. How to Mix Test and Development Environments and St... by Aleksandr Tarasov
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
Optimizing Communication to Optimize Human Behavior - LCBM by Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar39 views
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
LLMs in Production: Tooling, Process, and Team Structure by Aggregage
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
Aggregage65 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu474 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty66 views
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf by ThomasBronack
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdfBronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
ThomasBronack31 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li104 views
AI + Memoori = AIM by Memoori
AI + Memoori = AIMAI + Memoori = AIM
AI + Memoori = AIM
Memoori15 views
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 by BookNet Canada
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
BookNet Canada46 views

Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)

  • 1. Copy Protection Wars: Analyzing Retro and Modern Schemes Nate Lawson Cryptography Research, Inc. Hackers & Threats II (1450) February 6th, 2007
  • 2. Which copy protection era are you? Disk drive…? 2006 1996 1986
  • 3. Which copy protection era are you? Modchip…? 2006 1996 1986 (Xbox360) (Sony PS1) (Commodore 1541 floppy)
  • 4. Which copy protection era are you? ANSI…? 2006 1996 1986
  • 5. Which copy protection era are you? Monitor…? 2006 1996 1986
  • 6. Who am I? • Co-designer of the Blu-ray disc content protection layer (Cryptography Research) • Designer of ISS RealSecure network intrusion detection system • FreeBSD committer since 2002 — Author/maintainer of power management and ACPI kernel code, SCSI and USB • Contributor to C64 Preservation Project — Software for imaging original floppies and replicating copy protection schemes bit-for-bit
  • 7. Why does the past matter? • Approaches are still the same as for C64 — Killer tracks = LaserLock CD/DVD protection — Track-to-track alignment = Xbox1/360 sector skew checks — Custom GCR encoding = ECC tricks, weak sectors • Many modern hackers linked to C64 scene — commodore4eva: Xbox360 drive firmware hacks — Michael Steil: Xbox1 MIST PCI hack = ?
  • 8. Legal support for retro-hacking • Excluded from DMCA anti-circumvention clause — Library of Congress ruling (every 3 years) • Copyright protection still applies so you must have original media • Seek legal advice before circumventing any protection — I’m not your lawyer! Exemptions: 2. Computer programs and video games distributed in formats that have become obsolete and that require the original media or hardware as a condition of access, when circumvention is accomplished for the purpose of preservation or archival reproduction of published digital works by a library or archive. http://www.copyright.gov/1201/docs/2006_statement.html
  • 9. Definition: asymmetry • Asymmetry — Property where forward operation is cheaper than reverse — Example:
  • 10. Definition: copy protection • Copy protection — Leveraging asymmetry between production and playback environment to increase cost of copying — If cost of copying > profit of copying, vendor wins! • Note: almost no systems meet this criteria vs.
  • 11. Definition: defender advantage • Defender advantage — As first mover, defender sets the rules of the game — But defender must use advantage properly!
  • 12. Asymmetry used for copy protection • Physical media — Meta-data: production equipment can create patterns on media user equipment cannot — Cost: pressing discs cheaper than burning recordable media • Software — Obscurity: executing code easier than understanding it — Self-checks: creating integrity checks easier than finding them all — Environment: real hw/sw have behavior different from patched or emulated hw/sw • Crypto — Encrypting data with a key easier than decrypting without it • Caveat: key is always somewhere in hw/sw attacker controls
  • 13. Time for a remedial history lesson… C64 Protection Methods
  • 14. History: sector errors • Checking sector errors (1983) — Asymmetry: firmware in drive cannot create sectors with errors — Protection: create bad sectors during mastering and check for them — Attack: create custom drive routine to detect and replicate error • Modern use — Multi-session CD with TOC containing errors — Sony PS1/Suncomm/CactusShield/key2audio (“sharpie” hack) Data Bad sector
  • 15. History: gap bytes • Checking gap bytes (1985) — Asymmetry • Drive head requires time to switch from reading to writing • Drive finds where it is by reading header data — Protection: store pattern in gap between sectors and check for it — Attack: solder on more drive RAM or parallel cable so entire track can be written at once • Modern use — Store key in sub-channel data that is used to decrypt exe (SafeDisc) Gap bytes
  • 16. History: track alignment • Track-to-track alignment (1986) — Asymmetry: “soft sector” locator method means overall physical layout unknown — Protection: seek from track to track and immediately check first data found — Attack • Write entire track at once (addl. RAM or parallel cable) • Custom drive routine to recreate alignment of original • Modern use — CD Cops PC game protection — Xbox1/360 security sector alignment Rotational delay
  • 17. Who watches the watcher? • If you were listening, you said… — “All the above schemes can be subverted if code not intact.” • Self-checks, obfuscation, crypto, environment checks… — Would be another whole talk — Asymmetries • Difficult for human to understand arbitrary code • Protection can occur anywhere within the code • Nearly all methods of observing/modifying code execution cause observable side effects Profound impact on detecting modern virtualization techniques
  • 18. And now the main event… C64 vs. Xbox 360
  • 19. C64 drive interface • Serial I/O port provides command/response channel • Parallel I/O port added to tap data directly Parallel I/O Serial I/O
  • 20. C64 drive interface Parallel port Parallel I/O Serial I/O Drive head Direct taps Index hole sensor
  • 21. Demo: C64 disk imaging process • PC writes to drive RAM directly via serial port • Custom code reads raw track data • PC scans raw bytes from parallel port • PC loads disk image into emulator for analysis _flop_main: SEI LDA #$ee STA $1c0c LDA #$0b STA $180c LDA $1c00 AND #$f3 STA $1c00 LDA #$24 STA $c2 TRACK DATA ……#………………#…………………… ……………………………………………… ……………#…#.……………………… ……………………………##…………… ……………………………………………… …#########…………………… ………##………………###……..
  • 22. Xbox360 drive hardware hack • Desolder flash chip and dump/replace using socket • Disassemble firmware (MN103 microcontroller)
  • 23. Demo: cracking C64 disk in emulator • Disk image fails to boot in emulator • Watch command channel in emulated drive • Identify protection sequence in drive — Vorpal (Epyx): checks gap bytes • Subvert protection check by patching drive RAM
  • 24. Xbox 360 drive software hack • Unlocking drive (mode B) — Send a sequence of ATA commands — Ground pin on SATA connector while powering up • Accessing firmware — Read/write a few bytes in drive RAM using cmd 0xE7 — Upload and execute custom trampoline code — Read/write entire drive RAM using custom code // Hitachi read memory command (Kevin East – 7thSon) cgc.cmd[0] = 0xE7; cgc.cmd[1] = 0x48; cgc.cmd[2] = 0x49; cgc.cmd[3] = 0x54; cgc.cmd[4] = 0x01; cgc.cmd[6] = (unsigned char)((addr & 0xFF000000) >> 24); cgc.cmd[7] = (unsigned char)((addr & 0x00FF0000) >> 16); cgc.cmd[8] = (unsigned char)((addr & 0x0000FF00) >> 8); cgc.cmd[9] = (unsigned char)(addr & 0x000000FF);
  • 26. Xbox 360 status • Drive totally compromised — Fully custom firmware in use — Copies run from DVD-R media • Host completely uncompromised — No Linux, user-created games, etc. — All crypto keys and kernel code still secret • Current hacks good enough to support copied games — Attacker winning this battle • Much still unknown about overall security — Advantage: defender, but how well will they use this?
  • 27. Challenge/response scheme 1. Drive reads security sector from lead-out 2. Drive sends encrypted data to host 3. Host decrypts table 4. Host chooses various challenges and sends to drive — Type 0: static value from DRT table — Type 1, 3: measurements of length of security sectors — Type 5, 7: skew between sector locations on disc — Type E0: account of all previous challenges seen 5. Drive calculates response and replies 6. Host checks if response matches value decrypted from table
  • 28. Challenge/response attack analysis • Security sector stored in lead-out — Asymmetry: stock firmware won’t read this data for the user — Attack: read drive memory after it reads lead-out • C/R table is encrypted — Asymmetry: only Xbox has key to decrypt table — Attack: none yet, but table can be sent to host without decrypting • Responses to challenges derived from physical media — Asymmetry: real media has strict physical layout, recorded won’t — Attack: query drive from PC while real media in drive, replay values from patched firmware
  • 29. Repairing the hole • Attackers only have a tenuous hold on drive and no host compromise • Examining asymmetries gives new defenses — Asymmetry: real media analysis will be slightly different each time • Defense: check that responses vary appropriately between challenges of the same type — Asymmetry: patched firmware can’t disable loader methods • Defense: use same debug commands to load disc-specific hashing code into drive, check for patched firmware — Asymmetry: response table must be somewhere on copied media • Defense: look for SS.bin file via host or code loading into drive
  • 30. Conclusion • Asymmetry is a useful concept for analyzing schemes — Defender only has to increase cost of attack enough (effort/$) to force attackers to look elsewhere — Defender starts with inherent advantage but must use it properly • A lot can be learned from the past — Attacks and defenses still same as 1986! — Retro-hacking is fun, cheap, and informative Copies of the slides or comments? Nate Lawson nate@root.org http://root.org/