ffirs.indd 02:15:28:PM 01/08/2014 Page ii Hacking Point of Sale ffirs.indd 02:15:28:PM 01/08/2014 Page i ffirs.indd 02:15:28:PM 01/08/2014 Page ii Hacking Point of Sale Payment Application Secrets, Threats, and Solutions Slava Gomzin ffirs.indd 02:15:28:PM 01/08/2014 Page iii Hacking Point of Sale: Payment Application Secrets, Threats, and Solutions Published by John Wiley & Sons, Inc 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2014 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-81011-8 ISBN: 978-1-118-81010-1 (ebk) ISBN: 978-1-118-81007-1 (ebk) Manufactured in the United States of America 10 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600 Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose No warranty may be created or extended by sales or promotional materials The advice and strategies contained herein may not be suitable for every situation This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services If professional assistance is required, the services of a competent professional person should be sought Neither the publisher nor the author shall be liable for damages arising herefrom The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or website may provide or recommendations it may make Further, readers should be aware that Internet websites listed in this work may have changed or disappeared between when this work was written and when it is read For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002 Wiley publishes in a variety of print and electronic formats and by print-on-demand Some material included with standard print versions of this book may not be included in e-books or in print-on-demand If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http: //booksupport.wiley.com For more information about Wiley products, visit www.wiley.com Library of Congress Control Number: 2013954096 Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc and/or its affi liates, in the United States and other countries, and may not be used without written permission All other trademarks are the property of their respective owners John Wiley & Sons, Inc is not associated with any product or vendor mentioned in this book ffirs.indd 02:15:28:PM 01/08/2014 Page iv To all of us who pay and get paid with plastic ffirs.indd 02:15:28:PM 01/08/2014 Page v ffirs.indd 02:15:28:PM 01/08/2014 Page vi About the Author Slava Gomzin is a Security and Payments Technologist at Hewlett-Packard, where he helps create products that are integrated into modern payment processing ecosystems using the latest security and payments technologies Prior to joining Hewlett-Packard, Slava was a security architect, corporate product security officer, R & D and application security manager, and development team leader at Retalix, a Division of NCR Retail As PCI ISA, he focused on security and PA-DSS, PCI DSS, and PCI P2PE compliance of POS systems, payment applications, and gateways Before moving into security, Slava worked in R & D on design and implementation of new products including next-generation POS systems and various interfaces to payment gateways and processors He currently holds CISSP, PCIP, ECSP, and Security+ certifications Slava blogs about payment and technology security at www.gomzin.com vii ffirs.indd 02:15:28:PM 01/08/2014 Page vii ffirs.indd 02:15:28:PM 01/08/2014 Page viii 268 Index ■ C–D printers, 116, 117, 120–121 summary, 121 tippers, 116, 118 CreateToken, 184 credit cards, 3, 4, 93 See also payment cards CRL See Certificate Revocation List cryptanalysis, 150, 154, 155 cryptographic hardware, 188 See also HSM; TRSM cryptography, 167–193 See also encryption cryptographic key operations, PCI P2PE standard domain, 82 introduction, 167 NET System.Security Cryptography, 32, 170–171, 181, 233 standards, 188–191 summary, 191–192 tip of iceberg, 167–168 custom server certificate validation, 204 customer service phone numbers, payment cards, 96 CVV See card verification values CWE/SANS Top 25, 243–245 D Dark Market: Cyberthieves, Cybercops and You (Glenny), 114 data (cardholder data) access restriction, PCI DSS requirements, 72–74 server storage, PA-DSS requirements, 65 data at rest attacks, 148–159, 162 brute-force attacks, 152–153 data storage, 31–32 bindex.indd 11:59:26:AM 01/08/2014 Page 268 described, 20, 21, 31 DiskScraper utility, 157–159 key rotation, 155–156 keys DEK, 154–155, 208 insecure storage, 153–157 KEK, 154–155, 208 log files, 150–152 multiple key components, 207–208 PCI DSS requirements, 148 protection, 207–209 rainbow tables, 152–153 secure key management, 207 summary, 162 temporary storage, 21, 148, 149–150, 162 data breaches (security breaches) defined, 112 Heartland Payment Systems, 71 numbers, 2005-2012, 56–57 phases, 112–113 Privacy Rights Clearinghouse, 56, 113 TJX, 113–114 data encoding, 130–131 data encryption key See DEK Data Encryption Standard See DES data in memory described, 20, 21 minimize data exposure, 196 PCI DSS requirements, 148 protection, 195–196 data in transit attacks, 160–163 client authentication, 205–206 described, 20, 21 encrypted tunnels, 206–207 protection, 197–207 SSL implementation, 197–206 summary, 162–163 Index ■ D–D data signatures, 229–237 See also signatures message signing, 187 types, 230 data signing certificate, 230–231 data storage, PA, 31–32 database management systems, 151 debit (ATM, cash) cards, 3–4, 93–94 See also payment cards debit PIN encryption technology, 32, 80, 172, 173, 189 See also DUKPT decompiler tool, 239 decompiling, 237 See also reverse engineering decryption asymmetric encryption, 180 PCI P2PE standards, 82 symmetric encryption, 175–176 default keys, 156 defense See application code; cryptography; protection defense-in-depth principle, 195, 240 DEK (data encryption key), 154–155, 208 deployment models, PA gas station payment systems, 46–47 hybrid POS/Store deployment model, 46, 47 POS EPS deployment model, 44–45 store EPS deployment model, 43–44 types, 51 vulnerability score calculating, 41–42 factors, 42 hybrid POS/Store deployment model, 47 POS EPS deployment model, 45 store EPS deployment model, 44 DER format, 222 Derived Unique Key Per Transaction See DUKPT DES (Data Encryption Standard) described, 189–190 TRIPLE DES, 170, 189–190 deserialization, 36 detached signatures code signing, 229–230 described, 186–187 implementing, 232–235 deterministic generator, 174 developers mobile payment guidelines, PCI SSC, 86 payment applications PCI DSS, 77 dial-up fallback, 17, 29, 34 See also offline authorization dial-up modems, 34–35 digital certificates See certificates digital signatures See signatures Diners Club BIN range, 104 regular expressions, 111 disassembling, 141, 156 See also reverse engineering disclosure phase, security breaches, 113 Discover BIN range, 105 card verification values on magnetic stripes, 108 on plastic, 108 regular expressions, 111 DiskScraper utility, 157–159 Dispenser Payment Terminals, 46–47 documentation PA-DSS requirements, 66 PCI DSS requirements, 75 domains, P2PE, 81–82 double standard, PCI DSS, 68 dual purpose debit cards, 93–94 bindex.indd 11:59:26:AM 01/08/2014 Page 269 269 270 Index ■ D–F DUKPT (Derived Unique Key Per Transaction) debit PIN encryption technology, 32, 80, 172, 173, 189 described, 211–214 PTS, 80 X9.24-1 standard, 191 dumps, 114 E Electronic Payment System See EPS embossed data, payment cards, 94 embossers, 116, 117 EMV (Europay, MasterCard and Visa) Chip and PIN, 214, 215 defined, 143, 214 described, 214–215 Integrated Circuit Card Specifications, 214 PCI DSS Applicability in an EMV Environment, 85–86 EMVCo standard, 214 encoders, 116, 118–120 encrypted PIN block, 213, 214 encrypted tunnels, 206–207 encryption See also asymmetric encryption; keys; one-way encryption; P2PE; symmetric encryption AES, 155, 168, 169, 170, 173, 189, 190 device management, PCI P2PE standard domain, 81–82 environment, PCI P2PE standard domain, 82 encryption counter, 213, 214 EncryptionDemo application, 171, 173, 174, 177–182, 186 EncryptionDemo.exe file, 227, 228 encryptPassword, 184 bindex.indd 11:59:26:AM 01/08/2014 Page 270 end-to-end encryption, 129, 196 See also P2PE entry methods, payment cards, 5–6 See also magnetic stripe reader devices; POI devices EPS (Electronic Payment System), 39–40 Europay, MasterCard and Visa See EMV expiration date, magnetic stripe, 102–103 exposed PA API, 140–141 external interfaces See interfaces F fake voice authorization, 143 fallacy, tokenization, 83–84 Federal Information Processing Standards See FIPS file integrity monitoring, 59, 74 FIPS (Federal Information Processing Standards), 189–190 FIPS 140-2, 82, 188, 189, 190, 211 FIPS 197, 189, 190 firewall configurations Hardware P2PE, 249 PA-DSS requirements, 65 PCI DSS requirements, 70, 72, 75, 76 flat data files, 151 fleet (proprietary) cards, 4, Force Post, 143 forcing offline authorization, 109, 144 See also offline authorization forecourt controller, 46 forensics investigations, 64, 73, 126 frame relay systems, 35, 160, 162 fueling pump, 46 future keys, 213–214 Index ■ G–I G I gateways See payment gateways generateKey method, 174 See also key generation generating tokens, 183 gift cards, 4, 5, 93 Glenny, Misha, 114 Globally Unique Identifier, 83 Google Wallet, 48 IDs, PCI DSS requirements, 73 IIN Prefix, 103–105 information gathering phase, data breaches, 112 information security for personnel, PCI DSS requirements, 75 initial KSN, 212–214 initial meeting, PA-DSS validation process, 60 Initialization Vector (IV), 175–176 inkjet printers, 117, 120–121 insiders, 156 installing CA root certificate, 200–201 Integrated Circuit Card Specifications, EMV, 214 integrated payment terminals, Dispenser Payment Terminals, 46–47 integrity application code, 240, 246 card payment systems, 143–144 file integrity monitoring, 59, 74 interfaces internal, 36, 38 payment processor links, 27–28 payment transaction flow, 32–34 POI devices, 26 POS API, 27 summary, 38–39 types, 25, 50 internal interfaces, 36, 38 ipconfig, Windows, 137 iPhone, non-NFC mobile payment, 49 See also mobile payments IPSec, 207 Island Payment Terminals, 46–47 ISO Prefix, 103–105 H hackers intelligence, 111 motivations, 112 HackingPOS.Cryptography Encryption.dll, 173, 237, 238–239 HackingPOS.Scrapers.Common, 139, 159 handshake, SSL, 197–198 hardware authorization processing, 15 manufacturers’ role in paymentprocessing cycle, 11–12 settlement processing, 15 Hardware P2PE, 142, 210–211 hardware security modules See HSM Hardware/Hybrid P2PE, 81, 210 hash functions See one-way encryption Heartland Payment Systems, 71 holograms, 96 holographic magnetic stripe, 96 HSM (hardware security modules) See also POI devices; PTS defined, 188 PTS, 57, 80 HTTPS, 206 hybrid POS/Store deployment model, 46, 47 sniffing attacks, 135 bindex.indd 11:59:26:AM 01/08/2014 Page 271 271 272 Index ■ I–M issuers (issuing banks) authorization processing, 15 role in payment-processing cycle, 7–8 settlement processing, 15 issuing SSL server certificates, 202–203 IV See Initialization Vector J JCB BIN range, 104 card verification values on magnetic stripes, 108 on plastic, 108 regular expressions, 111 keystroke loggers, 5, 73 KIF (key injection facility), 82, 213 KSN, 212–214 L language-specific secure coding guidelines, 245 leased line systems, 35, 38 local in-memory communication, 36 local networks, sniffing, 135 logs data at rest, 150–152 PA-DSS requirements, 64 M K KEK (key encryption key), 154–155, 208 key containers, 178, 179, 222 key entropy, 170–171 key exchange, 197, 202 key generation asymmetric encryption, 178 symmetric encryption, 174–175 key injection facility See KIF key injection machines, 188, 212, 213 key loggers, 73 key players, card payment processing, 6–12 key rotation, 155–156, 209 key stretching, 171 KeyComponent, 174 keys data at rest, 207–208 DEK, 154–155 future (session), 213–214 insecure storage, 153–157 KEK, 154–155 management, 168 PKCS, 171, 175, 187, 191 private, 177–180 bindex.indd 11:59:26:AM 01/08/2014 Page 272 magnetic stripe reader (MSR) devices See also POI devices defined, encoders, 116, 118–120 keystroke loggers, POI devices, PTS compliance, 11–12 swipe entry, magnetic stripes, 98–110 See also PAN card verification values described, 107–110 different names, 97 on magnetic stripes, 108–109 non-profit organizations, 115 PA-DSS requirements, 63 payment cards feature, 94 on plastic, 108, 109–110 expiration date, 102–103 holographic, 96 PA-DSS requirements, 63 magnetic tracks card verification values, 108–109 expiration date location, 102–103 ISO Prefix location, 103–104 PAN check digit, 105 PAN location, 102 Index ■ M–N service code location, 106–107 Track 1, 98–100 Track 2, 100–101 Track 3, 98, 119 MakeCert tool CA creation, 198–199 code signing certificates, 220 issuing server certificate, 202–203 self-signed certificates, 178–179 malicious code injection, POI devices, 142 malware defined, 113 preparation, data breaches, 112 virus protection New York Times virus attack, 72 PA-DSS requirements, 65 PCI DSS requirements, 69, 71–72, 76, 79 smartphones, 143 mandatory security, payment cards, 97 man-in-the-middle attacks, 161–162 manual entry, See also POI devices masked PAN, 153 MasterCard See also EMV BIN range, 105 card brand, card verification values on magnetic stripes, 108 on plastic, 108 false positive PAN of test cards, 133 masked PAN, 153 regular expressions, 111 MD5, 152 memory buffers, 131, 196 memory scraping, 27, 36, 126 MemoryScanner, 129, 131 MemoryScraper utility, 127–134, 136, 139, 144, 157, 159 merchants authorization processing, 15 merchant accounts, 7, 8, 10 P2PE benefits, 83 PA-DSS understanding, 66–67 PCI DSS, merchant size, 75–77 responsibility, role in payment-processing cycle, settlement processing, 15 small, PCI DSS and, 75–77 message processing rules, 36 message protocols, 36–38 message serialization, 36 message signing See data signatures metallic tipping, 96 MII numbers, 104–105 minimize data exposure, data in memory, 196 mobile payments attacks, 142–143 described, 48–51 NFC-based, 48–49 non-NFC, 49–50 PCI SSC guidelines for developers, 86 protection, 215 monetization See also cashers online monetization strategy, 115 real-world action monetization strategy, 115 security breach phase, 113 Mono, 239 MSR See magnetic stripe reader devices multiple key components, 207–208 N National Institute of Standards and Technology See NIST Near Field Communication See NFC NET Framework, 178, 196, 239 bindex.indd 11:59:26:AM 01/08/2014 Page 273 273 274 Index ■ N–P NET System.Security Cryptography, 32, 170–171, 181, 233 Netscraper utility, 136–139, 144, 157, 159 network implementation, PA-DSS requirements, 65 network sniffing See sniffing New York Times, virus attack, 72 NFC (Near Field Communication), 48 NFC-based mobile payment solutions, 48–49 NIST (National Institute of Standards and Technology), 189–190 non-NFC mobile payment solutions, 49–50 non-profit organizations, CVV validation, 115 O obscurity, security through, 38 offline authorization (Store and Forward, fallback processing), 17–18, 19 described, 17–18 dial-up fallback, 17, 29, 34 forcing, 109, 144 Store and Forward module, 29–30 temporary storage, data at rest, 149–150 one-way encryption (hash functions) comparison of cryptographic groups, 168–170 described, 152–153, 181–186 diagram, 181 implementing, 181–182 ISO Prefix, 104 passwords validation, 184–186 salting passwords, 184 salting tokens, 182–183 size, 170–171 bindex.indd 11:59:26:AM 01/08/2014 Page 274 online monetization strategy, 115 online timestamping services, 226–227 on-site assessment, PA-DSS validation process, 60 OpenSSL, 199, 221–222, 225–226 See also SSL OWASP Top 10, 242–243 P P2PE (point-to-point encryption), 209–214 ANSI standards, 191 applicability, 58 compliance with PCI, 58 conclusion, 249–250 cryptographic key operations, PCI P2PE standard domain, 82 definition, PCI SSC, 81 domains, 81–82 end-to-end encryption, 129, 196 Hardware P2PE, 142, 210–211 Hardware/Hybrid P2PE, 81, 210 levels, 209–210 merchant benefits, 83 protection, 209–214 requirements, 82–83 Software, 209–210 types, 210, 215 PA (payment applications) API, exposed, 140–141 architecture, 25–53 data storage, 31–32 developers, PCI DSS and, 77 mobile payments, 48–51 NFC-based, 48–49 non-NFC, 49–50 POS-PA communication vulnerability points, 140 testing, PA-DSS requirements, 65 vendors role in payment-processing cycle, 11 Index ■ P–P PA deployment models gas station payment systems, 46–47 hybrid POS/Store deployment model, 46, 47 POS EPS deployment model, 44–45 store EPS deployment model, 43–44 types, 51 vulnerability score calculating, 41–42 factors, 42 hybrid POS/Store deployment model, 47 POS EPS deployment model, 45 store EPS deployment model, 44 packet analyzer, 135 See also sniffing padding, 175 PA-DSS (Payment Application Data Security Standard), 59–67 applicability, 58 compliance with PCI, 58 firewalls, 65 merchants understanding, 66–67 payment software vendors, 11 PCI-DSS vs., 59, 77 purpose, 59–60 requirements comparison with PCI DSS requirements, 77–80 described, 61–66 sniffing attacks, 135 validation process, 60–61 virus protection, 65 vulnerability areas and responsibility for mitigation, 59 WinHex tool, 126–127 PAN (Primary Account Number) See also magnetic stripe American Express false positive PAN of test cards, 133 PAN, 101 PAN Range Routing, 29 ASCII encoding, 131 check digit verification, 105–106 described, 101–102 hash functions, 152–153 ISO Prefix, 103–105 masking, 153 rainbow tables, 153 regex searches, 131–134 Unicode encoding, 131 PANandTracksSearch, 139 passwords database management systems, 151 PCI DSS requirements, 69, 70–71, 73, 76 salting, 184 validation, hash functions, 184–186 Payment Application Data Security Standard See PA-DSS payment application memory, 125–134 payment applications See PA payment brands (payment networks) authorization processing, 15 settlement processing, 15 payment card industry See PCI standards payment cards See also magnetic stripes artwork, 94 attacks, 93–124 brand logo, 94 color, 94 counterfeit card physical structure limitations, 94–96 card security limitations, 97–98 described, 116–121 embossers, 116, 117 encoders, 116, 118–120 printers, 116, 117, 120–121 summary, 121 tippers, 116, 118 bindex.indd 11:59:26:AM 01/08/2014 Page 275 275 276 Index ■ P–P customer service phone numbers, 96 differences, 93–94 embossed data, 94 entry methods, 5–6 holograms, 96 holographic magnetic stripe, 96 metallic tipping, 96 physical structure, 94–96 security features, 97–98 security limitations, 97–98 types, 3–5 ultraviolet marks, 94–96 payment gateways (payment switches) authorization processing, 15 described, 40–41 role in payment-processing cycle, 9–10 settlement processing, 15 payment processor links described, 27–28 payment transaction flow, 32–34 protocols interaction, 36–38 summary, 39 payment processors authorization processing, 15 role in payment-processing cycle, 8–9 settlement processing, 15 payment switches See payment gateways payment transaction flow, 32–34 payment transaction types, 16–19 payment-processing cycle key players, 6–12 stages, 12–15 PCI Council See PCI SSC PCI DSS (PCI Data Security Standard) applicability, 58 assessment process, 67–68 compliance with PCI, 58 conclusion, 249–250 bindex.indd 11:59:26:AM 01/08/2014 Page 276 double standard, 68 firewalls, 70, 72, 75, 76 introduction to world, 56 PA developers, 77 PA-DSS vs., 59, 77 passwords, 69, 70–71, 73, 76 requirements application code and configuration, 148 comparison with PA-DSS requirements, 77–80 data at rest, 148 data in memory, 148 data in transit, 148 described, 68–75 small merchants, 75–77 sniffing attacks, 135 Tokenization Guidelines, 84 virus protection, 69, 71–72, 76, 79 vulnerability areas and responsibility for mitigation, 59 WinHex tool, 126–127 PCI DSS Applicability in an EMV Environment, 85–86 PCI Implementation Guide, 60–61 PCI SSC (PCI Security Standards Council) defined, EMV guidance, 85–86 List of Validated Payment Applications, 61 mobile payments guidelines for developers, 86 P2PE certification, 82 definition, 81 PCI DSS certified organizations list, 68 Report of Validation, 61 tokenization guidelines, 83–84 Index ■ P–P PCI standards (payment card industry), 55–89 See also P2PE; PA-DSS; PCI DSS; PTS applicability, 58 compliance list of issues, 58 security vs compliance, 57 defined, 56–57 introduction, 55–56 lack, 55 PCI-protected areas, 147–164 data at rest, 148–159 data in transit, 160–163 summary of areas, 147–148 PED (PIN Entry Devices), 80, 213–214 PEM format, 222–223 penetrating security free zones, 125–146 See also application code memory scraping, 27, 36, 126 MemoryScraper utility, 127–134, 136, 139, 144, 157, 159 Netscraper utility, 136–139, 144, 157, 159 payment application memory, 125–134 sniffing, 134–140 swap file, 134 WinHex tool, 126–127 penetration testing, 60, 74 personnel information security, PCI DSS requirements, 75 PFX certificate file, 179–180, 225–226 pin block data PA-DSS requirements, 63 PIN Entry Devices See PED pinpads See also POI devices defined, PTS compliance, 11–12 TRSM capabilities, PKCS (Public-Key Cryptography Standards), 171, 175, 187, 191 PKI See Public Key Infrastructure plaintext, 175 plastic, card verification values on, 108, 109–110 POI (point of interaction) devices defined, interface, 26 interfaces/protocols summary, 38–39 malicious code injection, 142 manual entry, payment transaction flow, 32–34 POS-POI devices communication vulnerability points, 140 skimming, 142 point of interaction See POI devices point-of-sale See POS point-to-point encryption See P2PE POS (point-of-sale) systems API described, 27 payment transaction flow, 32–34 summary, 38–39 attacks future technologies, 142–143 hardware, 141–142 out of scope, 40 PA-POS communication vulnerability points, 140 POI-POS communication vulnerability points, 140 POS Vulnerability Rank Calculator, 251–255 PreAuth, 16, 19 “Preventing Memory-Parsing Malware Attacks on Grocery Merchants,” 125–126 Primary Account Number See PAN printers, 116, 120–121 bindex.indd 11:59:26:AM 01/08/2014 Page 277 277 278 Index ■ P–R Privacy Rights Clearinghouse, 56, 113 private keys, asymmetric encryption, 177–180 processing modules batch, 31 payment transaction flow, 32–34 router module, 28–29 Store and Forward module, 29–30 types, 28, 51 ProcessMemoryLoader, 129 processMemSize, 130 processors See payment processors production-grade code signing certificate, 223–226 proprietary cards See fleet cards proprietary message protocols, 36–38 protection (cardholder data), 195–217 See also application code; EMV; PCI-protected areas data at rest, 207–209 data in memory, 195–196 data in transit, 197–207 P2PE, 209–214 PA-DSS requirements, 63–64 summary, 215 protocols communication, 35–36 internal, 38 message, 36–38 summary, 38–39 PTS (PIN Transaction Security) applicability, 58 compliance PCI, 58 pinpads, 11–12 described, 80 MSR devices, 11–12 public key, 177 public key encryption See asymmetric encryption bindex.indd 11:59:26:AM 01/08/2014 Page 278 Public Key Infrastructure (PKI), 177 public networks, PA-DSS requirements, 66 Public-Key Cryptography Standards See PKCS purchases See sales Pvk2pfx tool, 179–180, 202–203, 205, 230 Q QSAs (Qualified Security Assessors), 60–61, 68, 82, 126 R rainbow tables, 152–153 RAM scraping See memory scraping RandomNumberGenerator, 171, 175, 184 reactive security controls, 64 ReadProcessMemory, 129 real-world action monetization strategy, 115 recharge, 18, 19 recursive search, DiskScraper utility, 158 regular expressions (regex) MemoryScraper, 130, 131–134 Track 1, Track 2, PAN components, 110–111 remote access, PA-DSS requirements, 65–66 Report of Validation, PA-DSS validation process, 61 requirements P2PE, 82–83 PA-DSS, 61–66 PCI DSS, 68–75 retrieving sensitive data, security breach phase, 112 returns, 16–17, 19 reversals See TOR Index ■ R–S reverse engineering defined, 156, 237 described, 237–240 disassembling, 141, 156 review paperwork, PA-DSS validation process, 60–61 Rfc2898DeriveBytes, 171, 174, 183, 238, 240 root CA, 221–222 root certificate, 199–201 router module described, 28–29 payment transaction flow, 32–34 RSA algorithm, 169, 177, 191 RSACryptoServiceProvider, 180 S sales (purchases), 16, 19 salting passwords, 184 salting tokens, 182–183 scope defined, 40 out of scope POS, 40 PCI DSS assessment, 67–68 secure card reader (SCR), 213–214 secure coding standards, 242–245 secure key management, 207 Secure Sockets Layer See SSL secure strings, 196 SecureString, 196 security See also protection communication, 38 PA vulnerability score calculating, 41–42 factors, 42 hybrid POS/Store deployment model, 47 POS EPS deployment model, 45 store EPS deployment model, 44 reactive security controls, 64 security through obscurity, 38 security auditors PCI DSS, 75, 77 QSAs (Qualified Security Assessors), 60–61, 68, 82, 126 security breaches See data breaches security free zones See penetrating security free zones security questionnaire See POS Vulnerability Rank Calculator Select Certificate Store dialog, 201 self-signed certificates, 178–179 serial connections, 35, 70 server certificate, 197–198, 202–203 service codes, 106–107 session keys, 213–214 settlement, 13–15 SHA, 152, 153, 170, 190, 200, 202 signatures attached, 186–187, 229–230 Authenticode signature, 186–187, 220, 229, 230, 246 described, 186–187 implementing, 235–237 strong-name signing, 187, 220 XML signing, 187, 235 data signatures, 229–237 message signing, 187 types, 230 described, 186–187 detached signatures code signing, 229–230 described, 186–187 implementing, 232–235 strong-name signing, 187, 220 SigningDemo application, 228–229 SignTool, 220, 225, 227, 228 size, encryption, 170–171 bindex.indd 11:59:26:AM 01/08/2014 Page 279 279 280 Index ■ S–T skimming defined, 142 Integrated Payment Terminals, gas station pumps, 47 MSR devices, 118 small merchants, PCI DSS and, 75–77 smartphones, 142–143 See also mobile payments S/MIME standard, 187 sniffing, 134–140 social engineering, 73, 113, 115, 142 Software P2PE, 209–210 spoofing attacks, 141 SSL (Secure Sockets Layer) encrypted tunnels, 206–207 handshake process, 197–198 implementing, 197–206 key exchange, 197, 202 OpenSSL, 199, 221–222, 225–226 server certificate, 197–198, 202–203 TLS, 66, 79, 161, 197 vulnerabilities, 160–161 SSLDemo application, 198–199 SSLDemoClient, 198, 205 SSLDemoRoot.cer, 198, 200, 202, 205, 206, 220, 222, 230 SSLDemoRoot.pvk, 200, 202 SSLDemoServer, 198–199, 203, 205 Starbucks’ Mobile App, 49–50 stolen payment cards incident, 114 Store and Forward See offline authorization strings, secure, 196 strong symmetric encryption, 173 strong-name signing, 187, 220 swap file, 134 swipe entry, See also magnetic stripe reader devices switches See payment gateways bindex.indd 11:59:26:AM 01/08/2014 Page 280 symmetric encryption benefits, 172 comparison of cryptographic groups, 168–170 decryption, 175–176 described, 172–176 diagram, 172 implementing, 174 key generation, 174–175 size, 170–171 strong algorithms, 173 symmetric key management See DUKPT System.Security.Cryptography, 32, 170–171, 181, 233 T Tamper-Resistant Security Module See TRSM “Targeted Hospitality Sector Vulnerabilities,” 125–126 TDEA See Triple DES temporary storage, 21, 148, 149–150, 162 See also offline authorization; TOR testing payment applications, PA-DSS requirements, 65 penetration, 60, 74 security systems, PCI DSS requirements, 74–75 text files, DiskScraper utility, 159 TG-3 See TR-39 thermal PVC printers, 116, 120 3TDEA, 170 timeout reversals See TOR timestamping, 226–227 tippers, 116, 118 TJX security breach, 113–114 TLS (Transport Layer Security), 66, 79, 161, 197 See also SSL tokenization, 83–84 Index ■ T–V tokens defined, 182 generation, 183 salting, 182–183 TOR (timeout reversals) data at rest, temporary storage, 149–150 defined, 18, 19 described, 30–31 TR-39 (TG-3), 188, 191, 211 tracks See magnetic tracks Transport Layer Security See TLS Triple DES (TDEA), 170, 189–190 Trojans, 73 TRSM (Tamper-Resistant Security Module) defined, 188 DUKPT, 213 P2PE, 209, 210, 211 pinpads, POS Vulnerability Rank Calculator, 253–254 Trusted Root Certification Authorities, 201, 220, 222, 230 tunnels, encrypted, 206–207 2TDEA, 170 two-factor authentication, 4, 65, 73, 79 U ultraviolet marks, 94–96 Unicode, 130–131 unique IDs, PCI DSS requirements, 73 V ValidatePassword, 185 validation custom server certificate validation, 204 PA-DSS, 60–61 passwords, hash functions, 184–186 PCI DSS assessment process, 67–68 verification See also card verification values PAN check digit, 105–106 VeriSign, 199, 227 virus protection New York Times virus attack, 72 PA-DSS requirements, 65 PCI DSS requirements, 69, 71–72, 76, 79 smartphones, 143 Visa See also EMV; payment cards BIN range, 104 card brand, card verification values on magnetic stripes, 108 on plastic, 108 false positive PAN of test cards, 133 masked PAN, 153 regular expressions, 110 stolen cards incident, 114 “Targeted Hospitality Sector Vulnerabilities,” 125–126 VisaNet, voice authorization, fake, 143 voids, 16–17, 19 vulnerability areas attack vectors vs., 20 described, 20–22 PA-DSS, responsibility for mitigation, 59 PCI DSS, responsibility for mitigation, 59 tokenization guidelines, 83–84 Vulnerability Rank Calculator, POS, 251–255 vulnerability score calculating, 41–42 factors, 42 hybrid POS/Store deployment model, 47 POS EPS deployment model, 45 store EPS deployment model, 44 bindex.indd 11:59:26:AM 01/08/2014 Page 281 281 282 Index ■ W–Z W wardriving, 113–114 WCF See Windows Communication Foundation WiFi, 48 Windows API functions, 129 Windows Communication Foundation (WCF), 198 Windows ipconfig, 137 Windows page file, 134 WinHex, 126–127 wireless transmissions PA-DSS requirements, 64–65 wardriving, 113–114 bindex.indd 11:59:26:AM 01/08/2014 Page 282 Wireshark, 135–136 wiretapping, 38, 134, 135, 139, 140 worms, 72 X X9.24-1 standard, 191 X.509 certificate, 178, 187, 222 X509Certificate2, 180, 202, 203 XML signing, 187, 235 XMLDSIG, 235 XOR, 175 Z zero-day software, 72 ...ffirs.indd 02:15:28:PM 01/08/2014 Page ii Hacking Point of Sale ffirs.indd 02:15:28:PM 01/08/2014 Page i ffirs.indd 02:15:28:PM 01/08/2014 Page ii Hacking Point of Sale Payment Application Secrets, Threats,... trend—a technology capable of protecting them all called point- to -point encryption The chapter defines the different types of point- topoint encryption implementation—hardware, software, and hybrid—and... types of users that will benefit from reading and using the information in this book Point of Sale and Payment Application Developers, Development Managers, and Software Architects working for software